From 299d0cb1d2157bc6cac3061862ea1a429e460977 Mon Sep 17 00:00:00 2001 From: drewski207 Date: Thu, 20 Mar 2008 12:34:30 +0000 Subject: * 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. --- src/gui/gui_combobox.pas | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/gui') 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); -- cgit v1.2.3-70-g09d2