diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/gdi/fpgfx_package.lpk | 8 | ||||
-rw-r--r-- | src/corelib/gdi/gfx_gdi.pas | 49 | ||||
-rw-r--r-- | src/corelib/gfx_widget.pas | 7 |
3 files changed, 52 insertions, 12 deletions
diff --git a/src/corelib/gdi/fpgfx_package.lpk b/src/corelib/gdi/fpgfx_package.lpk index 8b6d510d..aa5edb8c 100644 --- a/src/corelib/gdi/fpgfx_package.lpk +++ b/src/corelib/gdi/fpgfx_package.lpk @@ -10,7 +10,7 @@ <SearchPaths>
<IncludeFiles Value="..\"/>
<OtherUnitFiles Value="..\;..\..\gui\"/>
- <UnitOutputDirectory Value="..\..\..\lib\"/>
+ <UnitOutputDirectory Value="..\..\..\lib"/>
</SearchPaths>
<CodeGeneration>
<Optimizations>
@@ -21,11 +21,11 @@ <CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
- <Description Value="fpGUI redesign with multiple handles + <Description Value="fpGUI redesign with multiple handles
"/>
- <License Value="Modified LGPL + <License Value="Modified LGPL
"/>
- <Version Minor="5"/>
+ <Version Minor="5" Release="1"/>
<Files Count="13">
<Item1>
<Filename Value="..\gfxbase.pas"/>
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas index c366ad28..921c0b1e 100644 --- a/src/corelib/gdi/gfx_gdi.pas +++ b/src/corelib/gdi/gfx_gdi.pas @@ -352,16 +352,55 @@ var //------------ procedure SetMinMaxInfo(var MinMaxInfo: TMINMAXINFO); + + procedure GetWindowBorderDimentions(const w: TfpgWindowBase; var dx, dy: integer); + var + bx: integer; // left/right border width + by: integer; // top/bottom border height + bt: integer; // title bar + begin + bx := 0; + by := 0; + bt := 0; + + if w.WindowType in [wtWindow, wtModalForm] then + begin + if w is TfpgForm then + begin + if TfpgForm(w).Sizeable then + begin + bx := GetSystemMetrics(SM_CXSIZEFRAME); + by := GetSystemMetrics(SM_CYSIZEFRAME); + end + else + begin + bx := GetSystemMetrics(SM_CXFIXEDFRAME); + by := GetSystemMetrics(SM_CYFIXEDFRAME); + end; + end; + bt := GetSystemMetrics(SM_CYCAPTION); + end; + dx := (2 * bx); + dy := (2 * by) + bt; + end; + procedure SetWin32SizePoint(AWidth, AHeight: integer; var pt: TPoint); var IntfWidth: integer; IntfHeight: integer; + dx: integer; + dy: integer; begin // 0 means no constraint // if (AWidth=0) and (AHeight=0) then exit; - - IntfWidth := AWidth; - IntfHeight := AHeight; + dx := 0; + dy := 0; + IntfWidth := AWidth; + IntfHeight := AHeight; + + GetWindowBorderDimentions(w, dx, dy); + Inc(IntfWidth, dx); + Inc(IntfHeight, dy); if AWidth > 0 then pt.X := IntfWidth; @@ -369,7 +408,7 @@ var pt.Y := IntfHeight; end; begin - if (w = nil) or not (w is TfpgForm) then + if (w = nil) {or not (w is TfpgForm)} then Exit; //==> SetWin32SizePoint(w.MinWidth, w.MinHeight, MinMaxInfo.ptMinTrackSize); // SetWin32SizePoint(MaxWidth, MaxHeight, MinMaxInfo.ptMaxSize); @@ -971,6 +1010,8 @@ begin rwidth := FWidth; rheight := FHeight; + // Because a child has no borders or title bar the + // client area size gets adjusted. if (FWinStyle and WS_CHILD) = 0 then begin r.Left := FLeft; diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas index 48559855..ce96922e 100644 --- a/src/corelib/gfx_widget.pas +++ b/src/corelib/gfx_widget.pas @@ -824,7 +824,7 @@ var dh: integer; begin if (csLoading in ComponentState) then - Exit; + Exit; //==> FAlignRect.Top := 0; FAlignRect.Left := 0; FAlignRect.Width := Width; @@ -841,9 +841,8 @@ begin if (Components[n] is TfpgWidget) then begin wg := TfpgWidget(Components[n]); - if (wg.FAlign = alNone) and - (anBottom in wg.Anchors) or (anRight in wg.Anchors) then + ((anBottom in wg.Anchors) or (anRight in wg.Anchors)) then begin // we must alter the window dx := 0; @@ -863,7 +862,7 @@ begin wg.MoveAndResizeBy(dx, dy, dw, dh); end; - end; + end; { if } RePaint; end; |