Skip to content
This repository was archived by the owner on Nov 29, 2024. It is now read-only.

Commit f9602b7

Browse files
committed
Make GUI DPI-aware
1 parent f981dfb commit f9602b7

File tree

21 files changed

+208
-200
lines changed

21 files changed

+208
-200
lines changed

EAPMethods/src/Main_UI.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID l
5151
#endif
5252
g_peer.m_instance = hinstDLL;
5353

54+
#if _WIN32_WINNT >= _WIN32_WINNT_VISTA
55+
// Declare our DllHost process as DPI-aware.
56+
SetProcessDPIAware();
57+
#endif
58+
5459
// Save current activation context, as proper activation context is set at this time only (LoadLibrary() call).
5560
GetCurrentActCtx(&g_act_ctx);
5661
} else if (fdwReason == DLL_PROCESS_DETACH) {

EventMonitor/ETWLog.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos
168168
m_rec_idx(wxETWEVENT_RECORDS_MAX),
169169
wxListCtrl(parent, id, pos, size, style, validator, name)
170170
{
171-
this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, 160);
172-
this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, 50);
173-
this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, 50);
174-
this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, 80);
175-
this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, 350);
171+
this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, FromDIP(160));
172+
this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, FromDIP( 50));
173+
this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, FromDIP( 50));
174+
this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, FromDIP( 80));
175+
this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, FromDIP(350));
176176

177177
// Maximum expected column widths for pre-formatted row display
178178
m_col_format_width[0] = 26;

EventMonitor/Frame.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
//////////////////////////////////////////////////////////////////////////
2727

2828

29-
wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) :
30-
wxFrame(parent, id, title, pos, size, style, name)
29+
wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style, const wxString& name) :
30+
wxFrame(parent, id, title, pos, parent->FromDIP(wxSize(600,400)), style, name)
3131
{
32-
this->SetSizeHints(wxSize(150,150), wxDefaultSize);
32+
this->SetSizeHints(FromDIP(wxSize(150,150)), wxDefaultSize);
3333
m_mgr.SetManagedWindow(this);
3434
m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
3535

EventMonitor/Frame.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class wxEventMonitorFrame : public wxFrame
7272
/// \param[in] style The window style. See `wxFrame` class description.
7373
/// \param[in] name The name of the window. This parameter is used to associate a name with the item, allowing the application user to set Motif resource values for individual windows.
7474
///
75-
wxEventMonitorFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Event Monitor"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(600,400), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("EventMonitor"));
75+
wxEventMonitorFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Event Monitor"), const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("EventMonitor"));
7676

7777
///
7878
/// Destructor

EventMonitor/res/wxEventMonitor_UI.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wxEventMonitorLogPanelBase::wxEventMonitorLogPanelBase( wxWindow* parent, wxWind
1919
bSizerMain = new wxBoxSizer( wxVERTICAL );
2020

2121
m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER, wxDefaultValidator, wxT("EventMonitorLog") );
22-
bSizerMain->Add( m_log, 1, wxEXPAND, 5 );
22+
bSizerMain->Add( m_log, 1, wxEXPAND, FromDIP(5) );
2323

2424

2525
this->SetSizer( bSizerMain );

include/Common.props

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
<POCompile>
4848
<OutputFile>$(OutDir)..\locale\%(Filename)\$(ProjectName).mo</OutputFile>
4949
</POCompile>
50+
<Manifest>
51+
<EnableDpiAwareness>true</EnableDpiAwareness>
52+
</Manifest>
5053
</ItemDefinitionGroup>
5154
<ItemGroup />
5255
</Project>

lib/EAPBase_UI/include/EAP_UI.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ class wxEAPCredentialsPanel : public _Tbase
917917
if (!is_config && !m_cfg.m_use_cred && m_cfg.m_allow_save) {
918918
m_remember = new wxCheckBox(m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Remember"));
919919
m_remember->SetHelpText(_("Check if you would like to save credentials"));
920-
m_sb_credentials_vert->Add(m_remember, 0, wxALL|wxEXPAND, 5);
920+
m_sb_credentials_vert->Add(m_remember, 0, wxALL|wxEXPAND, FromDIP(5));
921921
} else
922922
m_remember = NULL;
923923
}
@@ -980,7 +980,7 @@ class wxPasswordCredentialsPanel : public wxEAPCredentialsPanel<_Tcred, _Tbase>
980980
bool layout = false;
981981
if (!m_prov.m_lbl_alt_credential.empty()) {
982982
m_credentials_label->SetLabel(m_prov.m_lbl_alt_credential);
983-
m_credentials_label->Wrap( 440 );
983+
m_credentials_label->Wrap( FromDIP(440) );
984984
layout = true;
985985
}
986986

0 commit comments

Comments
 (0)