diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-14 09:45:57 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-14 09:45:57 +0000 |
commit | a4059e6c08752c3d763b236d9b48cbafff4a6c11 (patch) | |
tree | 04cdf8849082e7dd3abdaf92764838a7cf9dc09a /src/gui | |
parent | eedba8c151df038f4dc25d2e41726e8c6b0f5dd5 (diff) | |
download | fpGUI-a4059e6c08752c3d763b236d9b48cbafff4a6c11.tar.xz |
* Introduced Setter methods for BaseWindow Width and Height properties.
* Fixed a minor bug in ComboBox that maintained it's own Width property. This also fixed the
issue in the uiDesigner loading forms with comboboxes and not painting the internal button.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui_combobox.pas | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas index 94ecf178..debec7db 100644 --- a/src/gui/gui_combobox.pas +++ b/src/gui/gui_combobox.pas @@ -25,8 +25,6 @@ uses type - { TfpgCustomComboBox } - TfpgCustomComboBox = class(TfpgWidget) private FDropDownCount: integer; @@ -48,16 +46,17 @@ type procedure SetFocusItem(const AValue: integer); procedure SetFontDesc(const AValue: string); procedure SetText(const AValue: string); - procedure SetWidth(const AValue: TfpgCoord); procedure CalculateInternalButtonRect; protected FMargin: integer; - property DropDownCount: integer read FDropDownCount write SetDropDownCount default 8; + procedure SetHeight(const AValue: TfpgCoord); override; + procedure SetWidth(const AValue: TfpgCoord); override; procedure HandleLMouseDown(x, y: integer; shiftstate: TShiftState); override; procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override; procedure HandleResize(awidth, aheight: TfpgCoord); override; procedure HandlePaint; override; procedure PaintInternalButton; virtual; + property DropDownCount: integer read FDropDownCount write SetDropDownCount default 8; property Items: TStringList read FItems; {$Note Make this read/write } property FocusItem: integer read FFocusItem write SetFocusItem; property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor; @@ -68,9 +67,7 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure Update; - procedure AfterConstruction; override; property Font: TfpgFont read FFont; - property Width: TfpgCoord read FWidth write SetWidth; end; @@ -322,9 +319,8 @@ end; procedure TfpgCustomComboBox.SetWidth(const AValue: TfpgCoord); begin - if FWidth = AValue then - Exit; //==> - FWidth := AValue; + inherited; + CalculateInternalButtonRect; RePaint; end; @@ -333,6 +329,13 @@ begin FInternalBtnRect.SetRect(Width - Min(Height, 20), 2, Min(Height, 20)-2, Height-4); end; +procedure TfpgCustomComboBox.SetHeight(const AValue: TfpgCoord); +begin + inherited; + CalculateInternalButtonRect; + RePaint; +end; + procedure TfpgCustomComboBox.HandleLMouseDown(x, y: integer; shiftstate: TShiftState); begin inherited HandleLMouseDown(x, y, shiftstate); @@ -451,7 +454,8 @@ begin FFont := fpgGetFont('#List'); FItems := TStringList.Create; - + CalculateInternalButtonRect; + FOnChange := nil; end; @@ -467,11 +471,5 @@ begin Repaint; end; -procedure TfpgCustomComboBox.AfterConstruction; -begin - inherited AfterConstruction; - CalculateInternalButtonRect; -end; - end. |