diff options
author | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-04-15 21:40:32 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@users.sourceforge.net> | 2007-04-15 21:40:32 +0000 |
commit | 6300ada280f4d84ca6246d00d2d205f5dbd90e0e (patch) | |
tree | 6dcacb75f197aa7ba3edcae285697f5d923da9ba /examples/gui | |
parent | 49971f1c1bc3b71ca149cd7ea0da3d6fb53dff10 (diff) | |
download | fpGUI-6300ada280f4d84ca6246d00d2d205f5dbd90e0e.tar.xz |
Fixed the rest of the GUI examples to work since we did a widget class renaming a while back.
Diffstat (limited to 'examples/gui')
-rw-r--r-- | examples/gui/concepttest/OpenSoftStyle.pas | 254 | ||||
-rw-r--r-- | examples/gui/concepttest/compileroptform.frm | 42 | ||||
-rw-r--r-- | examples/gui/concepttest/frmCompilerOpt.pas | 44 | ||||
-rw-r--r-- | examples/gui/concepttest/hello.lpi | 401 | ||||
-rw-r--r-- | examples/gui/concepttest/hello.lpr | 218 | ||||
-rw-r--r-- | examples/gui/helloworld/helloworld.pas | 2 | ||||
-rw-r--r-- | examples/gui/utfdemo/utfdemo.lpi | 14 | ||||
-rw-r--r-- | examples/gui/widgetdemo/widgetdemo.lpi (renamed from examples/gui/widgetdemo/WidgetDemo.lpi) | 4 | ||||
-rw-r--r-- | examples/gui/widgetdemo/widgetdemo.lpr (renamed from examples/gui/widgetdemo/WidgetDemo.lpr) | 0 |
9 files changed, 180 insertions, 799 deletions
diff --git a/examples/gui/concepttest/OpenSoftStyle.pas b/examples/gui/concepttest/OpenSoftStyle.pas deleted file mode 100644 index 60a25f8d..00000000 --- a/examples/gui/concepttest/OpenSoftStyle.pas +++ /dev/null @@ -1,254 +0,0 @@ -unit OpenSoftStyle; - -{$mode objfpc}{$H+} - -interface - -uses - Classes, fpgui, gfxbase; - -type - - TGradientDirection = (gdTopToBottom, gdBottomToTop, gdLeftToRight, gdRightToLeft); - TCalcGradientEndX = function(Y, H: Integer): Integer; - - - TOpenSoftStyle = class(TDefaultStyle) - private - procedure PaintGradient(pCanvas: TGfxCanvas; const R: TRect; StartColor, EndColor: TColor; Direction: TGradientDirection; GradLines: Integer = -1); - public - // Colors - function GetGUIColor(Color: TColor): TGfxColor; override; - // Buttons (todo) - procedure DrawButtonFace(Canvas: TGfxCanvas; const ARect: TRect; Flags: TFButtonFlags); override; - // GroupBox - procedure DrawGroupBox(Canvas: TGfxCanvas; const ARect: TRect; const ALabel: String; WidgetState: TWidgetState); override; - end; - - -var - FOpenSoftStyle: TOpenSoftStyle; - -implementation - - -const - // Some predefined colors: - rgbaDkBlue: TGfxColor = (Red: $0000; Green: $0000; Blue: $8000; Alpha: $0000); - rgbaLtYellow: TGfxColor = (Red: $ffff; Green: $ffff; Blue: $e100; Alpha: $0000); - - rgbaWindowText: TGfxColor = (Red: $0000; Green: $0000; Blue: $0000; Alpha: $0000); - rgbaWindow: TGfxColor = (Red: $efef; Green: $efef; Blue: $efef; Alpha: $0000); - rgbaDkGrey: TGfxColor = (Red: $8686; Green: $8686; Blue: $8686; Alpha: $0000); - rgbaGbAALtGrey: TGfxColor = (Red: $baba; Green: $baba; Blue: $baba; Alpha: $0000); - rgbaGbAADkGrey: TGfxColor = (Red: $7878; Green: $7878; Blue: $7878; Alpha: $0000); - - -{ -procedure DrawGradient(Canvas: TCanvas; const R: TRect; StartColor, EndColor: TColor; - Direction: TGradientDirection; GradLines: Integer = -1; CalcEndX: TCalcGradientEndX = nil); -procedure DrawGradientEx(Canvas: TCanvas; const R: TRect; StartColor: TColor; - StartToMidHeight: Integer; MidColor, EndColor: TColor; - Direction: TGradientDirection; CalcEndX: TCalcGradientEndX = nil); - - -procedure ToRGB(c: TColor; out rgb: TRGB); -var - l: TColorRef; -begin - c := ColorFromColormap(c); - l := ColorToRGB(c); - rgb.r := TRGBValue(l).r; - rgb.g := TRGBValue(l).g; - rgb.b := TRGBValue(l).b; -end; -} - - -{ TOpenSoftStyle } - -procedure TOpenSoftStyle.PaintGradient(pCanvas: TGfxCanvas; const R: TRect; StartColor, EndColor: TColor; Direction: TGradientDirection; GradLines: Integer = -1); -var - X, i, w, h, Count: Integer; - EndCol, StartCol, AddCol, Tmp: TGfxColor; -begin - w := R.Right - R.Left - 1; - h := R.Bottom - R.Top - 1; - if (w <= 0) or (h <= 0) then - Exit; //==> - - StartCol := GetGUIColor(StartColor); - EndCol := GetGUIColor(EndColor); - - case Direction of - gdTopToBottom: - Count := h; - gdLeftToRight: - Count := w; - gdBottomToTop: - begin - Count := h; - Tmp := EndCol; - EndCol := StartCol; - StartCol := Tmp; - end; - gdRightToLeft: - begin - Count := w; - Tmp := EndCol; - EndCol := StartCol; - StartCol := Tmp; - end; - else - Exit; //==> - end; - if GradLines < 0 then - GradLines := Count; - - AddCol.r := (EndCol.r - StartCol.r) / GradLines; - AddCol.g := (EndCol.g - StartCol.g) / GradLines; - AddCol.b := (EndCol.b - StartCol.b) / GradLines; - -// Canvas.Pen.Style := psSolid; - pCanvas.SaveState; -// Canvas.Start; - try - StartColor := TColor(Round(StartCol.r), Round(StartCol.g), Round(StartCol.b)); -// Canvas.Pen.Color := StartColor; - pCanvas.SetColor(GetGUIColor(StartColor)); - for i := 0 to Count - 1 do - begin - if Direction in [gdTopToBottom, gdBottomToTop] then - begin - Canvas.MoveTo(R.Left, R.Top + i); - if Assigned(CalcEndX) then - X := CalcEndX(i, Count) - else - X := 0; - Canvas.LineTo(R.Right + X, R.Top + i); - end - else - begin - Canvas.MoveTo(R.Left + i, R.Top); - Canvas.LineTo(R.Left + i, R.Bottom); - end; - StartCol.r := StartCol.r + AddCol.r; - StartCol.g := StartCol.g + AddCol.g; - StartCol.b := StartCol.b + AddCol.b; - EndColor := RGB(Round(StartCol.r), Round(StartCol.g), Round(StartCol.b)); - if StartColor <> EndColor then - begin -// Canvas.Pen.Color := EndColor; - pCanvas.SetColor(GetGUIColor(EndColor)); - StartColor := EndColor; - end; - end; // for - finally -// Canvas.Stop; - pCanvas.RestoreState; - end; -end; - - -function TOpenSoftStyle.GetGUIColor(Color: TColor): TGfxColor; -begin - Result := inherited GetGUIColor(Color); - case Color of - // UI element colors - clScrollBar: Result := rgbaWindow; - clMenu: Result := rgbaWindow; -// clWindow: Result := GetUIColor(clWhite); -// clMenuText: Result := GetUIColor(clBlack); -// clWindowText: Result := GetUIColor(clBlack); -// clAppWorkSpace: Result := GetUIColor(clGray); -// clHighlight: Result := GetUIColor(clNavy); -// clHighlightText: Result := GetUIColor(clWhite); - cl3DFace: Result := rgbaWindow; -// cl3DShadow: Result := rgbaDkWhite; -// clGrayText: Result := GetUIColor(clGray); -// clBtnText: Result := GetUIColor(clBlack); -// cl3DHighlight: Result := GetUIColor(clWhite); - cl3DDkShadow: Result := GetUIColor(clMidnightBlue); -// cl3DLight: Result := GetUIColor(clDarkWhite); -// clInfoText: Result := GetUIColor(clBlack); -// clInfoBk: Result := GetUIColor(clLightYellow); -// -// else Result := GetUIColor(clWhite); - end; - -end; - - -procedure TOpenSoftStyle.DrawButtonFace(Canvas: TGfxCanvas; const ARect: TRect; - Flags: TFButtonFlags); -begin -// inherited DrawButtonFace(Canvas, ARect, Flags); - PaintGradient(Canvas, ARect, Flags); - Draw3DFrame(Canvas, ARect, cl3DHighlight, cl3DLight, cl3DDkShadow, cl3DShadow); -end; - - -procedure TOpenSoftStyle.DrawGroupBox(Canvas: TGfxCanvas; const ARect: TRect; - const ALabel: String; WidgetState: TWidgetState); -var - TitleWidth, TitleHeight, TopLine: Integer; -begin - TitleWidth := Canvas.TextWidth(ALabel); - TitleHeight := Canvas.FontCellHeight; - TopLine := ARect.Top + TitleHeight div 3; - - Canvas.SetColor(rgbaDkGrey); - // box outline - with ARect do - begin - // top - Canvas.DrawLine(Point(Left + 2, TopLine), Point(Left + 12, TopLine)); - Canvas.DrawLine(Point(Left + TitleWidth + 16, TopLine), Point(Right - 2, TopLine)); - // right - Canvas.DrawLine(Point(Right-1, TopLine + 2), Point(Right-1, Bottom - 2)); - // bottom - Canvas.DrawLine(Point(Right - 3, Bottom-1), Point(Left + 1, Bottom-1)); - // left - Canvas.DrawLine(Point(Left, Bottom - 3), Point(Left, TopLine + 1)); - end; - - // Text caption - SetUIColor(Canvas, clWindowText); - DrawText(Canvas, ARect.TopLeft + Point(14, 0), ALabel, WidgetState); - - { Anti-Aliasing - Top/Left } - Canvas.SetColor(rgbaGbAALtGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(0, TopLine+1)); - Canvas.DrawPoint(ARect.TopLeft + Point(1, TopLine)); - Canvas.SetColor(rgbaGbAADkGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(1, TopLine+1)); - { Anti-Aliasing - Top/Right } - Canvas.SetColor(rgbaGbAALtGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-1, TopLine+1)); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-2, TopLine)); - Canvas.SetColor(rgbaGbAADkGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-2, TopLine+1)); - { Anti-Aliasing - Bottom/Right } - Canvas.SetColor(rgbaGbAALtGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-1, ARect.Bottom-2)); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-2, ARect.Bottom-1)); - Canvas.SetColor(rgbaGbAADkGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(ARect.Right-2, ARect.Bottom-2)); - { Anti-Aliasing - Bottom/Left } - Canvas.SetColor(rgbaGbAALtGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(0, ARect.Bottom-2)); - Canvas.DrawPoint(ARect.TopLeft + Point(1, ARect.Bottom-1)); - Canvas.SetColor(rgbaGbAADkGrey); - Canvas.DrawPoint(ARect.TopLeft + Point(1, ARect.Bottom-2)); -end; - - -initialization - FOpenSoftStyle := TOpenSoftStyle.Create(Application.Display); - -finalization - if Assigned(FOpenSoftStyle) then - FOpenSoftStyle.Free; - -end. - diff --git a/examples/gui/concepttest/compileroptform.frm b/examples/gui/concepttest/compileroptform.frm index 054601db..708f2e09 100644 --- a/examples/gui/concepttest/compileroptform.frm +++ b/examples/gui/concepttest/compileroptform.frm @@ -8,43 +8,43 @@ object CompilerOptForm: TCompilerOptForm Orientation = Vertical
Spacing = 4
object Box4: TFBoxLayout
- object grpBox1: TGroupBox
+ object grpBox1: TFGroupBox
Text = 'Unit Style:'
object grpBox1VBox1: TFBoxLayout
Orientation = Vertical
- object cbSmartLink: TCheckbox
+ object cbSmartLink: TFCheckbox
Checked = True
Text = 'Smart Linkable (-CX)'
end
end
end
- object grpBox2: TGroupBox
+ object grpBox2: TFGroupBox
Text = 'Checks:'
object grpBox2VBox1: TFBoxLayout
Orientation = Vertical
- object rbIO: TRadioButton
+ object rbIO: TFRadioButton
Checked = True
Text = 'I/O (-Ci)'
end
- object rbOverflow: TRadioButton
+ object rbOverflow: TFRadioButton
Checked = True
Text = 'Overflow (-Co)'
end
- object rbRange: TRadioButton
+ object rbRange: TFRadioButton
Checked = True
Text = 'Range (-Cr)'
end
- object rbStack: TRadioButton
+ object rbStack: TFRadioButton
Checked = True
Text = 'Stack (-Ct)'
end
end
end
- object grpBox3: TGroupBox
+ object grpBox3: TFGroupBox
Text = 'Heap Size (-Ch):'
object grpBox3VBox1: TFBoxLayout
Orientation = Vertical
- object edHeapSize: TEdit
+ object edHeapSize: TFEdit
Text = '0'
CanExpandWidth = False
end
@@ -52,23 +52,23 @@ object CompilerOptForm: TCompilerOptForm end
end
object Box5: TFBoxLayout
- object grpBox4: TGroupBox
+ object grpBox4: TFGroupBox
Text = 'Generate:'
object grpBox4VBox1: TFBoxLayout
Orientation = Vertical
- object rbNormal: TRadioButton
+ object rbNormal: TFRadioButton
Text = 'Normal Code (none)'
end
- object rbFaster: TRadioButton
+ object rbFaster: TFRadioButton
Checked = True
Text = 'Faster Code (-OG)'
end
- object rbSmaller: TRadioButton
+ object rbSmaller: TFRadioButton
Text = 'Smaller Code (-Og)'
end
end
end
- object grpBox5: TGroupBox
+ object grpBox5: TFGroupBox
Text = 'Target Platform:'
CanExpandHeight = True
object grpBox5VBox1: TFBoxLayout
@@ -87,28 +87,28 @@ object CompilerOptForm: TCompilerOptForm end
end
object Box6: TFBoxLayout
- object grpBox6: TGroupBox
+ object grpBox6: TFGroupBox
Text = 'Optimizations:'
object grpBox6VBox1: TFBoxLayout
Orientation = Vertical
CanExpandWidth = True
- object rbLevel0: TRadioButton
+ object rbLevel0: TFRadioButton
Text = 'Level 0 (no extra Optimizations) (none)'
end
- object rbLevel1: TRadioButton
+ object rbLevel1: TFRadioButton
Checked = True
Text = 'Level 1 (Quick Optimizations) (-O1)'
end
- object rbLevel2: TRadioButton
+ object rbLevel2: TFRadioButton
Text = 'Level 2 (Level 1 + Slower Optimizations) (-O2)'
end
- object rbLevel3: TRadioButton
+ object rbLevel3: TFRadioButton
Text = 'Level 3 (Level 2 + Uncertain) (-O3)'
end
- object rbKeepVarReg: TCheckbox
+ object rbKeepVarReg: TFCheckbox
Text = 'Keep certain variables in registers (-Or)'
end
- object rbUncOpt: TCheckbox
+ object rbUncOpt: TFCheckbox
Text = 'Uncertain Optimizations (-Ou)'
end
end
diff --git a/examples/gui/concepttest/frmCompilerOpt.pas b/examples/gui/concepttest/frmCompilerOpt.pas index b472e2ab..1a883c64 100644 --- a/examples/gui/concepttest/frmCompilerOpt.pas +++ b/examples/gui/concepttest/frmCompilerOpt.pas @@ -11,9 +11,9 @@ type { TCompilerOptForm } - TCompilerOptForm = Class(TForm) + TCompilerOptForm = Class(TFForm) private - FGroupBoxStyle: TStyle; + FGroupBoxStyle: TStyleAbs; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; @@ -28,34 +28,34 @@ type Box5: TFBoxLayout; Box6: TFBoxLayout; btnOK, btnCancel, btnShowOp, btnTest, btnLoadSave : TFButton; - grpBox1: TGroupBox; + grpBox1: TFGroupBox; grpBox1VBox1: TFBoxLayout; cbSmartLink: TFCheckbox; - grpBox2: TGroupBox; + grpBox2: TFGroupBox; grpBox2VBox1: TFBoxLayout; - rbIO: TRadioButton; - rbOverflow: TRadioButton; - rbRange: TRadioButton; - rbStack: TRadioButton; - grpBox3: TGroupBox; + rbIO: TFRadioButton; + rbOverflow: TFRadioButton; + rbRange: TFRadioButton; + rbStack: TFRadioButton; + grpBox3: TFGroupBox; grpBox3VBox1: TFBoxLayout; - edHeapSize: TEdit; - grpBox4: TGroupBox; + edHeapSize: TFEdit; + grpBox4: TFGroupBox; grpBox4VBox1: TFBoxLayout; - rbNormal: TRadioButton; - rbFaster: TRadioButton; - rbSmaller: TRadioButton; - grpBox5: TGroupBox; + rbNormal: TFRadioButton; + rbFaster: TFRadioButton; + rbSmaller: TFRadioButton; + grpBox5: TFGroupBox; grpBox5VBox1: TFBoxLayout; lblTarget1: TFLabel; lblTarget2: TFLabel; lblTarget3: TFLabel; - grpBox6: TGroupBox; + grpBox6: TFGroupBox; grpBox6VBox1: TFBoxLayout; - rbLevel0: TRadioButton; - rbLevel1: TRadioButton; - rbLevel2: TRadioButton; - rbLevel3: TRadioButton; + rbLevel0: TFRadioButton; + rbLevel1: TFRadioButton; + rbLevel2: TFRadioButton; + rbLevel3: TFRadioButton; rbKeepVarReg: TFCheckbox; rbUncOpt: TFCheckbox; end; @@ -64,8 +64,8 @@ var CompOpt: TCompilerOptForm; implementation -uses - OpenSoftStyle; +//uses +// OpenSoftStyle; { TCompilerOptForm } diff --git a/examples/gui/concepttest/hello.lpi b/examples/gui/concepttest/hello.lpi index 98611428..7d035197 100644 --- a/examples/gui/concepttest/hello.lpi +++ b/examples/gui/concepttest/hello.lpi @@ -4,14 +4,16 @@ <PathDelim Value="/"/> <Version Value="5"/> <General> + <Flags> + <SaveOnlyProjectUnits Value="True"/> + </Flags> + <SessionStorage Value="InProjectDir"/> <MainUnit Value="0"/> <IconPath Value="./"/> <TargetFileExt Value=""/> - <ActiveEditorIndexAtStart Value="2"/> </General> <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> @@ -26,407 +28,30 @@ <PackageName Value="fpguipackage"/> </Item1> </RequiredPackages> - <Units Count="59"> + <Units Count="3"> <Unit0> <Filename Value="hello.lpr"/> <IsPartOfProject Value="True"/> <UnitName Value="hello"/> - <CursorPos X="62" Y="10"/> - <TopLine Value="10"/> - <EditorIndex Value="0"/> - <UsageCount Value="136"/> - <Loaded Value="True"/> </Unit0> <Unit1> - <Filename Value="../../src/applicationh.inc"/> - <CursorPos X="18" Y="27"/> - <TopLine Value="1"/> - <UsageCount Value="13"/> - </Unit1> - <Unit2> - <Filename Value="../../src/application.inc"/> - <CursorPos X="17" Y="37"/> - <TopLine Value="73"/> - <UsageCount Value="29"/> - </Unit2> - <Unit3> - <Filename Value="../../src/formh.inc"/> - <CursorPos X="1" Y="83"/> - <TopLine Value="50"/> - <UsageCount Value="19"/> - </Unit3> - <Unit4> - <Filename Value="../../src/fpgui.pp"/> - <UnitName Value="fpGUI"/> - <CursorPos X="18" Y="136"/> - <TopLine Value="233"/> - <UsageCount Value="55"/> - </Unit4> - <Unit5> - <Filename Value="../../src/form.inc"/> - <CursorPos X="31" Y="112"/> - <TopLine Value="97"/> - <UsageCount Value="24"/> - </Unit5> - <Unit6> - <Filename Value="../../../fpgfx/src/gfxbase.pp"/> - <UnitName Value="GfxBase"/> - <CursorPos X="3" Y="41"/> - <TopLine Value="24"/> - <UsageCount Value="6"/> - </Unit6> - <Unit7> - <Filename Value="../layouttest/layouttest.pp"/> - <UnitName Value="LayoutTest"/> - <CursorPos X="16" Y="7"/> - <TopLine Value="1"/> - <UsageCount Value="10"/> - </Unit7> - <Unit8> - <Filename Value="../layouttest/mainform.frm"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="1"/> - <UsageCount Value="10"/> - <SyntaxHighlighter Value="None"/> - </Unit8> - <Unit9> - <Filename Value="../../src/layoutsh.inc"/> - <CursorPos X="15" Y="156"/> - <TopLine Value="131"/> - <UsageCount Value="23"/> - </Unit9> - <Unit10> - <Filename Value="../../src/widgeth.inc"/> - <CursorPos X="1" Y="264"/> - <TopLine Value="219"/> - <UsageCount Value="21"/> - </Unit10> - <Unit11> - <Filename Value="../../src/widget.inc"/> - <CursorPos X="9" Y="1356"/> - <TopLine Value="1311"/> - <UsageCount Value="45"/> - </Unit11> - <Unit12> - <Filename Value="../../src/buttonsh.inc"/> - <CursorPos X="19" Y="39"/> - <TopLine Value="11"/> - <UsageCount Value="1"/> - </Unit12> - <Unit13> - <Filename Value="../../src/buttons.inc"/> - <CursorPos X="3" Y="77"/> - <TopLine Value="56"/> - <UsageCount Value="10"/> - </Unit13> - <Unit14> <Filename Value="frmCompilerOpt.pas"/> <IsPartOfProject Value="True"/> <UnitName Value="frmCompilerOpt"/> - <CursorPos X="35" Y="107"/> - <TopLine Value="1"/> - <EditorIndex Value="2"/> - <UsageCount Value="135"/> - <Loaded Value="True"/> - </Unit14> - <Unit15> - <Filename Value="../../src/groupboxh.inc"/> - <CursorPos X="15" Y="21"/> - <TopLine Value="1"/> - <UsageCount Value="19"/> - </Unit15> - <Unit16> + </Unit1> + <Unit2> <Filename Value="compileroptform.frm"/> <IsPartOfProject Value="True"/> - <CursorPos X="43" Y="66"/> - <TopLine Value="1"/> - <UsageCount Value="135"/> - <SyntaxHighlighter Value="None"/> - </Unit16> - <Unit17> - <Filename Value="../layouttest/boxform.frm"/> - <CursorPos X="27" Y="6"/> - <TopLine Value="1"/> - <UsageCount Value="33"/> - <SyntaxHighlighter Value="None"/> - </Unit17> - <Unit18> - <Filename Value="../widgettest/groupboxform.frm"/> - <CursorPos X="9" Y="18"/> - <TopLine Value="1"/> - <UsageCount Value="18"/> - <SyntaxHighlighter Value="None"/> - </Unit18> - <Unit19> - <Filename Value="../../src/binh.inc"/> - <CursorPos X="1" Y="18"/> - <TopLine Value="1"/> - <UsageCount Value="6"/> - </Unit19> - <Unit20> - <Filename Value="../../src/containerh.inc"/> - <CursorPos X="1" Y="3"/> - <TopLine Value="1"/> - <UsageCount Value="6"/> - </Unit20> - <Unit21> - <Filename Value="opt/fpc-2.1.1/src/rtl/objpas/classes/classesh.inc"/> - <CursorPos X="3" Y="104"/> - <TopLine Value="81"/> - <UsageCount Value="1"/> - </Unit21> - <Unit22> - <Filename Value="../../src/checkboxh.inc"/> - <CursorPos X="1" Y="42"/> - <TopLine Value="20"/> - <UsageCount Value="13"/> - </Unit22> - <Unit23> - <Filename Value="../../src/groupbox.inc"/> - <CursorPos X="32" Y="26"/> - <TopLine Value="12"/> - <UsageCount Value="16"/> - </Unit23> - <Unit24> - <Filename Value="../../src/styleh.inc"/> - <CursorPos X="20" Y="86"/> - <TopLine Value="68"/> - <UsageCount Value="19"/> - </Unit24> - <Unit25> - <Filename Value="../../src/style.inc"/> - <CursorPos X="17" Y="103"/> - <TopLine Value="80"/> - <UsageCount Value="25"/> - </Unit25> - <Unit26> - <Filename Value="OpenSoftStyle.pas"/> - <IsPartOfProject Value="True"/> - <UnitName Value="OpenSoftStyle"/> - <CursorPos X="10" Y="108"/> - <TopLine Value="95"/> - <EditorIndex Value="1"/> - <UsageCount Value="122"/> - <Loaded Value="True"/> - </Unit26> - <Unit27> - <Filename Value="../../src/bin.inc"/> - <CursorPos X="29" Y="25"/> - <TopLine Value="2"/> - <UsageCount Value="7"/> - </Unit27> - <Unit28> - <Filename Value="../widgettest/editform.frm"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="1"/> - <UsageCount Value="4"/> - <SyntaxHighlighter Value="None"/> - </Unit28> - <Unit29> - <Filename Value="../widgettest/widgettest.pp"/> - <UnitName Value="WidgetTest"/> - <CursorPos X="1" Y="497"/> - <TopLine Value="461"/> - <UsageCount Value="6"/> - </Unit29> - <Unit30> - <Filename Value="../../src/separatorh.inc"/> - <CursorPos X="15" Y="26"/> - <TopLine Value="3"/> - <UsageCount Value="4"/> - </Unit30> - <Unit31> - <Filename Value="../../src/separator.inc"/> - <CursorPos X="19" Y="32"/> - <TopLine Value="30"/> - <UsageCount Value="4"/> - </Unit31> - <Unit32> - <Filename Value="../../src/layouts.inc"/> - <CursorPos X="17" Y="871"/> - <TopLine Value="613"/> - <UsageCount Value="29"/> - </Unit32> - <Unit33> - <Filename Value="../../src/win32/defstyle.inc"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="1"/> - <UsageCount Value="4"/> - </Unit33> - <Unit34> - <Filename Value="../../src/defimpl/defstyle.inc"/> - <CursorPos X="42" Y="57"/> - <TopLine Value="23"/> - <UsageCount Value="12"/> - </Unit34> - <Unit35> - <Filename Value="../../../fpGFX/src/x11/gfx_x11.pp"/> - <UnitName Value="GFX_X11"/> - <CursorPos X="14" Y="499"/> - <TopLine Value="470"/> - <UsageCount Value="5"/> - </Unit35> - <Unit36> - <Filename Value="../../../lptk/src/gfxstyle.pas"/> - <UnitName Value="gfxstyle"/> - <CursorPos X="39" Y="7"/> - <TopLine Value="93"/> - <UsageCount Value="5"/> - </Unit36> - <Unit37> - <Filename Value="../../../lptk/src/gfxwidget.pas"/> - <UnitName Value="gfxwidget"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="737"/> - <UsageCount Value="25"/> - </Unit37> - <Unit38> - <Filename Value="../../src/container.inc"/> - <CursorPos X="31" Y="25"/> - <TopLine Value="2"/> - <UsageCount Value="15"/> - </Unit38> - <Unit39> - <Filename Value="../../src/gridh.inc"/> - <CursorPos X="1" Y="137"/> - <TopLine Value="103"/> - <UsageCount Value="6"/> - </Unit39> - <Unit40> - <Filename Value="../../src/grid.inc"/> - <CursorPos X="3" Y="18"/> - <TopLine Value="1"/> - <UsageCount Value="7"/> - </Unit40> - <Unit41> - <Filename Value="media/sda5/Programming/MasterMaths/M2Browser_v3/3rdParty/Gauge/TGauge.pas"/> - <UnitName Value="TGauge"/> - <CursorPos X="39" Y="3"/> - <TopLine Value="90"/> - <UsageCount Value="7"/> - </Unit41> - <Unit42> - <Filename Value="../../src/checkbox.inc"/> - <CursorPos X="3" Y="89"/> - <TopLine Value="83"/> - <UsageCount Value="12"/> - </Unit42> - <Unit43> - <Filename Value="../../src/combobox.inc"/> - <CursorPos X="24" Y="171"/> - <TopLine Value="148"/> - <UsageCount Value="6"/> - </Unit43> - <Unit44> - <Filename Value="../../../personal/fpgui/src/form.inc"/> - <CursorPos X="27" Y="121"/> - <TopLine Value="101"/> - <UsageCount Value="6"/> - </Unit44> - <Unit45> - <Filename Value="../../src/radiobutton.inc"/> - <CursorPos X="19" Y="107"/> - <TopLine Value="85"/> - <UsageCount Value="12"/> - </Unit45> - <Unit46> - <Filename Value="../../../lptk/src/gfxbase.pas"/> - <UnitName Value="gfxbase"/> - <CursorPos X="38" Y="2355"/> - <TopLine Value="3421"/> - <UsageCount Value="25"/> - </Unit46> - <Unit47> - <Filename Value="../../../lptk/src/schar16.pas"/> - <UnitName Value="schar16"/> - <CursorPos X="10" Y="35"/> - <TopLine Value="1"/> - <UsageCount Value="7"/> - </Unit47> - <Unit48> - <Filename Value="../../../lptk/src/unitkeys.pas"/> - <UnitName Value="unitkeys"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="302"/> - <UsageCount Value="7"/> - </Unit48> - <Unit49> - <Filename Value="../../../lptk/src/wgbutton.pas"/> - <UnitName Value="wgbutton"/> - <CursorPos X="15" Y="34"/> - <TopLine Value="11"/> - <UsageCount Value="7"/> - </Unit49> - <Unit50> - <Filename Value="../../../lptk/src/wglabel.pas"/> - <UnitName Value="wglabel"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="1"/> - <UsageCount Value="7"/> - </Unit50> - <Unit51> - <Filename Value="../../src/colors.inc"/> - <CursorPos X="1" Y="1"/> - <TopLine Value="39"/> - <UsageCount Value="24"/> - </Unit51> - <Unit52> - <Filename Value="../../../fpgfx.trunk/src/gfxbase.pp"/> - <UnitName Value="GfxBase"/> - <CursorPos X="19" Y="402"/> - <TopLine Value="507"/> - <UsageCount Value="8"/> - </Unit52> - <Unit53> - <Filename Value="opt/lazarus/ide/editoroptions.pp"/> - <ComponentName Value="EditorOptionsForm"/> - <HasResources Value="True"/> - <ResourceFilename Value="opt/lazarus/ide/editoroptions.lrs"/> - <UnitName Value="EditorOptions"/> - <CursorPos X="28" Y="2302"/> - <TopLine Value="2595"/> - <UsageCount Value="21"/> - </Unit53> - <Unit54> - <Filename Value="opt/lazarus/components/synedit/synedit.pp"/> - <UnitName Value="SynEdit"/> - <CursorPos X="28" Y="6001"/> - <TopLine Value="5978"/> - <UsageCount Value="21"/> - </Unit54> - <Unit55> - <Filename Value="opt/lazarus/components/synedit/synedittextbuffer.pp"/> - <UnitName Value="SynEditTextBuffer"/> - <CursorPos X="15" Y="135"/> - <TopLine Value="181"/> - <UsageCount Value="21"/> - </Unit55> - <Unit56> - <Filename Value="opt/lazarus/components/synedit/synedithighlighter.pp"/> - <UnitName Value="SynEditHighlighter"/> - <CursorPos X="34" Y="145"/> - <TopLine Value="766"/> - <UsageCount Value="21"/> - </Unit56> - <Unit57> - <Filename Value="opt/lazarus/components/synedit/synhighlighterpas.pp"/> - <UnitName Value="SynHighlighterPas"/> - <CursorPos X="3" Y="83"/> - <TopLine Value="658"/> - <UsageCount Value="21"/> - </Unit57> - <Unit58> - <Filename Value="../../../tiOPF2/Source/Core/tiObject.pas"/> - <UnitName Value="tiObject"/> - <CursorPos X="1" Y="1756"/> - <TopLine Value="1933"/> - <UsageCount Value="19"/> - </Unit58> + </Unit2> </Units> - <JumpHistory Count="0" HistoryIndex="-1"/> </ProjectOptions> <CompilerOptions> <Version Value="5"/> + <Parsing> + <SyntaxOptions> + <AllowLabel Value="False"/> + </SyntaxOptions> + </Parsing> <CodeGeneration> <Generate Value="Faster"/> </CodeGeneration> diff --git a/examples/gui/concepttest/hello.lpr b/examples/gui/concepttest/hello.lpr index 7e723696..8a2fbc31 100644 --- a/examples/gui/concepttest/hello.lpr +++ b/examples/gui/concepttest/hello.lpr @@ -7,13 +7,13 @@ uses cthreads, {$ENDIF}{$ENDIF} Classes, - fpgui, gfxbase, frmCompilerOpt, OpenSoftStyle, fpguipackage; + fpGUI, fpGFX, gfxbase, frmCompilerOpt, StyleManager; type { TMainForm } - TMainForm = class(TForm) + TMainForm = class(TFForm) procedure Button3Clicked(Sender: TObject); private procedure btnCloseClick(Sender: TObject); @@ -24,23 +24,23 @@ type public constructor Create(AOwner: TComponent); override; published - HBox: TBoxLayout; - VBox: TBoxLayout; - TextLabel: TLabel; - Button: TButton; - btnGridForm: TButton; - btnCompOpt: TButton; - Button1: TButton; - Button2: TButton; - Button3: TButton; + HBox: TFBoxLayout; + VBox: TFBoxLayout; + TextLabel: TFLabel; + Button: TFButton; + btnGridForm: TFButton; + btnCompOpt: TFButton; + Button1: TFButton; + Button2: TFButton; + Button3: TFButton; end; { TGridForm } - TGridForm = Class(TForm) - Layout : TGridLayout; - Button1,Button2,Button3,Button4,Button5 : TButton; + TGridForm = Class(TFForm) + Layout: TFGridLayout; + Button1,Button2,Button3,Button4,Button5: TFButton; public constructor Create(AOwner: TComponent); override; end; @@ -48,22 +48,22 @@ type { TFindDialog } - TFindDialog = class(TForm) + TFindDialog = class(TFForm) private procedure btnCloseClick(Sender: TObject); public constructor Create(AOwner: TComponent); override; published - lblFind: TLabel; - btnFindNext, btnClose: TButton; - edFind: TEdit; - GroupBox1: TGroupBox; - grpBox1Layout: TBoxLayout; - Radio1, Radio2: TRadioButton; - cbCase: TCheckBox; - leftLayout, rightLayout: TBoxLayout; - topLeftLayout: TBoxLayout; - mainLayout: TBoxLayout; + lblFind: TFLabel; + btnFindNext, btnClose: TFButton; + edFind: TFEdit; + GroupBox1: TFGroupBox; + grpBox1Layout: TFBoxLayout; + Radio1, Radio2: TFRadioButton; + cbCase: TFCheckBox; + leftLayout, rightLayout: TFBoxLayout; + topLeftLayout: TFBoxLayout; + mainLayout: TFBoxLayout; end; @@ -80,49 +80,54 @@ begin inherited Create(AOwner); Text := 'Find Dialog'; BorderWidth := 8; - WindowType := wtWindow; - topLeftLayout := TBoxLayout.Create(self); - lblFind := TLabel.Create(self); - lblFind.Text := 'Find what'; - edFind := TEdit.Create(self); + topLeftLayout := TFBoxLayout.Create(self); + topLeftLayout.CanExpandWidth := True; + lblFind := TFLabel.Create(self); + lblFind.Text := 'Find what:'; + edFind := TFEdit.Create(self); topLeftLayout.InsertChild(lblFind); topLeftLayout.InsertChild(edFind); - leftLayout := TBoxLayout.Create(self); + leftLayout := TFBoxLayout.Create(self); leftLayout.Orientation := Vertical; - leftLayout.CanExpandHeight := True; - GroupBox1 := TGroupBox.Create(self); + leftLayout.CanExpandWidth := True; + + GroupBox1 := TFGroupBox.Create(self); GroupBox1.Text := 'Direction'; - grpBox1Layout := TBoxLayout.Create(self); -// grpBox1Layout.Orientation := Vertical; + GroupBox1.CanExpandWidth := True; + grpBox1Layout := TFBoxLayout.Create(self); + Radio1 := TFRadioButton.Create(self); + Radio1.Text := 'Up'; + Radio1.CanExpandWidth := True; + Radio2 := TFRadioButton.Create(self); + Radio2.Text := 'Down'; + Radio2.CanExpandWidth := True; GroupBox1.InsertChild(grpBox1Layout); - Radio1 := TRadioButton.Create(self); - Radio1.Text := 'Up'; - Radio2 := TRadioButton.Create(self); - Radio2.Text := 'Down'; grpBox1Layout.InsertChild(Radio1); grpBox1Layout.InsertChild(Radio2); - cbCase := TCheckBox.Create(self); + cbCase := TFCheckBox.Create(self); cbCase.Text := 'Case sensitive'; + cbCase.CanExpandWidth := True; + leftLayout.InsertChild(topLeftLayout); leftLayout.InsertChild(GroupBox1); leftLayout.InsertChild(cbCase); - rightLayout := TBoxLayout.Create(self); + rightLayout := TFBoxLayout.Create(self); rightLayout.Orientation := Vertical; rightLayout.VertAlign := vertTop; - btnFindNext := TButton.Create(self); - btnFindNext.Text := 'Find Next'; - btnClose := TButton.Create(self); - btnClose.Text := 'Close'; - btnClose.CanExpandWidth := True; - btnClose.OnClick := @btnCloseClick; + btnFindNext := TFButton.Create(self); + btnFindNext.Text := 'Find Next'; + btnClose := TFButton.Create(self); + btnClose.Text := 'Close'; + btnClose.CanExpandWidth := True; + btnClose.OnClick := @btnCloseClick; rightLayout.InsertChild(btnFindNext); rightLayout.InsertChild(btnClose); - mainLayout := TBoxLayout.Create(self); + mainLayout := TFBoxLayout.Create(self); mainLayout.InsertChild(leftLayout); mainLayout.InsertChild(rightLayout); @@ -166,30 +171,30 @@ begin BorderWidth := 8; self.BorderWidth := 11; - Layout := TGridLayout.Create(Self); + Layout := TFGridLayout.Create(Self); Layout.Name := 'Layout'; Layout.RowCount := 3; Layout.ColCount := 3; - Button1 := TButton.Create(Self); + Button1 := TFButton.Create(Self); Button1.Name := 'TopLeft'; Button1.Text := 'Top Left'; Layout.AddWidget(Button1, 0, 0, 1, 1); - Button2 := TButton.Create(Self); + Button2 := TFButton.Create(Self); Button2.Name := 'TopRight'; Button2.Text := 'Top Right'; Layout.AddWidget(Button2, 2,0,1,1); - Button3 := TButton.Create(Self); + Button3 := TFButton.Create(Self); Button3.Name := 'CenterCenter'; Button3.Text := 'Center Center'; // Button3.CanExpandWidth := False; // Button3.CanExpandHeight := False; Layout.AddWidget(Button3, 1,1,1,1); - Button4 := TButton.Create(Self); + Button4 := TFButton.Create(Self); Button4.Name := 'BottomLeft'; Button4.Text := 'Bottom Left'; Layout.AddWidget(Button4,0,2,1,1); - Button5 := TButton.Create(Self); + Button5 := TFButton.Create(Self); Button5.Name := 'BottomRight'; Button5.Text := 'Bottom Right'; Layout.AddWidget(Button5, 2,2,1,1); @@ -226,7 +231,12 @@ end; procedure TMainForm.btnCompOptClick(Sender: TObject); begin if not Assigned(CompOpt) then - Application.CreateForm(TCompilerOptForm, CompOpt) + begin + CompOpt := TCompilerOptForm.Create(GFApplication); + LoadForm(CompOpt); + CompOpt.Style := gStyleManager.CreateInstance('OpenSoft'); + CompOpt.Show; + end else CompOpt.Show; end; @@ -255,59 +265,56 @@ begin inherited Create(AOwner); Name := 'frmMain'; BorderWidth := 8; - WindowType := wtWindow; OnActivate := @MainFormActivate; - HBox := TBoxLayout.Create(self); - HBox.Name := 'HBox'; - HBox.Parent := self; - HBox.Spacing := 3; - HBox.Orientation := Horizontal; - - TextLabel := TLabel.Create(self); - TextLabel.Name := 'TextLabel'; - TextLabel.Text := 'Hello'; - TextLabel.Parent := HBox; - - Button := TButton.Create(self); - Button.Parent := HBox; - Button.Text := 'Close'; - Button.OnClick := @btnCloseClick; - - btnGridForm := TButton.Create(self); - btnGridForm.Parent := HBox; - btnGridForm.Text := 'Grid Form'; - btnGridForm.OnClick := @btnGridFormClick; + HBox := TFBoxLayout.Create(self); + HBox.Name := 'HBox'; + HBox.Parent := self; + HBox.Spacing := 3; + HBox.Orientation := Horizontal; + + TextLabel := TFLabel.Create(self); + TextLabel.Name := 'TextLabel'; + TextLabel.Text := 'Hello'; + TextLabel.Parent := HBox; + + Button := TFButton.Create(self); + Button.Parent := HBox; + Button.Text := 'Close'; + Button.OnClick := @btnCloseClick; + + btnGridForm := TFButton.Create(self); + btnGridForm.Parent := HBox; + btnGridForm.Text := 'Grid Form'; + btnGridForm.OnClick := @btnGridFormClick; - btnCompOpt := TButton.Create(Self); - btnCompOpt.Parent := HBox; - btnCompOpt.Name := 'btnCompOpt'; - btnCompOpt.Text := 'Compiler Options'; - btnCompOpt.OnClick := @btnCompOptClick; -// btnCompOpt.FCanExpandWidth := True; // if not used, button is smaller than others - - VBox := TBoxLayout.Create(self); - VBox.Orientation := Vertical; - Button1 := TButton.Create(Self); - Button1.Name := 'Top'; - Button1.Text := 'Top'; - Button1.CanExpandWidth := True; // if not used, button is smaller than others - Button1.OnClick := @btnTopClick; + btnCompOpt := TFButton.Create(Self); + btnCompOpt.Parent := HBox; + btnCompOpt.Name := 'btnCompOpt'; + btnCompOpt.Text := 'Compiler Options'; + btnCompOpt.OnClick := @btnCompOptClick; + + VBox := TFBoxLayout.Create(self); + VBox.Orientation := Vertical; + Button1 := TFButton.Create(Self); + Button1.Name := 'Top'; + Button1.Text := 'Top'; + Button1.CanExpandWidth := True; // if not used, button is smaller than others + Button1.OnClick := @btnTopClick; VBox.InsertChild(Button1); - Button2 := TButton.Create(Self); - Button2.Name := 'Centre'; - Button2.Text := 'Centre'; - Button2.CanExpandWidth := True; + Button2 := TFButton.Create(Self); + Button2.Name := 'Centre'; + Button2.Text := 'Centre'; + Button2.CanExpandWidth := True; VBox.InsertChild(Button2); - Button3 := TButton.Create(Self); - Button3.Name := 'Bottom'; - Button3.Text := 'Bottom (SetBounds)'; - Button3.OnClick :=@Button3Clicked; + Button3 := TFButton.Create(Self); + Button3.Name := 'Bottom'; + Button3.Text := 'Bottom (SetBounds)'; + Button3.OnClick := @Button3Clicked; VBox.InsertChild(Button3); HBox.InsertChild(VBox); - Child := HBox; end; @@ -317,18 +324,19 @@ var begin MainForm := nil; - { set application wide style } - Application.SetStyle(FOpenSoftStyle); + { set application wide style } + GFApplication.Initialize; +// gStyleManager.CreateInstance('OpenSoft'); - MainForm := TMainForm.Create(Application); -// MainForm.SetBounds(Point(100, 300), Size(300,200)); + MainForm := TMainForm.Create(GFApplication); try + MainForm.Style := gStyleManager.CreateInstance('OpenSoft'); MainForm.Show; - Application.Run; + GFApplication.Run; finally MainForm.Free; end; - end. + diff --git a/examples/gui/helloworld/helloworld.pas b/examples/gui/helloworld/helloworld.pas index 16af32f5..bbcfd99b 100644 --- a/examples/gui/helloworld/helloworld.pas +++ b/examples/gui/helloworld/helloworld.pas @@ -9,7 +9,7 @@ uses ; type - TMainForm = class(TForm) + TMainForm = class(TFForm) private BoxLayout: TFBoxLayout; btnHello: TFButton; diff --git a/examples/gui/utfdemo/utfdemo.lpi b/examples/gui/utfdemo/utfdemo.lpi index 35240ae6..07c7660d 100644 --- a/examples/gui/utfdemo/utfdemo.lpi +++ b/examples/gui/utfdemo/utfdemo.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=".exe"/> </General> <PublishOptions> @@ -20,7 +20,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"> @@ -39,11 +39,13 @@ </ProjectOptions> <CompilerOptions> <Version Value="5"/> - <PathDelim Value="\"/> + <Parsing> + <SyntaxOptions> + <AllowLabel Value="False"/> + </SyntaxOptions> + </Parsing> <CodeGeneration> <Generate Value="Faster"/> - <TargetCPU Value="i386"/> - <TargetOS Value="Win32"/> </CodeGeneration> <Other> <CustomOptions Value="-FUunits diff --git a/examples/gui/widgetdemo/WidgetDemo.lpi b/examples/gui/widgetdemo/widgetdemo.lpi index b7bd6bd7..54798ccc 100644 --- a/examples/gui/widgetdemo/WidgetDemo.lpi +++ b/examples/gui/widgetdemo/widgetdemo.lpi @@ -30,9 +30,9 @@ </RequiredPackages> <Units Count="1"> <Unit0> - <Filename Value="WidgetDemo.lpr"/> + <Filename Value="widgetdemo.lpr"/> <IsPartOfProject Value="True"/> - <UnitName Value="WidgetDemo"/> + <UnitName Value="widgetdemo"/> </Unit0> </Units> </ProjectOptions> diff --git a/examples/gui/widgetdemo/WidgetDemo.lpr b/examples/gui/widgetdemo/widgetdemo.lpr index 0dc8d206..0dc8d206 100644 --- a/examples/gui/widgetdemo/WidgetDemo.lpr +++ b/examples/gui/widgetdemo/widgetdemo.lpr |