diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-10 11:23:16 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-07-10 11:23:16 +0000 |
commit | 3ebb9e3e8b103a7e3bc740a41ebbb945aa9bb043 (patch) | |
tree | cbac7fed60cc35b867bba89551bfc7a92263567f | |
parent | d2aec3b34f257589ba18b28742180bc3a528731f (diff) | |
download | fpGUI-3ebb9e3e8b103a7e3bc740a41ebbb945aa9bb043.tar.xz |
* Fixed the svn eol style properties for the new prototype example.
* Fixed the mouse wheel support for X11 based on the changes made under Windows.
-rw-r--r-- | prototypes/fpgui2/examples/core/eventtest/eventtest.lpi | 7 | ||||
-rw-r--r-- | prototypes/fpgui2/source/core/x11/gfx_x11.pas | 8 | ||||
-rw-r--r-- | prototypes/newmultihandle/examples/helloworld.lpi | 242 | ||||
-rw-r--r-- | prototypes/newmultihandle/examples/helloworld.lpr | 142 | ||||
-rw-r--r-- | prototypes/newmultihandle/fpgui.pas | 46 | ||||
-rw-r--r-- | prototypes/newmultihandle/fpguipackage.lpk | 86 | ||||
-rw-r--r-- | prototypes/newmultihandle/fpguipackage.pas | 40 | ||||
-rw-r--r-- | prototypes/newmultihandle/gui_button.inc | 122 | ||||
-rw-r--r-- | prototypes/newmultihandle/gui_widget.inc | 72 |
9 files changed, 367 insertions, 398 deletions
diff --git a/prototypes/fpgui2/examples/core/eventtest/eventtest.lpi b/prototypes/fpgui2/examples/core/eventtest/eventtest.lpi index f09daf7e..d2803979 100644 --- a/prototypes/fpgui2/examples/core/eventtest/eventtest.lpi +++ b/prototypes/fpgui2/examples/core/eventtest/eventtest.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> @@ -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"> @@ -41,7 +41,6 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> <CodeGeneration> <Optimizations> <OptimizationLevel Value="0"/> diff --git a/prototypes/fpgui2/source/core/x11/gfx_x11.pas b/prototypes/fpgui2/source/core/x11/gfx_x11.pas index 9a5eff08..591b7b73 100644 --- a/prototypes/fpgui2/source/core/x11/gfx_x11.pas +++ b/prototypes/fpgui2/source/core/x11/gfx_x11.pas @@ -637,14 +637,8 @@ begin end; end; -// if ev.xbutton.button > 5 then -// i := 1 -// else -// i := 3; // amount - - msgp.mouse.x := i; + msgp.mouse.delta := i; fpgPostMessage(nil, w, FPGM_SCROLL, msgp); -// fpgPostMessage(nil, ewg, MSG_SCROLL, ev.xbutton.button mod 4, i, ev.xbutton.state ); end; end else diff --git a/prototypes/newmultihandle/examples/helloworld.lpi b/prototypes/newmultihandle/examples/helloworld.lpi index dd138dfa..bf424ab9 100644 --- a/prototypes/newmultihandle/examples/helloworld.lpi +++ b/prototypes/newmultihandle/examples/helloworld.lpi @@ -1,133 +1,109 @@ -<?xml version="1.0"?>
-<CONFIG>
- <ProjectOptions>
- <PathDelim Value="\"/>
- <Version Value="5"/>
- <General>
- <MainUnit Value="0"/>
- <IconPath Value="./"/>
- <TargetFileExt Value=".exe"/>
- <ActiveEditorIndexAtStart Value="4"/>
- </General>
- <VersionInfo>
- <ProjectVersion Value=""/>
- <Language Value=""/>
- <CharSet Value=""/>
- </VersionInfo>
- <PublishOptions>
- <Version Value="2"/>
- <IgnoreBinaries Value="False"/>
- <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="2">
- <Item1>
- <PackageName Value="fpguipackage"/>
- </Item1>
- <Item2>
- <PackageName Value="fpGFXPackage"/>
- </Item2>
- </RequiredPackages>
- <Units Count="7">
- <Unit0>
- <Filename Value="helloworld.lpr"/>
- <IsPartOfProject Value="True"/>
- <UnitName Value="helloworld"/>
- <CursorPos X="18" Y="12"/>
- <TopLine Value="1"/>
- <EditorIndex Value="0"/>
- <UsageCount Value="20"/>
- <Loaded Value="True"/>
- </Unit0>
- <Unit1>
- <Filename Value="..\fpgui.pas"/>
- <UnitName Value="fpgui"/>
- <CursorPos X="31" Y="8"/>
- <TopLine Value="1"/>
- <EditorIndex Value="2"/>
- <UsageCount Value="20"/>
- <Loaded Value="True"/>
- </Unit1>
- <Unit2>
- <Filename Value="..\..\fpgui2\source\gui\gui_form.pas"/>
- <UnitName Value="gui_form"/>
- <CursorPos X="5" Y="2"/>
- <TopLine Value="1"/>
- <UsageCount Value="10"/>
- </Unit2>
- <Unit3>
- <Filename Value="..\gui_widget.inc"/>
- <IsPartOfProject Value="True"/>
- <CursorPos X="17" Y="3"/>
- <TopLine Value="1"/>
- <EditorIndex Value="4"/>
- <UsageCount Value="20"/>
- <Loaded Value="True"/>
- </Unit3>
- <Unit4>
- <Filename Value="..\gui_button.inc"/>
- <IsPartOfProject Value="True"/>
- <CursorPos X="27" Y="37"/>
- <TopLine Value="37"/>
- <EditorIndex Value="5"/>
- <UsageCount Value="20"/>
- <Loaded Value="True"/>
- </Unit4>
- <Unit5>
- <Filename Value="..\..\..\gfx\gfxbase.pas"/>
- <UnitName Value="GfxBase"/>
- <CursorPos X="12" Y="122"/>
- <TopLine Value="109"/>
- <EditorIndex Value="3"/>
- <UsageCount Value="10"/>
- <Loaded Value="True"/>
- </Unit5>
- <Unit6>
- <Filename Value="..\..\..\..\..\lazarus215\fpc\2.1.5\source\rtl\objpas\classes\classesh.inc"/>
- <CursorPos X="4" Y="25"/>
- <TopLine Value="13"/>
- <EditorIndex Value="1"/>
- <UsageCount Value="10"/>
- <Loaded Value="True"/>
- </Unit6>
- </Units>
- <JumpHistory Count="5" HistoryIndex="4">
- <Position1>
- <Filename Value="helloworld.lpr"/>
- <Caret Line="44" Column="44" TopLine="27"/>
- </Position1>
- <Position2>
- <Filename Value="helloworld.lpr"/>
- <Caret Line="45" Column="27" TopLine="33"/>
- </Position2>
- <Position3>
- <Filename Value="helloworld.lpr"/>
- <Caret Line="25" Column="13" TopLine="21"/>
- </Position3>
- <Position4>
- <Filename Value="helloworld.lpr"/>
- <Caret Line="26" Column="13" TopLine="7"/>
- </Position4>
- <Position5>
- <Filename Value="..\gui_widget.inc"/>
- <Caret Line="27" Column="23" TopLine="12"/>
- </Position5>
- </JumpHistory>
- </ProjectOptions>
- <CompilerOptions>
- <Version Value="5"/>
- <PathDelim Value="\"/>
- <CodeGeneration>
- <Generate Value="Faster"/>
- </CodeGeneration>
- <Other>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
- </CompilerOptions>
-</CONFIG>
+<?xml version="1.0"?> +<CONFIG> + <ProjectOptions> + <PathDelim Value="/"/> + <Version Value="5"/> + <General> + <MainUnit Value="0"/> + <IconPath Value="./"/> + <TargetFileExt Value=".exe"/> + <ActiveEditorIndexAtStart Value="3"/> + </General> + <VersionInfo> + <ProjectVersion Value=""/> + <Language Value=""/> + <CharSet Value=""/> + </VersionInfo> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + <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="2"> + <Item1> + <PackageName Value="fpguipackage"/> + </Item1> + <Item2> + <PackageName Value="fpGFXPackage"/> + </Item2> + </RequiredPackages> + <Units Count="7"> + <Unit0> + <Filename Value="helloworld.lpr"/> + <IsPartOfProject Value="True"/> + <UnitName Value="helloworld"/> + <CursorPos X="18" Y="12"/> + <TopLine Value="1"/> + <EditorIndex Value="0"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit0> + <Unit1> + <Filename Value="../fpgui.pas"/> + <UnitName Value="fpgui"/> + <CursorPos X="31" Y="8"/> + <TopLine Value="1"/> + <EditorIndex Value="1"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit1> + <Unit2> + <Filename Value="../../fpgui2/source/gui/gui_form.pas"/> + <UnitName Value="gui_form"/> + <CursorPos X="5" Y="2"/> + <TopLine Value="1"/> + <UsageCount Value="10"/> + </Unit2> + <Unit3> + <Filename Value="../gui_widget.inc"/> + <IsPartOfProject Value="True"/> + <CursorPos X="17" Y="3"/> + <TopLine Value="1"/> + <EditorIndex Value="3"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit3> + <Unit4> + <Filename Value="../gui_button.inc"/> + <IsPartOfProject Value="True"/> + <CursorPos X="27" Y="37"/> + <TopLine Value="31"/> + <EditorIndex Value="4"/> + <UsageCount Value="20"/> + <Loaded Value="True"/> + </Unit4> + <Unit5> + <Filename Value="../../../gfx/gfxbase.pas"/> + <UnitName Value="GfxBase"/> + <CursorPos X="12" Y="122"/> + <TopLine Value="109"/> + <EditorIndex Value="2"/> + <UsageCount Value="10"/> + <Loaded Value="True"/> + </Unit5> + <Unit6> + <Filename Value="../../../../../lazarus215/fpc/2.1.5/source/rtl/objpas/classes/classesh.inc"/> + <CursorPos X="4" Y="25"/> + <TopLine Value="13"/> + <UsageCount Value="10"/> + </Unit6> + </Units> + <JumpHistory Count="0" HistoryIndex="-1"/> + </ProjectOptions> + <CompilerOptions> + <Version Value="5"/> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> +</CONFIG> diff --git a/prototypes/newmultihandle/examples/helloworld.lpr b/prototypes/newmultihandle/examples/helloworld.lpr index fcb9541b..19d20006 100644 --- a/prototypes/newmultihandle/examples/helloworld.lpr +++ b/prototypes/newmultihandle/examples/helloworld.lpr @@ -1,71 +1,71 @@ -program HelloWorld;
-
-{$mode objfpc}{$h+}
-
-uses
- Classes,
- fpgui,
- fpGFX,
- gfxBase;
-
-type
- TMainForm = class(TFWidget)
- private
-// BoxLayout: TFBoxLayout;
- btnHello: TFButton;
- public
- procedure AfterConstruction; override;
- end;
-
-
-{ TMainForm }
-
-procedure TMainForm.AfterConstruction;
-var
- lSize: TSize;
- lPoint: TPoint;
-begin
- inherited AfterConstruction;
- Name := 'MainForm';
-// BorderWidth := 8;
-// Text := 'fpGUI Application';
-
- { every fpGUI app needs a layout manager }
-{ BoxLayout := TFBoxLayout.Create(self);
- BoxLayout.Spacing := 8;
- BoxLayout.VertAlign := vertFill;
- InsertChild(BoxLayout);}
-
- { create our button }
- btnHello := TFButton.Create('Hello World!', self);
-{ btnHello.CanExpandWidth := True;
- btnHello.CanExpandHeight := True;
- BoxLayout.InsertChild(btnHello); }
- lSize.cx := 50;
- lSize.cy := 100;
- btnHello.SetMinMaxClientSize(lSize, lSize);
- lPoint.x := 25;
- lPoint.y := 25;
- btnHello.SetPosition(lPoint);
-
- { set a min and max size }
- lSize.cx := 200;
- lSize.cy := 200;
- SetMinMaxClientSize(lSize, lSize);
-end;
-
-
-var
- MainForm: TMainForm;
-begin
- GFApplication.Initialize;
- MainForm := TMainForm.Create(nil);
- try
-// GFApplication.AddWindow(MainForm);
- MainForm.Show;
- GFApplication.Run;
- finally
-// MainForm.Free;
- end;
-end.
-
+program HelloWorld; + +{$mode objfpc}{$h+} + +uses + Classes, + fpgui, + fpGFX, + gfxBase; + +type + TMainForm = class(TFWidget) + private +// BoxLayout: TFBoxLayout; + btnHello: TFButton; + public + procedure AfterConstruction; override; + end; + + +{ TMainForm } + +procedure TMainForm.AfterConstruction; +var + lSize: TSize; + lPoint: TPoint; +begin + inherited AfterConstruction; + Name := 'MainForm'; +// BorderWidth := 8; +// Text := 'fpGUI Application'; + + { every fpGUI app needs a layout manager } +{ BoxLayout := TFBoxLayout.Create(self); + BoxLayout.Spacing := 8; + BoxLayout.VertAlign := vertFill; + InsertChild(BoxLayout);} + + { create our button } + btnHello := TFButton.Create('Hello World!', self); +{ btnHello.CanExpandWidth := True; + btnHello.CanExpandHeight := True; + BoxLayout.InsertChild(btnHello); } + lSize.cx := 50; + lSize.cy := 100; + btnHello.SetMinMaxClientSize(lSize, lSize); + lPoint.x := 25; + lPoint.y := 25; + btnHello.SetPosition(lPoint); + + { set a min and max size } + lSize.cx := 200; + lSize.cy := 200; + SetMinMaxClientSize(lSize, lSize); +end; + + +var + MainForm: TMainForm; +begin + GFApplication.Initialize; + MainForm := TMainForm.Create(nil); + try +// GFApplication.AddWindow(MainForm); + MainForm.Show; + GFApplication.Run; + finally +// MainForm.Free; + end; +end. + diff --git a/prototypes/newmultihandle/fpgui.pas b/prototypes/newmultihandle/fpgui.pas index c4baf0e7..6423112e 100644 --- a/prototypes/newmultihandle/fpgui.pas +++ b/prototypes/newmultihandle/fpgui.pas @@ -1,23 +1,23 @@ -unit fpgui;
-
-{$mode objfpc}{$H+}
-
-interface
-
-uses
- Classes, SysUtils, gfxbase, fpgfx;
-
-{$include gui_widget.inc}
-
-{$include gui_button.inc}
-
-implementation
-
-{$define READ_IMPLEMENTATION}
-
-{$include gui_widget.inc}
-
-{$include gui_button.inc}
-
-end.
-
+unit fpgui; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, gfxbase, fpgfx; + +{$include gui_widget.inc} + +{$include gui_button.inc} + +implementation + +{$define READ_IMPLEMENTATION} + +{$include gui_widget.inc} + +{$include gui_button.inc} + +end. + diff --git a/prototypes/newmultihandle/fpguipackage.lpk b/prototypes/newmultihandle/fpguipackage.lpk index 46b70a33..4043429d 100644 --- a/prototypes/newmultihandle/fpguipackage.lpk +++ b/prototypes/newmultihandle/fpguipackage.lpk @@ -1,43 +1,43 @@ -<?xml version="1.0"?>
-<CONFIG>
- <Package Version="2">
- <PathDelim Value="\"/>
- <Name Value="fpguipackage"/>
- <CompilerOptions>
- <Version Value="5"/>
- <PathDelim Value="\"/>
- <SearchPaths>
- <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\"/>
- </SearchPaths>
- <CodeGeneration>
- <Generate Value="Faster"/>
- </CodeGeneration>
- <Other>
- <CompilerPath Value="$(CompPath)"/>
- </Other>
- </CompilerOptions>
- <Files Count="1">
- <Item1>
- <Filename Value="fpgui.pas"/>
- <UnitName Value="fpgui"/>
- </Item1>
- </Files>
- <Type Value="RunAndDesignTime"/>
- <RequiredPkgs Count="2">
- <Item1>
- <PackageName Value="fpGFXPackage"/>
- </Item1>
- <Item2>
- <PackageName Value="FCL"/>
- <MinVersion Major="1" Valid="True"/>
- </Item2>
- </RequiredPkgs>
- <UsageOptions>
- <UnitPath Value="$(PkgOutDir)"/>
- </UsageOptions>
- <PublishOptions>
- <Version Value="2"/>
- <IgnoreBinaries Value="False"/>
- </PublishOptions>
- </Package>
-</CONFIG>
+<?xml version="1.0"?> +<CONFIG> + <Package Version="2"> + <PathDelim Value="\"/> + <Name Value="fpguipackage"/> + <CompilerOptions> + <Version Value="5"/> + <PathDelim Value="\"/> + <SearchPaths> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)\"/> + </SearchPaths> + <CodeGeneration> + <Generate Value="Faster"/> + </CodeGeneration> + <Other> + <CompilerPath Value="$(CompPath)"/> + </Other> + </CompilerOptions> + <Files Count="1"> + <Item1> + <Filename Value="fpgui.pas"/> + <UnitName Value="fpgui"/> + </Item1> + </Files> + <Type Value="RunAndDesignTime"/> + <RequiredPkgs Count="2"> + <Item1> + <PackageName Value="fpGFXPackage"/> + </Item1> + <Item2> + <PackageName Value="FCL"/> + <MinVersion Major="1" Valid="True"/> + </Item2> + </RequiredPkgs> + <UsageOptions> + <UnitPath Value="$(PkgOutDir)"/> + </UsageOptions> + <PublishOptions> + <Version Value="2"/> + <IgnoreBinaries Value="False"/> + </PublishOptions> + </Package> +</CONFIG> diff --git a/prototypes/newmultihandle/fpguipackage.pas b/prototypes/newmultihandle/fpguipackage.pas index 3e13dea3..b53553c8 100644 --- a/prototypes/newmultihandle/fpguipackage.pas +++ b/prototypes/newmultihandle/fpguipackage.pas @@ -1,20 +1,20 @@ -{ This file was automatically created by Lazarus. Do not edit!
-This source is only used to compile and install the package.
- }
-
-unit fpguipackage;
-
-interface
-
-uses
- fpgui, LazarusPackageIntf;
-
-implementation
-
-procedure Register;
-begin
-end;
-
-initialization
- RegisterPackage('fpguipackage', @Register);
-end.
+{ This file was automatically created by Lazarus. Do not edit! +This source is only used to compile and install the package. + } + +unit fpguipackage; + +interface + +uses + fpgui, LazarusPackageIntf; + +implementation + +procedure Register; +begin +end; + +initialization + RegisterPackage('fpguipackage', @Register); +end. diff --git a/prototypes/newmultihandle/gui_button.inc b/prototypes/newmultihandle/gui_button.inc index 7208abe0..51f8f1a7 100644 --- a/prototypes/newmultihandle/gui_button.inc +++ b/prototypes/newmultihandle/gui_button.inc @@ -1,61 +1,61 @@ -{$ifndef READ_IMPLEMENTATION}
-
-type
- TFButton = class(TFWidget)
- public
- Text: string;
- constructor Create(AParent: TFCustomWindow); override;
- constructor Create(ACaption: string; AParent: TFCustomWindow);
- procedure Paint(Sender: TObject; const Rect: TRect); override;
- procedure MouseReleased(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint);
- end;
-
-
-{$else}
-
-constructor TFButton.Create(AParent: TFCustomWindow);
-begin
- inherited Create(AParent);
-
- OnMouseReleased := @MouseReleased;
- OnPaint := @Paint;
-
- SetClientSize(Size(125, 125));
- SetMinMaxClientSize(Size(125, 125), Size(125, 125));
-end;
-
-constructor TFButton.Create(ACaption: string; AParent: TFCustomWindow);
-begin
- Create(AParent);
-
- Text := ACaption;
-end;
-
-procedure TFButton.MouseReleased(Sender: TObject; AButton: TMouseButton;
- AShift: TShiftState; const AMousePos: TPoint);
-begin
- WriteLn('Mouse released on child window');
-end;
-
-procedure TFButton.Paint(Sender: TObject; const Rect: TRect);
-var
- r: TRect;
- tw: integer;
-begin
- Canvas.SetColor(colGray);
- r.Left := 0;
- r.Top := 0;
- r.Right := Width;
- r.Bottom := Height;
- Canvas.DrawRect(r);
-
- Canvas.SetColor(colWhite);
- r.Left := 1;
- r.Top := 1;
- r.Right := Width + 1;
- r.Bottom := Height + 1;
- Canvas.DrawRect(r);
-end;
-
-{$endif}
-
+{$ifndef READ_IMPLEMENTATION} + +type + TFButton = class(TFWidget) + public + Text: string; + constructor Create(AParent: TFCustomWindow); override; + constructor Create(ACaption: string; AParent: TFCustomWindow); + procedure Paint(Sender: TObject; const Rect: TRect); override; + procedure MouseReleased(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); + end; + + +{$else} + +constructor TFButton.Create(AParent: TFCustomWindow); +begin + inherited Create(AParent); + + OnMouseReleased := @MouseReleased; + OnPaint := @Paint; + + SetClientSize(Size(125, 125)); + SetMinMaxClientSize(Size(125, 125), Size(125, 125)); +end; + +constructor TFButton.Create(ACaption: string; AParent: TFCustomWindow); +begin + Create(AParent); + + Text := ACaption; +end; + +procedure TFButton.MouseReleased(Sender: TObject; AButton: TMouseButton; + AShift: TShiftState; const AMousePos: TPoint); +begin + WriteLn('Mouse released on child window'); +end; + +procedure TFButton.Paint(Sender: TObject; const Rect: TRect); +var + r: TRect; + tw: integer; +begin + Canvas.SetColor(colGray); + r.Left := 0; + r.Top := 0; + r.Right := Width; + r.Bottom := Height; + Canvas.DrawRect(r); + + Canvas.SetColor(colWhite); + r.Left := 1; + r.Top := 1; + r.Right := Width + 1; + r.Bottom := Height + 1; + Canvas.DrawRect(r); +end; + +{$endif} + diff --git a/prototypes/newmultihandle/gui_widget.inc b/prototypes/newmultihandle/gui_widget.inc index 39a5a9e5..e1d874f2 100644 --- a/prototypes/newmultihandle/gui_widget.inc +++ b/prototypes/newmultihandle/gui_widget.inc @@ -1,36 +1,36 @@ -{$ifndef READ_IMPLEMENTATION}
-
-type
- TFWidget = class(TFWindow)
- public
- constructor Create(AParent: TFCustomWindow); virtual;
- procedure Paint(Sender: TObject; const Rect: TRect); virtual;
- end;
-
-{$else}
-
-constructor TFWidget.Create(AParent: TFCustomWindow);
-begin
- if (AParent = nil) then inherited Create(nil, [woWindow])
- else inherited Create(AParent, [woChildWindow]);
-
- OnPaint := @Paint;
-
- SetClientSize(Size(125, 125));
- SetMinMaxClientSize(Size(125, 125), Size(125, 125));
-end;
-
-procedure TFWidget.Paint(Sender: TObject; const Rect: TRect);
-var
- r: TRect;
-begin
- Canvas.SetColor(colLtGray);
- r.Left := 0;
- r.Top := 0;
- r.Right := Width;
- r.Bottom := Height;
- Canvas.FillRect(r);
-end;
-
-{$endif}
-
+{$ifndef READ_IMPLEMENTATION} + +type + TFWidget = class(TFWindow) + public + constructor Create(AParent: TFCustomWindow); virtual; + procedure Paint(Sender: TObject; const Rect: TRect); virtual; + end; + +{$else} + +constructor TFWidget.Create(AParent: TFCustomWindow); +begin + if (AParent = nil) then inherited Create(nil, [woWindow]) + else inherited Create(AParent, [woChildWindow]); + + OnPaint := @Paint; + + SetClientSize(Size(125, 125)); + SetMinMaxClientSize(Size(125, 125), Size(125, 125)); +end; + +procedure TFWidget.Paint(Sender: TObject; const Rect: TRect); +var + r: TRect; +begin + Canvas.SetColor(colLtGray); + r.Left := 0; + r.Top := 0; + r.Right := Width; + r.Bottom := Height; + Canvas.FillRect(r); +end; + +{$endif} + |