diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2014-03-29 16:10:27 +0000 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2014-03-29 16:10:27 +0000 |
commit | 004127693eb92a2ae2cb2a6193cc1df1110482cc (patch) | |
tree | d5d402e97c638e726e8297b358d635bebd8da540 /src | |
parent | 598d9148aa861de14dcf3bd1e1cb42b7baad0cf1 (diff) | |
download | fpGUI-004127693eb92a2ae2cb2a6193cc1df1110482cc.tar.xz |
combobox/editcombo: Internal button painting now only done in HandlePaint
Painting outside the HandlePaint() is often a source of problems.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/fpg_combobox.pas | 8 | ||||
-rw-r--r-- | src/gui/fpg_editcombo.pas | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/gui/fpg_combobox.pas b/src/gui/fpg_combobox.pas index 47195b5b..fcd1dbe0 100644 --- a/src/gui/fpg_combobox.pas +++ b/src/gui/fpg_combobox.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -392,7 +392,6 @@ var ar: TfpgRect; btnflags: TfpgButtonFlags; begin - Canvas.BeginDraw; btnflags := []; ar := FInternalBtnRect; @@ -420,7 +419,6 @@ begin // paint arrow fpgStyle.DrawDirectionArrow(Canvas, ar.Left, ar.Top, ar.Width, ar.Height, adDown); - Canvas.EndDraw(FInternalBtnRect); end; function TfpgBaseComboBox.GetDropDownPos(AParent, AComboBox, ADropDown: TfpgWidget): TfpgRect; @@ -688,7 +686,7 @@ begin inherited HandleLMouseDown(x, y, shiftstate); // button state is down only if user clicked in the button rectangle. FBtnPressed := PtInRect(FInternalBtnRect, Point(x, y)); - PaintInternalButton; + Repaint; DoDropDown; end; @@ -696,7 +694,7 @@ procedure TfpgBaseStaticCombo.HandleLMouseUp(x, y: integer; shiftstate: TShiftSt begin inherited HandleLMouseUp(x, y, shiftstate); FBtnPressed := False; - PaintInternalButton; + Repaint; end; procedure TfpgBaseStaticCombo.HandleMouseScroll(x, y: integer; diff --git a/src/gui/fpg_editcombo.pas b/src/gui/fpg_editcombo.pas index 24c79cf3..4ebe9a67 100644 --- a/src/gui/fpg_editcombo.pas +++ b/src/gui/fpg_editcombo.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Toolkit - Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2014 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -697,12 +697,12 @@ begin FBtnPressed := PtInRect(FInternalBtnRect, Point(x, y)); if not FAutoCompletion then begin - PaintInternalButton; + Repaint; DoDropDown; end else if FBtnPressed then begin - PaintInternalButton; + Repaint; DoDropDown; end; end; @@ -712,7 +712,7 @@ procedure TfpgBaseEditCombo.HandleLMouseUp(x, y: integer; begin inherited HandleLMouseUp(x, y, shiftstate); FBtnPressed := False; - PaintInternalButton; + Repaint; end; procedure TfpgBaseEditCombo.HandleRMouseUp(x, y: integer; shiftstate: TShiftState); |