diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-04 16:51:36 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2010-10-04 16:51:36 +0200 |
commit | 2e1ddf6255060348ea1f31b064497e22e0156b00 (patch) | |
tree | 2941e5c35c2d165d081c42d9d38b9525c520eabd | |
parent | 1db98a1775c3f4caba4ba7a52180eb48eac6d5fc (diff) | |
download | fpGUI-2e1ddf6255060348ea1f31b064497e22e0156b00.tar.xz |
splitter bugfix: Splitter was sometimes non-movable because FControl was nil
The detection of which neighbouring control to resize was not
100% which resulted in a non-movable splitter. This is now fixed.
-rw-r--r-- | src/gui/fpg_splitter.pas | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/gui/fpg_splitter.pas b/src/gui/fpg_splitter.pas index 066727e4..61ecbb6d 100644 --- a/src/gui/fpg_splitter.pas +++ b/src/gui/fpg_splitter.pas @@ -133,12 +133,11 @@ var r: TfpgRect; begin Result := nil; - p := Point(Left, Top); case Align of - alLeft: Dec(p.X); - alRight: Inc(p.X, Width); - alTop: Dec(p.Y); - alBottom: Inc(p.Y, Height); + alLeft: p := Point(Left-2, Top + (Height div 2)); + alRight: p := Point(Right+2, Top + (Height div 2)); + alTop: p := Point(Left + (Width div 2), Top-2); + alBottom: p := Point(Left + (Width div 2), Bottom+2); else Exit; end; @@ -180,16 +179,10 @@ begin begin case Align of alLeft, alRight: -// FControl.Width := FNewSize; // (1) - FControl.SetPosition(FControl.Left, FControl.Top, FNewSize, FControl.Height); // (2) + FControl.SetPosition(FControl.Left, FControl.Top, FNewSize, FControl.Height); alTop, alBottom: -// FControl.Height := FNewSize; // (1) - FControl.SetPosition(FControl.Left, FControl.Top, FControl.Width, FNewSize); // (2) + FControl.SetPosition(FControl.Left, FControl.Top, FControl.Width, FNewSize); end; -// FControl.UpdateWindowPosition; // (1) - // vvzh: - // Lines marked with (1) work wrong under Linux (e.g. folding/unfolding Memo1) - // Lines marked with (2) work OK under both platforms. Why? Parent.Realign; // if Assigned(FOnMoved) then FOnMoved(Self); FOldSize := FNewSize; |