summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-08 17:38:00 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-08 17:38:00 +0000
commit63225c5058cd4739cc55839f49f72c69992f909e (patch)
treef12f827b78be6ab85c90bfcd494b850cf8c13936
parentf2e764149fb7bf9f6a3886906c64c27cd745a457 (diff)
downloadfpGUI-63225c5058cd4739cc55839f49f72c69992f909e.tar.xz
* UI Designer: Fixed the issue with scrolling in the property window and the active property editor doesn't scroll along.
* Added a new event OnScroll to the TfpgBaseListBox
-rw-r--r--examples/apps/uidesigner/newformdesigner.pas15
-rw-r--r--src/gui/gui_listbox.pas7
2 files changed, 21 insertions, 1 deletions
diff --git a/examples/apps/uidesigner/newformdesigner.pas b/examples/apps/uidesigner/newformdesigner.pas
index c5fa52ef..713c6564 100644
--- a/examples/apps/uidesigner/newformdesigner.pas
+++ b/examples/apps/uidesigner/newformdesigner.pas
@@ -106,9 +106,11 @@ type
procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override;
procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
+ procedure HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override;
procedure HandleSetFocus; override;
procedure HandleKillFocus; override;
procedure OnRowChange(Sender: TObject);
+ procedure OnScrolling(Sender: TObject);
procedure OnUpdateProperty(Sender: TObject);
public
Props: TPropertyList;
@@ -714,6 +716,7 @@ begin
NameWidth := 80;
editor := nil;
OnChange := @OnRowChange;
+ OnScroll := @OnScrolling;
BackgroundColor := clWindowBackground;
NameDrag := False;
//FontName := 'arial-10:antialias=false';
@@ -724,6 +727,11 @@ begin
AllocateEditor;
end;
+procedure TwgPropertyList.OnScrolling(Sender: TObject);
+begin
+ AllocateEditor;
+end;
+
procedure TwgPropertyList.DrawItem(num: integer; rect: TfpgRect; flags: integer);
var
x,
@@ -814,6 +822,13 @@ begin
inherited;
end;
+procedure TwgPropertyList.HandleMouseScroll(x, y: integer;
+ shiftstate: TShiftState; delta: smallint);
+begin
+ inherited HandleMouseScroll(x, y, shiftstate, delta);
+ AllocateEditor;
+end;
+
procedure TwgPropertyList.HandleSetFocus;
begin
inherited HandleSetFocus;
diff --git a/src/gui/gui_listbox.pas b/src/gui/gui_listbox.pas
index c35be4bf..64055937 100644
--- a/src/gui/gui_listbox.pas
+++ b/src/gui/gui_listbox.pas
@@ -47,6 +47,7 @@ type
private
FHotTrack: boolean;
FOnChange: TNotifyEvent;
+ FOnScroll: TNotifyEvent;
FOnSelect: TNotifyEvent;
FPopupFrame: boolean;
function GetFontDesc: string;
@@ -68,7 +69,7 @@ type
function ListHeight: TfpgCoord;
function ScrollBarWidth: TfpgCoord;
function PageLength: integer;
- procedure ScrollBarMove(Sender: TObject; position : integer);
+ procedure ScrollBarMove(Sender: TObject; position: integer);
procedure DrawItem(num: integer; rect: TfpgRect; flags: integer); virtual;
procedure DoChange;
procedure DoSelect;
@@ -92,6 +93,7 @@ type
property Font: TfpgFont read FFont;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnSelect: TNotifyEvent read FOnSelect write FOnSelect;
+ property OnScroll: TNotifyEvent read FOnScroll write FOnScroll;
end;
@@ -287,6 +289,8 @@ procedure TfpgBaseListBox.ScrollBarMove(Sender: TObject; position: integer);
begin
FFirstItem := position;
Repaint;
+ if Assigned(FOnScroll) then
+ FOnScroll(self);
end;
procedure TfpgBaseListBox.DoChange;
@@ -590,6 +594,7 @@ begin
FOnChange := nil;
FOnSelect := nil;
+ FOnScroll := nil;
end;
destructor TfpgBaseListBox.Destroy;