1
0
mirror of https://github.com/winscp/winscp.git synced 2026-10-24 02:28:55 +03:00

Bug fix: Pressing Alt with combo box focused did not show keyboard accelerators

Related to 4031057b67

Source commit: b796982e9cbd43669629b7a1d9cd3b4c8fa3515f
This commit is contained in:
Martin Prikryl
2019-01-16 13:18:51 +00:00
parent 68545d2a15
commit 822683ed3c
2 changed files with 25 additions and 1 deletions

View File

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

View File

@@ -25,6 +25,7 @@
#include <VCLCommon.h>
#include <WinApi.h>
#include <Vcl.ScreenTips.hpp>
#include <HistoryComboBox.hpp>
#include <vssym32.h>
#include "Animations96.h"
@@ -2104,4 +2105,8 @@ void __fastcall FindComponentClass(
{
ComponentClass = __classid(TUIStateAwareLabel);
}
else if (ComponentClass == __classid(TComboBox))
{
ComponentClass = __classid(TUIStateAwareComboBox);
}
}