Gtk2: fixed TScrollingWinControl positions update.issue #25909

git-svn-id: trunk@44504 -
This commit is contained in:
zeljko 2014-03-24 11:14:49 +00:00
parent 98a3e1a08c
commit 97c59105fe
2 changed files with 9 additions and 3 deletions

View File

@ -3153,7 +3153,7 @@ var
Widget: PGTKWidget; Widget: PGTKWidget;
AValue: gDouble; AValue: gDouble;
begin begin
// used only by TCustomForm ! #issue #25479 // used only by TScrollingWinControl ! #issue #25479
Widget := PGTKWidget(ARange); Widget := PGTKWidget(ARange);
if G_OBJECT_TYPE(ARange) = gtk_hscrollbar_get_type then if G_OBJECT_TYPE(ARange) = gtk_hscrollbar_get_type then
Msg.Msg := LM_HSCROLL Msg.Msg := LM_HSCROLL
@ -3186,11 +3186,11 @@ begin
// do not send messages to LCL if we are already synced. // do not send messages to LCL if we are already synced.
if (Msg.Msg = LM_VSCROLL) and if (Msg.Msg = LM_VSCROLL) and
(TCustomForm(PWidgetInfo(Data)^.LCLObject).VertScrollBar.Position = Msg.Pos) then (TScrollingWinControl(PWidgetInfo(Data)^.LCLObject).VertScrollBar.Position = Msg.Pos) then
exit exit
else else
if (Msg.Msg = LM_HSCROLL) and if (Msg.Msg = LM_HSCROLL) and
(TCustomForm(PWidgetInfo(Data)^.LCLObject).HorzScrollBar.Position = Msg.Pos) then (TScrollingWinControl(PWidgetInfo(Data)^.LCLObject).HorzScrollBar.Position = Msg.Pos) then
exit; exit;
DeliverMessage(PWidgetInfo(Data)^.LCLObject, Msg); DeliverMessage(PWidgetInfo(Data)^.LCLObject, Msg);

View File

@ -871,6 +871,12 @@ begin
TGCallback(@Gtk2RangeScrollCB), WidgetInfo); TGCallback(@Gtk2RangeScrollCB), WidgetInfo);
g_signal_connect(Scrolled^.vscrollbar, 'change-value', g_signal_connect(Scrolled^.vscrollbar, 'change-value',
TGCallback(@Gtk2RangeScrollCB), WidgetInfo); TGCallback(@Gtk2RangeScrollCB), WidgetInfo);
g_signal_connect(Scrolled^.hscrollbar, 'value-changed',
TGCallback(@Gtk2RangeValueChanged), WidgetInfo);
g_signal_connect(Scrolled^.vscrollbar, 'value-changed',
TGCallback(@Gtk2RangeValueChanged), WidgetInfo);
g_signal_connect(Scrolled^.hscrollbar, 'button-press-event', g_signal_connect(Scrolled^.hscrollbar, 'button-press-event',
TGCallback(@Gtk2RangeScrollPressCB), WidgetInfo); TGCallback(@Gtk2RangeScrollPressCB), WidgetInfo);
g_signal_connect(Scrolled^.hscrollbar, 'button-release-event', g_signal_connect(Scrolled^.hscrollbar, 'button-release-event',