summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-18 09:28:57 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2007-10-18 09:28:57 +0000
commit98ad0f11febab82677e87492360c1cff3e263e93 (patch)
tree722b1f54a8fceb06b47eddaa90c27278750f8318
parent22184fac6d8e34baf30f08b0119fc251c025e42a (diff)
downloadfpGUI-98ad0f11febab82677e87492360c1cff3e263e93.tar.xz
* Win32: Implemented MinWidth and MinHeight constraint support for Forms. Not sure if we need it for any Widgets or just Forms.
-rw-r--r--examples/corelib/canvastest/fpgcanvas.lpi9
-rw-r--r--examples/gui/filedialog/filedialog.lpi9
-rw-r--r--src/corelib/gdi/gfx_gdi.pas32
-rw-r--r--src/corelib/gfx_widget.pas1
4 files changed, 42 insertions, 9 deletions
diff --git a/examples/corelib/canvastest/fpgcanvas.lpi b/examples/corelib/canvastest/fpgcanvas.lpi
index f81836d4..7f1c6c21 100644
--- a/examples/corelib/canvastest/fpgcanvas.lpi
+++ b/examples/corelib/canvastest/fpgcanvas.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="fpcanvas"/>
</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">
@@ -43,6 +43,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/examples/gui/filedialog/filedialog.lpi b/examples/gui/filedialog/filedialog.lpi
index 93c2d7b0..06092817 100644
--- a/examples/gui/filedialog/filedialog.lpi
+++ b/examples/gui/filedialog/filedialog.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=""/>
</General>
<VersionInfo>
@@ -23,7 +23,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">
@@ -42,6 +42,7 @@
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
+ <PathDelim Value="\"/>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
diff --git a/src/corelib/gdi/gfx_gdi.pas b/src/corelib/gdi/gfx_gdi.pas
index 5ee48268..c366ad28 100644
--- a/src/corelib/gdi/gfx_gdi.pas
+++ b/src/corelib/gdi/gfx_gdi.pas
@@ -349,6 +349,33 @@ var
mcode: integer;
wmsg: TMsg;
PaintStruct: TPaintStruct;
+
+ //------------
+ procedure SetMinMaxInfo(var MinMaxInfo: TMINMAXINFO);
+ procedure SetWin32SizePoint(AWidth, AHeight: integer; var pt: TPoint);
+ var
+ IntfWidth: integer;
+ IntfHeight: integer;
+ begin
+ // 0 means no constraint
+// if (AWidth=0) and (AHeight=0) then exit;
+
+ IntfWidth := AWidth;
+ IntfHeight := AHeight;
+
+ if AWidth > 0 then
+ pt.X := IntfWidth;
+ if AHeight > 0 then
+ pt.Y := IntfHeight;
+ end;
+ begin
+ if (w = nil) or not (w is TfpgForm) then
+ Exit; //==>
+ SetWin32SizePoint(w.MinWidth, w.MinHeight, MinMaxInfo.ptMinTrackSize);
+// SetWin32SizePoint(MaxWidth, MaxHeight, MinMaxInfo.ptMaxSize);
+// SetWin32SizePoint(MaxWidth, MaxHeight, MinMaxInfo.ptMaxTrackSize);
+ end;
+
begin
if uMsg = WM_CREATE then
begin
@@ -546,6 +573,11 @@ begin
end; { if blockmsg }
end;
+ WM_GETMINMAXINFO:
+ begin
+ SetMinMaxInfo(PMINMAXINFO(LParam)^);
+ end;
+
WM_SIZE:
begin
// note that WM_SIZING allows some control on sizeing
diff --git a/src/corelib/gfx_widget.pas b/src/corelib/gfx_widget.pas
index f6eeba24..48559855 100644
--- a/src/corelib/gfx_widget.pas
+++ b/src/corelib/gfx_widget.pas
@@ -13,7 +13,6 @@ uses
type
TFocusSearchDirection = (fsdFirst, fsdLast, fsdNext, fsdPrev);
- { TfpgWidget }
TfpgWidget = class(TfpgWindow)
private