diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-17 11:07:41 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-17 11:07:41 +0000 |
commit | 742c2eccb4c96ba8bd2bf37a60ddb10e4d552d3d (patch) | |
tree | 56bceaafa04db781c1124cd28ada351c7267e93b /src/gui/gui_editcombo.pas | |
parent | dc4b8e37d0aba7e659f4e807cc494c6ce71eee59 (diff) | |
download | fpGUI-742c2eccb4c96ba8bd2bf37a60ddb10e4d552d3d.tar.xz |
* Applied Luiz Americo's resize patch with minor fixes.
* Fixed up the setting of FDirty.
* Fixed up scrollbar handling in Grid and Listbox components.
Diffstat (limited to 'src/gui/gui_editcombo.pas')
-rw-r--r-- | src/gui/gui_editcombo.pas | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index 5c7c4d19..3ed30a4c 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -64,6 +64,8 @@ type TAllowNew = (anNo, anYes, anAsk); + { TfpgBaseEditCombo } + TfpgBaseEditCombo = class(TfpgBaseComboBox) private FAutoCompletion: Boolean; @@ -88,13 +90,12 @@ type function GetText: string; virtual; function HasText: boolean; virtual; procedure SetText(const AValue: string); virtual; - procedure SetHeight(const AValue: TfpgCoord); override; - procedure SetWidth(const AValue: TfpgCoord); override; + procedure DoUpdateWindowPosition(aleft, atop, awidth, aheight: TfpgCoord); override; + procedure HandleResize(AWidth, AHeight: TfpgCoord); override; procedure HandleKeyChar(var AText: TfpgChar; var shiftstate: TShiftState; var consumed: Boolean); override; procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: Boolean); 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; property AutoCompletion: Boolean read FAutocompletion write FAutoCompletion default False; property AllowNew: TAllowNew read FAllowNew write SetAllowNew default anNo; @@ -398,18 +399,22 @@ begin end; end; -procedure TfpgBaseEditCombo.SetWidth(const AValue: TfpgCoord); +procedure TfpgBaseEditCombo.DoUpdateWindowPosition(aleft, atop, awidth, + aheight: TfpgCoord); begin - inherited SetWidth(AValue); - CalculateInternalButtonRect; - RePaint; + //This does not work because is not called before handle create + if FDirty then + CalculateInternalButtonRect; + inherited DoUpdateWindowPosition(aleft, atop, awidth, aheight); end; -procedure TfpgBaseEditCombo.SetHeight(const AValue: TfpgCoord); +procedure TfpgBaseEditCombo.HandleResize(AWidth, AHeight: TfpgCoord); begin - inherited SetHeight(AValue); - CalculateInternalButtonRect; - RePaint; + inherited HandleResize(AWidth, AHeight); + //FDirty is false in the first resize interation (before handle creation) + //so the hashandle check + if FDirty or not HasHandle then + CalculateInternalButtonRect; end; procedure TfpgBaseEditCombo.HandleKeyChar(var AText: TfpgChar; @@ -594,12 +599,6 @@ begin PaintInternalButton; end; -procedure TfpgBaseEditCombo.HandleResize(awidth, aheight: TfpgCoord); -begin - inherited HandleResize(awidth, aheight); - CalculateInternalButtonRect; -end; - procedure TfpgBaseEditCombo.HandlePaint; var r: TfpgRect; |