diff options
-rw-r--r-- | src/corelib/fpg_widget.pas | 8 | ||||
-rw-r--r-- | src/gui/fpg_spinedit.pas | 21 |
2 files changed, 18 insertions, 11 deletions
diff --git a/src/corelib/fpg_widget.pas b/src/corelib/fpg_widget.pas index 4f00f41d..3e786aca 100644 --- a/src/corelib/fpg_widget.pas +++ b/src/corelib/fpg_widget.pas @@ -90,6 +90,7 @@ type procedure SetVisible(const AValue: boolean); virtual; procedure SetShowHint(const AValue: boolean); virtual; procedure SetParentShowHint(const AValue: boolean); virtual; + procedure SetHint(const AValue: string); virtual; procedure DoUpdateWindowPosition; override; procedure DoAlign(AAlign: TAlign); procedure DoResize; @@ -152,7 +153,7 @@ type property Focused: boolean read FFocused write FFocused default False; property Anchors: TAnchors read FAnchors write FAnchors; property Align: TAlign read FAlign write FAlign; - property Hint: string read FHint write FHint; + property Hint: string read FHint write SetHint; property ShowHint: boolean read FShowHint write SetShowHint stored IsShowHintStored; property ParentShowHint: boolean read FParentShowHint write SetParentShowHint default True; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; @@ -271,6 +272,11 @@ begin FShowHint := False; end; +procedure TfpgWidget.SetHint(const AValue: string); +begin + FHint := AValue; +end; + procedure TfpgWidget.DoUpdateWindowPosition; var dw: integer; diff --git a/src/gui/fpg_spinedit.pas b/src/gui/fpg_spinedit.pas index 49f09b96..b176e5b9 100644 --- a/src/gui/fpg_spinedit.pas +++ b/src/gui/fpg_spinedit.pas @@ -53,8 +53,8 @@ type private FButtonUp: TfpgButton; FButtonDown: TfpgButton; - FArrowUpColor: Tfpgcolor; - FArrowDownColor: Tfpgcolor; + FArrowUpColor: TfpgColor; + FArrowDownColor: TfpgColor; FOnChange: TNotifyEvent; FTimer: TfpgTimer; FUp: Boolean; @@ -119,7 +119,7 @@ type procedure SetValue(const AValue: extended); procedure SetDecimals(const AValue: integer); procedure SetFixedDecimals(const AValue: Boolean); - procedure SetHint(const AValue: string); + procedure SetHint(const AValue: string); override; procedure ButtonUpClick(Sender: TObject); procedure ButtonDownClick(Sender: TObject); procedure ButtonUpMouseDown(Sender: TObject; AButton: TMouseButton; AShift: TShiftState; const AMousePos: TPoint); @@ -137,6 +137,7 @@ type published property EditBackgroundColor: Tfpgcolor read GetEditBackgroundColor write SetEditBackgroundColor default clBoxColor; property ButtonsBackgroundColor; + property ButtonWidth; property TextColor: Tfpgcolor read GetTextColor write SetTextColor; property NegativeColor: TfpgColor read GetNegativeColor write SetNegativeColor; property ArrowUpColor; @@ -149,7 +150,7 @@ type property Value: extended read FValue write SetValue; property Decimals: integer read GetDecimals write SetDecimals; property FixedDecimals: Boolean read GetFixedDecimals write SetFixedDecimals; - property Hint: string read FHint write SetHint; + property TabOrder; property OnChange; property OnEnter; property OnExit; @@ -217,6 +218,7 @@ type property LargeIncrement: integer read FLargeIncrement write SetLargeIncrement default 10; property Value: integer read FValue write SetValue default 0; property Hint: string read FHint write SetHint; + property TabOrder; property OnChange; property OnEnter; property OnExit; @@ -621,12 +623,11 @@ end; procedure TfpgSpinEditFloat.SetHint(const AValue: string); begin - if Hint <> AValue then - begin - FEdit.Hint := AValue; - FButtonUp.Hint := AValue; - FButtonDown.Hint := AValue; - end; + inherited SetHint(AValue); + // let child component use the same hint + FEdit.Hint := AValue; + FButtonUp.Hint := AValue; + FButtonDown.Hint := AValue; end; procedure TfpgSpinEditFloat.ButtonUpClick(Sender: TObject); |