diff options
author | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-20 12:34:30 +0000 |
---|---|---|
committer | drewski207 <drewski207@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-20 12:34:30 +0000 |
commit | 299d0cb1d2157bc6cac3061862ea1a429e460977 (patch) | |
tree | 42039c41865df1d21e2d25eec8f19c94b786cbf5 /src/gui | |
parent | 98a4c8130f56d4ebb0cbe7bd91bae8ec6b11cfba (diff) | |
download | fpGUI-299d0cb1d2157bc6cac3061862ea1a429e460977.tar.xz |
* Added a property to TfpgCanvasImpl(x11) FastDoubleBuffer
* Fixed painting of ListView Column
* Misc Listview painting changes
* Added OnColumnPaint to ListView
The new property FastDoubleBuffer will probably be moved to TfpgCanvaseBase also perhaps this can be set with an application
property since it doesn't free the backbuffer until the Canvas is freed which will result in some increase in memory usage.
The listview can have double buffering disabled now and it won't flicker sonce the painting is done with no overlapping rects.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui_combobox.pas | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas index 3b88ae28..f0ebe833 100644 --- a/src/gui/gui_combobox.pas +++ b/src/gui/gui_combobox.pas @@ -58,6 +58,8 @@ uses type + { TfpgBaseComboBox } + TfpgBaseComboBox = class(TfpgWidget) private FDropDownCount: integer; @@ -86,6 +88,8 @@ type end; + { TfpgAbstractComboBox } + TfpgAbstractComboBox = class(TfpgBaseComboBox) private FInternalBtnRect: TfpgRect; @@ -105,6 +109,7 @@ type 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 HandleMouseScroll(x, y: integer; shiftstate: TShiftState; delta: smallint); override; procedure HandleResize(awidth, aheight: TfpgCoord); override; procedure HandlePaint; override; procedure PaintInternalButton; virtual; @@ -496,6 +501,32 @@ begin PaintInternalButton; end; +procedure TfpgAbstractComboBox.HandleMouseScroll(x, y: integer; + shiftstate: TShiftState; delta: smallint); +var + NewIndex: Integer; +begin + if (FDropDown <> nil) and FDropDown.Visible then + Exit; + if Items.Count < 1 then + Exit; + + NewIndex := FocusItem + Delta; + + if NewIndex > Items.Count then + NewIndex := Items.Count; + + if NewIndex < 1 then + NewIndex := 1; + + if NewIndex <> FocusItem then + begin + FocusItem := NewIndex; + RePaint; + end; + +end; + procedure TfpgAbstractComboBox.HandleResize(awidth, aheight: TfpgCoord); begin inherited HandleResize(awidth, aheight); |