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 | |
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')
-rw-r--r-- | src/corelib/gfx_popupwindow.pas | 4 | ||||
-rw-r--r-- | src/corelib/gfxbase.pas | 20 | ||||
-rw-r--r-- | src/gui/gui_combobox.pas | 30 |
3 files changed, 32 insertions, 22 deletions
diff --git a/src/corelib/gfx_popupwindow.pas b/src/corelib/gfx_popupwindow.pas index 0c1d981c..ca6c0a42 100644 --- a/src/corelib/gfx_popupwindow.pas +++ b/src/corelib/gfx_popupwindow.pas @@ -2,10 +2,6 @@ unit gfx_popupwindow; {$mode objfpc}{$H+} -{ - Still under construction!!!!! -} - interface uses diff --git a/src/corelib/gfxbase.pas b/src/corelib/gfxbase.pas index cfe60c45..7b7eec6d 100644 --- a/src/corelib/gfxbase.pas +++ b/src/corelib/gfxbase.pas @@ -337,6 +337,8 @@ type procedure AllocateWindowHandle; procedure ReleaseWindowHandle; procedure SetWindowTitle(const ATitle: string); virtual; + procedure SetHeight(const AValue: TfpgCoord); virtual; + procedure SetWidth(const AValue: TfpgCoord); virtual; public // The standard constructor. constructor Create(AOwner: TComponent); override; @@ -357,8 +359,8 @@ type property WindowAttributes: TWindowAttributes read FWindowAttributes write FWindowAttributes; property Left: TfpgCoord read FLeft write FLeft; property Top: TfpgCoord read FTop write FTop; - property Width: TfpgCoord read FWidth write FWidth; - property Height: TfpgCoord read FHeight write FHeight; + property Width: TfpgCoord read FWidth write SetWidth; + property Height: TfpgCoord read FHeight write SetHeight; property MinWidth: TfpgCoord read FMinWidth write FMinWidth; property MinHeight: TfpgCoord read FMinHeight write FMinHeight; property Canvas: TfpgCanvasBase read GetCanvas; @@ -733,6 +735,20 @@ begin DoSetWindowTitle(ATitle); end; +procedure TfpgWindowBase.SetHeight(const AValue: TfpgCoord); +begin + if FHeight = AValue then + Exit; + FHeight := AValue; +end; + +procedure TfpgWindowBase.SetWidth(const AValue: TfpgCoord); +begin + if FWidth = AValue then + Exit; + FWidth := AValue; +end; + constructor TfpgWindowBase.Create(AOwner: TComponent); begin inherited Create(AOwner); 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. |