* fixed scrollcalback for scrollbox

git-svn-id: trunk@7788 -
This commit is contained in:
marc 2005-09-22 22:58:44 +00:00
parent be8123b7f1
commit ef06d18f54
3 changed files with 18 additions and 6 deletions

View File

@ -1188,7 +1188,7 @@ function gtkMouseBtnPress(widget: PGtkWidget; event: pgdkEventButton;
// Select it
gtk_list_item_select(PGtkListItem(List^.Data));
end;
var
DesignOnlySignal: boolean;
CaptureWidget: PGtkWidget;
@ -2620,7 +2620,7 @@ var
begin
Result := CallBackDefaultReturn;
Assert(False, Format('Trace:[GTKHScrollCB] Value: %d', [RoundToInt(Adjustment^.Value)]));
Scroll := PgtkRange(gtk_object_get_data(PGTKObject(Adjustment), 'ScrollBar'));
Scroll := PgtkRange(gtk_object_get_data(PGTKObject(Adjustment), odnScrollBar));
if Scroll<>nil then begin
Msg.Msg := LM_HSCROLL;
with Msg do begin
@ -2645,7 +2645,7 @@ var
begin
Result := CallBackDefaultReturn;
Assert(False, Format('Trace:[GTKVScrollCB] Value: %d', [RoundToInt(Adjustment^.Value)]));
Scroll := PgtkRange(gtk_object_get_data(PGTKObject(Adjustment), 'ScrollBar'));
Scroll := PgtkRange(gtk_object_get_data(PGTKObject(Adjustment), odnScrollBar));
if Scroll<>nil then begin
Msg.Msg := LM_VSCROLL;
with Msg do begin

View File

@ -419,6 +419,8 @@ var
const
odnScrollArea = 'scroll_area'; // the gtk_scrolled_window of a widget
// used by TCustomForm and TScrollbox
odnScrollBar = 'ScrollBar'; // Gives the scrollbar the tgtkrange is belonging to
// Used by TScrollbar, TScrollbox and TWinApiWidget
const
CallBackDefaultReturn = {$IFDEF GTK2}false{$ELSE}true{$ENDIF};

View File

@ -4747,7 +4747,7 @@ begin
if Adjustment <> nil
then with Adjustment^ do
begin
gtk_object_set_data(PGTKObject(Adjustment), 'ScrollBar',
gtk_object_set_data(PGTKObject(Adjustment), odnScrollBar,
PGTKScrolledWindow(Result)^.VScrollBar);
Step_Increment := 1;
end;
@ -4757,7 +4757,7 @@ begin
if Adjustment <> nil
then with Adjustment^ do
begin
gtk_object_set_data(PGTKObject(Adjustment), 'ScrollBar',
gtk_object_set_data(PGTKObject(Adjustment), odnScrollBar,
PGTKScrolledWindow(Result)^.HScrollBar);
Step_Increment := 1;
end;
@ -5402,7 +5402,7 @@ begin
P := gtk_hscrollbar_new(Adjustment)
else
P := gtk_vscrollbar_new(Adjustment);
gtk_object_set_data(PGTKObject(Adjustment), 'ScrollBar', P);
gtk_object_set_data(PGTKObject(Adjustment), odnScrollBar, P);
end;
csScrolledWindow :
@ -5468,6 +5468,16 @@ begin
GTK_POLICY_NEVER);
gtk_object_set_data(P,odnScrollArea, TempWidget);
Adjustment := gtk_scrolled_window_get_vadjustment(PGTKScrolledWindow(TempWidget));
if Adjustment <> nil
then gtk_object_set_data(PGTKObject(Adjustment), odnScrollBar,
PGTKScrolledWindow(TempWidget)^.vscrollbar);
Adjustment := gtk_scrolled_window_get_hadjustment(PGTKScrolledWindow(TempWidget));
if Adjustment <> nil
then gtk_object_set_data(PGTKObject(Adjustment), odnScrollBar,
PGTKScrolledWindow(TempWidget)^.hscrollbar);
TempWidget2 := gtk_layout_new(nil, nil);
gtk_container_add(PGTKContainer(TempWidget), TempWidget2);