diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/db/fpgui_db.pas | 2 | ||||
-rw-r--r-- | gui/fpgui.pas | 12 | ||||
-rw-r--r-- | gui/fpguibin.inc | 32 | ||||
-rw-r--r-- | gui/fpguibuttons.inc | 30 | ||||
-rw-r--r-- | gui/fpguicheckbox.inc | 24 | ||||
-rw-r--r-- | gui/fpguicombobox.inc | 56 | ||||
-rw-r--r-- | gui/fpguicontainer.inc | 22 | ||||
-rw-r--r-- | gui/fpguidialogs.inc | 34 | ||||
-rw-r--r-- | gui/fpguiedit.inc | 34 | ||||
-rw-r--r-- | gui/fpguiform.inc | 114 | ||||
-rw-r--r-- | gui/fpguigrid.inc | 100 | ||||
-rw-r--r-- | gui/fpguigroupbox.inc | 12 | ||||
-rw-r--r-- | gui/fpguilabel.inc | 18 | ||||
-rw-r--r-- | gui/fpguilayouts.inc | 218 | ||||
-rw-r--r-- | gui/fpguilistbox.inc | 58 | ||||
-rw-r--r-- | gui/fpguimenus.inc | 82 | ||||
-rw-r--r-- | gui/fpguipackage.lpk | 11 | ||||
-rw-r--r-- | gui/fpguipanel.inc | 14 | ||||
-rw-r--r-- | gui/fpguipopupwindow.inc | 10 | ||||
-rw-r--r-- | gui/fpguiprogressbar.inc | 18 | ||||
-rw-r--r-- | gui/fpguiradiobutton.inc | 34 | ||||
-rw-r--r-- | gui/fpguiscrollbar.inc | 172 | ||||
-rw-r--r-- | gui/fpguiscrollbox.inc | 128 | ||||
-rw-r--r-- | gui/fpguiseparator.inc | 2 | ||||
-rw-r--r-- | gui/fpguistyle.inc | 64 | ||||
-rw-r--r-- | gui/fpguiwidget.inc | 240 | ||||
-rw-r--r-- | gui/motifstyle.pas | 8 | ||||
-rw-r--r-- | gui/opensoftstyle.pas | 558 |
28 files changed, 1055 insertions, 1052 deletions
diff --git a/gui/db/fpgui_db.pas b/gui/db/fpgui_db.pas index 09224260..4be0aff2 100644 --- a/gui/db/fpgui_db.pas +++ b/gui/db/fpgui_db.pas @@ -43,7 +43,7 @@ type property OnDataChange: TNotifyEvent read FOnDataChange write FOnDataChange; end; - TDBText = class(TCustomLabel) + TDBText = class(TFCustomLabel) private FDataLink: TFieldDataLink; function GetDataField: String; diff --git a/gui/fpgui.pas b/gui/fpgui.pas index 78d26547..d4b1de66 100644 --- a/gui/fpgui.pas +++ b/gui/fpgui.pas @@ -74,12 +74,12 @@ resourcestring type - TWidget = class; + TFWidget = class; TEventObj = class; - TCustomForm = class; + TFCustomForm = class; - TWidgetState = set of ( + TFWidgetState = set of ( wsEnabled, wsIsVisible, wsSizeIsForced, @@ -94,10 +94,10 @@ type // The following flags are used for styles - TButtonFlags = set of (btnIsEmbedded, btnIsDefault, btnIsPressed, + TFButtonFlags = set of (btnIsEmbedded, btnIsDefault, btnIsPressed, btnIsSelected, btnHasFocus); - TCheckboxFlags = set of (cbIsPressed, cbHasFocus, cbIsEnabled, cbIsChecked); + TFCheckboxFlags = set of (cbIsPressed, cbHasFocus, cbIsEnabled, cbIsChecked); // Other stuff @@ -208,7 +208,7 @@ end; procedure LoadForm(AForm: TComponent); type - PForm = ^TCustomForm; + PForm = ^TFCustomForm; var lForm: PForm; Filename: string; diff --git a/gui/fpguibin.inc b/gui/fpguibin.inc index d30e20e7..3915ae32 100644 --- a/gui/fpguibin.inc +++ b/gui/fpguibin.inc @@ -19,19 +19,19 @@ {$IFDEF read_interface} { Bin widget declarations } - TBinWidget = class(TContainerWidget) + TFBinWidget = class(TFContainerWidget) protected - FChild: TWidget; - procedure SetChild(AChild: TWidget); + FChild: TFWidget; + procedure SetChild(AChild: TFWidget); function GetChildCount: Integer; override; - function GetChild(Index: Integer): TWidget; override; + function GetChild(Index: Integer): TFWidget; override; procedure CalcSizes; override; public // !!!: temporarily - property Child: TWidget read FChild write SetChild; + property Child: TFWidget read FChild write SetChild; // really public :) - function ContainsChild(AChild: TWidget): Boolean; override; - procedure InsertChild(AChild: TWidget); override; - procedure RemoveChild(AChild: TWidget); override; + function ContainsChild(AChild: TFWidget): Boolean; override; + procedure InsertChild(AChild: TFWidget); override; + procedure RemoveChild(AChild: TFWidget); override; end; {$ENDIF read_interface} @@ -43,16 +43,16 @@ // =================================================================== -// TBinWidget +// TFBinWidget // =================================================================== -function TBinWidget.ContainsChild(AChild: TWidget): Boolean; +function TFBinWidget.ContainsChild(AChild: TFWidget): Boolean; begin Result := Assigned(AChild) and (FChild = AChild); end; -procedure TBinWidget.InsertChild(AChild: TWidget); +procedure TFBinWidget.InsertChild(AChild: TFWidget); begin if FChild <> AChild then begin @@ -64,7 +64,7 @@ begin end; -procedure TBinWidget.RemoveChild(AChild: TWidget); +procedure TFBinWidget.RemoveChild(AChild: TFWidget); begin if FChild = AChild then begin @@ -74,13 +74,13 @@ begin end; -function TBinWidget.GetChildCount: Integer; +function TFBinWidget.GetChildCount: Integer; begin Result := Ord(Assigned(Child)); end; -function TBinWidget.GetChild(Index: Integer): TWidget; +function TFBinWidget.GetChild(Index: Integer): TFWidget; begin if (Index = 0) and Assigned(Child) then Result := Child @@ -89,7 +89,7 @@ begin end; -procedure TBinWidget.CalcSizes; +procedure TFBinWidget.CalcSizes; begin LAYOUTTRACE('TBinWidget.CalcSizes for %s:%s', [Name, ClassName]); if Assigned(Child) then @@ -101,7 +101,7 @@ begin end; -procedure TBinWidget.SetChild(AChild: TWidget); +procedure TFBinWidget.SetChild(AChild: TFWidget); begin InsertChild(AChild); end; diff --git a/gui/fpguibuttons.inc b/gui/fpguibuttons.inc index 9375b8e5..67831055 100644 --- a/gui/fpguibuttons.inc +++ b/gui/fpguibuttons.inc @@ -19,7 +19,7 @@ {$IFDEF read_interface} - TGenericButton = class(TWidget) + TFGenericButton = class(TFWidget) protected FEmbedded: Boolean; procedure Paint(Canvas: TFCanvas); override; @@ -29,7 +29,7 @@ end; - TCustomButton = class(TGenericButton) + TFCustomButton = class(TFGenericButton) protected procedure Paint(Canvas: TFCanvas); override; procedure CalcSizes; override; @@ -38,7 +38,7 @@ end; - TButton = class(TCustomButton) + TFButton = class(TFCustomButton) published property CanExpandWidth; property CanExpandHeight; @@ -48,7 +48,7 @@ end; { - TCustomImageButton = class(TGenericButton) + TCustomImageButton = class(TFGenericButton) protected procedure Paint(Canvas: TGfxCanvas); override; procedure EvRecalcLayout; override; @@ -69,19 +69,19 @@ {$IFDEF read_implementation} // =================================================================== -// TGenericButton +// TFGenericButton // =================================================================== -constructor TGenericButton.Create(AOwner: TComponent); +constructor TFGenericButton.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; end; -procedure TGenericButton.Paint(Canvas: TFCanvas); +procedure TFGenericButton.Paint(Canvas: TFCanvas); var - Flags: TButtonFlags; + Flags: TFButtonFlags; begin if Embedded then Flags := [btnIsEmbedded] @@ -100,17 +100,17 @@ begin end; // =================================================================== -// TCustomButton +// TFCustomButton // =================================================================== -procedure TCustomButton.Paint(Canvas: TFCanvas); +procedure TFCustomButton.Paint(Canvas: TFCanvas); var Pt: TPoint; Borders: TRect; begin inherited Paint(Canvas); - Borders := Style.GetButtonBorders; + Borders := Style.GeTFButtonBorders; Canvas.IntersectClipRect(Rect(Borders.Left, Borders.Top, BoundsSize.cx - Borders.Right, BoundsSize.cy - Borders.Bottom)); @@ -123,12 +123,12 @@ begin end; -procedure TCustomButton.CalcSizes; +procedure TFCustomButton.CalcSizes; var Borders: TRect; begin - LAYOUTTRACE('TCustomButton.CalcSizes for %s:%s', [Name, ClassName]); - Borders := Style.GetButtonBorders; + LAYOUTTRACE('TFCustomButton.CalcSizes for %s:%s', [Name, ClassName]); + Borders := Style.GeTFButtonBorders; with FindForm.Wnd.Canvas do begin FMinSize.cx := Borders.Left + Borders.Right + TextWidth(Text); @@ -139,7 +139,7 @@ begin FDefSize := FMinSize + gfxbase.Size(20, 2); end; -constructor TCustomButton.Create(const pText: string; pOwner: TComponent); +constructor TFCustomButton.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; diff --git a/gui/fpguicheckbox.inc b/gui/fpguicheckbox.inc index 2ca18c96..ff5e4cc6 100644 --- a/gui/fpguicheckbox.inc +++ b/gui/fpguicheckbox.inc @@ -18,9 +18,9 @@ {$IFDEF read_interface} - { TCustomCheckbox } + { TFCustomCheckbox } - TCustomCheckbox = class(TWidget) + TFCustomCheckbox = class(TFWidget) private procedure SetChecked(AChecked: Boolean); protected @@ -36,7 +36,7 @@ end; - TCheckbox = class(TCustomCheckbox) + TFCheckbox = class(TFCustomCheckbox) published property Enabled; property CanExpandHeight; @@ -53,35 +53,35 @@ {$IFDEF read_implementation} // =================================================================== -// TCustomCheckBox +// TFCustomCheckbox // =================================================================== -constructor TCustomCheckBox.Create(AOwner: TComponent); +constructor TFCustomCheckbox.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; end; -constructor TCustomCheckbox.Create(const pText: string; pOwner: TComponent); +constructor TFCustomCheckbox.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; end; -procedure TCustomCheckBox.Click; +procedure TFCustomCheckbox.Click; begin FChecked := not FChecked; inherited Click; end; -procedure TCustomCheckBox.Paint(Canvas: TFCanvas); +procedure TFCustomCheckbox.Paint(Canvas: TFCanvas); var FontHeight: Integer; LabelRect: TRect; - Flags: TCheckboxFlags; + Flags: TFCheckboxFlags; begin FontHeight := Canvas.FontCellHeight; LabelRect.Left := FLabelPos.x; @@ -105,15 +105,15 @@ begin end; -procedure TCustomCheckBox.CalcSizes; +procedure TFCustomCheckbox.CalcSizes; begin with FindForm.Wnd.Canvas do - Style.GetCheckBoxLayout(gfxbase.Size(TextWidth(Text), FontCellHeight), + Style.GeTFCheckboxLayout(gfxbase.Size(TextWidth(Text), FontCellHeight), FMinSize, FLabelPos); end; -procedure TCustomCheckBox.SetChecked(AChecked: Boolean); +procedure TFCustomCheckbox.SetChecked(AChecked: Boolean); begin if AChecked <> Checked then begin diff --git a/gui/fpguicombobox.inc b/gui/fpguicombobox.inc index 241c13c2..862f7297 100644 --- a/gui/fpguicombobox.inc +++ b/gui/fpguicombobox.inc @@ -20,17 +20,17 @@ { Combobox widget declarations } - TComboBoxPopup = class(TPopupWindow) + TFComboBoxPopup = class(TFPopupWindow) private - FLayout: TBoxLayout; - FListBox: TListBox; + FLayout: TFBoxLayout; + FListBox: TFListBox; public constructor Create(AOwner: TComponent); override; - property ListBox: TListBox read FListBox; + property ListBox: TFListBox read FListBox; end; - TCustomComboBox = class(TWidget) + TFCustomComboBox = class(TFWidget) private FItemIndex: Integer; FItems: TStrings; @@ -40,9 +40,9 @@ procedure DropDownDestroy(Sender: TObject); procedure SetItemIndex(const AValue: Integer); protected - ComboBoxButton: TGenericButton; - FDropDown: TComboBoxPopup; - lbl: TLabel; + ComboBoxButton: TFGenericButton; + FDropDown: TFComboBoxPopup; + lbl: TFLabel; procedure Click; override; procedure Paint(Canvas: TFCanvas); override; procedure CalcSizes; override; @@ -59,7 +59,7 @@ end; - TComboBox = class(TCustomComboBox) + TFComboBox = class(TFCustomComboBox) published property CanExpandWidth; property CanExpandHeight; @@ -79,14 +79,14 @@ { Combobox widget implementation } type - TArrowButton = class(TGenericButton) + TFArrowButton = class(TFGenericButton) protected procedure Paint(Canvas: TFCanvas); override; procedure CalcSizes; override; end; -procedure TArrowButton.Paint(Canvas: TFCanvas); +procedure TFArrowButton.Paint(Canvas: TFCanvas); begin inherited Paint(Canvas); Style.DrawComboBoxArrow(Canvas, Rect(0, 0, Width, Height), @@ -94,12 +94,12 @@ begin wsEnabled in WidgetState); end; -procedure TArrowButton.CalcSizes; +procedure TFArrowButton.CalcSizes; begin FMinSize := Style.GetComboBoxBtnSize; end; -constructor TComboBoxPopup.Create(AOwner: TComponent); +constructor TFComboBoxPopup.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; @@ -107,13 +107,13 @@ begin Color := clBlack; Name := '#ComboBoxPopup'; - FLayout := TBoxLayout.Create(self); + FLayout := TFBoxLayout.Create(self); FLayout.Name := '#VBoxLayout'; FLayout.Orientation := Vertical; FLayout.Spacing := 0; InsertChild(FLayout); - FListBox := TListBox.Create(self); + FListBox := TFListBox.Create(self); FListBox.Name := '#Listbox'; FListBox.HotTrack := True; FLayout.InsertChild(FListBox); @@ -124,7 +124,7 @@ end; // TCustomComboBox // ------------------------------------------------------------------- -constructor TCustomComboBox.Create(AOwner: TComponent); +constructor TFCustomComboBox.Create(AOwner: TComponent); begin inherited Create(AOwner); FCanExpandWidth := True; @@ -132,7 +132,7 @@ begin FItems := TStringList.Create; FItemIndex := -1; - ComboBoxButton := TArrowButton.Create(Self); + ComboBoxButton := TFArrowButton.Create(Self); ComboBoxButton.Name := '#ComboBoxButton'; ComboBoxButton.Embedded := True; ComboBoxButton.CanExpandWidth := False; @@ -141,13 +141,13 @@ begin ComboBoxButton.SetEmbeddedParent(Self); end; -destructor TCustomComboBox.Destroy; +destructor TFCustomComboBox.Destroy; begin FDropDown.Free; inherited Destroy; end; -procedure TCustomComboBox.Paint(Canvas: TFCanvas); +procedure TFCustomComboBox.Paint(Canvas: TFCanvas); var Pt: TPoint; ItemRect: TRect; @@ -200,7 +200,7 @@ begin end; end; -procedure TCustomComboBox.CalcSizes; +procedure TFCustomComboBox.CalcSizes; begin with Style.GetEditBoxBorders do FMinSize := Size(ComboBoxButton.MinSize.cx, @@ -208,7 +208,7 @@ begin TopLeft + BottomRight; end; -procedure TCustomComboBox.Resized; +procedure TFCustomComboBox.Resized; begin with Style.GetEditBoxBorders do ComboBoxButton.SetBounds( @@ -216,13 +216,13 @@ begin ComboBoxButton.MinSize); end; -function TCustomComboBox.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomComboBox.DistributeEvent(Event: TEventObj): Boolean; begin Result := Event.SendToChild(ComboBoxButton); // or inherited DistributeEvent(Event); end; -procedure TCustomComboBox.ComboBoxButtonClick(Sender: TObject); +procedure TFCustomComboBox.ComboBoxButtonClick(Sender: TObject); begin if Assigned(FDropDown) and FDropDown.Visible then begin @@ -232,7 +232,7 @@ begin if not Assigned(FDropDown) then begin - FDropDown := TComboBoxPopup.Create(Self); + FDropDown := TFComboBoxPopup.Create(Self); FDropDown.OnDestroy := @DropDownDestroy; FDropDown.ListBox.Items.Text := FItems.Text; FDropDown.ListBox.FItemIndex := FItemIndex; @@ -244,7 +244,7 @@ begin FDropDown.Wnd.SetMinMaxClientSize(MaxSize, MaxSize); end; -procedure TCustomComboBox.DropDownDeactivate(Sender: TObject); +procedure TFCustomComboBox.DropDownDeactivate(Sender: TObject); begin LAYOUTTRACE('TCustomComboBox.DropDownDestroy for %s:%s', [Name, ClassName]); ItemIndex := FDropDown.ListBox.ItemIndex; @@ -252,13 +252,13 @@ begin SetFocus; end; -procedure TCustomComboBox.DropDownDestroy(Sender: TObject); +procedure TFCustomComboBox.DropDownDestroy(Sender: TObject); begin LAYOUTTRACE('TCustomComboBox.DropDownDestroy for %s:%s', [Name, ClassName]); FDropDown := nil; end; -procedure TCustomComboBox.SetItemIndex(const AValue: Integer); +procedure TFCustomComboBox.SetItemIndex(const AValue: Integer); begin if FItemIndex <> AValue then begin @@ -277,7 +277,7 @@ end; { This event causes the combobox to drop open when you click anywhere in the component, or press the spacebar key. } -procedure TCustomComboBox.Click; +procedure TFCustomComboBox.Click; begin ComboBoxButtonClick(nil); inherited Click; diff --git a/gui/fpguicontainer.inc b/gui/fpguicontainer.inc index 56ae76d6..6b9611c9 100644 --- a/gui/fpguicontainer.inc +++ b/gui/fpguicontainer.inc @@ -20,19 +20,19 @@ { Container widget declarations } - TContainerWidget = class(TWidget) + TFContainerWidget = class(TFWidget) protected function DistributeEvent(Event: TEventObj): Boolean; override; function GetChildCount: Integer; virtual; abstract; - function GetChild(Index: Integer): TWidget; virtual; abstract; + function GetChild(Index: Integer): TFWidget; virtual; abstract; property ChildCount: Integer read GetChildCount; - property Children[Index: Integer]: TWidget read GetChild; + property Children[Index: Integer]: TFWidget read GetChild; // Move to public in decendant classes, if you want them visible - procedure InsertChild(AChild: TWidget); dynamic; virtual; - procedure RemoveChild(AChild: TWidget); dynamic; virtual; + procedure InsertChild(AChild: TFWidget); dynamic; virtual; + procedure RemoveChild(AChild: TFWidget); dynamic; virtual; public - function GetChildAt(APoint: TPoint): TWidget; - function ContainsChild(AChild: TWidget): Boolean; dynamic; abstract; + function GetChildAt(APoint: TPoint): TFWidget; + function ContainsChild(AChild: TFWidget): Boolean; dynamic; abstract; end; {$ENDIF read_interface} @@ -45,7 +45,7 @@ // TContainerWidget // =================================================================== -function TContainerWidget.GetChildAt(APoint: TPoint): TWidget; +function TFContainerWidget.GetChildAt(APoint: TPoint): TFWidget; var i: Integer; begin @@ -58,7 +58,7 @@ begin Result := nil; end; -function TContainerWidget.DistributeEvent(Event: TEventObj): Boolean; +function TFContainerWidget.DistributeEvent(Event: TEventObj): Boolean; var i: Integer; begin @@ -73,12 +73,12 @@ begin Result := inherited DistributeEvent(Event); end; -procedure TContainerWidget.InsertChild(AChild: TWidget); +procedure TFContainerWidget.InsertChild(AChild: TFWidget); begin // do nothing end; -procedure TContainerWidget.RemoveChild(AChild: TWidget); +procedure TFContainerWidget.RemoveChild(AChild: TFWidget); begin // do nothing end; diff --git a/gui/fpguidialogs.inc b/gui/fpguidialogs.inc index f0fdd54e..b92bcc9b 100644 --- a/gui/fpguidialogs.inc +++ b/gui/fpguidialogs.inc @@ -19,25 +19,25 @@ {$IFDEF read_interface} - TCustomStandardDialog = class(TCustomForm) + TFCustomStandardDialog = class(TFCustomForm) private procedure StdBtnClicked(Sender: TObject); protected FButtons: TMsgDlgButtons; - MainLayout, BtnLayout: TBoxLayout; + MainLayout, BtnLayout: TFBoxLayout; Separator: TSeparator; function ProcessEvent(Event: TEventObj): Boolean; override; function DistributeEvent(Event: TEventObj): Boolean; override; procedure CalcSizes; override; procedure Resized; override; - procedure SetButtons(AButtons: TMsgDlgButtons); - property Buttons: TMsgDlgButtons read FButtons write SetButtons default [mbOk, mbCancel]; + procedure SeTFButtons(AButtons: TMsgDlgButtons); + property Buttons: TMsgDlgButtons read FButtons write SeTFButtons default [mbOk, mbCancel]; public constructor Create(AOwner: TComponent); override; end; - TStandardDialog = class(TCustomStandardDialog) + TFStandardDialog = class(TFCustomStandardDialog) published property Text; property OnCreate; @@ -53,16 +53,16 @@ // =================================================================== -// TCustomStandardDialog +// TFCustomStandardDialog // =================================================================== // public methods -constructor TCustomStandardDialog.Create(AOwner: TComponent); +constructor TFCustomStandardDialog.Create(AOwner: TComponent); - function AddBtn(const AText: String; ADefault: Boolean): TButton; + function AddBtn(const AText: String; ADefault: Boolean): TFButton; begin - Result := TButton.Create(Self); + Result := TFButton.Create(Self); Result.Text := AText; // Result.Default := ADefault; Result.OnClick := @StdBtnClicked; @@ -74,14 +74,14 @@ begin FButtons := [mbOk, mbCancel]; FBorderWidth := 4; - MainLayout := TBoxLayout.Create(Self); + MainLayout := TFBoxLayout.Create(Self); MainLayout.Orientation := Vertical; MainLayout.SetEmbeddedParent(Self); Separator := TSeparator.Create(Self); Separator.Parent := MainLayout; - BtnLayout := TBoxLayout.Create(Self); + BtnLayout := TFBoxLayout.Create(Self); BtnLayout.Orientation := Horizontal; BtnLayout.HorzAlign := horzRight; BtnLayout.VertAlign := vertCenter; @@ -106,17 +106,17 @@ end; // protected methods -function TCustomStandardDialog.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomStandardDialog.ProcessEvent(Event: TEventObj): Boolean; begin Result := MainLayout.ProcessEvent(Event) or inherited ProcessEvent(Event); end; -function TCustomStandardDialog.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomStandardDialog.DistributeEvent(Event: TEventObj): Boolean; begin Result := Event.SendToChild(MainLayout) or inherited DistributeEvent(Event); end; -procedure TCustomStandardDialog.CalcSizes; +procedure TFCustomStandardDialog.CalcSizes; begin if Assigned(Child) then begin @@ -134,7 +134,7 @@ begin FMaxSize.cy := Min(InfiniteSize, MaxSize.cy + MainLayout.DefSize.cy); end; -procedure TCustomStandardDialog.Resized; +procedure TFCustomStandardDialog.Resized; begin if Assigned(Child) then Child.SetBounds(Point(BorderWidth, BorderWidth), @@ -145,12 +145,12 @@ begin gfxBase.Size(Width - 2 * BorderWidth, MainLayout.DefSize.cy - BorderWidth)); end; -procedure TCustomStandardDialog.SetButtons(AButtons: TMsgDlgButtons); +procedure TFCustomStandardDialog.SeTFButtons(AButtons: TMsgDlgButtons); begin FButtons := AButtons; end; -procedure TCustomStandardDialog.StdBtnClicked(Sender: TObject); +procedure TFCustomStandardDialog.StdBtnClicked(Sender: TObject); begin Close; end; diff --git a/gui/fpguiedit.inc b/gui/fpguiedit.inc index ce00f4d9..c471334f 100644 --- a/gui/fpguiedit.inc +++ b/gui/fpguiedit.inc @@ -18,9 +18,9 @@ {$IFDEF read_interface} - { TCustomEdit } + { TFCustomEdit } - TCustomEdit = class(TWidget) + TFCustomEdit = class(TFWidget) private FFontColor: TColor; FSelStart: integer; @@ -52,7 +52,7 @@ end; - TEdit = class(TCustomEdit) + TFEdit = class(TFCustomEdit) published property CanExpandWidth; property Enabled; @@ -69,10 +69,10 @@ {$IFDEF read_implementation} // =================================================================== -// TCustomEdit +// TFCustomEdit // =================================================================== -constructor TCustomEdit.Create(AOwner: TComponent); +constructor TFCustomEdit.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; @@ -83,14 +83,14 @@ begin end; -constructor TCustomEdit.Create(const pText: string; pOwner: TComponent); +constructor TFCustomEdit.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; end; -procedure TCustomEdit.Paint(Canvas: TFCanvas); +procedure TFCustomEdit.Paint(Canvas: TFCanvas); var Borders: TRect; s: String; @@ -162,7 +162,7 @@ begin end; -function TCustomEdit.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomEdit.ProcessEvent(Event: TEventObj): Boolean; begin if Event.InheritsFrom(TMousePressedEventObj) then begin @@ -174,7 +174,7 @@ begin end; -procedure TCustomEdit.EvKeyPressed(Key: Word; Shift: TShiftState); +procedure TFCustomEdit.EvKeyPressed(Key: Word; Shift: TShiftState); begin if Shift * [ssShift, ssAlt, ssCtrl, ssMeta, ssSuper, ssHyper, ssAltGr] = [] then begin @@ -218,7 +218,7 @@ begin end; -procedure TCustomEdit.EvKeyChar(KeyChar: Char); +procedure TFCustomEdit.EvKeyChar(KeyChar: Char); begin case KeyChar of #8: { Backspace } @@ -244,7 +244,7 @@ begin end; -procedure TCustomEdit.CalcSizes; +procedure TFCustomEdit.CalcSizes; var Borders: TRect; begin @@ -254,7 +254,7 @@ begin end; -procedure TCustomEdit.EvTextChanged; +procedure TFCustomEdit.EvTextChanged; begin Redraw; if Assigned(OnChange) then @@ -262,14 +262,14 @@ begin end; -procedure TCustomEdit.SetText(const AText: String); +procedure TFCustomEdit.SetText(const AText: String); begin FSelOffset := 0; inherited SetText(AText); end; -procedure TCustomEdit.SetPasswordChar(APasswordChar: Char); +procedure TFCustomEdit.SetPasswordChar(APasswordChar: Char); begin if APasswordChar <> PasswordChar then begin @@ -279,14 +279,14 @@ begin end; -procedure TCustomEdit.SetFontColor(const AValue: TColor); +procedure TFCustomEdit.SetFontColor(const AValue: TColor); begin if FFontColor = AValue then exit; FFontColor := AValue; end; -procedure TCustomEdit.SetCursorPos(ACursorPos: Integer); +procedure TFCustomEdit.SetCursorPos(ACursorPos: Integer); begin if ACursorPos <> CursorPos then begin @@ -296,7 +296,7 @@ begin end; -procedure TCustomEdit.DoMousePressed(pEvent: TMousePressedEventObj); +procedure TFCustomEdit.DoMousePressed(pEvent: TMousePressedEventObj); var Borders: TRect; cp: integer; diff --git a/gui/fpguiform.inc b/gui/fpguiform.inc index 3dd4b80a..0db9b297 100644 --- a/gui/fpguiform.inc +++ b/gui/fpguiform.inc @@ -18,12 +18,12 @@ {$IFDEF read_interface} - { TCustomForm } + { TFCustomForm } - TCustomForm = class(TBinWidget) + TFCustomForm = class(TFBinWidget) private - FFocusedWidget: TWidget; - FMouseCaptureWidget: TWidget; + FFocusedWidget: TFWidget; + FMouseCaptureWidget: TFWidget; FLastSetCursor: TFCursor; FWindowOptions: TFWindowOptions; FWnd: TFCustomWindow; @@ -33,8 +33,8 @@ FOnDeactivate: TNotifyEvent; // Property access function GetWnd: TFCustomWindow; - procedure SetFocusedWidget(AWidget: TWidget); - procedure SetMouseCaptureWidget(AWidget: TWidget); + procedure SetFocusedWidget(AWidget: TFWidget); + procedure SetMouseCaptureWidget(AWidget: TFWidget); procedure SetWindowOptions(const AValue: TFWindowOptions); // fpGFX event handling procedure WndClose(Sender: TObject); @@ -62,7 +62,7 @@ procedure Loaded; override; procedure Paint(Canvas: TFCanvas); override; procedure Resized; override; - function WidgetCoords(AWidget: TWidget): TPoint; + function WidgetCoords(AWidget: TFWidget): TPoint; function ProcessEvent(Event: TEventObj): Boolean; override; procedure CalcSizes; override; procedure EvTextChanged; override; @@ -82,15 +82,15 @@ procedure ShowModal; procedure Close; virtual; procedure SetPosition(APosition: TPoint); - property FocusedWidget: TWidget read FFocusedWidget write SetFocusedWidget; + property FocusedWidget: TFWidget read FFocusedWidget write SetFocusedWidget; property IsActive: Boolean read FIsActive; - property MouseCaptureWidget: TWidget read FMouseCaptureWidget write SetMouseCaptureWidget; + property MouseCaptureWidget: TFWidget read FMouseCaptureWidget write SetMouseCaptureWidget; property WindowOptions: TFWindowOptions read FWindowOptions write SetWindowOptions; property Wnd: TFCustomWindow read GetWnd; end; - TForm = class(TCustomForm) + TFForm = class(TFCustomForm) published property BorderWidth; property Color; @@ -110,10 +110,10 @@ {$IFDEF read_implementation} // =================================================================== -// TCustomForm +// TFCustomForm // =================================================================== -constructor TCustomForm.Create(AOwner: TComponent); +constructor TFCustomForm.Create(AOwner: TComponent); begin if not Assigned(FStyle) then FStyle := gStyleManager.DefaultStyle; @@ -128,7 +128,7 @@ begin end; -destructor TCustomForm.Destroy; +destructor TFCustomForm.Destroy; begin if Assigned(OnDestroy) then OnDestroy(Self); @@ -139,9 +139,9 @@ begin end; -procedure TCustomForm.Show; +procedure TFCustomForm.Show; begin - LAYOUTTRACE('TCustomForm.Show for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFCustomForm.Show for %s:%s', [Name, ClassName]); // if Assigned(Wnd) then ; // this makes sure that wnd is created @@ -150,15 +150,15 @@ begin Wnd.Show; end; -procedure TCustomForm.ShowModal; +procedure TFCustomForm.ShowModal; begin Include(WindowOptions, woModal); Show; end; -procedure TCustomForm.Close; +procedure TFCustomForm.Close; begin - LAYOUTTRACE('TCustomForm.Close for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFCustomForm.Close for %s:%s', [Name, ClassName]); GFApplication.RemoveWindow(FWnd); FVisible := False; @@ -168,7 +168,7 @@ begin end; -procedure TCustomForm.SetPosition(APosition: TPoint); +procedure TFCustomForm.SetPosition(APosition: TPoint); begin if Assigned(FWnd) then Wnd.SetPosition(APosition) @@ -180,7 +180,7 @@ begin end; -function TCustomForm.WidgetCoords(AWidget: TWidget): TPoint; +function TFCustomForm.WidgetCoords(AWidget: TFWidget): TPoint; begin Result := Point(0, 0); while AWidget <> Self do @@ -191,7 +191,7 @@ begin end; -procedure TCustomForm.Loaded; +procedure TFCustomForm.Loaded; begin inherited Loaded; if Assigned(OnCreate) then @@ -199,14 +199,14 @@ begin end; -procedure TCustomForm.Paint(Canvas: TFCanvas); +procedure TFCustomForm.Paint(Canvas: TFCanvas); begin inherited Paint(Canvas); Style.DrawWindowBackground(Canvas, Rect(0, 0, Width, Height)); end; -procedure TCustomForm.CalcSizes; +procedure TFCustomForm.CalcSizes; begin if Assigned(Child) then begin @@ -218,7 +218,7 @@ begin end; -function TCustomForm.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomForm.ProcessEvent(Event: TEventObj): Boolean; begin if Event is TDestroyEventObj then FWnd := nil; @@ -227,19 +227,19 @@ begin end; -procedure TCustomForm.EvTextChanged; +procedure TFCustomForm.EvTextChanged; begin if Assigned(FWnd) then Wnd.Title := Text; end; -procedure TCustomForm.CreateWnd; +procedure TFCustomForm.CreateWnd; var ParentWnd: TFCustomWindow; begin - if Parent is TCustomForm then - ParentWnd := TCustomForm(Parent).Wnd + if Parent is TFCustomForm then + ParentWnd := TFCustomForm(Parent).Wnd else ParentWnd := nil; @@ -274,7 +274,7 @@ end; { -procedure TCustomForm.ApplyNewLayout; +procedure TFCustomForm.ApplyNewLayout; var OrigW, OrigH: Integer; begin @@ -305,14 +305,14 @@ begin if (ClientRect.Right <> OrigW) or (ClientRect.Bottom <> OrigH) then begin - LAYOUTTRACE('TCustomForm.EvRecalcLayout for %s:%s: Setting size to %dx%d', + LAYOUTTRACE('TFCustomForm.EvRecalcLayout for %s:%s: Setting size to %dx%d', [Name, ClassName, ClientRect.Right, ClientRect.Bottom]); Wnd.SetClientSize(ClientRect.Right, ClientRect.Bottom); end; end;} -procedure TCustomForm.Resized; +procedure TFCustomForm.Resized; begin ClientRect.Right := Wnd.ClientWidth; ClientRect.Bottom := Wnd.ClientHeight; @@ -322,7 +322,7 @@ begin end; -procedure TCustomForm.SetFocusedWidget(AWidget: TWidget); +procedure TFCustomForm.SetFocusedWidget(AWidget: TFWidget); begin if AWidget <> FocusedWidget then begin @@ -340,7 +340,7 @@ begin end; end; -function TCustomForm.GetWnd: TFCustomWindow; +function TFCustomForm.GetWnd: TFCustomWindow; begin if not Assigned(FWnd) then begin @@ -354,7 +354,7 @@ begin end; -procedure TCustomForm.SetMouseCaptureWidget(AWidget: TWidget); +procedure TFCustomForm.SetMouseCaptureWidget(AWidget: TFWidget); begin if AWidget <> FMouseCaptureWidget then begin @@ -366,7 +366,7 @@ begin end; end; -procedure TCustomForm.SetWindowOptions(const AValue: TFWindowOptions); +procedure TFCustomForm.SetWindowOptions(const AValue: TFWindowOptions); begin if FWindowOptions=AValue then exit; FWindowOptions:=AValue; @@ -376,13 +376,13 @@ end; // GfxWindow message handlers -procedure TCustomForm.WndClose(Sender: TObject); +procedure TFCustomForm.WndClose(Sender: TObject); begin SendEvent(TDestroyEventObj.Create(Self)); FMouseCaptureWidget := nil; end; -procedure TCustomForm.WndFocusIn(Sender: TObject); +procedure TFCustomForm.WndFocusIn(Sender: TObject); begin FIsActive := True; if Assigned(FocusedWidget) then @@ -391,7 +391,7 @@ begin OnActivate(Self); end; -procedure TCustomForm.WndFocusOut(Sender: TObject); +procedure TFCustomForm.WndFocusOut(Sender: TObject); begin FIsActive := False; if Assigned(FocusedWidget) then @@ -400,9 +400,9 @@ begin OnDeactivate(Self); end; -procedure TCustomForm.WndHide(Sender: TObject); +procedure TFCustomForm.WndHide(Sender: TObject); begin - LAYOUTTRACE('TCustomForm.WndHide for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFCustomForm.WndHide for %s:%s', [Name, ClassName]); if wsIsVisible in WidgetState then begin Exclude(WidgetState, wsIsVisible); @@ -411,7 +411,7 @@ begin end; end; -procedure TCustomForm.WndKeyPressed(Sender: TObject; +procedure TFCustomForm.WndKeyPressed(Sender: TObject; AKey: Word; AShift: TShiftState); begin if Assigned(FocusedWidget) then @@ -420,7 +420,7 @@ begin EvKeyPressed(AKey, AShift); end; -procedure TCustomForm.WndKeyReleased(Sender: TObject; +procedure TFCustomForm.WndKeyReleased(Sender: TObject; AKey: Word; AShift: TShiftState); begin if Assigned(FocusedWidget) then @@ -429,7 +429,7 @@ begin EvKeyReleased(AKey, AShift); end; -procedure TCustomForm.WndKeyChar(Sender: TObject; AKeyChar: Char); +procedure TFCustomForm.WndKeyChar(Sender: TObject; AKeyChar: Char); begin if Assigned(FocusedWidget) then FocusedWidget.EvKeyChar(AKeyChar) @@ -437,7 +437,7 @@ begin EvKeyChar(AKeyChar); end; -procedure TCustomForm.WndMouseEnter(Sender: TObject; +procedure TFCustomForm.WndMouseEnter(Sender: TObject; AShift: TShiftState; const AMousePos: TPoint); begin if wsEnabled in WidgetState then @@ -445,14 +445,14 @@ begin end; -procedure TCustomForm.WndMouseLeave(Sender: TObject); +procedure TFCustomForm.WndMouseLeave(Sender: TObject); begin if wsEnabled in WidgetState then SendEvent(TMouseLeaveEventObj.Create(Self)); end; -procedure TCustomForm.WndMouseMoved(Sender: TObject; +procedure TFCustomForm.WndMouseMoved(Sender: TObject; AShift: TShiftState; const AMousePos: TPoint); {var dx, dy: Integer; @@ -474,7 +474,7 @@ begin TMouseMovedEventObj.Create(Self, Shift, x - dx, y - dy)); end else} - procedure SendMouseEvents(Widget: TWidget; APos: TPoint); + procedure SendMouseEvents(Widget: TFWidget; APos: TPoint); var LeaveCheckEvent: TMouseLeaveCheckEventObj; begin @@ -503,7 +503,7 @@ begin end; -procedure TCustomForm.WndMousePressed(Sender: TObject; AButton: TMouseButton; +procedure TFCustomForm.WndMousePressed(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin if wsEnabled in WidgetState then @@ -522,7 +522,7 @@ begin end; -procedure TCustomForm.WndMouseReleased(Sender: TObject; AButton: TMouseButton; +procedure TFCustomForm.WndMouseReleased(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); begin if wsEnabled in WidgetState then @@ -539,7 +539,7 @@ begin end; -procedure TCustomForm.WndMouseWheel(Sender: TObject; AShift: TShiftState; +procedure TFCustomForm.WndMouseWheel(Sender: TObject; AShift: TShiftState; AWheelDelta: Single; const AMousePos: TPoint); begin if wsEnabled in WidgetState then @@ -547,24 +547,24 @@ begin end; -procedure TCustomForm.WndPaint(Sender: TObject; const ARect: TRect); +procedure TFCustomForm.WndPaint(Sender: TObject; const ARect: TRect); begin - LAYOUTTRACE('TCustomForm.WndPaint for %s:%s (%d/%d-%d/%d)', + LAYOUTTRACE('TFCustomForm.WndPaint for %s:%s (%d/%d-%d/%d)', [Name, ClassName, ARect.Left, ARect.Top, ARect.Right, ARect.Bottom]); if wsIsVisible in WidgetState then SendEvent(TPaintEventObj.Create(Self, TFCanvas(Wnd.Canvas))); end; -procedure TCustomForm.WndMove(Sender: TObject); +procedure TFCustomForm.WndMove(Sender: TObject); begin FOrigin := Point(Wnd.Left, Wnd.Top); end; -procedure TCustomForm.WndResize(Sender: TObject); +procedure TFCustomForm.WndResize(Sender: TObject); begin - LAYOUTTRACE('TCustomForm.WndResize for %s:%s: New size is %dx%d. Visible? %d', + LAYOUTTRACE('TFCustomForm.WndResize for %s:%s: New size is %dx%d. Visible? %d', [Name, ClassName, Wnd.Width, Wnd.Height, Ord(wsIsVisible in WidgetState)]); if Visible or (wsIsVisible in WidgetState) then begin @@ -574,9 +574,9 @@ begin end; -procedure TCustomForm.WndShow(Sender: TObject); +procedure TFCustomForm.WndShow(Sender: TObject); begin - LAYOUTTRACE('TCustomForm.WndShow for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFCustomForm.WndShow for %s:%s', [Name, ClassName]); if not (wsIsVisible in WidgetState) then begin Include(WidgetState, wsIsVisible); diff --git a/gui/fpguigrid.inc b/gui/fpguigrid.inc index c7fb6ef3..be11ae2e 100644 --- a/gui/fpguigrid.inc +++ b/gui/fpguigrid.inc @@ -19,7 +19,7 @@ {$IFDEF read_interface} // ------------------------------------------------------------------- -// TCustomGrid +// TFCustomGrid // ------------------------------------------------------------------- EInvalidGridOperation = class(Exception); @@ -31,7 +31,7 @@ // TIntegerArray = array[0..(MAXINT div SizeOf(Integer))-1] of Integer; - TCustomGrid = class(TWidget) + TFCustomGrid = class(TFWidget) private FColCount: Integer; FRowCount: Integer; @@ -55,7 +55,7 @@ function GetRowHeights(ARow: Integer): Integer; procedure SetRowHeights(ARow, AHeight: Integer); procedure HorzScrollBarScroll(Sender: TObject; var APosition: Integer); - procedure VertScrollBarScroll(Sender: TObject; var APosition: Integer); + procedure VerTFScrollBarScroll(Sender: TObject; var APosition: Integer); protected ScrollingSupport: TScrollingSupport; procedure Paint(Canvas: TFCanvas); override; @@ -88,14 +88,14 @@ // ------------------------------------------------------------------- -// TDrawGrid +// TFDrawGrid // ------------------------------------------------------------------- TDrawCellEvent = procedure(Sender: TObject; ACanvas: TFCanvas; ACol, ARow: Integer; Rect: TRect; State: TGridDrawState) of object; - TDrawGrid = class(TCustomGrid) + TFDrawGrid = class(TFCustomGrid) private FOnDrawCell: TDrawCellEvent; protected @@ -118,14 +118,14 @@ // ------------------------------------------------------------------- -// TStringGrid +// TFStringGrid // ------------------------------------------------------------------- PCells = ^TCells; TCells = array[0..(1 shl 30) div SizeOf(AnsiString)] of AnsiString; - TStringGrid = class(TDrawGrid) + TFStringGrid = class(TFDrawGrid) private CellStrings: PCells; function GetCells(ACol, ARow: Integer): String; @@ -158,12 +158,12 @@ resourcestring SGridIndexOutOfRange = 'Grid index out of range'; // =================================================================== -// TCustomGrid +// TFCustomGrid // =================================================================== // public methods -constructor TCustomGrid.Create(AOwner: TComponent); +constructor TFCustomGrid.Create(AOwner: TComponent); var i: Integer; begin @@ -173,7 +173,7 @@ begin FCanExpandHeight := True; ScrollingSupport := TScrollingSupport.Create(Self); ScrollingSupport.HorzScrollBar.OnScroll := @HorzScrollBarScroll; - ScrollingSupport.VertScrollBar.OnScroll := @VertScrollBarScroll; + ScrollingSupport.VerTFScrollBar.OnScroll := @VerTFScrollBarScroll; FDefaultColWidth := 64; FDefaultRowHeight := 24; @@ -193,7 +193,7 @@ begin RowHeightsChanged; end; -destructor TCustomGrid.Destroy; +destructor TFCustomGrid.Destroy; begin FreeMem(FRowHeights); FreeMem(FColWidths); @@ -204,7 +204,7 @@ end; // protected methods -procedure TCustomGrid.Paint(Canvas: TFCanvas); +procedure TFCustomGrid.Paint(Canvas: TFCanvas); var x1, y1, x2, y2, x, y, Sum: Integer; CellRect: TRect; @@ -279,7 +279,7 @@ begin Inc(y); if y = FixedRows then - Inc(y, ScrollingSupport.VertScrollBar.Position); + Inc(y, ScrollingSupport.VerTFScrollBar.Position); end; @@ -301,7 +301,7 @@ begin Inc(y); if y = FixedRows then - Inc(y, ScrollingSupport.VertScrollBar.Position); + Inc(y, ScrollingSupport.VerTFScrollBar.Position); end; x := 0; @@ -331,29 +331,29 @@ begin Canvas.FillRect(Rect(x1, CellRect.Top, CellRect.Right + 1, y2)); end; -function TCustomGrid.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomGrid.ProcessEvent(Event: TEventObj): Boolean; begin Result := ScrollingSupport.ProcessEvent(Event) or inherited ProcessEvent(Event); end; -function TCustomGrid.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomGrid.DistributeEvent(Event: TEventObj): Boolean; begin Result := ScrollingSupport.DistributeEvent(Event) or inherited DistributeEvent(Event); end; -procedure TCustomGrid.CalcSizes; +procedure TFCustomGrid.CalcSizes; begin ScrollingSupport.CalcSizes; end; -procedure TCustomGrid.Resized; +procedure TFCustomGrid.Resized; begin ScrollingSupport.Resized; end; -procedure TCustomGrid.ColWidthsChanged; +procedure TFCustomGrid.ColWidthsChanged; var i: Integer; begin @@ -370,7 +370,7 @@ begin Dec(FFixedWidth); end; -procedure TCustomGrid.RowHeightsChanged; +procedure TFCustomGrid.RowHeightsChanged; var i: Integer; begin @@ -387,17 +387,17 @@ begin Dec(FFixedHeight); end; -procedure TCustomGrid.SizeChanged(OldColCount, OldRowCount: Integer); +procedure TFCustomGrid.SizeChanged(OldColCount, OldRowCount: Integer); begin Assert(OldColCount = OldColCount); Assert(OldRowCount = OldRowCount); - // This dynamic method is only used for descendants of TCustomGrid + // This dynamic method is only used for descendants of TFCustomGrid end; // private methods -procedure TCustomGrid.SetColCount(AColCount: Integer); +procedure TFCustomGrid.SetColCount(AColCount: Integer); var OldColCount, i: Integer; begin @@ -417,7 +417,7 @@ begin end; end; -procedure TCustomGrid.SetRowCount(ARowCount: Integer); +procedure TFCustomGrid.SetRowCount(ARowCount: Integer); var OldRowCount, i: Integer; begin @@ -430,14 +430,14 @@ begin for i := OldRowCount to FRowCount - 1 do FRowHeights^[i] := FDefaultRowHeight; - ScrollingSupport.VertScrollBar.Max := RowCount - FixedRows - 1; + ScrollingSupport.VerTFScrollBar.Max := RowCount - FixedRows - 1; RowHeightsChanged; SizeChanged(FColCount, OldRowCount); end; end; -procedure TCustomGrid.SetFixedCols(AFixedCols: Integer); +procedure TFCustomGrid.SetFixedCols(AFixedCols: Integer); begin if AFixedCols <> FixedCols then begin @@ -446,16 +446,16 @@ begin end; end; -procedure TCustomGrid.SetFixedRows(AFixedRows: Integer); +procedure TFCustomGrid.SetFixedRows(AFixedRows: Integer); begin if AFixedRows <> FixedRows then begin FFixedRows := AFixedRows; - ScrollingSupport.VertScrollBar.Max := RowCount - FixedRows - 1; + ScrollingSupport.VerTFScrollBar.Max := RowCount - FixedRows - 1; end; end; -procedure TCustomGrid.SetDefaultColWidth(AWidth: Integer); +procedure TFCustomGrid.SetDefaultColWidth(AWidth: Integer); var i: Integer; begin @@ -468,7 +468,7 @@ begin end; end; -procedure TCustomGrid.SetDefaultRowHeight(AHeight: Integer); +procedure TFCustomGrid.SetDefaultRowHeight(AHeight: Integer); var i: Integer; begin @@ -481,35 +481,35 @@ begin end; end; -function TCustomGrid.GetColWidths(ACol: Integer): Integer; +function TFCustomGrid.GetColWidths(ACol: Integer): Integer; begin if (ACol < 0) or (ACol >= FColCount) then raise EInvalidGridOperation(SGridIndexOutOfRange); Result := FColWidths^[ACol]; end; -procedure TCustomGrid.SetColWidths(ACol, AWidth: Integer); +procedure TFCustomGrid.SetColWidths(ACol, AWidth: Integer); begin if (ACol < 0) or (ACol >= FColCount) then raise EInvalidGridOperation(SGridIndexOutOfRange); FColWidths^[ACol] := AWidth; end; -function TCustomGrid.GetRowHeights(ARow: Integer): Integer; +function TFCustomGrid.GetRowHeights(ARow: Integer): Integer; begin if (ARow < 0) or (ARow >= FRowCount) then raise EInvalidGridOperation(SGridIndexOutOfRange); Result := FRowHeights^[ARow]; end; -procedure TCustomGrid.SetRowHeights(ARow, AHeight: Integer); +procedure TFCustomGrid.SetRowHeights(ARow, AHeight: Integer); begin if (ARow < 0) or (ARow >= FRowCount) then raise EInvalidGridOperation(SGridIndexOutOfRange); FRowHeights^[ARow] := AHeight; end; -procedure TCustomGrid.HorzScrollBarScroll(Sender: TObject; +procedure TFCustomGrid.HorzScrollBarScroll(Sender: TObject; var APosition: Integer); var i, Delta: Integer; @@ -536,18 +536,18 @@ begin end; end; -procedure TCustomGrid.VertScrollBarScroll(Sender: TObject; +procedure TFCustomGrid.VerTFScrollBarScroll(Sender: TObject; var APosition: Integer); var i, Delta: Integer; r: TRect; begin Delta := 0; - if APosition > ScrollingSupport.VertScrollBar.Position then - for i := ScrollingSupport.VertScrollBar.Position to APosition - 1 do + if APosition > ScrollingSupport.VerTFScrollBar.Position then + for i := ScrollingSupport.VerTFScrollBar.Position to APosition - 1 do Dec(Delta, RowHeights[i + FixedRows] + 1) else - for i := APosition to ScrollingSupport.VertScrollBar.Position - 1 do + for i := APosition to ScrollingSupport.VerTFScrollBar.Position - 1 do Inc(Delta, RowHeights[i + FixedRows] + 1); // Scroll the grid body @@ -565,10 +565,10 @@ end; // ------------------------------------------------------------------- -// TDrawGrid +// TFDrawGrid // ------------------------------------------------------------------- -procedure TDrawGrid.DrawCell(ACanvas: TFCanvas; ACol, ARow: Integer; +procedure TFDrawGrid.DrawCell(ACanvas: TFCanvas; ACol, ARow: Integer; ARect: TRect; AState: TGridDrawState); begin @@ -576,7 +576,7 @@ begin OnDrawCell(Self, ACanvas, ACol, ARow, ARect, AState); end; -function TDrawGrid.CellRect(ACol, ARow: Integer): TRect; +function TFDrawGrid.CellRect(ACol, ARow: Integer): TRect; var i: Integer; begin @@ -593,10 +593,10 @@ end; // ------------------------------------------------------------------- -// TStringGrid +// TFStringGrid // ------------------------------------------------------------------- -function TStringGrid.GetCells(ACol, ARow: Integer): String; +function TFStringGrid.GetCells(ACol, ARow: Integer): String; begin if (ACol >= 0) and (ARow >= 0) and (ACol < ColCount) and (ARow < RowCount) then Result := CellStrings^[ARow * ColCount + ACol] @@ -604,13 +604,13 @@ begin SetLength(Result, 0); end; -procedure TStringGrid.SetCells(ACol, ARow: Integer; const AValue: String); +procedure TFStringGrid.SetCells(ACol, ARow: Integer; const AValue: String); begin if (ACol >= 0) and (ARow >= 0) and (ACol < ColCount) and (ARow < RowCount) then CellStrings^[ARow * ColCount + ACol] := AValue; end; -procedure TStringGrid.SizeChanged(OldColCount, OldRowCount: Integer); +procedure TFStringGrid.SizeChanged(OldColCount, OldRowCount: Integer); var Count: Integer; begin @@ -622,13 +622,13 @@ begin Count * SizeOf(AnsiString), #0); end; -procedure TStringGrid.DrawCell(ACanvas: TFCanvas; ACol, ARow: Integer; +procedure TFStringGrid.DrawCell(ACanvas: TFCanvas; ACol, ARow: Integer; ARect: TRect; AState: TGridDrawState); var s: String; begin - // WriteLn('TStringGrid.DrawCell(', ACol, ', ', ARow, ', ', Integer(AState), ');'); + // WriteLn('TFStringGrid.DrawCell(', ACol, ', ', ARow, ', ', Integer(AState), ');'); s := Cells[ACol, ARow]; if Length(s) > 0 then ACanvas.TextOut(ARect.TopLeft + Point(2, 2), s); @@ -636,13 +636,13 @@ begin OnDrawCell(Self, ACanvas, ACol, ARow, ARect, AState); end; -constructor TStringGrid.Create(AOwner: TComponent); +constructor TFStringGrid.Create(AOwner: TComponent); begin inherited Create(AOwner); Self.SizeChanged(0, 0); end; -destructor TStringGrid.Destroy; +destructor TFStringGrid.Destroy; var i: Integer; begin diff --git a/gui/fpguigroupbox.inc b/gui/fpguigroupbox.inc index 07489bfd..cf51071b 100644 --- a/gui/fpguigroupbox.inc +++ b/gui/fpguigroupbox.inc @@ -20,7 +20,7 @@ { TCustomGroupBox } - TCustomGroupBox = class(TBinWidget) + TFCustomGroupBox = class(TFBinWidget) protected procedure Paint(Canvas: TFCanvas); override; procedure CalcSizes; override; @@ -30,7 +30,7 @@ end; - TGroupBox = class(TCustomGroupBox) + TFGroupBox = class(TFCustomGroupBox) published property CanExpandWidth; property CanExpandHeight; @@ -50,13 +50,13 @@ // TCustomGroupBox // =================================================================== -procedure TCustomGroupBox.Paint(Canvas: TFCanvas); +procedure TFCustomGroupBox.Paint(Canvas: TFCanvas); begin Style.DrawGroupBox(Canvas, Rect(0, 0, Width, Height), Text, WidgetState); end; -procedure TCustomGroupBox.CalcSizes; +procedure TFCustomGroupBox.CalcSizes; var Borders: TRect; LabelWidth: Integer; @@ -80,7 +80,7 @@ begin end; -procedure TCustomGroupBox.Resized; +procedure TFCustomGroupBox.Resized; var LabelWidth: Integer; Borders: TRect; @@ -95,7 +95,7 @@ begin end; -constructor TCustomGroupBox.Create(const pText: string; pOwner: TComponent); +constructor TFCustomGroupBox.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; diff --git a/gui/fpguilabel.inc b/gui/fpguilabel.inc index 43ce5b70..b7903f22 100644 --- a/gui/fpguilabel.inc +++ b/gui/fpguilabel.inc @@ -19,9 +19,9 @@ {$IFDEF read_interface} - { TCustomLabel } + { TFCustomLabel } - TCustomLabel = class(TWidget) + TFCustomLabel = class(TFWidget) private FFontColor: TColor; procedure SetAlignment(AAlignment: TAlignment); @@ -37,7 +37,7 @@ end; - TLabel = class(TCustomLabel) + TFLabel = class(TFCustomLabel) public published property CanExpandWidth; @@ -55,10 +55,10 @@ // =================================================================== -// TCustomLabel +// TFCustomLabel // =================================================================== -procedure TCustomLabel.Paint(Canvas: TFCanvas); +procedure TFCustomLabel.Paint(Canvas: TFCanvas); var x: Integer; begin @@ -74,14 +74,14 @@ begin end; -procedure TCustomLabel.CalcSizes; +procedure TFCustomLabel.CalcSizes; begin with FindForm.Wnd.Canvas do FMinSize := gfxbase.Size(TextWidth(Text), FontCellHeight); end; -constructor TCustomLabel.Create(const pText: string; pOwner: TComponent); +constructor TFCustomLabel.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; @@ -89,7 +89,7 @@ begin end; -procedure TCustomLabel.SetAlignment(AAlignment: TAlignment); +procedure TFCustomLabel.SetAlignment(AAlignment: TAlignment); begin if AAlignment <> Alignment then begin @@ -99,7 +99,7 @@ begin end; -procedure TCustomLabel.SetFontColor(const AValue: TColor); +procedure TFCustomLabel.SetFontColor(const AValue: TColor); begin if FFontColor = AValue then exit; FFontColor := AValue; diff --git a/gui/fpguilayouts.inc b/gui/fpguilayouts.inc index cba0ed93..ba044f4c 100644 --- a/gui/fpguilayouts.inc +++ b/gui/fpguilayouts.inc @@ -29,34 +29,34 @@ type THorzAlign = (horzLeft, horzCenter, horzRight, horzFill); TVertAlign = (vertTop, vertCenter, vertBottom, vertFill); - TLayoutItem = class(TCollectionItem) + TFLayoutItem = class(TCollectionItem) private - FWidget: TWidget; + FWidget: TFWidget; published - property Widget: TWidget read FWidget write FWidget; + property Widget: TFWidget read FWidget write FWidget; end; - TWidgetArrayInfo = record + TFWidgetArrayInfo = record min, def, max: Integer; MinFlag, MaxFlag: Boolean; end; - TWidgetArrayInfoArray = array[0..(1 shl 30) div SizeOf(TWidgetArrayInfo) - 1] of TWidgetArrayInfo; - PWidgetArrayInfoArray = ^TWidgetArrayInfoArray; + TFWidgetArrayInfoArray = array[0..(1 shl 30) div SizeOf(TFWidgetArrayInfo) - 1] of TFWidgetArrayInfo; + PWidgetArrayInfoArray = ^TFWidgetArrayInfoArray; - TLayout = class(TContainerWidget) + TFLayout = class(TFContainerWidget) protected FWidgets: TCollection; FBorderSpacing: Integer; IsRecalcingLayout: Boolean; function GetChildCount: Integer; override; - function GetChild(Index: Integer): TWidget; override; + function GetChild(Index: Integer): TFWidget; override; property BorderSpacing: Integer read FBorderSpacing write FBorderSpacing; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - function ContainsChild(AChild: TWidget): Boolean; override; + function ContainsChild(AChild: TFWidget): Boolean; override; end; @@ -64,7 +64,7 @@ type // FixedLayout // ------------------------------------------------------------------- - TFixedItem = class(TLayoutItem) + TFFixedItem = class(TFLayoutItem) public Left: Integer; Top: Integer; @@ -73,15 +73,15 @@ type { TFixedLayout } - TFixedLayout = class(TLayout) + TFFixedLayout = class(TFLayout) private - procedure AddFixedChild(AChild: TWidget); + procedure AddFixedChild(AChild: TFWidget); protected procedure CalcSizes; override; public constructor Create(AOwner: TComponent); override; - procedure AddWidget(AWidget: TWidget; ALeft, ATop: Integer); - procedure MoveWidget(AWidget: TWidget; ALeft, ATop: Integer); + procedure AddWidget(AWidget: TFWidget; ALeft, ATop: Integer); + procedure MoveWidget(AWidget: TFWidget; ALeft, ATop: Integer); published property Enabled; end; @@ -93,20 +93,20 @@ type TDockingMode = (dmTop, dmBottom, dmLeft, dmRight, dmClient, dmUndocked); - TDockingItem = class(TLayoutItem) + TFDockingItem = class(TFLayoutItem) public Left, Top: Integer; DockingMode: TDockingMode; end; - TDockingLayout = class(TLayout) + TFDockingLayout = class(TFLayout) protected procedure CalcSizes; override; public constructor Create(AOwner: TComponent); override; - procedure AddWidget(AWidget: TWidget; ADockingMode: TDockingMode); - procedure AddWidget(AWidget: TWidget; ALeft, ATop: Integer); + procedure AddWidget(AWidget: TFWidget; ADockingMode: TDockingMode); + procedure AddWidget(AWidget: TFWidget; ALeft, ATop: Integer); published property Enabled; end; @@ -116,7 +116,7 @@ type // BoxLayout // ------------------------------------------------------------------- - TCustomBoxLayout = class(TLayout) + TFCustomBoxLayout = class(TFLayout) private FHorzAlign: THorzAlign; FVertAlign: TVertAlign; @@ -132,12 +132,12 @@ type property Spacing: Integer read FSpacing write FSpacing default 4; public constructor Create(AOwner: TComponent); override; - procedure InsertChild(AChild: TWidget); override; - procedure RemoveChild(AChild: TWidget); override; + procedure InsertChild(AChild: TFWidget); override; + procedure RemoveChild(AChild: TFWidget); override; end; - TBoxLayout = class(TCustomBoxLayout) + TFBoxLayout = class(TFCustomBoxLayout) published property CanExpandWidth; property CanExpandHeight; @@ -151,10 +151,10 @@ type // ------------------------------------------------------------------- -// GridLayout +// FGridLayout // ------------------------------------------------------------------- - TGridItem = class(TLayoutItem) + TFGridItem = class(TFLayoutItem) private FX, FY, FWidth, FHeight: Integer; public @@ -167,9 +167,9 @@ type end; - { TCustomGridLayout } + { TFCustomGridLayout } - TCustomGridLayout = class(TLayout) + TFCustomGridLayout = class(TFLayout) private FColCount: Integer; FRowCount: Integer; @@ -191,12 +191,12 @@ type property RowSpacing: Integer read FRowSpacing write SetRowSpacing default 4; public constructor Create(AOwner: TComponent); override; - procedure AddWidget(AWidget: TWidget; x, y, w, h: Integer); - procedure MoveWidget(AWidget: TWidget; x, y, w, h: Integer); + procedure AddWidget(AWidget: TFWidget; x, y, w, h: Integer); + procedure MoveWidget(AWidget: TFWidget; x, y, w, h: Integer); end; - TGridLayout = class(TCustomGridLayout) + TFGridLayout = class(TFCustomGridLayout) published property Enabled; property ColCount; @@ -309,12 +309,12 @@ end; // ------------------------------------------------------------------- -// TLayout +// TFLayout // ------------------------------------------------------------------- // public methods -constructor TLayout.Create(AOwner: TComponent); +constructor TFLayout.Create(AOwner: TComponent); begin inherited Create(AOwner); FCanExpandWidth := True; @@ -322,19 +322,19 @@ begin end; -destructor TLayout.Destroy; +destructor TFLayout.Destroy; begin FWidgets.Free; inherited Destroy; end; -function TLayout.ContainsChild(AChild: TWidget): Boolean; +function TFLayout.ContainsChild(AChild: TFWidget): Boolean; var i: Integer; begin for i := 0 to FWidgets.Count - 1 do - if TLayoutItem(FWidgets.Items[i]).Widget = AChild then + if TFLayoutItem(FWidgets.Items[i]).Widget = AChild then begin Result := True; exit; @@ -345,33 +345,33 @@ end; // protected methods -function TLayout.GetChildCount: Integer; +function TFLayout.GetChildCount: Integer; begin Result := FWidgets.Count; end; -function TLayout.GetChild(Index: Integer): TWidget; +function TFLayout.GetChild(Index: Integer): TFWidget; begin - Result := TLayoutItem(FWidgets.Items[Index]).Widget; + Result := TFLayoutItem(FWidgets.Items[Index]).Widget; end; // ------------------------------------------------------------------- -// TFixedLayout +// TFFixedLayout // ------------------------------------------------------------------- -constructor TFixedLayout.Create(AOwner: TComponent); +constructor TFFixedLayout.Create(AOwner: TComponent); begin inherited Create(AOwner); - FWidgets := TCollection.Create(TFixedItem); + FWidgets := TCollection.Create(TFFixedItem); end; -procedure TFixedLayout.AddWidget(AWidget: TWidget; ALeft, ATop: Integer); +procedure TFFixedLayout.AddWidget(AWidget: TFWidget; ALeft, ATop: Integer); var - item: TFixedItem; + item: TFFixedItem; begin AWidget.Parent := Self; - item := TFixedItem(FWidgets.Add); + item := TFFixedItem(FWidgets.Add); item.Left := ALeft; item.Top := ATop; item.Widget := AWidget; @@ -379,14 +379,14 @@ begin AddFixedChild(AWidget); end; -procedure TFixedLayout.MoveWidget(AWidget: TWidget; ALeft, ATop: Integer); +procedure TFFixedLayout.MoveWidget(AWidget: TFWidget; ALeft, ATop: Integer); var i: integer; - item: TFixedItem; + item: TFFixedItem; begin for i := 0 to FWidgets.Count - 1 do begin - item := TFixedItem(FWidgets.Items[i]); + item := TFFixedItem(FWidgets.Items[i]); if item.Widget = AWidget then begin item.Left := ALeft; @@ -398,22 +398,22 @@ begin raise ELayoutError.Create(SLayoutWidgetNotFound); end; -procedure TFixedLayout.AddFixedChild(AChild: TWidget); +procedure TFFixedLayout.AddFixedChild(AChild: TFWidget); begin // todo end; -procedure TFixedLayout.CalcSizes; +procedure TFFixedLayout.CalcSizes; var i: Integer; - item: TFixedItem; + item: TFFixedItem; begin if FWidgets.Count = 0 then FDefSize := gfxbase.Size(50, 50) else for i := 0 to FWidgets.Count - 1 do begin - item := TFixedItem(FWidgets.Items[i]); + item := TFFixedItem(FWidgets.Items[i]); FDefSize.cx := Max(DefSize.cx, item.Left + item.Widget.DefSize.cx); FDefSize.cy := Max(DefSize.cx, item.Top + item.Widget.DefSize.cy); end; @@ -433,20 +433,20 @@ end;} // ------------------------------------------------------------------- -// TDockingLayout +// TFDockingLayout // ------------------------------------------------------------------- -constructor TDockingLayout.Create(AOwner: TComponent); +constructor TFDockingLayout.Create(AOwner: TComponent); begin inherited Create(AOwner); - FWidgets := TCollection.Create(TDockingItem); + FWidgets := TCollection.Create(TFDockingItem); end; -procedure TDockingLayout.CalcSizes; +procedure TFDockingLayout.CalcSizes; var i: Integer; - item: TDockingItem; - w, cw: TWidget; + item: TFDockingItem; + w, cw: TFWidget; begin if FWidgets.Count = 0 then begin @@ -458,7 +458,7 @@ begin cw := nil; for i := 0 to FWidgets.Count - 1 do begin - item := TDockingItem(FWidgets.Items[i]); + item := TFDockingItem(FWidgets.Items[i]); if item.DockingMode = dmClient then begin cw := item.Widget; @@ -476,7 +476,7 @@ begin for i := 0 to FWidgets.Count - 1 do begin - item := TDockingItem(FWidgets.Items[i]); + item := TFDockingItem(FWidgets.Items[i]); w := item.Widget; case item.DockingMode of dmTop, dmBottom: @@ -513,7 +513,7 @@ end; {procedure TDockingLayout.EvLayoutChildren(Canvas: TGfxCanvas); var clx, cly, clw, clh: Integer; // Client rectangle - ClientWidget: TWidget; + ClienTFWidget: TFWidget; i, WidgetW, WidgetH: Integer; item: TDockingItem; begin @@ -526,7 +526,7 @@ begin exit; // Process all attached widgets - ClientWidget := nil; + ClienTFWidget := nil; for i := 0 to FWidgets.Count - 1 do begin item := TDockingItem(FWidgets.Items[i]); @@ -566,32 +566,32 @@ begin Dec(clh, WidgetH); end; dmClient: - ClientWidget := item.Widget; + ClienTFWidget := item.Widget; end; if item.DockingMode <> dmClient then item.Widget.SetBounds(item.Left, item.Top, WidgetW, WidgetH); end; - if Assigned(ClientWidget) then - ClientWidget.SetBounds(clx, cly, clw, clh); + if Assigned(ClienTFWidget) then + ClienTFWidget.SetBounds(clx, cly, clw, clh); end;} -procedure TDockingLayout.AddWidget(AWidget: TWidget; ADockingMode: TDockingMode); +procedure TFDockingLayout.AddWidget(AWidget: TFWidget; ADockingMode: TDockingMode); var - item: TDockingItem; + item: TFDockingItem; begin AWidget.Parent := Self; - item := TDockingItem(FWidgets.Add); + item := TFDockingItem(FWidgets.Add); item.Widget := AWidget; item.DockingMode := ADockingMode; // AddFixedChild(AWidget); end; -procedure TDockingLayout.AddWidget(AWidget: TWidget; ALeft, ATop: Integer); +procedure TFDockingLayout.AddWidget(AWidget: TFWidget; ALeft, ATop: Integer); var - item: TDockingItem; + item: TFDockingItem; begin AWidget.Parent := Self; - item := TDockingItem(FWidgets.Add); + item := TFDockingItem(FWidgets.Add); item.Widget := AWidget; item.DockingMode := dmUndocked; item.Left := ALeft; @@ -601,10 +601,10 @@ end; // ------------------------------------------------------------------- -// TCustomBoxLayout +// TFCustomBoxLayout // ------------------------------------------------------------------- -procedure TCustomBoxLayout.SetOrientation(AOrientation: TOrientation); +procedure TFCustomBoxLayout.SetOrientation(AOrientation: TOrientation); begin if AOrientation <> FOrientation then begin @@ -614,10 +614,10 @@ begin end; -constructor TCustomBoxLayout.Create(AOwner: TComponent); +constructor TFCustomBoxLayout.Create(AOwner: TComponent); begin inherited Create(AOwner); - FWidgets := TCollection.Create(TLayoutItem); + FWidgets := TCollection.Create(TFLayoutItem); FOrientation := Horizontal; FHorzAlign := horzFill; FVertAlign := vertFill; @@ -625,30 +625,30 @@ begin end; -procedure TCustomBoxLayout.InsertChild(AChild: TWidget); +procedure TFCustomBoxLayout.InsertChild(AChild: TFWidget); var - item: TLayoutItem; + item: TFLayoutItem; begin if not ContainsChild(AChild) then begin - item := TLayoutItem(FWidgets.Add); + item := TFLayoutItem(FWidgets.Add); item.Widget := AChild; AChild.Parent := Self; end; end; -procedure TCustomBoxLayout.RemoveChild(AChild: TWidget); +procedure TFCustomBoxLayout.RemoveChild(AChild: TFWidget); begin {$Warning Not implemented yet.} raise Exception.Create('TCustomBoxLayout.RemoveChild - Not implemented yet'); end; -procedure TCustomBoxLayout.CalcSizes; +procedure TFCustomBoxLayout.CalcSizes; var i: Integer; - item: TLayoutItem; + item: TFLayoutItem; begin i := (FWidgets.Count - 1) * FSpacing; if Orientation = Horizontal then @@ -673,7 +673,7 @@ begin for i := 0 to FWidgets.Count - 1 do begin - item := TLayoutItem(FWidgets.Items[i]); + item := TFLayoutItem(FWidgets.Items[i]); if Orientation = Horizontal then begin Inc(FMinSize.cx, item.Widget.MinSize.cx); @@ -709,13 +709,13 @@ begin FMaxSize.cy := Min(InfiniteSize, MaxSize.cy + 2 * FBorderSpacing); end; -procedure TCustomBoxLayout.Resized; +procedure TFCustomBoxLayout.Resized; var sizes: PWidgetArrayInfoArray; i, x, y, xpos, ypos, w, h, sum: Integer; - item: TLayoutItem; + item: TFLayoutItem; begin - GetMem(sizes, FWidgets.Count * SizeOf(TWidgetArrayInfo)); + GetMem(sizes, FWidgets.Count * SizeOf(TFWidgetArrayInfo)); for i := 0 to FWidgets.Count - 1 do begin @@ -729,7 +729,7 @@ begin if Orientation = Horizontal then for i := 0 to FWidgets.Count - 1 do begin - item := TLayoutItem(FWidgets.Items[i]); + item := TFLayoutItem(FWidgets.Items[i]); sizes^[i].min := Max(sizes^[i].min, item.Widget.MinSize.cx); sizes^[i].def := Max(sizes^[i].def, item.Widget.DefSize.cx); sizes^[i].max := Min(sizes^[i].max, item.Widget.MaxSize.cx); @@ -737,7 +737,7 @@ begin else for i := 0 to FWidgets.Count - 1 do begin - item := TLayoutItem(FWidgets.Items[i]); + item := TFLayoutItem(FWidgets.Items[i]); sizes^[i].min := Max(sizes^[i].min, item.Widget.MinSize.cy); sizes^[i].def := Max(sizes^[i].def, item.Widget.DefSize.cy); sizes^[i].max := Min(sizes^[i].max, item.Widget.MaxSize.cy); @@ -779,7 +779,7 @@ begin for i := 0 to FWidgets.Count - 1 do begin - item := TLayoutItem(FWidgets.Items[i]); + item := TFLayoutItem(FWidgets.Items[i]); if Orientation = Horizontal then begin xpos := x; @@ -816,10 +816,10 @@ end; // ------------------------------------------------------------------- -// TCustomGridLayout +// TFCustomGridLayout // ------------------------------------------------------------------- -constructor TGridItem.Create(ACollection: TCollection); +constructor TFGridItem.Create(ACollection: TCollection); begin inherited Create(ACollection); Width := 1; @@ -827,7 +827,7 @@ begin end; -procedure TCustomGridLayout.SetColCount(AColCount: Integer); +procedure TFCustomGridLayout.SetColCount(AColCount: Integer); begin if AColCount <> FColCount then begin @@ -837,7 +837,7 @@ begin end; -procedure TCustomGridLayout.SetRowCount(ARowCount: Integer); +procedure TFCustomGridLayout.SetRowCount(ARowCount: Integer); begin if ARowCount <> FRowCount then begin @@ -847,7 +847,7 @@ begin end; -procedure TCustomGridLayout.SetColSpacing(AColSpacing: Integer); +procedure TFCustomGridLayout.SetColSpacing(AColSpacing: Integer); begin if AColSpacing <> FColSpacing then begin @@ -857,7 +857,7 @@ begin end; -procedure TCustomGridLayout.SetRowSpacing(ARowSpacing: Integer); +procedure TFCustomGridLayout.SetRowSpacing(ARowSpacing: Integer); begin if ARowSpacing <> FRowSpacing then begin @@ -867,13 +867,13 @@ begin end; -procedure TCustomGridLayout.InitSizeInfos(var ColInfos, RowInfos: PWidgetArrayInfoArray); +procedure TFCustomGridLayout.InitSizeInfos(var ColInfos, RowInfos: PWidgetArrayInfoArray); var i: Integer; - item: TGridItem; + item: TFGridItem; begin - GetMem(ColInfos, FColCount * SizeOf(TWidgetArrayInfo)); - GetMem(RowInfos, FRowCount * SizeOf(TWidgetArrayInfo)); + GetMem(ColInfos, FColCount * SizeOf(TFWidgetArrayInfo)); + GetMem(RowInfos, FRowCount * SizeOf(TFWidgetArrayInfo)); for i := 0 to FColCount - 1 do begin @@ -895,7 +895,7 @@ begin for i := 0 to FWidgets.Count - 1 do begin - item := TGridItem(FWidgets.Items[i]); + item := TFGridItem(FWidgets.Items[i]); ColInfos^[item.x].min := Max(ColInfos^[item.x].min, item.Widget.MinSize.cx); ColInfos^[item.x].def := Max(ColInfos^[item.x].def, item.Widget.DefSize.cx); ColInfos^[item.x].max := Min(ColInfos^[item.x].max, item.Widget.MaxSize.cx); @@ -926,7 +926,7 @@ begin end; -procedure TCustomGridLayout.CalcSizes; +procedure TFCustomGridLayout.CalcSizes; var ColInfos, RowInfos: PWidgetArrayInfoArray; i: Integer; @@ -959,11 +959,11 @@ begin end; -procedure TCustomGridLayout.Resized; +procedure TFCustomGridLayout.Resized; var ColInfos, RowInfos: PWidgetArrayInfoArray; i, j, x, y, w, h: Integer; - item: TGridItem; + item: TFGridItem; begin InitSizeInfos(ColInfos, RowInfos); @@ -972,7 +972,7 @@ begin for i := 0 to FWidgets.Count - 1 do begin - item := TGridItem(FWidgets.Items[i]); + item := TFGridItem(FWidgets.Items[i]); x := 0; for j := 0 to item.x - 1 do Inc(x, ColInfos^[j].def); @@ -995,22 +995,22 @@ begin FreeMem(RowInfos); end; -constructor TCustomGridLayout.Create(AOwner: TComponent); +constructor TFCustomGridLayout.Create(AOwner: TComponent); begin inherited Create(AOwner); - FWidgets := TCollection.Create(TGridItem); + FWidgets := TCollection.Create(TFGridItem); FColCount := 2; FRowCount := 2; FColSpacing := 4; FRowSpacing := 4; end; -procedure TCustomGridLayout.AddWidget(AWidget: TWidget; x, y, w, h: Integer); +procedure TFCustomGridLayout.AddWidget(AWidget: TFWidget; x, y, w, h: Integer); var - item: TGridItem; + item: TFGridItem; begin AWidget.Parent := Self; - item := TGridItem(FWidgets.Add); + item := TFGridItem(FWidgets.Add); item.Widget := AWidget; item.x := x; item.y := y; @@ -1018,14 +1018,14 @@ begin item.Height := h; end; -procedure TCustomGridLayout.MoveWidget(AWidget: TWidget; x, y, w, h: Integer); +procedure TFCustomGridLayout.MoveWidget(AWidget: TFWidget; x, y, w, h: Integer); var i: integer; - item: TGridItem; + item: TFGridItem; begin for i := 0 to FWidgets.Count - 1 do begin - item := TGridItem(FWidgets.Items[i]); + item := TFGridItem(FWidgets.Items[i]); if item.Widget = AWidget then begin item.x := x; diff --git a/gui/fpguilistbox.inc b/gui/fpguilistbox.inc index 91db2be1..6858940a 100644 --- a/gui/fpguilistbox.inc +++ b/gui/fpguilistbox.inc @@ -4,7 +4,7 @@ {$IFDEF read_interface} - TCustomListBox = class(TWidget) + TFCustomListBox = class(TFWidget) private FHotTrack: Boolean; FItems: TStrings; @@ -37,7 +37,7 @@ end; - TListBox = class(TCustomListBox) + TFListBox = class(TFCustomListBox) published // TWidget properties property OnClick; @@ -55,28 +55,28 @@ {$IFDEF read_implementation} // =================================================================== -// TListBoxStrings +// TFListBoxStrings // =================================================================== type - TListBoxStrings = class(TStringList) + TFListBoxStrings = class(TStringList) protected - ListBox: TCustomListBox; + ListBox: TFCustomListBox; procedure SetUpdateState(Updating: Boolean); override; public - constructor Create(AListBox: TCustomListBox); + constructor Create(AListBox: TFCustomListBox); function Add(const s: String): Integer; override; end; -constructor TListBoxStrings.Create(AListBox: TCustomListBox); +constructor TFListBoxStrings.Create(AListBox: TFCustomListBox); begin inherited Create; ListBox := AListBox; end; -function TListBoxStrings.Add(const s: String): Integer; +function TFListBoxStrings.Add(const s: String): Integer; var ItemWidth: Integer; begin @@ -90,7 +90,7 @@ begin end; end; -procedure TListBoxStrings.SetUpdateState(Updating: Boolean); +procedure TFListBoxStrings.SetUpdateState(Updating: Boolean); begin if not Updating then ListBox.RecalcWidth; @@ -101,7 +101,7 @@ end; // TCustomListBox // =================================================================== -constructor TCustomListBox.Create(AOwner: TComponent); +constructor TFCustomListBox.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; @@ -111,14 +111,14 @@ begin ScrollingSupport := TScrollingSupport.Create(Self); ScrollingSupport.HorzScrollBar.OnScroll := @ScrollingSupport.DefHorzScrollHandler; - ScrollingSupport.VertScrollBar.OnScroll := + ScrollingSupport.VerTFScrollBar.OnScroll := @ScrollingSupport.DefVertScrollHandler; - Items := TListBoxStrings.Create(Self); + Items := TFListBoxStrings.Create(Self); FItemIndex := -1; UpdateScrollBars; end; -destructor TCustomListBox.Destroy; +destructor TFCustomListBox.Destroy; begin Items.Free; ScrollingSupport.Free; @@ -128,7 +128,7 @@ end; // protected methods -procedure TCustomListBox.Paint(Canvas: TFCanvas); +procedure TFCustomListBox.Paint(Canvas: TFCanvas); var i, StartIndex, EndIndex: Integer; ItemRect: TRect; @@ -144,7 +144,7 @@ begin Canvas.FillRect(ScrollingSupport.ClientRect); Style.SetUIColor(Canvas, clWindowText); - with ScrollingSupport.VertScrollBar do + with ScrollingSupport.VerTFScrollBar do begin StartIndex := Position div ItemHeight; EndIndex := (Position + PageSize) div ItemHeight; @@ -187,7 +187,7 @@ begin end; end; -function TCustomListBox.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomListBox.ProcessEvent(Event: TEventObj): Boolean; begin if Event.InheritsFrom(TMousePressedEventObj) then Result := ScrollingSupport.ProcessEvent(Event) or @@ -206,27 +206,27 @@ begin inherited ProcessEvent(Event); end; -function TCustomListBox.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomListBox.DistributeEvent(Event: TEventObj): Boolean; begin Result := ScrollingSupport.DistributeEvent(Event) or inherited DistributeEvent(Event); end; -procedure TCustomListBox.CalcSizes; +procedure TFCustomListBox.CalcSizes; begin ScrollingSupport.CalcSizes; ItemHeight := FindForm.Wnd.Canvas.FontCellHeight; - ScrollingSupport.VertScrollBar.SmallChange := ItemHeight; + ScrollingSupport.VerTFScrollBar.SmallChange := ItemHeight; RecalcWidth; end; -procedure TCustomListBox.Resized; +procedure TFCustomListBox.Resized; begin ScrollingSupport.Resized; UpdateScrollBars; end; -procedure TCustomListBox.RecalcWidth; +procedure TFCustomListBox.RecalcWidth; var i, ItemWidth: Integer; begin @@ -243,13 +243,13 @@ begin UpdateScrollBars; end; -procedure TCustomListBox.UpdateScrollBars; +procedure TFCustomListBox.UpdateScrollBars; begin ScrollingSupport.SetVirtualSize( Size(FMaxItemWidth, Items.Count * ItemHeight - 1)); end; -procedure TCustomListBox.RedrawItem(AIndex: Integer); +procedure TFCustomListBox.RedrawItem(AIndex: Integer); var ItemRect: TRect; begin @@ -257,7 +257,7 @@ begin exit; //==> ItemRect := ScrollingSupport.ClientRect; Inc(ItemRect.Top, AIndex * ItemHeight - - ScrollingSupport.VertScrollBar.Position); + ScrollingSupport.VerTFScrollBar.Position); if (ItemRect.Top > ScrollingSupport.ClientRect.Bottom) or (ItemRect.Top + ItemHeight <= ScrollingSupport.ClientRect.Top) then exit; @@ -269,7 +269,7 @@ end; // private methods -function TCustomListBox.EvMousePressed(Event: TMousePressedEventObj): Boolean; +function TFCustomListBox.EvMousePressed(Event: TMousePressedEventObj): Boolean; begin if HotTrack then Result := False @@ -279,7 +279,7 @@ begin Result := False; end; -function TCustomListBox.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; +function TFCustomListBox.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; begin if HotTrack and (Event.Button = mbLeft) then Result := ProcessMouseEvent(Event) @@ -287,7 +287,7 @@ begin Result := False; end; -function TCustomListBox.EvMouseMoved(Event: TMouseMoveEventObj): Boolean; +function TFCustomListBox.EvMouseMoved(Event: TMouseMoveEventObj): Boolean; begin if HotTrack then Result := ProcessMouseEvent(Event) @@ -295,7 +295,7 @@ begin Result := False; end; -function TCustomListBox.ProcessMouseEvent(Event: TMouseEventObj): Boolean; +function TFCustomListBox.ProcessMouseEvent(Event: TMouseEventObj): Boolean; var Index: Integer; begin @@ -306,7 +306,7 @@ begin end; Index := (Event.Position.y - ScrollingSupport.ClientRect.Top + - ScrollingSupport.VertScrollBar.Position) div ItemHeight; + ScrollingSupport.VerTFScrollBar.Position) div ItemHeight; if (Index >= 0) and (Index < Items.Count) and ((Index <> ItemIndex) or (HotTrack and Event.InheritsFrom(TMouseReleasedEventObj))) then begin diff --git a/gui/fpguimenus.inc b/gui/fpguimenus.inc index 8024a161..7a59f318 100644 --- a/gui/fpguimenus.inc +++ b/gui/fpguimenus.inc @@ -22,17 +22,17 @@ {$IFDEF read_interface} - TPopupMenu = class; - TMenuBar = class; + TFPopupMenu = class; + TFMenuBar = class; - { TMenuItem } + { TFMenuItem } - TMenuItem = class(TCustomPanel) + TFMenuItem = class(TFCustomPanel) private FHotKeyDef: string; FSeparator: boolean; - FSubMenu: TPopupMenu; - function GetSubMenu: TPopupMenu; + FSubMenu: TFPopupMenu; + function GetSubMenu: TFPopupMenu; procedure InternalShowPopupMenu; protected procedure Paint(Canvas: TFCanvas); override; @@ -41,7 +41,7 @@ public constructor Create(const pText: string; pOwner: TComponent); overload; destructor Destroy; override; - property SubMenu: TPopupMenu read GetSubMenu; + property SubMenu: TFPopupMenu read GetSubMenu; published property Separator: boolean read FSeparator write FSeparator; property HotKeyDef: string read FHotKeyDef write FHotKeyDef; @@ -51,28 +51,28 @@ end; - { TPopupMenu } + { TFPopupMenu } - TPopupMenu = class(TPopupWindow) + TFPopupMenu = class(TFPopupWindow) private - FMenu: TMenuBar; + FMenu: TFMenuBar; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; - function AddMenu(const pTitle: string): TMenuItem; - function AddMenu(const pTitle: string; const pHotKeyDef: string; pHandlerProc: TNotifyEvent): TMenuItem; + function AddMenu(const pTitle: string): TFMenuItem; + function AddMenu(const pTitle: string; const pHotKeyDef: string; pHandlerProc: TNotifyEvent): TFMenuItem; end; - { TMenuBar } + { TFMenuBar } - TMenuBar = class(TCustomBoxLayout) + TFMenuBar = class(TFCustomBoxLayout) private protected public constructor Create(AOwner: TComponent); override; - function AddMenu(const pTitle: string): TMenuItem; - function AddMenu(const pTitle: string; const pHotKeyDef: string; pHandlerProc: TNotifyEvent): TMenuItem; + function AddMenu(const pTitle: string): TFMenuItem; + function AddMenu(const pTitle: string; const pHotKeyDef: string; pHandlerProc: TNotifyEvent): TFMenuItem; published end; @@ -82,16 +82,16 @@ {$IFDEF read_implementation} -{ TMenuItem } +{ TFMenuItem } -function TMenuItem.GetSubMenu: TPopupMenu; +function TFMenuItem.GetSubMenu: TFPopupMenu; begin if not Assigned(FSubMenu) then - FSubMenu := TPopupMenu.Create(self); + FSubMenu := TFPopupMenu.Create(self); Result := FSubMenu; end; -procedure TMenuItem.InternalShowPopupMenu; +procedure TFMenuItem.InternalShowPopupMenu; begin if Assigned(FSubMenu) and FSubMenu.Visible then begin @@ -101,7 +101,7 @@ begin if not Assigned(FSubMenu) then begin - FSubMenu := TPopupMenu.Create(Self); + FSubMenu := TFPopupMenu.Create(Self); end; FSubMenu.SetPosition(ClientToScreen(Point(0, Height))); @@ -109,7 +109,7 @@ begin FSubMenu.Wnd.SetMinMaxClientSize(MaxSize, MaxSize); end; -procedure TMenuItem.Paint(Canvas: TFCanvas); +procedure TFMenuItem.Paint(Canvas: TFCanvas); begin if (wsClicked in WidgetState) or (wsMouseInside in WidgetState) then FBevelStyle := bsRaised @@ -121,7 +121,7 @@ begin inherited Paint(Canvas); end; -function TMenuItem.ProcessEvent(Event: TEventObj): Boolean; +function TFMenuItem.ProcessEvent(Event: TEventObj): Boolean; begin {$IFDEF DEBUG} if Event.InheritsFrom(TMouseEnterEventObj) then @@ -146,7 +146,7 @@ begin result := inherited ProcessEvent(Event); end; -procedure TMenuItem.Click; +procedure TFMenuItem.Click; begin if (wsMouseInside in WidgetState) and Assigned(FSubMenu) then begin @@ -155,27 +155,27 @@ begin else inherited Click; - if FindForm is TPopupMenu then - TPopupMenu(FindForm).Close; + if FindForm is TFPopupMenu then + TFPopupMenu(FindForm).Close; end; -constructor TMenuItem.Create(const pText: string; pOwner: TComponent); +constructor TFMenuItem.Create(const pText: string; pOwner: TComponent); begin inherited Create(pText, pOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; FBevelStyle := bsPlain; end; -destructor TMenuItem.Destroy; +destructor TFMenuItem.Destroy; begin if Assigned(FSubMenu) then FSubMenu.Free; inherited Destroy; end; -{ TPopupMenu } +{ TFPopupMenu } -constructor TPopupMenu.Create(AOwner: TComponent); +constructor TFPopupMenu.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; @@ -183,33 +183,33 @@ begin Color := clBlack; Name := '#MenuPopup'; - FMenu := TMenuBar.Create(self); + FMenu := TFMenuBar.Create(self); FMenu.Name := '#VBoxMenu'; FMenu.Orientation := Vertical; FMenu.Spacing := 0; InsertChild(FMenu); end; -destructor TPopupMenu.Destroy; +destructor TFPopupMenu.Destroy; begin FMenu.Free; inherited Destroy; end; -function TPopupMenu.AddMenu(const pTitle: string): TMenuItem; +function TFPopupMenu.AddMenu(const pTitle: string): TFMenuItem; begin Result := FMenu.AddMenu(pTitle); end; -function TPopupMenu.AddMenu(const pTitle: string; const pHotKeyDef: string; - pHandlerProc: TNotifyEvent): TMenuItem; +function TFPopupMenu.AddMenu(const pTitle: string; const pHotKeyDef: string; + pHandlerProc: TNotifyEvent): TFMenuItem; begin Result := FMenu.AddMenu(pTitle, photKeyDef, pHandlerProc); end; -{ TMenuBar } +{ TFMenuBar } -constructor TMenuBar.Create(AOwner: TComponent); +constructor TFMenuBar.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; @@ -217,15 +217,15 @@ begin Spacing := 0; end; -function TMenuBar.AddMenu(const pTitle: string): TMenuItem; +function TFMenuBar.AddMenu(const pTitle: string): TFMenuItem; begin - Result := TMenuItem.Create(pTitle, self); + Result := TFMenuItem.Create(pTitle, self); InsertChild(Result); end; -function TMenuBar.AddMenu(const pTitle: string; const pHotKeyDef: string; - pHandlerProc: TNotifyEvent): TMenuItem; +function TFMenuBar.AddMenu(const pTitle: string; const pHotKeyDef: string; + pHandlerProc: TNotifyEvent): TFMenuItem; begin Result := AddMenu(pTitle); if pTitle <> '-' then diff --git a/gui/fpguipackage.lpk b/gui/fpguipackage.lpk index 9c2d3bd7..36dd8cf8 100644 --- a/gui/fpguipackage.lpk +++ b/gui/fpguipackage.lpk @@ -1,12 +1,14 @@ <?xml version="1.0"?> <CONFIG> <Package Version="2"> + <PathDelim Value="\"/> <Name Value="fpguipackage"/> <Author Value="Graeme Geldenhuys"/> <CompilerOptions> <Version Value="5"/> + <PathDelim Value="\"/> <SearchPaths> - <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> + <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/> </SearchPaths> <Parsing> <SyntaxOptions> @@ -30,7 +32,7 @@ <Files Count="5"> <Item1> <Filename Value="stylemanager.pas"/> - <UnitName Value="stylemanager"/> + <UnitName Value="StyleManager"/> </Item1> <Item2> <Filename Value="fpgui.pas"/> @@ -49,7 +51,7 @@ <UnitName Value="OpenSoftStyle"/> </Item5> </Files> - <LazDoc Paths="../docs/xml/gui/"/> + <LazDoc Paths="..\docs\xml\gui\"/> <RequiredPkgs Count="2"> <Item1> <PackageName Value="fpgfxpackage"/> @@ -61,10 +63,11 @@ </Item2> </RequiredPkgs> <UsageOptions> - <UnitPath Value="$(PkgOutDir)/"/> + <UnitPath Value="$(PkgOutDir)\"/> </UsageOptions> <PublishOptions> <Version Value="2"/> + <DestinationDirectory Value="$(TestDir)\publishedpackage\"/> <IgnoreBinaries Value="False"/> </PublishOptions> </Package> diff --git a/gui/fpguipanel.inc b/gui/fpguipanel.inc index 99015c7d..3d77e891 100644 --- a/gui/fpguipanel.inc +++ b/gui/fpguipanel.inc @@ -23,7 +23,7 @@ {$IFDEF read_interface} - TCustomPanel = class(TBinWidget) + TFCustomPanel = class(TFBinWidget) private FBevelStyle: TBevelStyle; procedure SetBevelStyle(const AValue: TBevelStyle); @@ -38,7 +38,7 @@ end; - TPanel = class(TCustomPanel) + TFPanel = class(TFCustomPanel) published property CanExpandWidth; property CanExpandHeight; @@ -53,14 +53,14 @@ {$IFDEF read_implementation} -procedure TCustomPanel.SetBevelStyle(const AValue: TBevelStyle); +procedure TFCustomPanel.SetBevelStyle(const AValue: TBevelStyle); begin if FBevelStyle = AValue then exit; FBevelStyle := AValue; Redraw; end; -procedure TCustomPanel.Paint(Canvas: TFCanvas); +procedure TFCustomPanel.Paint(Canvas: TFCanvas); var Pt: TPoint; begin @@ -76,7 +76,7 @@ begin end; end; -procedure TCustomPanel.CalcSizes; +procedure TFCustomPanel.CalcSizes; var Borders: TRect; LabelWidth: Integer; @@ -98,7 +98,7 @@ begin end; end; -procedure TCustomPanel.Resized; +procedure TFCustomPanel.Resized; var LabelWidth: Integer; Borders: TRect; @@ -112,7 +112,7 @@ begin end; end; -constructor TCustomPanel.Create(const pText: string; pOwner: TComponent); +constructor TFCustomPanel.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); FCanExpandWidth := True; diff --git a/gui/fpguipopupwindow.inc b/gui/fpguipopupwindow.inc index 324316d8..9b735c2d 100644 --- a/gui/fpguipopupwindow.inc +++ b/gui/fpguipopupwindow.inc @@ -18,7 +18,7 @@ {$IFDEF read_interface} - TPopupWindow = class(TCustomForm) + TFPopupWindow = class(TFCustomForm) public constructor Create(AOwner: TComponent); override; procedure Show; override; @@ -31,7 +31,7 @@ {$IFDEF read_implementation} -constructor TPopupWindow.Create(AOwner: TComponent); +constructor TFPopupWindow.Create(AOwner: TComponent); begin inherited Create(AOwner); FParent := nil; @@ -39,15 +39,15 @@ begin end; -procedure TPopupWindow.Show; +procedure TFPopupWindow.Show; begin inherited Show; - LAYOUTTRACE('TPopupWindow.Show for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFPopupWindow.Show for %s:%s', [Name, ClassName]); Wnd.CaptureMouse; end; -procedure TPopupWindow.Close; +procedure TFPopupWindow.Close; begin Wnd.ReleaseMouse; inherited Close; diff --git a/gui/fpguiprogressbar.inc b/gui/fpguiprogressbar.inc index 19a4de34..3bdc91f3 100644 --- a/gui/fpguiprogressbar.inc +++ b/gui/fpguiprogressbar.inc @@ -24,7 +24,7 @@ { TCustomProgressBar } - TCustomProgressBar = class(TCustomPanel) + TFCustomProgressBar = class(TFCustomPanel) private FFillColor: TColor; FMax: integer; @@ -48,7 +48,7 @@ end; - TProgressBar = class(TCustomProgressBar) + TFProgressBar = class(TFCustomProgressBar) published property CanExpandWidth; property CanExpandHeight; @@ -67,14 +67,14 @@ {$IFDEF read_implementation} -procedure TCustomProgressBar.SetFillColor(const AValue: TColor); +procedure TFCustomProgressBar.SetFillColor(const AValue: TColor); begin if FFillColor = AValue then exit; FFillColor := AValue; Redraw; end; -procedure TCustomProgressBar.SetMax(const AValue: integer); +procedure TFCustomProgressBar.SetMax(const AValue: integer); begin if FMax = AValue then exit; FMax := AValue; @@ -83,7 +83,7 @@ begin Redraw; end; -procedure TCustomProgressBar.SetMin(const AValue: integer); +procedure TFCustomProgressBar.SetMin(const AValue: integer); begin if FMin = AValue then exit; FMin := AValue; @@ -92,7 +92,7 @@ begin Redraw; end; -procedure TCustomProgressBar.SetPosition(const AValue: integer); +procedure TFCustomProgressBar.SetPosition(const AValue: integer); begin if FPosition = AValue then exit; //==> @@ -103,7 +103,7 @@ begin end; end; -procedure TCustomProgressBar.SetShowPercentage(const AValue: Boolean); +procedure TFCustomProgressBar.SetShowPercentage(const AValue: Boolean); begin if FShowPercentage = AValue then Exit; //==> @@ -111,7 +111,7 @@ begin Redraw; end; -procedure TCustomProgressBar.Paint(Canvas: TFCanvas); +procedure TFCustomProgressBar.Paint(Canvas: TFCanvas); var Pt: TPoint; r: TRect; @@ -143,7 +143,7 @@ begin end; end; -constructor TCustomProgressBar.Create(const pText: string; pOwner: TComponent); +constructor TFCustomProgressBar.Create(const pText: string; pOwner: TComponent); begin inherited Create(pText, pOwner); FCanExpandHeight := False; diff --git a/gui/fpguiradiobutton.inc b/gui/fpguiradiobutton.inc index 5d452181..60ca6f71 100644 --- a/gui/fpguiradiobutton.inc +++ b/gui/fpguiradiobutton.inc @@ -18,9 +18,9 @@ {$IFDEF read_interface} - { TCustomRadioButton } + { TFCustomRadioButton } - TCustomRadioButton = class(TWidget) + TFCustomRadioButton = class(TFWidget) private procedure SetChecked(AChecked: Boolean); protected @@ -36,7 +36,7 @@ end; - TRadioButton = class(TCustomRadioButton) + TRadioButton = class(TFCustomRadioButton) published property CanExpandWidth; property CanExpandHeight; @@ -54,24 +54,24 @@ // =================================================================== -// TCustomRadioButton +// TFCustomRadioButton // =================================================================== -constructor TCustomRadioButton.Create(AOwner: TComponent); +constructor TFCustomRadioButton.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable]; end; -constructor TCustomRadioButton.Create(const pText: string; pOwner: TComponent); +constructor TFCustomRadioButton.Create(const pText: string; pOwner: TComponent); begin Create(pOwner); Text := pText; end; -procedure TCustomRadioButton.Click; +procedure TFCustomRadioButton.Click; begin if not Checked then SetChecked(True); @@ -79,11 +79,11 @@ begin end; -procedure TCustomRadioButton.Paint(Canvas: TFCanvas); +procedure TFCustomRadioButton.Paint(Canvas: TFCanvas); var FontHeight: Integer; LabelRect: TRect; - Flags: TCheckboxFlags; + Flags: TFCheckboxFlags; begin FontHeight := Canvas.FontCellHeight; LabelRect.Left := FLabelPos.x; @@ -106,17 +106,17 @@ begin Style.DrawText(Canvas, LabelRect.TopLeft, Text, WidgetState); end; -procedure TCustomRadioButton.CalcSizes; +procedure TFCustomRadioButton.CalcSizes; begin with FindForm.Wnd.Canvas do Style.GetRadioButtonLayout(gfxbase.Size(TextWidth(Text), FontCellHeight), FMinSize, FLabelPos); end; -procedure TCustomRadioButton.SetChecked(AChecked: Boolean); +procedure TFCustomRadioButton.SetChecked(AChecked: Boolean); var i: Integer; - Child: TWidget; + Child: TFWidget; begin if AChecked <> Checked then begin @@ -124,12 +124,12 @@ begin Redraw; if Checked and Assigned(Parent) and - Parent.InheritsFrom(TContainerWidget) then - for i := 0 to TContainerWidget(Parent).ChildCount - 1 do + Parent.InheritsFrom(TFContainerWidget) then + for i := 0 to TFContainerWidget(Parent).ChildCount - 1 do begin - Child := TContainerWidget(Parent).Children[i]; - if (Child <> Self) and Child.InheritsFrom(TCustomRadioButton) then - TCustomRadioButton(Child).Checked := False; + Child := TFContainerWidget(Parent).Children[i]; + if (Child <> Self) and Child.InheritsFrom(TFCustomRadioButton) then + TFCustomRadioButton(Child).Checked := False; end; end; end; diff --git a/gui/fpguiscrollbar.inc b/gui/fpguiscrollbar.inc index c6a128d8..38b55384 100644 --- a/gui/fpguiscrollbar.inc +++ b/gui/fpguiscrollbar.inc @@ -22,7 +22,7 @@ TScrollEvent = procedure(Sender: TObject; var APosition: Integer) of object; - TCustomScrollBar = class(TWidget) + TFCustomScrollBar = class(TFWidget) private FOrientation: TOrientation; FMin: Integer; @@ -33,9 +33,9 @@ FLargeChange: Integer; FOnChange: TNotifyEvent; FOnScroll: TScrollEvent; - ButtonUp: TGenericButton; - ButtonDown: TGenericButton; - Slider: TWidget; + ButtonUp: TFGenericButton; + ButtonDown: TFGenericButton; + Slider: TFWidget; Embedded: Boolean; // for internal embedded usage! // Event handling @@ -48,7 +48,7 @@ procedure SetPageSize(APageSize: Integer); procedure SetPosition(APosition: Integer); // Helpers - function GetButtonSize: Integer; + function GeTFButtonSize: Integer; function ClipPosition(APosition: Integer): Integer; procedure UpdateBar; protected @@ -74,7 +74,7 @@ end; - TScrollBar = class(TCustomScrollBar) + TFScrollBar = class(TFCustomScrollBar) published property Enabled; property Orientation; @@ -98,16 +98,16 @@ // =================================================================== -// TCustomScrollBar and helper classes +// TFCustomScrollBar and helper classes // =================================================================== // ------------------------------------------------------------------- -// TScrollBarButton +// TFScrollBarButton // ------------------------------------------------------------------- type { Private button type only used for scrollbars. } - TScrollBarButton = class(TGenericButton) + TFScrollBarButton = class(TFGenericButton) protected procedure Paint(Canvas: TFCanvas); override; procedure CalcSizes; override; @@ -116,7 +116,7 @@ type end; -procedure TScrollBarButton.Paint(Canvas: TFCanvas); +procedure TFScrollBarButton.Paint(Canvas: TFCanvas); begin inherited Paint(Canvas); Style.DrawScrollBarButton(Canvas, Rect(0, 0, BoundsSize.cx, BoundsSize.cy), @@ -125,19 +125,19 @@ begin end; -procedure TScrollBarButton.CalcSizes; +procedure TFScrollBarButton.CalcSizes; begin - ASSERT(Owner is TCustomScrollBar); - FMinSize := Style.GetScrollBarBtnSize(TCustomScrollBar(Owner).Orientation); + ASSERT(Owner is TFCustomScrollBar); + FMinSize := Style.GeTFScrollBarBtnSize(TFCustomScrollBar(Owner).Orientation); end; // ------------------------------------------------------------------- -// TScrollBarSlider +// TFScrollBarSlider // ------------------------------------------------------------------- type - TScrollBarSlider = class(TWidget) + TFScrollBarSlider = class(TFWidget) private function EvMousePressed(Event: TMousePressedEventObj): Boolean; function EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; @@ -149,7 +149,7 @@ type PrevAreaPressed: Boolean; NextAreaPressed: Boolean; DragStartMousePos: Integer; - DragStartButtonPos: Integer; + DragStarTFButtonPos: Integer; // ButtonMoveSavedPosition: Integer; procedure Paint(Canvas: TFCanvas); override; function ProcessEvent(Event: TEventObj): Boolean; override; @@ -161,21 +161,21 @@ type end; -constructor TScrollBarSlider.Create(AOwner: TComponent); +constructor TFScrollBarSlider.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsCaptureMouse, wsClickable, wsOpaque]; end; -procedure TScrollBarSlider.UpdateBar; +procedure TFScrollBarSlider.UpdateBar; var Size: Integer; begin - ASSERT(Owner is TCustomScrollBar); + ASSERT(Owner is TFCustomScrollBar); if Visible then begin - with TCustomScrollBar(Owner) do + with TFCustomScrollBar(Owner) do begin if (Min = Max) or (Max - Min = PageSize - 1) then ButtonPos := 0 @@ -192,23 +192,23 @@ begin ButtonPos := (Position - Min) * (Size - ButtonSize) div (Max - Min - PageSize + 1); end; - ButtonSize := GetButtonSize; + ButtonSize := GeTFButtonSize; end; Redraw; end; end; -procedure TScrollBarSlider.Paint(Canvas: TFCanvas); +procedure TFScrollBarSlider.Paint(Canvas: TFCanvas); var Size: Integer; r: TRect; StartPos, EndPos: PInteger; Color2: TColor; begin - ASSERT(Owner is TCustomScrollBar); + ASSERT(Owner is TFCustomScrollBar); inherited Paint(Canvas); - if TCustomScrollBar(Owner).Orientation = Horizontal then + if TFCustomScrollBar(Owner).Orientation = Horizontal then begin r.Top := 0; r.Bottom := Height; @@ -254,7 +254,7 @@ begin Style.DrawButtonFace(Canvas, r, [btnIsEmbedded]); end; -function TScrollBarSlider.ProcessEvent(Event: TEventObj): Boolean; +function TFScrollBarSlider.ProcessEvent(Event: TEventObj): Boolean; begin Result := False; if Event.InheritsFrom(TMousePressedEventObj) then @@ -271,7 +271,7 @@ begin UpdateBar; end; -function TScrollBarSlider.EvMousePressed(Event: TMousePressedEventObj): Boolean; +function TFScrollBarSlider.EvMousePressed(Event: TMousePressedEventObj): Boolean; var Pos: Integer; begin @@ -280,7 +280,7 @@ begin if Event.Button <> mbLeft then exit; - if TCustomScrollBar(Owner).Orientation = Horizontal then + if TFCustomScrollBar(Owner).Orientation = Horizontal then Pos := Event.Position.x else Pos := Event.Position.y; @@ -288,24 +288,24 @@ begin if Pos < ButtonPos then begin PrevAreaPressed := True; - TCustomScrollBar(Owner).PageUp + TFCustomScrollBar(Owner).PageUp end else if Pos > ButtonPos + ButtonSize then begin NextAreaPressed := True; - TCustomScrollBar(Owner).PageDown + TFCustomScrollBar(Owner).PageDown end else begin IsDraggingButton := True; DragStartMousePos := Pos; - DragStartButtonPos := ButtonPos; + DragStarTFButtonPos := ButtonPos; end; Result := True; end; -function TScrollBarSlider.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; +function TFScrollBarSlider.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; var NewPosition: Integer; begin @@ -318,15 +318,15 @@ begin begin IsDraggingButton := False; NewPosition := CalcPosition; - if NewPosition <> TCustomScrollBar(Owner).Position then + if NewPosition <> TFCustomScrollBar(Owner).Position then begin - if Assigned(TCustomScrollBar(Owner).OnScroll) then - TCustomScrollBar(Owner).OnScroll(Owner, NewPosition); - TCustomScrollBar(Owner).FPosition := NewPosition; + if Assigned(TFCustomScrollBar(Owner).OnScroll) then + TFCustomScrollBar(Owner).OnScroll(Owner, NewPosition); + TFCustomScrollBar(Owner).FPosition := NewPosition; end; if (NewPosition <> DragStartMousePos) and - Assigned(TCustomScrollBar(Owner).OnChange) then - TCustomScrollBar(Owner).OnChange(Self); + Assigned(TFCustomScrollBar(Owner).OnChange) then + TFCustomScrollBar(Owner).OnChange(Self); UpdateBar; end else if PrevAreaPressed then @@ -342,7 +342,7 @@ begin Result := True; end; -function TScrollBarSlider.EvMouseMove(Event: TMouseMoveEventObj): Boolean; +function TFScrollBarSlider.EvMouseMove(Event: TMouseMoveEventObj): Boolean; var Pos, Size, VirtualPos: Integer; begin @@ -350,7 +350,7 @@ begin begin if wsMouseInside in WidgetState then begin - if TCustomScrollBar(Owner).Orientation = Horizontal then + if TFCustomScrollBar(Owner).Orientation = Horizontal then begin Pos := Event.Position.x; Size := Width; @@ -363,21 +363,21 @@ begin else begin Pos := DragStartMousePos; - if TCustomScrollBar(Owner).Orientation = Horizontal then + if TFCustomScrollBar(Owner).Orientation = Horizontal then Size := Width else Size := Height; end; { if/else } - ButtonPos := ClipMinMax(DragStartButtonPos + Pos - DragStartMousePos, + ButtonPos := ClipMinMax(DragStarTFButtonPos + Pos - DragStartMousePos, 0, Size - ButtonSize); VirtualPos := CalcPosition; - if VirtualPos <> TCustomScrollBar(Owner).Position then + if VirtualPos <> TFCustomScrollBar(Owner).Position then begin - if Assigned(TCustomScrollBar(Owner).OnScroll) then - TCustomScrollBar(Owner).OnScroll(Owner, VirtualPos); - TCustomScrollBar(Owner).FPosition := VirtualPos; + if Assigned(TFCustomScrollBar(Owner).OnScroll) then + TFCustomScrollBar(Owner).OnScroll(Owner, VirtualPos); + TFCustomScrollBar(Owner).FPosition := VirtualPos; end; Redraw; @@ -386,21 +386,21 @@ begin Result := False; end; -procedure TScrollBarSlider.CalcSizes; +procedure TFScrollBarSlider.CalcSizes; begin - if TCustomScrollBar(Owner).Orientation = Horizontal then - FDefSize.cx := Style.GetScrollBarBtnSize(Horizontal).cy * 5 + if TFCustomScrollBar(Owner).Orientation = Horizontal then + FDefSize.cx := Style.GeTFScrollBarBtnSize(Horizontal).cy * 5 else - FDefSize.cy := Style.GetScrollBarBtnSize(Vertical).cx * 5; + FDefSize.cy := Style.GeTFScrollBarBtnSize(Vertical).cx * 5; end; -function TScrollBarSlider.CalcPosition: Integer; +function TFScrollBarSlider.CalcPosition: Integer; var Size: Integer; - lOwner: TCustomScrollBar; + lOwner: TFCustomScrollBar; begin - Assert(Owner is TCustomScrollBar); - lOwner := TCustomScrollBar(Owner); + Assert(Owner is TFCustomScrollBar); + lOwner := TFCustomScrollBar(Owner); if lOwner.Orientation = Horizontal then Size := Width @@ -423,10 +423,10 @@ end; // ------------------------------------------------------------------- -// TCustomScrollBar +// TFCustomScrollBar // ------------------------------------------------------------------- -constructor TCustomScrollBar.Create(AOwner: TComponent); +constructor TFCustomScrollBar.Create(AOwner: TComponent); begin inherited Create(AOwner); Include(WidgetStyle, wsOpaque); @@ -435,22 +435,22 @@ begin FMax := 100; FSmallChange := 1; - ButtonUp := TScrollBarButton.Create(Self); + ButtonUp := TFScrollBarButton.Create(Self); ButtonUp.Name := '#ScrollBarButtonUp'; - TScrollBarButton(ButtonUp).Direction := arrowLeft; + TFScrollBarButton(ButtonUp).Direction := arrowLeft; ButtonUp.Embedded := True; ButtonUp.CanExpandWidth := False; ButtonUp.CanExpandHeight := False; ButtonUp.OnClick := @ButtonUpClick; ButtonUp.SetEmbeddedParent(Self); - Slider := TScrollBarSlider.Create(Self); + Slider := TFScrollBarSlider.Create(Self); Slider.Name := '#ScrollBarSlider'; Slider.SetEmbeddedParent(Self); - ButtonDown := TScrollBarButton.Create(Self); + ButtonDown := TFScrollBarButton.Create(Self); ButtonDown.Name := '#ScrollBarButtonDown'; - TScrollBarButton(ButtonDown).Direction := arrowRight; + TFScrollBarButton(ButtonDown).Direction := arrowRight; ButtonDown.Embedded := True; ButtonDown.CanExpandWidth := False; ButtonDown.CanExpandHeight := False; @@ -458,17 +458,17 @@ begin ButtonDown.SetEmbeddedParent(Self); end; -procedure TCustomScrollBar.LineUp; +procedure TFCustomScrollBar.LineUp; begin Position := Position - SmallChange; end; -procedure TCustomScrollBar.LineDown; +procedure TFCustomScrollBar.LineDown; begin Position := Position + SmallChange; end; -procedure TCustomScrollBar.PageUp; +procedure TFCustomScrollBar.PageUp; var Diff: Integer; begin @@ -483,7 +483,7 @@ begin end; -procedure TCustomScrollBar.PageDown; +procedure TFCustomScrollBar.PageDown; var Diff: Integer; begin @@ -498,21 +498,21 @@ begin end; -function TCustomScrollBar.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomScrollBar.DistributeEvent(Event: TEventObj): Boolean; begin Result := Event.SendToChild(Slider) or Event.SendToChild(ButtonUp) or Event.SendToChild(ButtonDown); end; -procedure TCustomScrollBar.Paint(Canvas: TFCanvas); +procedure TFCustomScrollBar.Paint(Canvas: TFCanvas); begin if not Embedded then Style.DrawScrollBarBorder(Canvas, Rect(0, 0, Width, Height)); end; -procedure TCustomScrollBar.CalcSizes; +procedure TFCustomScrollBar.CalcSizes; begin if Orientation = Horizontal then begin @@ -533,7 +533,7 @@ begin end; if not Embedded then - with Style.GetScrollBarBorders(Orientation) do + with Style.GeTFScrollBarBorders(Orientation) do begin Inc(FMinSize.cx, Left + Right); Inc(FMinSize.cy, Top + Bottom); @@ -545,12 +545,12 @@ begin end; -procedure TCustomScrollBar.Resized; +procedure TFCustomScrollBar.Resized; var r: TRect; begin if not Embedded then - with Style.GetScrollBarBorders(Orientation) do + with Style.GeTFScrollBarBorders(Orientation) do begin r.Left := Left; r.Top := Top; @@ -589,37 +589,37 @@ begin end; -procedure TCustomScrollBar.ButtonUpClick(Sender: TObject); +procedure TFCustomScrollBar.ButtonUpClick(Sender: TObject); begin LineUp; end; -procedure TCustomScrollBar.ButtonDownClick(Sender: TObject); +procedure TFCustomScrollBar.ButtonDownClick(Sender: TObject); begin LineDown; end; -procedure TCustomScrollBar.SetOrientation(AOrientation: TOrientation); +procedure TFCustomScrollBar.SetOrientation(AOrientation: TOrientation); begin if AOrientation <> Orientation then begin FOrientation := AOrientation; if Orientation = Horizontal then begin - TScrollBarButton(ButtonUp).Direction := arrowLeft; - TScrollBarButton(ButtonDown).Direction := arrowRight; + TFScrollBarButton(ButtonUp).Direction := arrowLeft; + TFScrollBarButton(ButtonDown).Direction := arrowRight; end else begin - TScrollBarButton(ButtonUp).Direction := arrowUp; - TScrollBarButton(ButtonDown).Direction := arrowDown; + TFScrollBarButton(ButtonUp).Direction := arrowUp; + TFScrollBarButton(ButtonDown).Direction := arrowDown; end; end; end; -procedure TCustomScrollBar.SetMin(AMin: Integer); +procedure TFCustomScrollBar.SetMin(AMin: Integer); begin if AMin <> FMin then begin @@ -630,7 +630,7 @@ begin end; -procedure TCustomScrollBar.SetMax(AMax: Integer); +procedure TFCustomScrollBar.SetMax(AMax: Integer); begin if AMax <> FMax then begin @@ -641,7 +641,7 @@ begin end; -procedure TCustomScrollBar.SetPageSize(APageSize: Integer); +procedure TFCustomScrollBar.SetPageSize(APageSize: Integer); begin if FPageSize <> APageSize then begin @@ -652,7 +652,7 @@ begin end; -procedure TCustomScrollBar.SetPosition(APosition: Integer); +procedure TFCustomScrollBar.SetPosition(APosition: Integer); begin APosition := ClipPosition(APosition); @@ -669,7 +669,7 @@ begin end; -function TCustomScrollBar.GetButtonSize: Integer; +function TFCustomScrollBar.GeTFButtonSize: Integer; var Size: Integer; begin @@ -684,7 +684,7 @@ begin Size := Slider.Width else Size := Slider.Height; - Result := fpGUI.Max(Style.GetScrollBarBtnMinSize, + Result := fpGUI.Max(Style.GeTFScrollBarBtnMinSize, PageSize * Size div fpGUI.Max(1, Max - Min + 1)); if Result > Size then Result := Size; @@ -692,7 +692,7 @@ begin end; -function TCustomScrollBar.ClipPosition(APosition: Integer): Integer; +function TFCustomScrollBar.ClipPosition(APosition: Integer): Integer; begin if APosition > (Max - PageSize) then begin @@ -708,11 +708,11 @@ begin end; -procedure TCustomScrollBar.UpdateBar; +procedure TFCustomScrollBar.UpdateBar; begin if Embedded then Visible := (Max > Min) and ((PageSize = 0) or (PageSize <= Max - Min)); - TScrollBarSlider(Slider).UpdateBar; + TFScrollBarSlider(Slider).UpdateBar; end; diff --git a/gui/fpguiscrollbox.inc b/gui/fpguiscrollbox.inc index dc4782c9..81ce48db 100644 --- a/gui/fpguiscrollbox.inc +++ b/gui/fpguiscrollbox.inc @@ -22,19 +22,19 @@ TScrollingSupport = class private - Parent: TWidget; + Parent: TFWidget; FBorders: TRect; FClientRect: TRect; FVirtualSize: TSize; - FHorzScrollBar, FVertScrollBar: TScrollBar; + FHorzScrollBar, FVerTFScrollBar: TFScrollBar; FOnClientRectChange: TNotifyEvent; function EvMouseWheel(Event: TMouseWheelEventObj): Boolean; public - constructor Create(AParent: TWidget); + constructor Create(AParent: TFWidget); destructor Destroy; override; function ProcessEvent(Event: TEventObj): Boolean; function DistributeEvent(Event: TEventObj): Boolean; - function SendToChild(AChild: TWidget; Event: TEventObj): Boolean; + function SendToChild(AChild: TFWidget; Event: TEventObj): Boolean; procedure CalcSizes; procedure Resized; function CalcClientSize(AHorzBarVisible, AVertBarVisible: Boolean): TSize; @@ -44,13 +44,13 @@ procedure DefVertScrollHandler(Sender: TObject; var APosition: Integer); property Borders: TRect read FBorders; property ClientRect: TRect read FClientRect; - property HorzScrollBar: TScrollBar read FHorzScrollBar; - property VertScrollBar: TScrollBar read FVertScrollBar; + property HorzScrollBar: TFScrollBar read FHorzScrollBar; + property VerTFScrollBar: TFScrollBar read FVerTFScrollBar; property OnClientRectChange: TNotifyEvent read FOnClientRectChange write FOnClientRectChange; end; - TCustomScrollBox = class(TWidget) + TFCustomScrollBox = class(TFWidget) protected ScrollingSupport: TScrollingSupport; procedure Paint(Canvas: TFCanvas); override; @@ -65,7 +65,7 @@ end; - TScrollBox = class(TCustomScrollBox) + TFScrollBox = class(TFCustomScrollBox) end; {$ENDIF read_interface} @@ -78,20 +78,20 @@ // TScrollingSupport // =================================================================== -constructor TScrollingSupport.Create(AParent: TWidget); +constructor TScrollingSupport.Create(AParent: TFWidget); begin Parent := AParent; - FHorzScrollBar := TScrollBar.Create(Parent); + FHorzScrollBar := TFScrollBar.Create(Parent); HorzScrollBar.Name := '#Scrolling_HorzBar'; HorzScrollBar.Embedded := True; HorzScrollBar.SetEmbeddedParent(Parent); - FVertScrollBar := TScrollBar.Create(Parent); - VertScrollBar.Name := '#Scrolling_VertBar'; - VertScrollBar.Orientation := Vertical; - VertScrollBar.Embedded := True; - VertScrollBar.SetEmbeddedParent(Parent); + FVerTFScrollBar := TFScrollBar.Create(Parent); + VerTFScrollBar.Name := '#Scrolling_VertBar'; + VerTFScrollBar.Orientation := Vertical; + VerTFScrollBar.Embedded := True; + VerTFScrollBar.SetEmbeddedParent(Parent); end; destructor TScrollingSupport.Destroy; @@ -101,7 +101,7 @@ end; function TScrollingSupport.ProcessEvent(Event: TEventObj): Boolean; var - HorzScrollBarHeight, VertScrollBarWidth: Integer; + HorzScrollBarHeight, VerTFScrollBarWidth: Integer; Canvas: TFCanvas; begin if Event.InheritsFrom(TPaintEventObj) then @@ -111,16 +111,16 @@ begin else HorzScrollBarHeight := 0; - if VertScrollBar.Visible then - VertScrollBarWidth := VertScrollBar.MinSize.cx + if VerTFScrollBar.Visible then + VerTFScrollBarWidth := VerTFScrollBar.MinSize.cx else - VertScrollBarWidth := 0; + VerTFScrollBarWidth := 0; Canvas := TPaintEventObj(Event).Canvas; Parent.Style.DrawScrollBoxBorder(Canvas, Rect(0, 0, Parent.Width, Parent.Height)); - Parent.Style.DrawWindowBackground(Canvas, Rect(VertScrollBar.Left, - HorzScrollBar.Top, VertScrollBar.Left + VertScrollBarWidth, + Parent.Style.DrawWindowBackground(Canvas, Rect(VerTFScrollBar.Left, + HorzScrollBar.Top, VerTFScrollBar.Left + VerTFScrollBarWidth, HorzScrollBar.Top + HorzScrollBarHeight)); Result := False; end else if Event.InheritsFrom(TMouseWheelEventObj) then @@ -132,10 +132,10 @@ end; function TScrollingSupport.DistributeEvent(Event: TEventObj): Boolean; begin Result := Event.SendToChild(HorzScrollBar) or - Event.SendToChild(VertScrollBar); + Event.SendToChild(VerTFScrollBar); end; -function TScrollingSupport.SendToChild(AChild: TWidget; +function TScrollingSupport.SendToChild(AChild: TFWidget; Event: TEventObj): Boolean; var Canvas: TFCanvas; @@ -146,7 +146,7 @@ begin Canvas := TPaintEventObj(Event).Canvas; OldMatrix := Canvas.Matrix; Canvas.AppendTranslation(Point(ClientRect.Left - HorzScrollBar.Position, - ClientRect.Top - VertScrollBar.Position)); + ClientRect.Top - VerTFScrollBar.Position)); Result := Event.SendToChild(AChild); Canvas.Matrix := OldMatrix; end else if Event.InheritsFrom(TPaintEventObj) then @@ -155,7 +155,7 @@ begin Canvas.SaveState; try Canvas.AppendTranslation(Point(-HorzScrollBar.Position, - -VertScrollBar.Position)); + -VerTFScrollBar.Position)); if Canvas.IntersectClipRect(ClientRect) {and Canvas.IntersectClipRect( Rect(AChild.Left + ClientRect.Left, AChild.Top + ClientRect.Top, AChild.Left + AChild.Width + ClientRect.Left, @@ -181,16 +181,16 @@ begin FBorders := Parent.Style.GetScrollBoxBorders; with Parent, Borders do begin - FMinSize := HorzScrollBar.MinSize + VertScrollBar.MinSize + + FMinSize := HorzScrollBar.MinSize + VerTFScrollBar.MinSize + TopLeft + BottomRight; - FDefSize := HorzScrollBar.DefSize + VertScrollBar.DefSize + + FDefSize := HorzScrollBar.DefSize + VerTFScrollBar.DefSize + TopLeft + BottomRight; end; end; procedure TScrollingSupport.Resized; var - HorzScrollBarHeight, VertScrollBarWidth: Integer; + HorzScrollBarHeight, VerTFScrollBarWidth: Integer; procedure CalcScrollBarSizes; begin @@ -199,10 +199,10 @@ var else HorzScrollBarHeight := 0; - if VertScrollBar.Visible then - VertScrollBarWidth := VertScrollBar.MinSize.cx + if VerTFScrollBar.Visible then + VerTFScrollBarWidth := VerTFScrollBar.MinSize.cx else - VertScrollBarWidth := 0; + VerTFScrollBarWidth := 0; end; var @@ -211,14 +211,14 @@ var LastHorzBarVisible, LastVertBarVisible: Boolean; begin HorzBarVisible := HorzScrollBar.Visible; - VertBarVisible := VertScrollBar.Visible; + VertBarVisible := VerTFScrollBar.Visible; LastHorzBarVisible := not HorzBarVisible; if FVirtualSize <> gfxbase.Size(0, 0) then with gfxbase.Size(ClientRect) do begin HorzScrollBar.PageSize := cx; - VertScrollBar.PageSize := cy; + VerTFScrollBar.PageSize := cy; end; FBorders := Parent.Style.GetScrollBoxBorders; @@ -232,22 +232,22 @@ begin CalcScrollBarSizes; HorzScrollBar.SetBounds( Point(Left, Parent.Height - HorzScrollBar.MinSize.cy - Bottom), - gfxbase.Size(Parent.Width - VertScrollBarWidth - Left - Right, + gfxbase.Size(Parent.Width - VerTFScrollBarWidth - Left - Right, HorzScrollBar.MinSize.cy)); - VertScrollBar.SetBounds( - Point(Parent.Width - VertScrollBar.MinSize.cx - Right, Top), - gfxbase.Size(VertScrollBar.MinSize.cx, + VerTFScrollBar.SetBounds( + Point(Parent.Width - VerTFScrollBar.MinSize.cx - Right, Top), + gfxbase.Size(VerTFScrollBar.MinSize.cx, Parent.Height - HorzScrollBarHeight - Top - Bottom)); ClientRect.Left := Left; ClientRect.Top := Top; - ClientRect.Right := Parent.Width - Right - VertScrollBarWidth; + ClientRect.Right := Parent.Width - Right - VerTFScrollBarWidth; ClientRect.Bottom := Parent.Height - Bottom - HorzScrollBarHeight; if Assigned(OnClientRectChange) then OnClientRectChange(Self); HorzBarVisible := HorzScrollBar.Visible; - VertBarVisible := VertScrollBar.Visible; + VertBarVisible := VerTFScrollBar.Visible; end; end; end; @@ -258,7 +258,7 @@ begin FBorders := Parent.Style.GetScrollBoxBorders; Result := Parent.BoundsSize - Borders.TopLeft - Borders.BottomRight; if AVertBarVisible then - Dec(Result.cx, VertScrollBar.MinSize.cx); + Dec(Result.cx, VerTFScrollBar.MinSize.cx); if AHorzBarVisible then Dec(Result.cy, HorzScrollBar.MinSize.cy); end; @@ -267,13 +267,13 @@ procedure TScrollingSupport.SetVirtualSize(const ASize: TSize); begin FVirtualSize := ASize; HorzScrollBar.Max := FVirtualSize.cx; - VertScrollBar.Max := FVirtualSize.cy; + VerTFScrollBar.Max := FVirtualSize.cy; end; function TScrollingSupport.ScrollPos: TPoint; begin Result.x := HorzScrollBar.Position; - Result.y := VertScrollBar.Position; + Result.y := VerTFScrollBar.Position; end; procedure TScrollingSupport.DefHorzScrollHandler(Sender: TObject; @@ -297,7 +297,7 @@ var Delta: Integer; r: TRect; begin - Delta := VertScrollBar.Position - APosition; + Delta := VerTFScrollBar.Position - APosition; r := ClientRect; if Delta < 0 then // Scrolling downwards Dec(r.Top, Delta) @@ -316,24 +316,24 @@ begin mshift := Event.Shift * [ssShift, ssAlt, ssCtrl, ssMeta, ssSuper, ssHyper, ssAltGr]; - if not VertScrollBar.Visible then + if not VerTFScrollBar.Visible then Include(mshift, ssShift); if mshift = [] then - VertScrollBar.Position := VertScrollBar.Position + - Round(Event.WheelDelta * VertScrollBar.SmallChange) + VerTFScrollBar.Position := VerTFScrollBar.Position + + Round(Event.WheelDelta * VerTFScrollBar.SmallChange) else if mshift = [ssShift] then HorzScrollBar.Position := HorzScrollBar.Position + - Round(Event.WheelDelta * VertScrollBar.SmallChange); + Round(Event.WheelDelta * VerTFScrollBar.SmallChange); Result := True; end; // =================================================================== -// TCustomScrollBox +// TFCustomScrollBox // =================================================================== -constructor TCustomScrollBox.Create(AOwner: TComponent); +constructor TFCustomScrollBox.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := WidgetStyle + [wsClickable, wsOpaque]; @@ -342,7 +342,7 @@ begin ScrollingSupport := TScrollingSupport.Create(Self); end; -destructor TCustomScrollBox.Destroy; +destructor TFCustomScrollBox.Destroy; begin ScrollingSupport.Free; inherited Destroy; @@ -351,39 +351,39 @@ end; // Protected methods -procedure TCustomScrollBox.Paint(Canvas: TFCanvas); +procedure TFCustomScrollBox.Paint(Canvas: TFCanvas); begin Assert(Canvas = Canvas); { Style.DrawWindowBackground(Canvas, Rect(HorzScrollBar.Left, - VertScrollBar.Top, HorzScrollBar.Left + HorzScrollBar.Width, - VertScrollBar.Top + VertScrollBar.Height));} + VerTFScrollBar.Top, HorzScrollBar.Left + HorzScrollBar.Width, + VerTFScrollBar.Top + VerTFScrollBar.Height));} end; -function TCustomScrollBox.ProcessEvent(Event: TEventObj): Boolean; +function TFCustomScrollBox.ProcessEvent(Event: TEventObj): Boolean; begin Result := ScrollingSupport.ProcessEvent(Event) or inherited ProcessEvent(Event); end; -function TCustomScrollBox.DistributeEvent(Event: TEventObj): Boolean; +function TFCustomScrollBox.DistributeEvent(Event: TEventObj): Boolean; begin Result := ScrollingSupport.DistributeEvent(Event) or inherited DistributeEvent(Event); end; -procedure TCustomScrollBox.CalcSizes; +procedure TFCustomScrollBox.CalcSizes; begin ScrollingSupport.CalcSizes; end; -procedure TCustomScrollBox.Resized; +procedure TFCustomScrollBox.Resized; begin ScrollingSupport.Resized; end; { !!!: Move to TScrollingSupport as soon as this is a real event -procedure TCustomScrollBox.EvKeyPressed(Key: Word; Shift: TShiftState); +procedure TFCustomScrollBox.EvKeyPressed(Key: Word; Shift: TShiftState); var mshift: TShiftState; begin @@ -395,17 +395,17 @@ begin keyRight: HorzScrollBar.ButtonDownClick(nil); keyUp: - VertScrollBar.ButtonUpClick(nil); + VerTFScrollBar.ButtonUpClick(nil); keyDown: - VertScrollBar.ButtonDownClick(nil); + VerTFScrollBar.ButtonDownClick(nil); keyPageUp: - VertScrollBar.PageUp; + VerTFScrollBar.PageUp; keyPageDown: - VertScrollBar.PageDown; + VerTFScrollBar.PageDown; keyHome: - VertScrollBar.Position := 0; + VerTFScrollBar.Position := 0; keyEnd: - VertScrollBar.Position := VertScrollBar.Max - VertScrollBar.PageSize; + VerTFScrollBar.Position := VerTFScrollBar.Max - VerTFScrollBar.PageSize; end else if mshift = [ssShift] then case Key of diff --git a/gui/fpguiseparator.inc b/gui/fpguiseparator.inc index 74538c24..d4566801 100644 --- a/gui/fpguiseparator.inc +++ b/gui/fpguiseparator.inc @@ -18,7 +18,7 @@ {$IFDEF read_interface} - TCustomSeparator = class(TWidget) + TCustomSeparator = class(TFWidget) private procedure SetOrientation(AOrientation: TOrientation); procedure SetSpacing(ASpacing: Integer); diff --git a/gui/fpguistyle.inc b/gui/fpguistyle.inc index c3acf3dd..2f1ef8f0 100644 --- a/gui/fpguistyle.inc +++ b/gui/fpguistyle.inc @@ -40,7 +40,7 @@ function GetUIColor(AColor: TColor): TGfxColor; procedure SetUIColor(Canvas: TFCanvas; Color: TColor); // General - procedure DrawText(Canvas: TFCanvas; const APosition: TPoint; const AText: String; State: TWidgetState); virtual; abstract; + procedure DrawText(Canvas: TFCanvas; const APosition: TPoint; const AText: String; State: TFWidgetState); virtual; abstract; procedure DrawItemBefore(Canvas: TFCanvas; const ARect: TRect; Flags: TItemFlags); virtual; abstract; procedure DrawItemAfter(Canvas: TFCanvas; const ARect: TRect; Flags: TItemFlags); virtual; abstract; procedure Draw3DFrame(Canvas: TFCanvas; const ARect: TRect; Color1, Color2, Color3, Color4: TColor); virtual; abstract; @@ -50,31 +50,31 @@ // Windows procedure DrawWindowBackground(Canvas: TFCanvas; const ARect: TRect); virtual; abstract; // Buttons - procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TButtonFlags); virtual; abstract; - function GetButtonBorders: TRect; virtual; abstract; + procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TFButtonFlags); virtual; abstract; + function GeTFButtonBorders: TRect; virtual; abstract; // Separators function GetSeparatorSize: Integer; virtual; abstract; procedure DrawSeparator(Canvas: TFCanvas; const ARect: TRect; AOrientation: TOrientation); virtual; abstract; // Group boxes - procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TWidgetState); virtual; abstract; + procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TFWidgetState); virtual; abstract; function GetGroupBoxBorders(Canvas: TFCanvas; const ALabel: String; var LabelWidth: Integer): TRect; virtual; abstract; // Edit widgets procedure DrawEditBox(Canvas: TFCanvas; const ARect: TRect); virtual; abstract; function GetEditBoxBorders: TRect; virtual; abstract; // Check boxes - procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TCheckboxFlags); virtual; abstract; - procedure GetCheckBoxLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); virtual; abstract; + procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); virtual; abstract; + procedure GeTFCheckboxLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); virtual; abstract; // Radio buttons - procedure DrawRadioButton(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TCheckboxFlags); virtual; abstract; + procedure DrawRadioButton(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); virtual; abstract; procedure GetRadioButtonLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); virtual; abstract; // Combo boxes function GetComboBoxArrowSize: TSize; virtual; abstract; procedure DrawComboBoxArrow(Canvas: TFCanvas; const ARect: TRect; IsPressed, IsEnabled: Boolean); virtual; abstract; function GetComboBoxBtnSize: TSize; virtual; abstract; // Scroll bars - function GetScrollBarBorders(Orientation: TOrientation): TRect; virtual; abstract; - function GetScrollBarBtnSize(Orientation: TOrientation): TSize; virtual; abstract; - function GetScrollBarBtnMinSize: Integer; virtual; abstract; + function GeTFScrollBarBorders(Orientation: TOrientation): TRect; virtual; abstract; + function GeTFScrollBarBtnSize(Orientation: TOrientation): TSize; virtual; abstract; + function GeTFScrollBarBtnMinSize: Integer; virtual; abstract; procedure DrawScrollBarBorder(Canvas: TFCanvas; const ARect: TRect); virtual; abstract; procedure DrawScrollBarButton(Canvas: TFCanvas; const ARect: TRect; Direction: TArrowDirection; IsPressed, IsEnabled: Boolean); virtual; abstract; // Scroll boxes @@ -96,14 +96,14 @@ FMaskCanvas: TFCanvas; protected procedure DrawDirectionArrows(ACanvas: TFCanvas; const ARect: TRect; ADirection: TArrowDirection); - procedure DrawCheckBoxCheck(ACanvas: TFCanvas; const ARect: TRect; AFlags: TCheckboxFlags); + procedure DrawCheckBoxCheck(ACanvas: TFCanvas; const ARect: TRect; AFlags: TFCheckboxFlags); public constructor Create; override; destructor Destroy; override; // Colors function GetGUIColor(Color: TColor): TGfxColor; override; // General - procedure DrawText(Canvas: TFCanvas; const APosition: TPoint; const AText: String; State: TWidgetState); override; + procedure DrawText(Canvas: TFCanvas; const APosition: TPoint; const AText: String; State: TFWidgetState); override; procedure DrawItemBefore(Canvas: TFCanvas; const ARect: TRect; Flags: TItemFlags); override; procedure DrawItemAfter(Canvas: TFCanvas; const ARect: TRect; Flags: TItemFlags); override; procedure Draw3DFrame(Canvas: TFCanvas; const ARect: TRect; Color1, Color2, Color3, Color4: TColor); override; @@ -113,31 +113,31 @@ // Windows procedure DrawWindowBackground(Canvas: TFCanvas; const ARect: TRect); override; // Buttons - procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TButtonFlags); override; - function GetButtonBorders: TRect; override; + procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TFButtonFlags); override; + function GeTFButtonBorders: TRect; override; // Separators procedure DrawSeparator(Canvas: TFCanvas; const ARect: TRect; AOrientation: TOrientation); override; function GetSeparatorSize: Integer; override; // Group boxes - procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TWidgetState); override; + procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TFWidgetState); override; function GetGroupBoxBorders(Canvas: TFCanvas; const ALabel: String; var LabelWidth: Integer): TRect; override; // Edit widgets procedure DrawEditBox(Canvas: TFCanvas; const ARect: TRect); override; function GetEditBoxBorders: TRect; override; // Check boxes - procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TCheckboxFlags); override; - procedure GetCheckBoxLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); override; + procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); override; + procedure GeTFCheckboxLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); override; // Radio buttons - procedure DrawRadioButton(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TCheckboxFlags); override; + procedure DrawRadioButton(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); override; procedure GetRadioButtonLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); override; // Combo boxes procedure DrawComboBoxArrow(Canvas: TFCanvas; const ARect: TRect; IsPressed, IsEnabled: Boolean); override; function GetComboBoxArrowSize: TSize; override; function GetComboBoxBtnSize: TSize; override; // Scroll bars - function GetScrollBarBorders(Orientation: TOrientation): TRect; override; - function GetScrollBarBtnSize(Orientation: TOrientation): TSize; override; - function GetScrollBarBtnMinSize: Integer; override; + function GeTFScrollBarBorders(Orientation: TOrientation): TRect; override; + function GeTFScrollBarBtnSize(Orientation: TOrientation): TSize; override; + function GeTFScrollBarBtnMinSize: Integer; override; procedure DrawScrollBarBorder(Canvas: TFCanvas; const ARect: TRect); override; procedure DrawScrollBarButton(Canvas: TFCanvas; const ARect: TRect; Direction: TArrowDirection; IsPressed, IsEnabled: Boolean); override; // Scroll boxes @@ -270,7 +270,7 @@ begin end; procedure TBasicStyle.DrawCheckBoxCheck(ACanvas: TFCanvas; - const ARect: TRect; AFlags: TCheckboxFlags); + const ARect: TRect; AFlags: TFCheckboxFlags); begin if (cbIsEnabled in AFlags) then SetUIColor(ACanvas, clBtnText) @@ -465,7 +465,7 @@ begin end; procedure TBasicStyle.DrawText(Canvas: TFCanvas; const APosition: TPoint; - const AText: String; State: TWidgetState); + const AText: String; State: TFWidgetState); begin if not (wsEnabled in State) then begin @@ -502,7 +502,7 @@ begin end; procedure TBasicStyle.DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; - Flags: TButtonFlags); + Flags: TFButtonFlags); var r: TRect; begin @@ -551,7 +551,7 @@ begin end; end; -function TBasicStyle.GetButtonBorders: TRect; +function TBasicStyle.GeTFButtonBorders: TRect; begin Result := Rect(5, 5, 5, 5); end; @@ -577,7 +577,7 @@ begin end; procedure TBasicStyle.DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; - const ALabel: String; WidgetState: TWidgetState); + const ALabel: String; WidgetState: TFWidgetState); var TitleWidth, TitleHeight, TopLine: Integer; begin @@ -631,7 +631,7 @@ begin end; procedure TBasicStyle.DrawCheckBox(Canvas: TFCanvas; - const ARect, LabelRect: TRect; Flags: TCheckboxFlags); + const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); var r: TRect; begin @@ -655,7 +655,7 @@ begin DrawFocusRect(Canvas, Rect(Left - 2, Top - 2, Right + 2, Bottom + 2)); end; -procedure TBasicStyle.GetCheckBoxLayout(const LabelSize: TSize; +procedure TBasicStyle.GeTFCheckboxLayout(const LabelSize: TSize; var TotalSize: TSize; var LabelPos: TPoint); begin TotalSize := Size(LabelSize.cx + 21, Max(13, LabelSize.cy + 4)); @@ -664,7 +664,7 @@ end; procedure TBasicStyle.DrawRadioButton(Canvas: TFCanvas; - const ARect, LabelRect: TRect; Flags: TCheckboxFlags); + const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); var Index, BtnY: Integer; r: TRect; @@ -764,18 +764,18 @@ begin DrawDirectionArrows(Canvas, r, arrowDown); end; -function TBasicStyle.GetScrollBarBorders(Orientation: TOrientation): TRect; +function TBasicStyle.GeTFScrollBarBorders(Orientation: TOrientation): TRect; begin Result := Rect(1, 1, 1, 1); end; -function TBasicStyle.GetScrollBarBtnSize(Orientation: TOrientation): TSize; +function TBasicStyle.GeTFScrollBarBtnSize(Orientation: TOrientation): TSize; begin Result.cx := 16; Result.cy := 16; end; -function TBasicStyle.GetScrollBarBtnMinSize: Integer; +function TBasicStyle.GeTFScrollBarBtnMinSize: Integer; begin Result := 30; end; diff --git a/gui/fpguiwidget.inc b/gui/fpguiwidget.inc index cd3df2e6..baf5e927 100644 --- a/gui/fpguiwidget.inc +++ b/gui/fpguiwidget.inc @@ -36,7 +36,7 @@ constructor Create(ASender: TObject); procedure AddRef; procedure Release; - function SendToChild(AChild: TWidget): Boolean; virtual; + function SendToChild(AChild: TFWidget): Boolean; virtual; published property Sender: TObject read FSender write FSender; end; @@ -78,14 +78,14 @@ TPreparePaintEventObj = class(TPaintingEventObj) public // To prevent invisible children to be processed: - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; end; TPaintEventObj = class(TPaintingEventObj) public // To adapt the clipping region and add a translation: - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; end; @@ -97,7 +97,7 @@ FPosition: TPoint; public constructor Create(ASender: TObject; AShift: TShiftState; APosition: TPoint); - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; property Position: TPoint read FPosition write FPosition; published property Shift: TShiftState read FShift write FShift; @@ -121,7 +121,7 @@ TMouseMoveEventObj = class(TMouseEventObj) public - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; end; @@ -133,13 +133,13 @@ TMouseLeaveEventObj = class(TEventObj) public - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; end; TMouseLeaveCheckEventObj = class(TMouseEventObj) public - function SendToChild(AChild: TWidget): Boolean; override; + function SendToChild(AChild: TFWidget): Boolean; override; NewCursor: TFCursor; end; @@ -159,19 +159,19 @@ // TWidget // ------------------------------------------------------------------- - TWidgetStyle = set of (wsCaptureMouse, wsClickable, wsOpaque); + TFWidgetStyle = set of (wsCaptureMouse, wsClickable, wsOpaque); - TContainerWidget = class; + TFContainerWidget = class; - TWidget = class(TComponent) + TFWidget = class(TComponent) private FColor: TColor; - FParent: TWidget; + FParent: TFWidget; FOnClick: TNotifyEvent; // Property access procedure SetColor(const AValue: TColor); - procedure SetParent(AParent: TWidget); + procedure SetParent(AParent: TFWidget); function GetBoundsRect: TRect; function GetLeft: Integer; function GetTop: Integer; @@ -203,8 +203,8 @@ FMinSize: TSize; FMaxSize: TSize; FDefSize: TSize; - WidgetStyle: TWidgetStyle; - WidgetState: TWidgetState; + WidgetStyle: TFWidgetStyle; + WidgetState: TFWidgetState; procedure Loaded; override; procedure Click; dynamic; procedure Paint(Canvas: TFCanvas); virtual; @@ -239,8 +239,8 @@ constructor Create(AOwner: TComponent); override; destructor Destroy; override; function SendEvent(Event: TEventObj): Boolean; - function FindForm: TCustomForm; - procedure SetEmbeddedParent(AParent: TWidget); + function FindForm: TFCustomForm; + procedure SetEmbeddedParent(AParent: TFWidget); procedure SetBounds(APosition: TPoint; ASize: TSize); procedure SetBounds(x, y, w, h: Integer); overload; function WidgetToClient(const APoint: TPoint): TPoint; virtual; @@ -253,7 +253,7 @@ procedure Scroll(const ARect: TRect; DeltaX, DeltaY: Integer); procedure SetFocus; procedure Update; - property Parent: TWidget read FParent write SetParent; + property Parent: TFWidget read FParent write SetParent; property Origin: TPoint read FOrigin; property BoundsSize: TSize read FBoundsSize; property BoundsRect: TRect read GetBoundsRect; @@ -302,7 +302,7 @@ begin end; -function TEventObj.SendToChild(AChild: TWidget): Boolean; +function TEventObj.SendToChild(AChild: TFWidget): Boolean; begin Inc(RefCount); Result := AChild.SendEvent(Self); @@ -320,7 +320,7 @@ begin end; -function TPreparePaintEventObj.SendToChild(AChild: TWidget): Boolean; +function TPreparePaintEventObj.SendToChild(AChild: TFWidget): Boolean; begin if wsIsVisible in AChild.WidgetState then Result := inherited SendToChild(AChild) @@ -336,7 +336,7 @@ begin end; -function TPaintEventObj.SendToChild(AChild: TWidget): Boolean; +function TPaintEventObj.SendToChild(AChild: TFWidget): Boolean; var ClientPos: TPoint; begin @@ -372,7 +372,7 @@ begin end; -function TMouseEventObj.SendToChild(AChild: TWidget): Boolean; +function TMouseEventObj.SendToChild(AChild: TFWidget): Boolean; var OldPos, ClientPos: TPoint; begin @@ -400,7 +400,7 @@ begin end; -function TMouseMoveEventObj.SendToChild(AChild: TWidget): Boolean; +function TMouseMoveEventObj.SendToChild(AChild: TFWidget): Boolean; begin if AChild.WidgetState * [wsEnabled, wsIsVisible] = [wsEnabled, wsIsVisible] then @@ -415,7 +415,7 @@ begin end; -function TMouseLeaveEventObj.SendToChild(AChild: TWidget): Boolean; +function TMouseLeaveEventObj.SendToChild(AChild: TFWidget): Boolean; begin if wsMouseInside in AChild.WidgetState then Result := inherited SendToChild(AChild) @@ -424,7 +424,7 @@ begin end; -function TMouseLeaveCheckEventObj.SendToChild(AChild: TWidget): Boolean; +function TMouseLeaveCheckEventObj.SendToChild(AChild: TFWidget): Boolean; begin if ((FPosition.X < AChild.Left) or (FPosition.Y < AChild.Top) or (FPosition.X >= AChild.Left + AChild.Width) or @@ -448,7 +448,7 @@ end; // TWidget // =================================================================== -constructor TWidget.Create(AOwner: TComponent); +constructor TFWidget.Create(AOwner: TComponent); begin inherited Create(AOwner); WidgetStyle := []; @@ -460,12 +460,12 @@ begin FColor := cl3DFace; end; -destructor TWidget.Destroy; +destructor TFWidget.Destroy; begin inherited Destroy; end; -function TWidget.SendEvent(Event: TEventObj): Boolean; +function TFWidget.SendEvent(Event: TEventObj): Boolean; {$IFDEF TraceEvents} var i: Integer; @@ -490,12 +490,12 @@ begin Event.Release; end; -function TWidget.FindForm: TCustomForm; +function TFWidget.FindForm: TFCustomForm; var - Widget: TWidget; + Widget: TFWidget; begin Widget := Self; - while not (Widget is TCustomForm) do + while not (Widget is TFCustomForm) do begin Widget := Widget.Parent; if not Assigned(Widget) then @@ -504,17 +504,17 @@ begin exit; end; end; - Result := TCustomForm(Widget); + Result := TFCustomForm(Widget); end; -procedure TWidget.SetEmbeddedParent(AParent: TWidget); +procedure TFWidget.SetEmbeddedParent(AParent: TFWidget); begin FParent := AParent; end; -procedure TWidget.SetBounds(APosition: TPoint; ASize: TSize); +procedure TFWidget.SetBounds(APosition: TPoint; ASize: TSize); begin - LAYOUTTRACE('TWidget.SetBounds for %s:%s. Old size: %dx%d, new size: %dx%d', + LAYOUTTRACE('TFWidget.SetBounds for %s:%s. Old size: %dx%d, new size: %dx%d', [Name, ClassName, BoundsSize.cx, BoundsSize.cy, ASize.cx, ASize.cy]); FOrigin := APosition; if ASize <> BoundsSize then @@ -525,24 +525,24 @@ begin end; end; -procedure TWidget.SetBounds(x, y, w, h: Integer); +procedure TFWidget.SetBounds(x, y, w, h: Integer); begin SetBounds(Point(x, y), Size(w, h)); end; -function TWidget.WidgetToClient(const APoint: TPoint): TPoint; +function TFWidget.WidgetToClient(const APoint: TPoint): TPoint; begin // as default, the outer rectangle is identical to the client rectangle Result := APoint; end; -function TWidget.ClientToWidget(const APoint: TPoint): TPoint; +function TFWidget.ClientToWidget(const APoint: TPoint): TPoint; begin // as default, the outer rectangle is identical to the client rectangle Result := APoint; end; -function TWidget.ClientToScreen(const APoint: TPoint): TPoint; +function TFWidget.ClientToScreen(const APoint: TPoint): TPoint; begin Result := APoint + Origin; Result := ClientToWidget(Result); @@ -550,9 +550,9 @@ begin Result := Parent.ClientToScreen(Result); end; -{procedure TWidget.Update; +{procedure TFWidget.Update; begin - LAYOUTTRACE('TWidget.Update for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFWidget.Update for %s:%s', [Name, ClassName]); if wsIsUpdating in WidgetState then exit; @@ -561,16 +561,16 @@ begin Exclude(WidgetState, wsIsUpdating); end; -procedure TWidget.RecalcLayout; +procedure TFWidget.RecalcLayout; var OldW, OldH: Integer; x, y: Integer; - Widget: TWidget; + Widget: TFWidget; begin if (csLoading in ComponentState) or (not Visible) then exit; - LAYOUTTRACE('TWidget.RecalcLayout for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFWidget.RecalcLayout for %s:%s', [Name, ClassName]); OldW := Width; OldH := Height; @@ -600,13 +600,13 @@ begin x := 0; y := 0; Widget := Self; - while not (Widget is TCustomForm) do + while not (Widget is TFCustomForm) do begin Inc(x, Widget.Left); Inc(y, Widget.Top); Widget := Widget.parent; end; - TCustomForm(Widget).Wnd.Invalidate(Rect(x, y, + TFCustomForm(Widget).Wnd.Invalidate(Rect(x, y, x + Max(Width, OldW), y + Max(Height, OldH))); end; @@ -614,11 +614,11 @@ begin Parent.RecalcLayout; end;} -procedure TWidget.Show; +procedure TFWidget.Show; begin if not Visible then begin - LAYOUTTRACE('TWidget.Show for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFWidget.Show for %s:%s', [Name, ClassName]); FVisible := True; if Assigned(Parent) and (wsIsVisible in Parent.WidgetState) then begin @@ -628,11 +628,11 @@ begin end; end; -procedure TWidget.Hide; +procedure TFWidget.Hide; begin if Visible then begin - LAYOUTTRACE('TWidget.Hide for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFWidget.Hide for %s:%s', [Name, ClassName]); FVisible := False; if wsIsVisible in WidgetState then begin @@ -643,7 +643,7 @@ begin end; end; -procedure TWidget.Redraw; +procedure TFWidget.Redraw; begin Redraw(Rect(0, 0, BoundsSize.cx, BoundsSize.cy)); {$IFDEF DEBUG} @@ -651,10 +651,10 @@ begin {$ENDIF} end; -procedure TWidget.Redraw(const ARect: TRect); +procedure TFWidget.Redraw(const ARect: TRect); var x, y: Integer; - Form: TCustomForm; + Form: TFCustomForm; WidgetPos, FormPos: TPoint; begin if not (wsIsVisible in WidgetState) then @@ -670,11 +670,11 @@ begin Rect(x, y, x + ARect.Right - ARect.Left, y + ARect.Bottom - ARect.Top)); end; -procedure TWidget.Scroll(const ARect: TRect; DeltaX, DeltaY: Integer); +procedure TFWidget.Scroll(const ARect: TRect; DeltaX, DeltaY: Integer); var r, ClipRect: TRect; - Widget: TWidget; - Form: TCustomForm; + Widget: TFWidget; + Form: TFCustomForm; Canvas: TFCanvas; begin if not (wsIsVisible in WidgetState) then @@ -787,12 +787,12 @@ begin end; end; -procedure TWidget.SetFocus; +procedure TFWidget.SetFocus; begin FindForm.FocusedWidget := Self; end; -procedure TWidget.Update; +procedure TFWidget.Update; var PropagateUpdate: Boolean; OldMinSize, OldMaxSize, OldDefSize: TSize; @@ -818,32 +818,32 @@ begin SendEvent(TResizedEventObj.Create(Self, wsSizeIsForced in WidgetState)); end; -procedure TWidget.Loaded; +procedure TFWidget.Loaded; begin inherited Loaded; {!!!: if not (wsEnabled in WidgetState) then UpdateEnabledState;} end; -procedure TWidget.Click; +procedure TFWidget.Click; begin Redraw; if Assigned(OnClick) then OnClick(Self); end; -procedure TWidget.Paint(Canvas: TFCanvas); +procedure TFWidget.Paint(Canvas: TFCanvas); begin Canvas.SetColor(Style.GetUIColor(FColor)); end; -procedure TWidget.SetParentComponent(AParent: TComponent); +procedure TFWidget.SetParentComponent(AParent: TComponent); begin - if AParent is TContainerWidget then - SetParent(TContainerWidget(AParent)); + if AParent is TFContainerWidget then + SetParent(TFContainerWidget(AParent)); end; -procedure TWidget.SetEnabled(AEnabled: Boolean); +procedure TFWidget.SetEnabled(AEnabled: Boolean); begin if AEnabled <> Enabled then begin @@ -852,12 +852,12 @@ begin end; end; -procedure TWidget.SetStyle(const AValue: TStyleAbs); +procedure TFWidget.SetStyle(const AValue: TStyleAbs); begin FStyle := AValue; end; -procedure TWidget.SetVisible(AVisible: Boolean); +procedure TFWidget.SetVisible(AVisible: Boolean); begin if AVisible then Show @@ -865,19 +865,19 @@ begin Hide; end; -procedure TWidget.Resized; +procedure TFWidget.Resized; begin // Do nothing by default end; -procedure TWidget.EvFocusChanged; +procedure TFWidget.EvFocusChanged; begin Redraw; end; -procedure TWidget.EvKeyPressed(Key: Word; Shift: TShiftState); +procedure TFWidget.EvKeyPressed(Key: Word; Shift: TShiftState); - function SetFocusIfPossible(Widget: TWidget): Boolean; + function SetFocusIfPossible(Widget: TFWidget): Boolean; begin Result := (wsClickable in Widget.WidgetStyle) and (wsEnabled in Widget.WidgetState); @@ -885,18 +885,18 @@ procedure TWidget.EvKeyPressed(Key: Word; Shift: TShiftState); Widget.SetFocus; end; - function FocusFirst(Widget: TWidget): Boolean; + function FocusFirst(Widget: TFWidget): Boolean; var i: Integer; - Child: TWidget; + Child: TFWidget; begin Result := False; - if not Widget.InheritsFrom(TContainerWidget) then + if not Widget.InheritsFrom(TFContainerWidget) then exit; - for i := 0 to TContainerWidget(Widget).ChildCount - 1 do + for i := 0 to TFContainerWidget(Widget).ChildCount - 1 do begin - Child := TContainerWidget(Widget).Children[i]; + Child := TFContainerWidget(Widget).Children[i]; if SetFocusIfPossible(Child) or FocusFirst(Child) then begin Result := True; @@ -905,18 +905,18 @@ procedure TWidget.EvKeyPressed(Key: Word; Shift: TShiftState); end; end; - function FocusLast(Widget: TWidget): Boolean; + function FocusLast(Widget: TFWidget): Boolean; var i: Integer; - Child: TWidget; + Child: TFWidget; begin Result := False; - if not Widget.InheritsFrom(TContainerWidget) then + if not Widget.InheritsFrom(TFContainerWidget) then exit; - for i := TContainerWidget(Widget).ChildCount - 1 downto 0 do + for i := TFContainerWidget(Widget).ChildCount - 1 downto 0 do begin - Child := TContainerWidget(Widget).Children[i]; + Child := TFContainerWidget(Widget).Children[i]; if SetFocusIfPossible(Child) or FocusLast(Child) then begin Result := True; @@ -928,8 +928,8 @@ procedure TWidget.EvKeyPressed(Key: Word; Shift: TShiftState); var mshift: TShiftState; i, j: Integer; - CurWidget: TWidget; - CurParent: TContainerWidget; + CurWidget: TFWidget; + CurParent: TFContainerWidget; begin // Handle focus movement keys mshift := Shift * [ssShift, ssAlt, ssCtrl, ssMeta, ssSuper, ssHyper, ssAltGr]; @@ -939,8 +939,8 @@ begin if Assigned(Parent) then begin CurWidget := Self; - CurParent := TContainerWidget(Parent); - while Assigned(CurParent) and CurParent.InheritsFrom(TContainerWidget) do + CurParent := TFContainerWidget(Parent); + while Assigned(CurParent) and CurParent.InheritsFrom(TFContainerWidget) do begin for i := CurParent.ChildCount - 1 downto 1 do begin @@ -958,7 +958,7 @@ begin break; end; { if } end; { for } - CurParent := TContainerWidget(CurParent.Parent); + CurParent := TFContainerWidget(CurParent.Parent); end; { while } end else @@ -975,8 +975,8 @@ begin if Assigned(Parent) then begin CurWidget := Self; - CurParent := TContainerWidget(Parent); - while Assigned(CurParent) and CurParent.InheritsFrom(TContainerWidget) do + CurParent := TFContainerWidget(Parent); + while Assigned(CurParent) and CurParent.InheritsFrom(TFContainerWidget) do begin for i := 0 to CurParent.ChildCount - 2 do begin @@ -994,7 +994,7 @@ begin break; end; { if } end; { for } - CurParent := TContainerWidget(CurParent.Parent); + CurParent := TFContainerWidget(CurParent.Parent); end; { while } end else @@ -1014,25 +1014,25 @@ begin Parent.EvKeyPressed(Key, Shift); end; -procedure TWidget.EvKeyReleased(Key: Word; Shift: TShiftState); +procedure TFWidget.EvKeyReleased(Key: Word; Shift: TShiftState); begin if Assigned(Parent) then Parent.EvKeyReleased(Key, Shift); end; -procedure TWidget.EvKeyChar(KeyChar: Char); +procedure TFWidget.EvKeyChar(KeyChar: Char); begin if Assigned(Parent) then Parent.EvKeyChar(KeyChar); end; -procedure TWidget.EvTextChanged; +procedure TFWidget.EvTextChanged; begin Update; Redraw; end; -function TWidget.DoMouseEnter(AShift: TShiftState; AMousePos: TPoint): Boolean; +function TFWidget.DoMouseEnter(AShift: TShiftState; AMousePos: TPoint): Boolean; var Event: TMouseEnterEventObj; begin @@ -1044,9 +1044,9 @@ begin Event.Free; end; -function TWidget.GetStyle: TStyleAbs; +function TFWidget.GetStyle: TStyleAbs; var - Widget: TWidget; + Widget: TFWidget; begin if Assigned(FStyle) then Result := FStyle @@ -1064,7 +1064,7 @@ begin end; end; -function TWidget.ProcessEvent(Event: TEventObj): Boolean; +function TFWidget.ProcessEvent(Event: TEventObj): Boolean; var Canvas: TFCanvas; Matrix: TGfxMatrix; @@ -1137,62 +1137,62 @@ begin end; end; -function TWidget.DistributeEvent(Event: TEventObj): Boolean; +function TFWidget.DistributeEvent(Event: TEventObj): Boolean; begin - // Do nothing here, as TWidget itself doesn't have children + // Do nothing here, as TFWidget itself doesn't have children Result := False; end; -procedure TWidget.SetParent(AParent: TWidget); +procedure TFWidget.SetParent(AParent: TFWidget); begin // !!!: reparenting when changing the form is not possible if AParent <> FParent then begin // Remove the widget from the old parent, if it had a parent... - if Assigned(FParent) and FParent.InheritsFrom(TContainerWidget) then - TContainerWidget(FParent).RemoveChild(Self); + if Assigned(FParent) and FParent.InheritsFrom(TFContainerWidget) then + TFContainerWidget(FParent).RemoveChild(Self); FParent := AParent; // ...and add it to the new parent, if existent. - if Assigned(Parent) and Parent.InheritsFrom(TContainerWidget) then - TContainerWidget(Parent).InsertChild(Self); + if Assigned(Parent) and Parent.InheritsFrom(TFContainerWidget) then + TFContainerWidget(Parent).InsertChild(Self); end; end; -procedure TWidget.SetColor(const AValue: TColor); +procedure TFWidget.SetColor(const AValue: TColor); begin if FColor=AValue then exit; FColor:=AValue; end; -function TWidget.GetBoundsRect: TRect; +function TFWidget.GetBoundsRect: TRect; begin Result.TopLeft := Origin; Result.BottomRight := Origin + BoundsSize; end; -function TWidget.GetLeft: Integer; +function TFWidget.GetLeft: Integer; begin Result := Origin.x; end; -function TWidget.GetTop: Integer; +function TFWidget.GetTop: Integer; begin Result := Origin.y; end; -function TWidget.GetWidth: Integer; +function TFWidget.GetWidth: Integer; begin Result := BoundsSize.cx; end; -function TWidget.GetHeight: Integer; +function TFWidget.GetHeight: Integer; begin Result := BoundsSize.cy; end; -procedure TWidget.SetCanExpandWidth(allow: Boolean); +procedure TFWidget.SetCanExpandWidth(allow: Boolean); begin if FCanExpandWidth <> allow then begin @@ -1201,7 +1201,7 @@ begin end; end; -procedure TWidget.SetCanExpandHeight(allow: Boolean); +procedure TFWidget.SetCanExpandHeight(allow: Boolean); begin if FCanExpandHeight <> allow then begin @@ -1210,7 +1210,7 @@ begin end; end; -procedure TWidget.SetText(const AText: String); +procedure TFWidget.SetText(const AText: String); begin if AText <> Text then begin @@ -1219,9 +1219,9 @@ begin end; end; -function TWidget.EvCalcSizes(Event: TCalcSizesEventObj): Boolean; +function TFWidget.EvCalcSizes(Event: TCalcSizesEventObj): Boolean; begin - LAYOUTTRACE('TWidget.EvCalcSizes for %s:%s', [Name, ClassName]); + LAYOUTTRACE('TFWidget.EvCalcSizes for %s:%s', [Name, ClassName]); FMinSize := Size(0, 0); FMaxSize := Size(InfiniteSize, InfiniteSize); @@ -1242,7 +1242,7 @@ begin Result := False; end; -function TWidget.EvEnabledChange(Event: TEnabledChangeEventObj): Boolean; +function TFWidget.EvEnabledChange(Event: TEnabledChangeEventObj): Boolean; var NewState: Boolean; begin @@ -1267,7 +1267,7 @@ begin Result := False; end; -function TWidget.EvVisibilityChange(Event: TVisibilityChangeEventObj): Boolean; +function TFWidget.EvVisibilityChange(Event: TVisibilityChangeEventObj): Boolean; begin if Visible then begin @@ -1279,7 +1279,7 @@ begin Result := False; end; -function TWidget.EvMousePressed(Event: TMousePressedEventObj): Boolean; +function TFWidget.EvMousePressed(Event: TMousePressedEventObj): Boolean; begin if (wsClickable in WidgetStyle) and (wsEnabled in WidgetState) and (Event.Button = mbLeft) then @@ -1296,7 +1296,7 @@ begin Result := False; end; -function TWidget.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; +function TFWidget.EvMouseReleased(Event: TMouseReleasedEventObj): Boolean; begin if (wsClickable in WidgetStyle) and (wsEnabled in WidgetState) and (Event.Button = mbLeft) then @@ -1319,7 +1319,7 @@ begin Result := False; end; -function TWidget.EvMouseEnter(Event: TMouseEnterEventObj): Boolean; +function TFWidget.EvMouseEnter(Event: TMouseEnterEventObj): Boolean; begin Include(WidgetState, wsMouseInside); if Cursor <> crDefault then @@ -1333,7 +1333,7 @@ begin {$ENDIF} end; -function TWidget.EvMouseLeave(Event: TMouseLeaveEventObj): Boolean; +function TFWidget.EvMouseLeave(Event: TMouseLeaveEventObj): Boolean; begin Exclude(WidgetState, wsMouseInside); if (wsClickable in WidgetStyle) and (wsClicked in WidgetState) and @@ -1345,7 +1345,7 @@ begin {$ENDIF} end; -function TWidget.EvMouseLeaveCheck(Event: TMouseLeaveCheckEventObj): Boolean; +function TFWidget.EvMouseLeaveCheck(Event: TMouseLeaveCheckEventObj): Boolean; begin if ((Event.Position.x < 0) or (Event.Position.y < 0) or (Event.Position.x >= BoundsSize.cx) or diff --git a/gui/motifstyle.pas b/gui/motifstyle.pas index e079982b..5abf01e0 100644 --- a/gui/motifstyle.pas +++ b/gui/motifstyle.pas @@ -35,9 +35,9 @@ type // General procedure DrawFocusRect(Canvas: TFCanvas; const ARect: TRect); override; // Buttons - procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TButtonFlags); override; + procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TFButtonFlags); override; // Check boxes - procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TCheckboxFlags); override; + procedure DrawCheckBox(Canvas: TFCanvas; const ARect, LabelRect: TRect; Flags: TFCheckboxFlags); override; end; @@ -47,7 +47,7 @@ implementation { MotifStyle } procedure TMotifStyle.DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; - Flags: TButtonFlags); + Flags: TFButtonFlags); var r: TRect; begin @@ -103,7 +103,7 @@ begin end; procedure TMotifStyle.DrawCheckBox(Canvas: TFCanvas; const ARect, - LabelRect: TRect; Flags: TCheckboxFlags); + LabelRect: TRect; Flags: TFCheckboxFlags); var r: TRect; xmid: integer; diff --git a/gui/opensoftstyle.pas b/gui/opensoftstyle.pas index 1752aa60..1e17b84d 100644 --- a/gui/opensoftstyle.pas +++ b/gui/opensoftstyle.pas @@ -1,279 +1,279 @@ -{ - fpGUI - Free Pascal GUI Library - - OpenSoft look-and-feel style implementation - - Copyright (C) 2006 - 2007 See the file AUTHORS.txt, included in this - distribution, for details of the copyright. - - See the file COPYING.modifiedLGPL, included in this distribution, - for details about redistributing fpGUI. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -} - -unit OpenSoftStyle; - -{$mode objfpc}{$H+} - -interface -uses - Classes - ,fpGUI - ,gfxBase - ,fpGFX - ; - -type - - TGradientDirection = (gdTopToBottom, gdBottomToTop, gdLeftToRight, gdRightToLeft); - TCalcGradientEndX = function(Y, H: Integer): Integer; - - - TOpenSoftStyle = class(TBasicStyle) - private - procedure PaintGradient(pCanvas: TFCanvas; const R: TRect; StartColor, EndColor: TColor; Direction: TGradientDirection; GradLines: Integer = -1); - public - // Colors - function GetGUIColor(Color: TColor): TGfxColor; override; - // Buttons (todo) -// procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TButtonFlags); override; - // GroupBox - procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TWidgetState); override; - end; - - -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: TFCanvas; const R: TRect; - StartColor, EndColor: TColor; Direction: TGradientDirection; - GradLines: Integer = -1); -var - X: integer; - i: integer; - w: integer; - h: integer; - Count: integer; - EndCol: TGfxColor; - StartCol: TGfxColor; - AddCol: TGfxColor; - 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.Red := (EndCol.Red - StartCol.Red) div GradLines; - AddCol.Green := (EndCol.Green - StartCol.Green) div GradLines; - AddCol.Blue := (EndCol.Blue - StartCol.Blue) div GradLines; - -// Canvas.Pen.Style := psSolid; - pCanvas.SaveState; -// Canvas.Start; - try -// StartColor := TColor(Round(StartCol.Red), Round(StartCol.Green), Round(StartCol.Blue)); -// Canvas.Pen.Color := StartColor; - pCanvas.SetColor(GetGUIColor(StartColor)); - for i := 0 to Count - 1 do - begin - if Direction in [gdTopToBottom, gdBottomToTop] then - begin -// pCanvas.MoveTo(R.Left, R.Top + i); -// if Assigned(CalcEndX) then -// X := CalcEndX(i, Count) -// else - X := 0; -// pCanvas.LineTo(R.Right + X, R.Top + i); - pCanvas.DrawLine(Point(R.Left, R.Top + i), Point(R.Right + X, R.Top + i)); - end - else - begin - pCanvas.DrawLine(Point(R.Left + i, R.Top), Point(R.Left + i, R.Bottom)) -// pCanvas.MoveTo(R.Left + i, R.Top); -// pCanvas.LineTo(R.Left + i, R.Bottom); - end; - StartCol.Red := StartCol.Red + AddCol.Red; - StartCol.Green := StartCol.Green + AddCol.Green; - StartCol.Blue := StartCol.Blue + AddCol.Blue; - EndColor := RGB(Round(StartCol.Red), Round(StartCol.Green), Round(StartCol.Blue)); - 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 := GetUIColor(clLightGrey); //rgbaWindow; - clMenu: Result := GetUIColor(clLightGrey); //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 := GetUIColor(clLightGrey); //rgbaWindow; -// cl3DShadow: Result := rgbaDkWhite; -// clGrayText: Result := GetUIColor(clGray); -// clBtnText: Result := GetUIColor(clBlack); -// cl3DHighlight: Result := GetUIColor(clWhite); - cl3DDkShadow: Result := GetUIColor(clBlack); -// cl3DLight: Result := GetUIColor(clDarkWhite); -// clInfoText: Result := GetUIColor(clBlack); -// clInfoBk: Result := GetUIColor(clLightYellow); -// -// else Result := GetUIColor(clWhite); - end; - -end; - -(* -procedure TOpenSoftStyle.DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; - Flags: TButtonFlags); -begin -// inherited DrawButtonFace(Canvas, ARect, Flags); -// PaintGradient(Canvas, ARect, Flags); - Draw3DFrame(Canvas, ARect, cl3DHighlight, cl3DLight, cl3DDkShadow, cl3DShadow); -end; -*) - -procedure TOpenSoftStyle.DrawGroupBox(Canvas: TFCanvas; 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 -//finalization -// gStyleManager.RegisterClass('OpenSoft', TOpenSoftStyle); - -end. - +{
+ fpGUI - Free Pascal GUI Library
+
+ OpenSoft look-and-feel style implementation
+
+ Copyright (C) 2006 - 2007 See the file AUTHORS.txt, included in this
+ distribution, for details of the copyright.
+
+ See the file COPYING.modifiedLGPL, included in this distribution,
+ for details about redistributing fpGUI.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+}
+
+unit OpenSoftStyle;
+
+{$mode objfpc}{$H+}
+
+interface
+uses
+ Classes
+ ,fpGUI
+ ,gfxBase
+ ,fpGFX
+ ;
+
+type
+
+ TGradientDirection = (gdTopToBottom, gdBottomToTop, gdLeftToRight, gdRightToLeft);
+ TCalcGradientEndX = function(Y, H: Integer): Integer;
+
+
+ TOpenSoftStyle = class(TBasicStyle)
+ private
+ procedure PaintGradient(pCanvas: TFCanvas; const R: TRect; StartColor, EndColor: TColor; Direction: TGradientDirection; GradLines: Integer = -1);
+ public
+ // Colors
+ function GetGUIColor(Color: TColor): TGfxColor; override;
+ // Buttons (todo)
+// procedure DrawButtonFace(Canvas: TFCanvas; const ARect: TRect; Flags: TFButtonFlags); override;
+ // GroupBox
+ procedure DrawGroupBox(Canvas: TFCanvas; const ARect: TRect; const ALabel: String; WidgetState: TFWidgetState); override;
+ end;
+
+
+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: TFCanvas; const R: TRect;
+ StartColor, EndColor: TColor; Direction: TGradientDirection;
+ GradLines: Integer = -1);
+var
+ X: integer;
+ i: integer;
+ w: integer;
+ h: integer;
+ Count: integer;
+ EndCol: TGfxColor;
+ StartCol: TGfxColor;
+ AddCol: TGfxColor;
+ 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.Red := (EndCol.Red - StartCol.Red) div GradLines;
+ AddCol.Green := (EndCol.Green - StartCol.Green) div GradLines;
+ AddCol.Blue := (EndCol.Blue - StartCol.Blue) div GradLines;
+
+// Canvas.Pen.Style := psSolid;
+ pCanvas.SaveState;
+// Canvas.Start;
+ try
+// StartColor := TColor(Round(StartCol.Red), Round(StartCol.Green), Round(StartCol.Blue));
+// Canvas.Pen.Color := StartColor;
+ pCanvas.SetColor(GetGUIColor(StartColor));
+ for i := 0 to Count - 1 do
+ begin
+ if Direction in [gdTopToBottom, gdBottomToTop] then
+ begin
+// pCanvas.MoveTo(R.Left, R.Top + i);
+// if Assigned(CalcEndX) then
+// X := CalcEndX(i, Count)
+// else
+ X := 0;
+// pCanvas.LineTo(R.Right + X, R.Top + i);
+ pCanvas.DrawLine(Point(R.Left, R.Top + i), Point(R.Right + X, R.Top + i));
+ end
+ else
+ begin
+ pCanvas.DrawLine(Point(R.Left + i, R.Top), Point(R.Left + i, R.Bottom))
+// pCanvas.MoveTo(R.Left + i, R.Top);
+// pCanvas.LineTo(R.Left + i, R.Bottom);
+ end;
+ StartCol.Red := StartCol.Red + AddCol.Red;
+ StartCol.Green := StartCol.Green + AddCol.Green;
+ StartCol.Blue := StartCol.Blue + AddCol.Blue;
+ EndColor := RGB(Round(StartCol.Red), Round(StartCol.Green), Round(StartCol.Blue));
+ 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 := GetUIColor(clLightGrey); //rgbaWindow;
+ clMenu: Result := GetUIColor(clLightGrey); //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 := GetUIColor(clLightGrey); //rgbaWindow;
+// cl3DShadow: Result := rgbaDkWhite;
+// clGrayText: Result := GetUIColor(clGray);
+// clBtnText: Result := GetUIColor(clBlack);
+// cl3DHighlight: Result := GetUIColor(clWhite);
+ cl3DDkShadow: Result := GetUIColor(clBlack);
+// cl3DLight: Result := GetUIColor(clDarkWhite);
+// clInfoText: Result := GetUIColor(clBlack);
+// clInfoBk: Result := GetUIColor(clLightYellow);
+//
+// else Result := GetUIColor(clWhite);
+ end;
+
+end;
+
+(*
+procedure TOpenSoftStyle.DrawButtonFace(Canvas: TFCanvas; 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: TFCanvas; const ARect: TRect;
+ const ALabel: String; WidgetState: TFWidgetState);
+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
+//finalization
+// gStyleManager.RegisterClass('OpenSoft', TOpenSoftStyle);
+
+end.
+
|