mirror of
https://github.com/winscp/winscp.git
synced 2026-10-24 02:28:55 +03:00
Control labels do not show keyboard accelerator cue, until Alt key is pressed
(including mechanism to inject a different control implementation + as I needed to add an header include to most form header files, I reordered include sections along a bit) Source commit: aa2a1b6f5daf70865c0c87c0733aad1be4825b83
This commit is contained in:
@@ -116,6 +116,8 @@ private:
|
||||
int FVerticalLogPadding;
|
||||
TTextFormat FLogTextFormat;
|
||||
bool FShowNoActivate;
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Configuration.h>
|
||||
#include <SessionData.h>
|
||||
#include <WinInterface.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------
|
||||
enum TWinSCPData {wdConfiguration = 1, wdStoredSessions, wdHostKeys,
|
||||
wdConfigurationIniFile, wdRandomSeedFile, wdTemporaryFolders };
|
||||
@@ -38,6 +39,9 @@ private:
|
||||
void __fastcall InitControls();
|
||||
void __fastcall UpdateControls();
|
||||
bool __fastcall GetCleanupData(TWinSCPData Data);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
virtual __fastcall TCleanupDialog(TComponent* AOwner);
|
||||
__property TStoredSessionList *SessionList = { read=FSessionList, write=FSessionList };
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "PngImageList.hpp"
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <System.Actions.hpp>
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
class TConsoleDialog : public TForm
|
||||
{
|
||||
@@ -79,6 +80,8 @@ protected:
|
||||
virtual void __fastcall Dispatch(void * Message);
|
||||
void __fastcall DoAdjustWindow();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
virtual __fastcall ~TConsoleDialog();
|
||||
virtual __fastcall TConsoleDialog(TComponent* AOwner);
|
||||
|
||||
@@ -76,6 +76,9 @@ protected:
|
||||
bool __fastcall RemotePaths();
|
||||
void __fastcall CopyParamListPopup(TRect R, int AdditionalOptions);
|
||||
int __fastcall ActualCopyParamAttrs();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
__fastcall TCopyDialog(
|
||||
TComponent* Owner, bool ToRemote, bool Move, TStrings * FileList, int Options,
|
||||
|
||||
@@ -47,6 +47,8 @@ protected:
|
||||
TCopyParamRule * __fastcall GetRule();
|
||||
void __fastcall SetRuleData(const TCopyParamRuleData & Data);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
__fastcall TCopyParamPresetDialog(TComponent * Owner,
|
||||
TCopyParamPresetMode Mode, TCopyParamRuleData * CurrentRuleData);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include <Bookmarks.h>
|
||||
#include <GUITools.h>
|
||||
#include "RightsExt.h"
|
||||
#include "Rights.h"
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -43,6 +44,8 @@ public:
|
||||
protected:
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
private:
|
||||
int FAllowedChanges;
|
||||
};
|
||||
|
||||
@@ -55,6 +55,8 @@ private:
|
||||
protected:
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
__fastcall TCustomCommandDialog(TComponent* Owner,
|
||||
const TCustomCommandList * CustomCommandList, TCustomCommandsMode Mode,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <Buttons.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include <WinInterface.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
class TEditMaskDialog : public TForm
|
||||
{
|
||||
@@ -53,6 +54,8 @@ protected:
|
||||
void __fastcall LoadFileMasks(TMemo * Memo, TStrings * MasksStr);
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
private:
|
||||
UnicodeString FExcludeDirectoryMasks;
|
||||
bool FChanging;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <Forms.hpp>
|
||||
#include "HistoryComboBox.hpp"
|
||||
//---------------------------------------------------------------------------
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
class TEditorPreferencesDialog : public TForm
|
||||
{
|
||||
__published:
|
||||
@@ -49,6 +51,8 @@ private:
|
||||
|
||||
bool FMayRemote;
|
||||
UnicodeString FSystemExternalEditor;
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -135,6 +135,8 @@ private:
|
||||
void __fastcall FileDownloadFinished(const UnicodeString & FileName, bool Success);
|
||||
TListItem * __fastcall FileOperationFinished(const UnicodeString & FileName);
|
||||
void __fastcall FileListOperation(TFileListOperationEvent Operation, TFileOperationFinishedEvent OnFileOperationFinished);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include <Vcl.ActnList.hpp>
|
||||
#include <Vcl.StdActns.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
typedef void __fastcall (__closure *TFeedFileSystemData)
|
||||
(TControl * Control, int Label, UnicodeString Value);
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -95,6 +97,8 @@ private:
|
||||
void __fastcall NeedSpaceAvailable();
|
||||
bool __fastcall SpaceAvailableSupported();
|
||||
void __fastcall FeedControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -7,13 +7,14 @@
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <HistoryComboBox.hpp>
|
||||
|
||||
#include <WinInterface.h>
|
||||
#include <CopyParam.h>
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include <WinInterface.h>
|
||||
#include <CopyParam.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
class TFullSynchronizeDialog : public TForm
|
||||
{
|
||||
__published:
|
||||
@@ -114,6 +115,8 @@ public:
|
||||
|
||||
protected:
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
#include <Vcl.Controls.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
#include <Vcl.Forms.hpp>
|
||||
|
||||
#include "SessionData.h"
|
||||
#include <Vcl.ComCtrls.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
#include <System.Actions.hpp>
|
||||
#include <Vcl.ActnList.hpp>
|
||||
#include <Vcl.StdActns.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include "SessionData.h"
|
||||
#include <WinInterface.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
class TGenerateUrlDialog : public TForm
|
||||
{
|
||||
@@ -75,6 +76,8 @@ protected:
|
||||
UnicodeString __fastcall GenerateAssemblyCode(UnicodeString & AssemblyDescription);
|
||||
void __fastcall AddSampleDescription(UnicodeString & Description);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
__fastcall TGenerateUrlDialog(
|
||||
TComponent * Owner, TSessionData * Data, TFilesSelected FilesSelected, TStrings * Paths,
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#include <Vcl.ComCtrls.hpp>
|
||||
#include <Vcl.Controls.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
//---------------------------------------------------------------------
|
||||
#include <SessionData.h>
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------
|
||||
class TImportSessionsDialog : public TForm
|
||||
{
|
||||
@@ -48,6 +49,8 @@ private:
|
||||
virtual void __fastcall DestroyHandle();
|
||||
virtual void __fastcall Dispatch(void * Message);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
virtual __fastcall TImportSessionsDialog(TComponent * AOwner);
|
||||
void __fastcall Init(TList * SessionListsList, TStrings * Errors);
|
||||
|
||||
@@ -8,18 +8,20 @@
|
||||
#include <Vcl.Controls.hpp>
|
||||
#include <Vcl.ImgList.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
#include "IEComboBox.hpp"
|
||||
#include <ComCtrls.hpp>
|
||||
#include <ImgList.hpp>
|
||||
#include "PngImageList.hpp"
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
|
||||
#include <FileOperationProgress.h>
|
||||
#include <Terminal.h>
|
||||
#include <WinInterface.h>
|
||||
#include <Bookmarks.h>
|
||||
#include "IEComboBox.hpp"
|
||||
#include <ComCtrls.hpp>
|
||||
#include <ImgList.hpp>
|
||||
#include <PasTools.hpp>
|
||||
#include "PngImageList.hpp"
|
||||
#include <Vcl.ExtCtrls.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
class TLocationProfilesDialog : public TForm
|
||||
{
|
||||
@@ -161,6 +163,8 @@ private:
|
||||
TBookmarkList * Source);
|
||||
bool __fastcall ProfileMatch(TTreeNode * Node);
|
||||
UnicodeString __fastcall BookmarkText(TBookmark * Bookmark);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <SessionData.h>
|
||||
#include <PasTools.hpp>
|
||||
#include <System.Actions.hpp>
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
class TLoginDialog : public TForm
|
||||
{
|
||||
@@ -412,6 +413,8 @@ protected:
|
||||
DYNAMIC void __fastcall ChangeScale(int M, int D);
|
||||
__property TSessionData * SelectedSession = { read=GetSelectedSession };
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
virtual __fastcall TLoginDialog(TComponent* AOwner);
|
||||
__fastcall ~TLoginDialog();
|
||||
|
||||
@@ -124,6 +124,8 @@ private:
|
||||
UnicodeString __fastcall BookmarkDirectory(TBookmark * Bookmark);
|
||||
UnicodeString __fastcall BookmarkText(TBookmark * Bookmark);
|
||||
inline TBookmark * __fastcall GetBookmark(TListBox * BookmarksList, int Index);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
#include <Dialogs.hpp>
|
||||
#include <PasTools.hpp>
|
||||
#include "HistoryComboBox.hpp"
|
||||
#include <WinInterface.h>
|
||||
#include "PathLabel.hpp"
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
#include <WinInterface.h>
|
||||
#include <WinConfiguration.h>
|
||||
#include "PathLabel.hpp"
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
class TCustomCommandList;
|
||||
class TEditorList;
|
||||
@@ -522,6 +523,8 @@ protected:
|
||||
void __fastcall FileColorMove(int Source, int Dest);
|
||||
void __fastcall UpdateFileColorsView();
|
||||
void __fastcall AddEditFileColor(bool Edit);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -134,6 +134,8 @@ protected:
|
||||
virtual void __fastcall Dispatch(void * Message);
|
||||
void __fastcall SetCancelLower(TCancelStatus ACancel);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
static UnicodeString __fastcall ProgressStr(
|
||||
const TSynchronizeProgress * SynchronizeProgress, const TFileOperationProgressType * ProgressData);
|
||||
|
||||
@@ -13,11 +13,10 @@
|
||||
#include <Vcl.Graphics.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include "Rights.h"
|
||||
#include "RightsExt.h"
|
||||
#include <Menus.hpp>
|
||||
//----------------------------------------------------------------------------
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
struct TCalculateSizeStats;
|
||||
//----------------------------------------------------------------------------
|
||||
class TPropertiesDialog : public TForm
|
||||
@@ -121,6 +120,8 @@ protected:
|
||||
virtual void __fastcall Dispatch(void * Message);
|
||||
void __fastcall UpdateFileImage();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
virtual __fastcall TPropertiesDialog(TComponent * AOwner,
|
||||
TStrings * FileList, const UnicodeString Directory,
|
||||
|
||||
@@ -50,6 +50,8 @@ private:
|
||||
bool FDirectCopy;
|
||||
bool FMulti;
|
||||
TDirectRemoteCopy FAllowDirectCopy;
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -8,10 +8,11 @@
|
||||
#include <Forms.hpp>
|
||||
#include <HistoryComboBox.hpp>
|
||||
#include <CustomDirView.hpp>
|
||||
|
||||
#include <WinInterface.h>
|
||||
#include <Buttons.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include <WinInterface.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
class TSelectMaskDialog : public TForm
|
||||
{
|
||||
__published:
|
||||
@@ -45,6 +46,8 @@ private:
|
||||
void __fastcall ColorChange(TColor Color);
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
enum TMode { smSelect, smDeselect, smFilter, smFileColor };
|
||||
__fastcall TSelectMaskDialog(TComponent* Owner);
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
#include <Vcl.Mask.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
#include <Vcl.StdCtrls.hpp>
|
||||
#include "PngImageList.hpp"
|
||||
//----------------------------------------------------------------------------
|
||||
#include <Configuration.h>
|
||||
#include <SessionData.h>
|
||||
#include <PasTools.hpp>
|
||||
|
||||
#include "PngImageList.hpp"
|
||||
#include <GUITools.h>
|
||||
//----------------------------------------------------------------------------
|
||||
class TSiteAdvancedDialog : public TForm
|
||||
{
|
||||
@@ -353,6 +353,8 @@ private:
|
||||
bool __fastcall IsNeon(TFSProtocol FSProtocol);
|
||||
void __fastcall PrivateKeyCreatedOrModified(TObject * Sender, const UnicodeString FileName);
|
||||
TCustomEdit * __fastcall GetEncryptKeyEdit(bool AShow = true);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//----------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <Controls.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include "CopyParam.h"
|
||||
#include "GUITools.h"
|
||||
//---------------------------------------------------------------------------
|
||||
class TSymlinkDialog : public TForm
|
||||
{
|
||||
@@ -47,6 +49,8 @@ public:
|
||||
__property bool SymbolicLink = { read = GetSymbolicLink, write = SetSymbolicLink };
|
||||
protected:
|
||||
void __fastcall UpdateControls();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -7,14 +7,15 @@
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <HistoryComboBox.hpp>
|
||||
|
||||
#include <WinInterface.h>
|
||||
#include "GrayedCheckBox.hpp"
|
||||
#include <ComCtrls.hpp>
|
||||
#include <ExtCtrls.hpp>
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
#include <Vcl.Menus.hpp>
|
||||
//---------------------------------------------------------------------------
|
||||
#include <WinInterface.h>
|
||||
#include <GUITools.h>
|
||||
//---------------------------------------------------------------------------
|
||||
struct TLogItemData;
|
||||
//---------------------------------------------------------------------------
|
||||
class TSynchronizeDialog : public TForm
|
||||
@@ -133,6 +134,8 @@ protected:
|
||||
void __fastcall UpdateControls();
|
||||
bool __fastcall AllowStartInNewWindow();
|
||||
|
||||
INTERFACE_HOOK;
|
||||
|
||||
public:
|
||||
__fastcall TSynchronizeDialog(TComponent * Owner);
|
||||
void __fastcall Init(TSynchronizeStartStopEvent OnStartStop,
|
||||
|
||||
@@ -71,6 +71,8 @@ private:
|
||||
void __fastcall GlobalMinimize(TObject * Sender);
|
||||
void __fastcall CancelOperation();
|
||||
void __fastcall CMDialogKey(TCMDialogKey & Message);
|
||||
|
||||
INTERFACE_HOOK;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
#endif
|
||||
|
||||
@@ -2068,3 +2068,31 @@ void __fastcall TNewRichEdit::DestroyWnd()
|
||||
FreeLibrary(FLibrary);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
static int HideAccelFlag(TControl * Control)
|
||||
{
|
||||
//ask the top level window about its UI state
|
||||
while (Control->Parent != NULL)
|
||||
{
|
||||
Control = Control->Parent;
|
||||
}
|
||||
int Result;
|
||||
if (FLAGSET(Control->Perform(WM_QUERYUISTATE, 0, 0), UISF_HIDEACCEL))
|
||||
{
|
||||
Result = DT_HIDEPREFIX;
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = 0;
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TUIStateAwareLabel::DoDrawText(TRect & Rect, int Flags)
|
||||
{
|
||||
if (ShowAccelChar)
|
||||
{
|
||||
Flags = Flags | HideAccelFlag(this);
|
||||
}
|
||||
TLabel::DoDrawText(Rect, Flags);
|
||||
}
|
||||
|
||||
@@ -179,6 +179,30 @@ private:
|
||||
HINSTANCE FLibrary;
|
||||
};
|
||||
//---------------------------------------------------------------------------
|
||||
// Based on:
|
||||
// https://stackoverflow.com/q/6912424/850848
|
||||
// https://stackoverflow.com/q/4685863/850848
|
||||
class TUIStateAwareLabel : public TLabel
|
||||
{
|
||||
protected:
|
||||
DYNAMIC void __fastcall DoDrawText(TRect & Rect, int Flags);
|
||||
};
|
||||
#define INTERFACE_HOOK \
|
||||
protected: \
|
||||
virtual void __fastcall ReadState(TReader * Reader) \
|
||||
{ \
|
||||
Reader->OnFindComponentClass = FindComponentClass; \
|
||||
TForm::ReadState(Reader); \
|
||||
} \
|
||||
\
|
||||
void __fastcall FindComponentClass(TReader * Reader, const UnicodeString ClassName, TComponentClass & ComponentClass) \
|
||||
{ \
|
||||
if (ComponentClass == __classid(TLabel)) \
|
||||
{ \
|
||||
ComponentClass = __classid(TUIStateAwareLabel); \
|
||||
} \
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
extern const UnicodeString PageantTool;
|
||||
extern const UnicodeString PuttygenTool;
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user