|
@@ -6,6 +6,12 @@ uses
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
|
StdCtrls;
|
|
StdCtrls;
|
|
|
|
|
|
|
|
+type
|
|
|
|
+ TUIStateAwareComboBox = class(TComboBox)
|
|
|
|
+ protected
|
|
|
|
+ procedure ComboWndProc(var Message: TMessage; ComboWnd: HWnd; ComboProc: TWindowProcPtr); override;
|
|
|
|
+ end;
|
|
|
|
+
|
|
type
|
|
type
|
|
THistorySaveOn = set of (soExit, soDropDown);
|
|
THistorySaveOn = set of (soExit, soDropDown);
|
|
|
|
|
|
@@ -19,7 +25,7 @@ type
|
|
THistoryComboBoxGetData = procedure(Sender: THistoryComboBox; var Data: Pointer) of object;
|
|
THistoryComboBoxGetData = procedure(Sender: THistoryComboBox; var Data: Pointer) of object;
|
|
THistoryComboBoxSetData = procedure(Sender: THistoryComboBox; Data: Pointer) of object;
|
|
THistoryComboBoxSetData = procedure(Sender: THistoryComboBox; Data: Pointer) of object;
|
|
|
|
|
|
- THistoryComboBox = class(TComboBox)
|
|
|
|
|
|
+ THistoryComboBox = class(TUIStateAwareComboBox)
|
|
private
|
|
private
|
|
{ Private declarations }
|
|
{ Private declarations }
|
|
FSaveOn: THistorySaveOn;
|
|
FSaveOn: THistorySaveOn;
|
|
@@ -72,6 +78,19 @@ begin
|
|
Strings.Delete(Strings.Count-1);
|
|
Strings.Delete(Strings.Count-1);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ { TUIStateAwareComboBox }
|
|
|
|
+
|
|
|
|
+procedure TUIStateAwareComboBox.ComboWndProc(var Message: TMessage; ComboWnd: HWnd; ComboProc: TWindowProcPtr);
|
|
|
|
+begin
|
|
|
|
+ inherited;
|
|
|
|
+
|
|
|
|
+ if Message.Msg = WM_SYSKEYDOWN then
|
|
|
|
+ begin
|
|
|
|
+ UpdateUIState(TWMKey(Message).CharCode);
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+
|
|
{ THistoryComboBox }
|
|
{ THistoryComboBox }
|
|
|
|
|
|
constructor THistoryComboBox.Create(AOwner: TComponent);
|
|
constructor THistoryComboBox.Create(AOwner: TComponent);
|