diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-18 08:26:10 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-18 08:26:10 +0000 |
commit | 0af8a64c03213270d6932a56d48783f6e7e4740a (patch) | |
tree | 91f1989160ed6555d4c464c0fb0e117714a605bc | |
parent | 60420d5e337bbd62fe05613c269e9ebecca6aad8 (diff) | |
download | fpGUI-0af8a64c03213270d6932a56d48783f6e7e4740a.tar.xz |
* Removed unnecessary parameters from DoUpdateWindowPosition.
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 6 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 6 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 6 | ||||
-rw-r--r-- | src/corelib/x11/gfx_x11.pas | 14 | ||||
-rw-r--r-- | src/gui/gui_editcombo.pas | 7 |
5 files changed, 18 insertions, 21 deletions
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index a2a40a12..b2873297 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -160,7 +160,7 @@ type procedure DoRemoveWindowLookup; override; procedure DoSetWindowVisible(const AValue: Boolean); override; function HandleIsValid: boolean; override; - procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override; + procedure DoUpdateWindowPosition; override; procedure DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); override; function DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; override; //procedure MoveToScreenCenter; override; @@ -1458,7 +1458,7 @@ begin Result := FWinHandle > 0; end; -procedure TfpgWindowImpl.DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); +procedure TfpgWindowImpl.DoUpdateWindowPosition; var bx, by: integer; begin @@ -1466,7 +1466,7 @@ begin GetWindowBorderDimensions(Self, bx, by); Windows.SetWindowPos( WinHandle, HWND_TOP, - aleft, atop, awidth + bx, aheight + by, + FLeft, FTop, FWidth + bx, FHeight + by, SWP_NOZORDER);// or SWP_NOREDRAW); Windows.InvalidateRect(WinHandle, nil, True); FSkipResizeMessage := False; diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index a998efb9..c883edf9 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -69,7 +69,7 @@ type procedure SetParent(const AValue: TfpgWidget); reintroduce; procedure SetEnabled(const AValue: boolean); virtual; procedure SetVisible(const AValue: boolean); virtual; - procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override; + procedure DoUpdateWindowPosition; override; procedure DoAlign(AAlign: TAlign); procedure DoResize; procedure HandlePaint; virtual; @@ -207,7 +207,7 @@ begin end; end; -procedure TfpgWidget.DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); +procedure TfpgWidget.DoUpdateWindowPosition; var dw: integer; dh: integer; @@ -222,7 +222,7 @@ begin HandleAlignments(dw, dh); end; - inherited DoUpdateWindowPosition(aleft, atop, awidth, aheight); + inherited DoUpdateWindowPosition; if FDirty and ((dw <> 0) or (dh <> 0)) then DoResize; diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index 108b5bce..1655a65a 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -360,8 +360,6 @@ type end; - { TfpgWindowBase } - TfpgWindowBase = class(TfpgComponent) private FParent: TfpgWindowBase; @@ -387,7 +385,7 @@ type FCanvas: TfpgCanvasBase; FDirty: Boolean; function HandleIsValid: boolean; virtual; abstract; - procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); virtual; abstract; + procedure DoUpdateWindowPosition; virtual; abstract; procedure DoAllocateWindowHandle(AParent: TfpgWindowBase); virtual; abstract; procedure DoReleaseWindowHandle; virtual; abstract; procedure DoRemoveWindowLookup; virtual; abstract; @@ -1102,7 +1100,7 @@ end; procedure TfpgWindowBase.UpdateWindowPosition; begin if HasHandle then - DoUpdateWindowPosition(FLeft, FTop, FWidth, FHeight); + DoUpdateWindowPosition; end; procedure TfpgWindowBase.MoveWindow(const x: TfpgCoord; const y: TfpgCoord); diff --git a/src/corelib/x11/gfx_x11.pas b/src/corelib/x11/gfx_x11.pas index c62413f3..92456bff 100644 --- a/src/corelib/x11/gfx_x11.pas +++ b/src/corelib/x11/gfx_x11.pas @@ -199,7 +199,7 @@ type procedure DoSetWindowTitle(const ATitle: string); override; procedure DoMoveWindow(const x: TfpgCoord; const y: TfpgCoord); override; function DoWindowToScreen(ASource: TfpgWindowBase; const AScreenPos: TPoint): TPoint; override; - procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override; + procedure DoUpdateWindowPosition; override; procedure DoSetMouseCursor; override; property WinHandle: TfpgWinHandle read FWinHandle; public @@ -1526,22 +1526,22 @@ begin Result.Y := dy; end; -procedure TfpgWindowImpl.DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); +procedure TfpgWindowImpl.DoUpdateWindowPosition; var w: longword; h: longword; begin - if awidth > 1 then - w := awidth + if FWidth > 1 then + w := FWidth else w := 1; - if aheight > 1 then - h := aheight + if FHeight > 1 then + h := FHeight else h := 1; if FWinHandle > 0 then - XMoveResizeWindow(xapplication.display, FWinHandle, aleft, atop, w, h); + XMoveResizeWindow(xapplication.display, FWinHandle, FLeft, FTop, w, h); end; procedure TfpgWindowImpl.DoSetMouseCursor; diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index 3ed30a4c..28c0b526 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -90,7 +90,7 @@ type function GetText: string; virtual; function HasText: boolean; virtual; procedure SetText(const AValue: string); virtual; - procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override; + procedure DoUpdateWindowPosition; override; procedure HandleResize(AWidth, AHeight: TfpgCoord); override; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); override; @@ -399,13 +399,12 @@ begin end; end; -procedure TfpgBaseEditCombo.DoUpdateWindowPosition(aleft, atop, awidth, - aheight: TfpgCoord); +procedure TfpgBaseEditCombo.DoUpdateWindowPosition; begin //This does not work because is not called before handle create if FDirty then CalculateInternalButtonRect; - inherited DoUpdateWindowPosition(aleft, atop, awidth, aheight); + inherited DoUpdateWindowPosition; end; procedure TfpgBaseEditCombo.HandleResize(AWidth, AHeight: TfpgCoord); |