summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/apps/uidesigner/uidesigner.lpi9
-rw-r--r--examples/gui/alignment/aligntest.lpi12
-rw-r--r--examples/gui/fontselect/fontselect.lpi107
-rw-r--r--examples/gui/treeviewtest/treeviewtest.lpi8
-rw-r--r--src/corelib/gdi/fpgfx_package.lpk8
-rw-r--r--src/corelib/gdi/gfx_gdi.pas49
-rw-r--r--src/corelib/gfx_widget.pas7
7 files changed, 123 insertions, 77 deletions
diff --git a/examples/apps/uidesigner/uidesigner.lpi b/examples/apps/uidesigner/uidesigner.lpi
index 683e219a..cd6e7a2d 100644
--- a/examples/apps/uidesigner/uidesigner.lpi
+++ b/examples/apps/uidesigner/uidesigner.lpi
@@ -1,15 +1,15 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
- <Version Value="6"/>
+ <PathDelim Value="\"/>
+ <Version Value="5"/>
<General>
<Flags>
<SaveOnlyProjectUnits Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
<Title Value="uiDesigner"/>
</General>
@@ -24,7 +24,7 @@
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -108,6 +108,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<Parsing>
<SyntaxOptions>
<AllowLabel Value="False"/>
diff --git a/examples/gui/alignment/aligntest.lpi b/examples/gui/alignment/aligntest.lpi
index 4baa8867..d69be9b7 100644
--- a/examples/gui/alignment/aligntest.lpi
+++ b/examples/gui/alignment/aligntest.lpi
@@ -1,12 +1,12 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
+ <PathDelim Value="\"/>
<Version Value="5"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -14,13 +14,14 @@
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
+ <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -38,9 +39,10 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<SearchPaths>
- <IncludeFiles Value="../src/"/>
- <OtherUnitFiles Value="../src/"/>
+ <IncludeFiles Value="..\src\"/>
+ <OtherUnitFiles Value="..\src\"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
diff --git a/examples/gui/fontselect/fontselect.lpi b/examples/gui/fontselect/fontselect.lpi
index 230ba30c..7cb6ee37 100644
--- a/examples/gui/fontselect/fontselect.lpi
+++ b/examples/gui/fontselect/fontselect.lpi
@@ -1,53 +1,54 @@
-<?xml version="1.0"?>
-<CONFIG>
- <ProjectOptions>
- <PathDelim Value="/"/>
- <Version Value="5"/>
- <General>
- <Flags>
- <SaveOnlyProjectUnits Value="True"/>
- </Flags>
- <SessionStorage Value="InProjectDir"/>
- <MainUnit Value="0"/>
- <IconPath Value="./"/>
- <TargetFileExt Value=""/>
- </General>
- <VersionInfo>
- <ProjectVersion Value=""/>
- </VersionInfo>
- <PublishOptions>
- <Version Value="2"/>
- <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
- <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
- </PublishOptions>
- <RunParams>
- <local>
- <FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
- </local>
- </RunParams>
- <RequiredPackages Count="1">
- <Item1>
- <PackageName Value="fpgui_package"/>
- <MinVersion Minor="5" Valid="True"/>
- </Item1>
- </RequiredPackages>
- <Units Count="1">
- <Unit0>
- <Filename Value="fontselect.lpr"/>
- <IsPartOfProject Value="True"/>
- <UnitName Value="fontselect"/>
- </Unit0>
- </Units>
- </ProjectOptions>
- <CompilerOptions>
- <Version Value="5"/>
- <CodeGeneration>
- <Generate Value="Faster"/>
- </CodeGeneration>
- <Other>
- <CustomOptions Value="-FUunits"/>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
- </CompilerOptions>
-</CONFIG>
+<?xml version="1.0"?>
+<CONFIG>
+ <ProjectOptions>
+ <PathDelim Value="\"/>
+ <Version Value="5"/>
+ <General>
+ <Flags>
+ <SaveOnlyProjectUnits Value="True"/>
+ </Flags>
+ <SessionStorage Value="InProjectDir"/>
+ <MainUnit Value="0"/>
+ <IconPath Value=".\"/>
+ <TargetFileExt Value=""/>
+ </General>
+ <VersionInfo>
+ <ProjectVersion Value=""/>
+ </VersionInfo>
+ <PublishOptions>
+ <Version Value="2"/>
+ <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
+ <ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
+ </PublishOptions>
+ <RunParams>
+ <local>
+ <FormatVersion Value="1"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
+ </local>
+ </RunParams>
+ <RequiredPackages Count="1">
+ <Item1>
+ <PackageName Value="fpgui_package"/>
+ <MinVersion Minor="5" Valid="True"/>
+ </Item1>
+ </RequiredPackages>
+ <Units Count="1">
+ <Unit0>
+ <Filename Value="fontselect.lpr"/>
+ <IsPartOfProject Value="True"/>
+ <UnitName Value="fontselect"/>
+ </Unit0>
+ </Units>
+ </ProjectOptions>
+ <CompilerOptions>
+ <Version Value="5"/>
+ <PathDelim Value="\"/>
+ <CodeGeneration>
+ <Generate Value="Faster"/>
+ </CodeGeneration>
+ <Other>
+ <CustomOptions Value="-FUunits"/>
+ <CompilerPath Value="$(CompPath)"/>
+ </Other>
+ </CompilerOptions>
+</CONFIG>
diff --git a/examples/gui/treeviewtest/treeviewtest.lpi b/examples/gui/treeviewtest/treeviewtest.lpi
index 779a40a2..4990220b 100644
--- a/examples/gui/treeviewtest/treeviewtest.lpi
+++ b/examples/gui/treeviewtest/treeviewtest.lpi
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
- <PathDelim Value="/"/>
+ <PathDelim Value="\"/>
<Version Value="5"/>
<General>
<Flags>
@@ -9,7 +9,7 @@
</Flags>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
- <IconPath Value="./"/>
+ <IconPath Value=".\"/>
<TargetFileExt Value=""/>
</General>
<VersionInfo>
@@ -17,13 +17,14 @@
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
+ <DestinationDirectory Value="$(TestDir)\publishedproject\"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
- <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
+ <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="1">
@@ -42,6 +43,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
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;