summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 15:16:45 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-08-24 15:16:45 +0200
commita28d45f3a9979011d6a02546ac0619fab0a13b82 (patch)
treee56934e10f3fad62b68e9c2d49587d7b77f73d48
parentd7c91eb3c135f90679a4b68e3a0d6861c2192251 (diff)
downloadfpGUI-a28d45f3a9979011d6a02546ac0619fab0a13b82.tar.xz
splitter: When double-clicking splitter, it now snaps closed if AutoSnap is set.
-rw-r--r--src/gui/fpg_splitter.pas20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/fpg_splitter.pas b/src/gui/fpg_splitter.pas
index 6094656b..8a5aa3d3 100644
--- a/src/gui/fpg_splitter.pas
+++ b/src/gui/fpg_splitter.pas
@@ -61,6 +61,7 @@ type
procedure HandleMouseMove(x, y: integer; btnstate: word; shiftstate: TShiftState); override;
procedure HandleMouseEnter; override;
procedure HandleMouseExit; override;
+ procedure HandleDoubleClick(x, y: integer; button: word; shiftstate: TShiftState); override;
procedure HandlePaint; override;
procedure StopSizing; dynamic;
Procedure DrawGrabBar(ARect: TfpgRect); virtual;
@@ -304,6 +305,25 @@ begin
Repaint;
end;
+procedure TfpgSplitter.HandleDoubleClick(x, y: integer; button: word;
+ shiftstate: TShiftState);
+begin
+ inherited HandleDoubleClick(x, y, button, shiftstate);
+ if FAutoSnap then
+ begin
+ if FNewSize = 0 then
+ begin
+ FNewSize := FMinSize+1;
+ DoCanResize(FNewSize);
+ end
+ else
+ begin
+ FNewSize := 0;
+ DoCanResize(FNewSize);
+ end;
+ end;
+end;
+
procedure TfpgSplitter.HandlePaint;
var
lRect: TfpgRect;