summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-24 14:59:07 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-06-24 14:59:07 +0000
commit80cd1427db1111010d6702ebe437e42194db15cb (patch)
tree2a77c637f84d25de9fa5a25c63cb7eb7c5b29b74 /src/gui
parentd3899e742e2a205b2e6138384eef731c46401ed5 (diff)
downloadfpGUI-80cd1427db1111010d6702ebe437e42194db15cb.tar.xz
* Using Assign() to set Items of TfpgComboBox did not update the displayed text.
* Added a new option to the TfpgBaseComboBox.Options called wo_AllowUserBlank. By default a user cannot use Up arrow to reset/blank the ComboBox to FocusItem = -1. You now have to add wo_AllowUserBlank in the Options to enable that.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui_combobox.pas8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/gui_combobox.pas b/src/gui/gui_combobox.pas
index 31dc8989..6840882e 100644
--- a/src/gui/gui_combobox.pas
+++ b/src/gui/gui_combobox.pas
@@ -57,7 +57,7 @@ uses
type
// widget options
- TfpgComboOption = (wo_FocusItemTriggersOnChange);
+ TfpgComboOption = (wo_FocusItemTriggersOnChange, wo_AllowUserBlank);
TfpgComboOptions = set of TfpgComboOption;
@@ -236,6 +236,7 @@ procedure TfpgBaseComboBox.InternalItemsChanged(Sender: TObject);
begin
if FItems.Count = 0 then
FocusItem := -1;
+ Repaint;
end;
procedure TfpgBaseComboBox.HandleKeyPress(var keycode: word;
@@ -263,7 +264,10 @@ begin
keyUp:
begin
- FocusItem := FocusItem - 1;
+ if (FocusItem = 0) and (wo_AllowUserBlank in FOptions) then
+ FocusItem := FocusItem - 1
+ else if FocusItem > 0 then
+ FocusItem := FocusItem - 1;
if old <> FocusItem then
DoOnChange;
consumed := True;