summaryrefslogtreecommitdiff
path: root/src/gui/gui_editcombo.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-23 14:17:56 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-23 14:17:56 +0000
commit626b9d82f7c6351d5f8dbf1bc5011fc48387e210 (patch)
tree8d26b540787e5cada3811aa06e9734a815c65113 /src/gui/gui_editcombo.pas
parent8ff503a46409a7ca024e9f85b65c2baebcc5982e (diff)
downloadfpGUI-626b9d82f7c6351d5f8dbf1bc5011fc48387e210.tar.xz
* TfpgListBox now handles the Resize message. This fixes the scrollbar issue in the UI Designer and at runtime resizing.
* Implemented correct 'lazy refresh' in TfpgWidget when setting the size and position with .SetPostion() method. * Refactored the Combo components removing some code duplication. Some paint methods are now inthe BasicCombobox component.
Diffstat (limited to 'src/gui/gui_editcombo.pas')
-rw-r--r--src/gui/gui_editcombo.pas43
1 files changed, 2 insertions, 41 deletions
diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas
index 154d130c..dc1f271d 100644
--- a/src/gui/gui_editcombo.pas
+++ b/src/gui/gui_editcombo.pas
@@ -76,10 +76,8 @@ type
procedure SetAllowNew(const AValue: TAllowNew);
procedure InternalBtnClick(Sender: TObject);
procedure InternalListBoxSelect(Sender: TObject);
- procedure CalculateInternalButtonRect;
protected
FMargin: integer;
- FBtnPressed: Boolean;
FDropDown: TfpgPopupWindow;
FDrawOffset: integer;
FSelStart: integer;
@@ -97,12 +95,11 @@ type
procedure HandleLMouseUp(x, y: integer; shiftstate: TShiftState); override;
procedure HandleResize(awidth, aheight: TfpgCoord); override;
procedure HandlePaint; override;
- procedure PaintInternalButton; virtual;
property AutoCompletion: Boolean read FAutocompletion write FAutoCompletion default False;
property AutoDropDown: Boolean read FAutoDropDown write FAutoDropDown default False;
property AllowNew: TAllowNew read FAllowNew write SetAllowNew default anNo;
- property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clBoxColor;
- property TextColor: TfpgColor read FTextColor write SetTextColor default clText1;
+ property BackgroundColor default clBoxColor;
+ property TextColor default clText1;
property Text: string read GetText write SetText;
public
constructor Create(AOwner: TComponent); override;
@@ -385,12 +382,6 @@ begin
RePaint;
end;
-procedure TfpgAbstractEditCombo.CalculateInternalButtonRect;
-begin
- FInternalBtnRect.SetRect(Width - Min(Height, 20), 2, Min(Height, 20)-2,
- Height-4);
-end;
-
procedure TfpgAbstractEditCombo.SetHeight(const AValue: TfpgCoord);
begin
inherited SetHeight(AValue);
@@ -726,35 +717,6 @@ begin
Canvas.EndDraw;
end;
-procedure TfpgAbstractEditCombo.PaintInternalButton;
-var
- ar: TfpgRect;
- btnflags: TFButtonFlags;
-begin
- Canvas.BeginDraw;
- btnflags := [];
- ar := FInternalBtnRect;
- InflateRect(ar, -2, -2);
- if FBtnPressed then
- begin
- Include(btnflags, btfIsPressed);
- OffsetRect(ar, 1, 1);
- end;
- // paint button face
- fpgStyle.DrawButtonFace(Canvas,
- FInternalBtnRect.Left,
- FInternalBtnRect.Top,
- FInternalBtnRect.Width,
- FInternalBtnRect.Height, btnflags);
- if Enabled then
- Canvas.SetColor(clText1)
- else
- Canvas.SetColor(clShadow1);
- // paint arrow
- fpgStyle.DrawDirectionArrow(Canvas, ar.Left, ar.Top, ar.Width, ar.Height, 1);
- Canvas.EndDraw(FInternalBtnRect);
-end;
-
constructor TfpgAbstractEditCombo.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
@@ -764,7 +726,6 @@ begin
FHeight := Font.Height + 6;
FMargin := 3;
FFocusable := True;
- FBtnPressed := False;
FAutocompletion := False;
FAutoDropDown := False;
FAllowNew := anNo;