From 10297c7ab3e316ebd5accc52f3017943def4f61f Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Mon, 17 Sep 2018 11:43:19 +0200 Subject: [PATCH] Make GUI DPI-aware --- EAPMethods/src/Main_UI.cpp | 5 + EventMonitor/ETWLog.cpp | 10 +- EventMonitor/Frame.cpp | 6 +- EventMonitor/Frame.h | 2 +- EventMonitor/res/wxEventMonitor_UI.cpp | 2 +- include/Common.props | 3 + lib/EAPBase_UI/include/EAP_UI.h | 4 +- lib/EAPBase_UI/res/wxEAP_UI.cpp | 220 ++++++++++++------------- lib/EAPBase_UI/res/wxEAP_UI.h | 14 +- lib/EAPBase_UI/src/EAP_UI.cpp | 32 ++-- lib/EapHost_UI/res/wxEapHost_UI.cpp | 18 +- lib/EapHost_UI/res/wxEapHost_UI.h | 2 +- lib/EapHost_UI/src/EapHost_UI.cpp | 2 +- lib/GTC_UI/res/wxGTC_UI.cpp | 28 ++-- lib/GTC_UI/res/wxGTC_UI.h | 4 +- lib/GTC_UI/src/GTC_UI.cpp | 2 +- lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp | 2 +- lib/PAP_UI/src/PAP_UI.cpp | 2 +- lib/TLS_UI/res/wxTLS_UI.cpp | 54 +++--- lib/TLS_UI/res/wxTLS_UI.h | 4 +- lib/TLS_UI/src/TLS_UI.cpp | 4 +- lib/TTLS_UI/res/wxTTLS_UI.cpp | 24 +-- lib/TTLS_UI/res/wxTTLS_UI.h | 2 +- lib/TTLS_UI/src/TTLS_UI.cpp | 18 +- 24 files changed, 236 insertions(+), 228 deletions(-) diff --git a/EAPMethods/src/Main_UI.cpp b/EAPMethods/src/Main_UI.cpp index aba2414..58bee06 100644 --- a/EAPMethods/src/Main_UI.cpp +++ b/EAPMethods/src/Main_UI.cpp @@ -51,6 +51,11 @@ BOOL WINAPI DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID l #endif g_peer.m_instance = hinstDLL; +#if _WIN32_WINNT >= _WIN32_WINNT_VISTA + // Declare our DllHost process as DPI-aware. + SetProcessDPIAware(); +#endif + // Save current activation context, as proper activation context is set at this time only (LoadLibrary() call). GetCurrentActCtx(&g_act_ctx); } else if (fdwReason == DLL_PROCESS_DETACH) { diff --git a/EventMonitor/ETWLog.cpp b/EventMonitor/ETWLog.cpp index aa28dbe..fe8e74d 100644 --- a/EventMonitor/ETWLog.cpp +++ b/EventMonitor/ETWLog.cpp @@ -168,11 +168,11 @@ wxETWListCtrl::wxETWListCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos m_rec_idx(wxETWEVENT_RECORDS_MAX), wxListCtrl(parent, id, pos, size, style, validator, name) { - this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, 160); - this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, 50); - this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, 50); - this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, 80); - this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, 350); + this->AppendColumn(_("Time" ), wxLIST_FORMAT_LEFT, FromDIP(160)); + this->AppendColumn(_("PID" ), wxLIST_FORMAT_LEFT, FromDIP( 50)); + this->AppendColumn(_("TID" ), wxLIST_FORMAT_LEFT, FromDIP( 50)); + this->AppendColumn(_("Source"), wxLIST_FORMAT_LEFT, FromDIP( 80)); + this->AppendColumn(_("Event" ), wxLIST_FORMAT_LEFT, FromDIP(350)); // Maximum expected column widths for pre-formatted row display m_col_format_width[0] = 26; diff --git a/EventMonitor/Frame.cpp b/EventMonitor/Frame.cpp index 217dfb3..94e3b14 100644 --- a/EventMonitor/Frame.cpp +++ b/EventMonitor/Frame.cpp @@ -26,10 +26,10 @@ ////////////////////////////////////////////////////////////////////////// -wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name) : - wxFrame(parent, id, title, pos, size, style, name) +wxEventMonitorFrame::wxEventMonitorFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style, const wxString& name) : + wxFrame(parent, id, title, pos, parent->FromDIP(wxSize(600,400)), style, name) { - this->SetSizeHints(wxSize(150,150), wxDefaultSize); + this->SetSizeHints(FromDIP(wxSize(150,150)), wxDefaultSize); m_mgr.SetManagedWindow(this); m_mgr.SetFlags(wxAUI_MGR_DEFAULT); diff --git a/EventMonitor/Frame.h b/EventMonitor/Frame.h index faff92e..1e751b3 100644 --- a/EventMonitor/Frame.h +++ b/EventMonitor/Frame.h @@ -72,7 +72,7 @@ public: /// \param[in] style The window style. See `wxFrame` class description. /// \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. /// - 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")); + 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")); /// /// Destructor diff --git a/EventMonitor/res/wxEventMonitor_UI.cpp b/EventMonitor/res/wxEventMonitor_UI.cpp index 99a35d8..aa10d70 100644 --- a/EventMonitor/res/wxEventMonitor_UI.cpp +++ b/EventMonitor/res/wxEventMonitor_UI.cpp @@ -19,7 +19,7 @@ wxEventMonitorLogPanelBase::wxEventMonitorLogPanelBase( wxWindow* parent, wxWind bSizerMain = new wxBoxSizer( wxVERTICAL ); m_log = new wxETWListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_SORT_HEADER|wxLC_REPORT|wxLC_VIRTUAL|wxNO_BORDER, wxDefaultValidator, wxT("EventMonitorLog") ); - bSizerMain->Add( m_log, 1, wxEXPAND, 5 ); + bSizerMain->Add( m_log, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( bSizerMain ); diff --git a/include/Common.props b/include/Common.props index 8f556f5..fc71435 100644 --- a/include/Common.props +++ b/include/Common.props @@ -47,6 +47,9 @@ $(OutDir)..\locale\%(Filename)\$(ProjectName).mo + + true + \ No newline at end of file diff --git a/lib/EAPBase_UI/include/EAP_UI.h b/lib/EAPBase_UI/include/EAP_UI.h index 6841888..c5a3647 100644 --- a/lib/EAPBase_UI/include/EAP_UI.h +++ b/lib/EAPBase_UI/include/EAP_UI.h @@ -918,7 +918,7 @@ public: if (!is_config && !m_cfg.m_use_cred && m_cfg.m_allow_save) { m_remember = new wxCheckBox(m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Remember")); m_remember->SetHelpText(_("Check if you would like to save credentials")); - m_sb_credentials_vert->Add(m_remember, 0, wxALL|wxEXPAND, 5); + m_sb_credentials_vert->Add(m_remember, 0, wxALL|wxEXPAND, FromDIP(5)); } else m_remember = NULL; } @@ -980,7 +980,7 @@ public: bool layout = false; if (!m_prov.m_lbl_alt_credential.empty()) { m_credentials_label->SetLabel(m_prov.m_lbl_alt_credential); - m_credentials_label->Wrap( 440 ); + m_credentials_label->Wrap( FromDIP(440) ); layout = true; } diff --git a/lib/EAPBase_UI/res/wxEAP_UI.cpp b/lib/EAPBase_UI/res/wxEAP_UI.cpp index 61bf4fa..54f9c4a 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.cpp +++ b/lib/EAPBase_UI/res/wxEAP_UI.cpp @@ -20,13 +20,13 @@ wxEAPConfigDialogBase::wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id, c m_banner = new wxEAPBannerPanel( this ); - sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_providers = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_providers->SetExtraStyle( wxWS_EX_VALIDATE_RECURSIVELY ); - sb_content->Add( m_providers, 1, wxEXPAND|wxALL, 10 ); + sb_content->Add( m_providers, 1, wxEXPAND|wxALL, FromDIP(10) ); wxBoxSizer* sb_bottom_horiz; sb_bottom_horiz = new wxBoxSizer( wxHORIZONTAL ); @@ -34,23 +34,23 @@ wxEAPConfigDialogBase::wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id, c wxBoxSizer* sb_bottom_horiz_inner; sb_bottom_horiz_inner = new wxBoxSizer( wxHORIZONTAL ); - m_prov_add = new wxButton( this, wxID_ANY, _("+"), wxDefaultPosition, wxSize( 30,-1 ), 0 ); + m_prov_add = new wxButton( this, wxID_ANY, _("+"), wxDefaultPosition, FromDIP(wxSize( 30,-1 )), 0 ); m_prov_add->SetToolTip( _("Adds new provider") ); - sb_bottom_horiz_inner->Add( m_prov_add, 0, wxALL, 5 ); + sb_bottom_horiz_inner->Add( m_prov_add, 0, wxALL, FromDIP(5) ); - m_prov_remove = new wxButton( this, wxID_ANY, _("-"), wxDefaultPosition, wxSize( 30,-1 ), 0 ); + m_prov_remove = new wxButton( this, wxID_ANY, _("-"), wxDefaultPosition, FromDIP(wxSize( 30,-1 )), 0 ); m_prov_remove->SetToolTip( _("Removes selected provider") ); - sb_bottom_horiz_inner->Add( m_prov_remove, 0, wxALL, 5 ); + sb_bottom_horiz_inner->Add( m_prov_remove, 0, wxALL, FromDIP(5) ); m_prov_advanced = new wxButton( this, wxID_ANY, _("Advanced..."), wxDefaultPosition, wxDefaultSize, 0 ); m_prov_advanced->SetToolTip( _("Opens dialog with provider settings") ); - sb_bottom_horiz_inner->Add( m_prov_advanced, 0, wxALL, 5 ); + sb_bottom_horiz_inner->Add( m_prov_advanced, 0, wxALL, FromDIP(5) ); - sb_bottom_horiz->Add( sb_bottom_horiz_inner, 1, wxEXPAND, 5 ); + sb_bottom_horiz->Add( sb_bottom_horiz_inner, 1, wxEXPAND, FromDIP(5) ); m_buttons = new wxStdDialogButtonSizer(); m_buttonsOK = new wxButton( this, wxID_OK ); @@ -59,10 +59,10 @@ wxEAPConfigDialogBase::wxEAPConfigDialogBase( wxWindow* parent, wxWindowID id, c m_buttons->AddButton( m_buttonsCancel ); m_buttons->Realize(); - sb_bottom_horiz->Add( m_buttons, 0, wxEXPAND|wxALL, 5 ); + sb_bottom_horiz->Add( m_buttons, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_content->Add( sb_bottom_horiz, 0, wxEXPAND, 5 ); + sb_content->Add( sb_bottom_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_content ); @@ -97,12 +97,12 @@ wxEAPGeneralDialogBase::wxEAPGeneralDialogBase( wxWindow* parent, wxWindowID id, m_banner = new wxEAPBannerPanel( this ); - sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_panels = new wxBoxSizer( wxVERTICAL ); - sb_content->Add( m_panels, 1, wxEXPAND|wxALL, 5 ); + sb_content->Add( m_panels, 1, wxEXPAND|wxALL, FromDIP(5) ); m_buttons = new wxStdDialogButtonSizer(); m_buttonsOK = new wxButton( this, wxID_OK ); @@ -111,7 +111,7 @@ wxEAPGeneralDialogBase::wxEAPGeneralDialogBase( wxWindow* parent, wxWindowID id, m_buttons->AddButton( m_buttonsCancel ); m_buttons->Realize(); - sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 ); + sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, FromDIP(5) ); this->SetSizer( sb_content ); @@ -138,13 +138,13 @@ wxEAPCredentialsConnectionDialogBase::wxEAPCredentialsConnectionDialogBase( wxWi m_banner = new wxEAPBannerPanel( this ); - sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_providers = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_providers->SetExtraStyle( wxWS_EX_VALIDATE_RECURSIVELY ); - sb_content->Add( m_providers, 1, wxEXPAND | wxALL, 5 ); + sb_content->Add( m_providers, 1, wxEXPAND | wxALL, FromDIP(5) ); m_buttons = new wxStdDialogButtonSizer(); m_buttonsOK = new wxButton( this, wxID_OK ); @@ -153,7 +153,7 @@ wxEAPCredentialsConnectionDialogBase::wxEAPCredentialsConnectionDialogBase( wxWi m_buttons->AddButton( m_buttonsCancel ); m_buttons->Realize(); - sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 ); + sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, FromDIP(5) ); this->SetSizer( sb_content ); @@ -174,7 +174,7 @@ wxEAPCredentialsConnectionDialogBase::~wxEAPCredentialsConnectionDialogBase() wxEAPBannerPanelBase::wxEAPBannerPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) { this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ); - this->SetMinSize( wxSize( -1,48 ) ); + this->SetMinSize( FromDIP(wxSize( -1,48 )) ); wxBoxSizer* sb_content; sb_content = new wxBoxSizer( wxVERTICAL ); @@ -184,7 +184,7 @@ wxEAPBannerPanelBase::wxEAPBannerPanelBase( wxWindow* parent, wxWindowID id, con m_title->SetFont( wxFont( 18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); m_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHTTEXT ) ); - sb_content->Add( m_title, 0, wxALL|wxEXPAND, 5 ); + sb_content->Add( m_title, 0, wxALL|wxEXPAND, FromDIP(5) ); this->SetSizer( sb_content ); @@ -196,7 +196,7 @@ wxEAPBannerPanelBase::~wxEAPBannerPanelBase() { } -wxEAPNotePanelBase::wxEAPNotePanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +wxEAPNotePanelBase::wxEAPNotePanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) ); @@ -204,16 +204,16 @@ wxEAPNotePanelBase::wxEAPNotePanelBase( wxWindow* parent, wxWindowID id, const w sb_note_horiz = new wxBoxSizer( wxHORIZONTAL ); m_note_icon = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_note_horiz->Add( m_note_icon, 0, wxALL, 5 ); + sb_note_horiz->Add( m_note_icon, 0, wxALL, FromDIP(5) ); m_note_vert = new wxBoxSizer( wxVERTICAL ); m_note_label = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_note_label->Wrap( 449 ); - m_note_vert->Add( m_note_label, 0, wxALL|wxEXPAND, 5 ); + m_note_label->Wrap( FromDIP(449) ); + m_note_vert->Add( m_note_label, 0, wxALL|wxEXPAND, FromDIP(5) ); - sb_note_horiz->Add( m_note_vert, 1, wxEXPAND, 5 ); + sb_note_horiz->Add( m_note_vert, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_note_horiz ); @@ -224,7 +224,7 @@ wxEAPNotePanelBase::~wxEAPNotePanelBase() { } -wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("%s User Credentials") ), wxVERTICAL ); @@ -232,19 +232,19 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 ); + sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_credentials_vert; sb_credentials_vert = new wxBoxSizer( wxVERTICAL ); m_credentials_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Select the source where your credentials used to connect are stored."), wxDefaultPosition, wxDefaultSize, 0 ); - m_credentials_label->Wrap( 440 ); - sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 ); + m_credentials_label->Wrap( FromDIP(440) ); + sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, FromDIP(5) ); m_storage = new wxRadioButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from Credential &Manager"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_storage->SetToolTip( _("Select this option if you would like to use credentials stored in Windows Credential Manager") ); - sb_credentials_vert->Add( m_storage, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + sb_credentials_vert->Add( m_storage, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, FromDIP(5) ); wxBoxSizer* sb_storage; sb_storage = new wxBoxSizer( wxVERTICAL ); @@ -254,17 +254,17 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare m_storage_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Identity:"), wxDefaultPosition, wxDefaultSize, 0 ); m_storage_identity_label->Wrap( -1 ); - sb_storage_identity->Add( m_storage_identity_label, 0, 0, 5 ); + sb_storage_identity->Add( m_storage_identity_label, 0, 0, FromDIP(5) ); m_storage_identity = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_storage_identity->Wrap( -1 ); m_storage_identity->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_storage_identity->SetToolTip( _("Your present credentials stored in Windows Credential Manager") ); - sb_storage_identity->Add( m_storage_identity, 1, wxEXPAND|wxLEFT, 5 ); + sb_storage_identity->Add( m_storage_identity, 1, wxEXPAND|wxLEFT, FromDIP(5) ); - sb_storage->Add( sb_storage_identity, 1, wxEXPAND, 5 ); + sb_storage->Add( sb_storage_identity, 1, wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_buttons_storage; sb_buttons_storage = new wxBoxSizer( wxHORIZONTAL ); @@ -272,23 +272,23 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare m_storage_clear = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Clear Credentials"), wxDefaultPosition, wxDefaultSize, 0 ); m_storage_clear->SetToolTip( _("Click to clear your credentials from Credential Manager.\nNote: You will be prompted to enter credentials when connecting.") ); - sb_buttons_storage->Add( m_storage_clear, 0, wxRIGHT, 5 ); + sb_buttons_storage->Add( m_storage_clear, 0, wxRIGHT, FromDIP(5) ); m_storage_set = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); m_storage_set->SetToolTip( _("Click here to set or modify your credentials") ); - sb_buttons_storage->Add( m_storage_set, 0, wxLEFT, 5 ); + sb_buttons_storage->Add( m_storage_set, 0, wxLEFT, FromDIP(5) ); - sb_storage->Add( sb_buttons_storage, 0, wxALIGN_RIGHT|wxTOP, 5 ); + sb_storage->Add( sb_buttons_storage, 0, wxALIGN_RIGHT|wxTOP, FromDIP(5) ); - sb_credentials_vert->Add( sb_storage, 0, wxEXPAND|wxALL, 5 ); + sb_credentials_vert->Add( sb_storage, 0, wxEXPAND|wxALL, FromDIP(5) ); m_config = new wxRadioButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Use credentials from &profile configuration"), wxDefaultPosition, wxDefaultSize, 0 ); m_config->SetToolTip( _("Select this option if you would like to store credentials as a part of profile configuration") ); - sb_credentials_vert->Add( m_config, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + sb_credentials_vert->Add( m_config, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, FromDIP(5) ); wxBoxSizer* sb_config; sb_config = new wxBoxSizer( wxVERTICAL ); @@ -298,17 +298,17 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare m_config_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Identity:"), wxDefaultPosition, wxDefaultSize, 0 ); m_config_identity_label->Wrap( -1 ); - sb_config_identity->Add( m_config_identity_label, 0, 0, 5 ); + sb_config_identity->Add( m_config_identity_label, 0, 0, FromDIP(5) ); m_config_identity = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_config_identity->Wrap( -1 ); m_config_identity->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString ) ); m_config_identity->SetToolTip( _("Profile configuration credentials") ); - sb_config_identity->Add( m_config_identity, 1, wxEXPAND|wxLEFT, 5 ); + sb_config_identity->Add( m_config_identity, 1, wxEXPAND|wxLEFT, FromDIP(5) ); - sb_config->Add( sb_config_identity, 1, wxEXPAND, 5 ); + sb_config->Add( sb_config_identity, 1, wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_buttons_config; sb_buttons_config = new wxBoxSizer( wxHORIZONTAL ); @@ -316,19 +316,19 @@ wxEAPCredentialsConfigPanelBase::wxEAPCredentialsConfigPanelBase( wxWindow* pare m_config_set = new wxButton( m_sb_credentials->GetStaticBox(), wxID_ANY, _("&Set Credentials..."), wxDefaultPosition, wxDefaultSize, 0 ); m_config_set->SetToolTip( _("Click here to set or modify your credentials") ); - sb_buttons_config->Add( m_config_set, 0, 0, 5 ); + sb_buttons_config->Add( m_config_set, 0, 0, FromDIP(5) ); - sb_config->Add( sb_buttons_config, 0, wxALIGN_RIGHT|wxTOP, 5 ); + sb_config->Add( sb_buttons_config, 0, wxALIGN_RIGHT|wxTOP, FromDIP(5) ); - sb_credentials_vert->Add( sb_config, 0, wxEXPAND|wxALL, 5 ); + sb_credentials_vert->Add( sb_config, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, 5 ); + sb_credentials_horiz->Add( sb_credentials_vert, 1, wxEXPAND, FromDIP(5) ); - m_sb_credentials->Add( sb_credentials_horiz, 1, wxEXPAND, 5 ); + m_sb_credentials->Add( sb_credentials_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( m_sb_credentials ); @@ -354,7 +354,7 @@ wxEAPCredentialsConfigPanelBase::~wxEAPCredentialsConfigPanelBase() } -wxPasswordCredentialsPanelBase::wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style, name ) +wxPasswordCredentialsPanelBase::wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxEAPCredentialsPanelBase( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User ID and Password") ), wxVERTICAL ); @@ -362,46 +362,46 @@ wxPasswordCredentialsPanelBase::wxPasswordCredentialsPanelBase( wxWindow* parent sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 ); + sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, FromDIP(5) ); m_sb_credentials_vert = new wxBoxSizer( wxVERTICAL ); m_credentials_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Please provide your user ID and password."), wxDefaultPosition, wxDefaultSize, 0 ); - m_credentials_label->Wrap( 440 ); - m_sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 ); + m_credentials_label->Wrap( FromDIP(440) ); + m_sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxFlexGridSizer* sb_credentials_tbl; - sb_credentials_tbl = new wxFlexGridSizer( 0, 2, 5, 5 ); + sb_credentials_tbl = new wxFlexGridSizer( 0, 2, FromDIP(5), FromDIP(5) ); sb_credentials_tbl->AddGrowableCol( 1 ); sb_credentials_tbl->SetFlexibleDirection( wxBOTH ); sb_credentials_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("User ID:"), wxDefaultPosition, wxDefaultSize, 0 ); m_identity_label->Wrap( -1 ); - sb_credentials_tbl->Add( m_identity_label, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_identity_label, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5) ); m_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_identity->SetToolTip( _("Enter your user name here (user@domain.org, DOMAIN\\User, etc.)") ); - sb_credentials_tbl->Add( m_identity, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_identity, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) ); m_password_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Password:"), wxDefaultPosition, wxDefaultSize, 0 ); m_password_label->Wrap( -1 ); - sb_credentials_tbl->Add( m_password_label, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_password_label, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5) ); m_password = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD ); m_password->SetToolTip( _("Enter your password here") ); - sb_credentials_tbl->Add( m_password, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_password, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) ); - m_sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, 5 ); + m_sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, 5 ); + sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, FromDIP(5) ); - m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, 5 ); + m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( m_sb_credentials ); @@ -418,7 +418,7 @@ wxPasswordCredentialsPanelBase::~wxPasswordCredentialsPanelBase() } -wxIdentityCredentialsPanelBase::wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style, name ) +wxIdentityCredentialsPanelBase::wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxEAPCredentialsPanelBase( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User ID") ), wxVERTICAL ); @@ -426,37 +426,37 @@ wxIdentityCredentialsPanelBase::wxIdentityCredentialsPanelBase( wxWindow* parent sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 ); + sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, FromDIP(5) ); m_sb_credentials_vert = new wxBoxSizer( wxVERTICAL ); m_credentials_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Please provide your user ID."), wxDefaultPosition, wxDefaultSize, 0 ); - m_credentials_label->Wrap( 440 ); - m_sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, 5 ); + m_credentials_label->Wrap( FromDIP(440) ); + m_sb_credentials_vert->Add( m_credentials_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxFlexGridSizer* sb_credentials_tbl; - sb_credentials_tbl = new wxFlexGridSizer( 0, 2, 5, 5 ); + sb_credentials_tbl = new wxFlexGridSizer( 0, 2, FromDIP(5), FromDIP(5) ); sb_credentials_tbl->AddGrowableCol( 1 ); sb_credentials_tbl->SetFlexibleDirection( wxBOTH ); sb_credentials_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("User ID:"), wxDefaultPosition, wxDefaultSize, 0 ); m_identity_label->Wrap( -1 ); - sb_credentials_tbl->Add( m_identity_label, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_identity_label, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5) ); m_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_identity->SetToolTip( _("Enter your user name here (user@domain.org, DOMAIN\\User, etc.)") ); - sb_credentials_tbl->Add( m_identity, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sb_credentials_tbl->Add( m_identity, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) ); - m_sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, 5 ); + m_sb_credentials_vert->Add( sb_credentials_tbl, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, 5 ); + sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, FromDIP(5) ); - m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, 5 ); + m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( m_sb_credentials ); @@ -467,7 +467,7 @@ wxIdentityCredentialsPanelBase::~wxIdentityCredentialsPanelBase() { } -wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { wxStaticBoxSizer* sb_provider_contact; sb_provider_contact = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Your Organization") ), wxVERTICAL ); @@ -476,40 +476,40 @@ wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* sb_provider_contact_horiz = new wxBoxSizer( wxHORIZONTAL ); m_provider_contact_icon = new wxStaticBitmap( sb_provider_contact->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_provider_contact_horiz->Add( m_provider_contact_icon, 0, wxALL, 5 ); + sb_provider_contact_horiz->Add( m_provider_contact_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_provider_contact_vert; sb_provider_contact_vert = new wxBoxSizer( wxVERTICAL ); m_provider_contact_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Describe your organization to customize user prompts. When organization is introduced, end-users find program messages easier to understand and act."), wxDefaultPosition, wxDefaultSize, 0 ); - m_provider_contact_label->Wrap( 440 ); - sb_provider_contact_vert->Add( m_provider_contact_label, 0, wxALL|wxEXPAND, 5 ); + m_provider_contact_label->Wrap( FromDIP(440) ); + sb_provider_contact_vert->Add( m_provider_contact_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_provider_name; sb_provider_name = new wxBoxSizer( wxVERTICAL ); m_provider_name_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Your organization &name:"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_name_label->Wrap( -1 ); - sb_provider_name->Add( m_provider_name_label, 0, wxBOTTOM, 5 ); + sb_provider_name->Add( m_provider_name_label, 0, wxBOTTOM, FromDIP(5) ); m_provider_name = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_provider_name->SetToolTip( _("Your organization name as it will appear on helpdesk contact notifications") ); - sb_provider_name->Add( m_provider_name, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_provider_name->Add( m_provider_name, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_provider_name_note = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("(Keep it short, please)"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_name_note->Wrap( -1 ); - sb_provider_name->Add( m_provider_name_note, 0, wxALIGN_RIGHT, 5 ); + sb_provider_name->Add( m_provider_name_note, 0, wxALIGN_RIGHT, FromDIP(5) ); - sb_provider_contact_vert->Add( sb_provider_name, 0, wxEXPAND|wxALL, 5 ); + sb_provider_contact_vert->Add( sb_provider_name, 0, wxEXPAND|wxALL, FromDIP(5) ); wxBoxSizer* sb_provider_helpdesk; sb_provider_helpdesk = new wxBoxSizer( wxVERTICAL ); m_provider_helpdesk_label = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("Helpdesk contact &information:"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_helpdesk_label->Wrap( -1 ); - sb_provider_helpdesk->Add( m_provider_helpdesk_label, 0, wxBOTTOM, 5 ); + sb_provider_helpdesk->Add( m_provider_helpdesk_label, 0, wxBOTTOM, FromDIP(5) ); wxFlexGridSizer* sb_provider_helpdesk_inner; sb_provider_helpdesk_inner = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -521,46 +521,46 @@ wxEAPProviderContactInfoPanelBase::wxEAPProviderContactInfoPanelBase( wxWindow* m_provider_web_icon->Wrap( -1 ); m_provider_web_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Wingdings") ) ); - sb_provider_helpdesk_inner->Add( m_provider_web_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_web_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, FromDIP(5) ); m_provider_web = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_provider_web->SetToolTip( _("Your helpdesk website address") ); - sb_provider_helpdesk_inner->Add( m_provider_web, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_web, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, FromDIP(5) ); m_provider_email_icon = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _("*"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_email_icon->Wrap( -1 ); m_provider_email_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Wingdings") ) ); - sb_provider_helpdesk_inner->Add( m_provider_email_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_email_icon, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, FromDIP(5) ); m_provider_email = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_provider_email->SetToolTip( _("Your helpdesk e-mail address") ); - sb_provider_helpdesk_inner->Add( m_provider_email, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_email, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxBOTTOM, FromDIP(5) ); m_provider_phone_icon = new wxStaticText( sb_provider_contact->GetStaticBox(), wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_phone_icon->Wrap( -1 ); m_provider_phone_icon->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxT("Wingdings") ) ); - sb_provider_helpdesk_inner->Add( m_provider_phone_icon, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_phone_icon, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, FromDIP(5) ); m_provider_phone = new wxTextCtrl( sb_provider_contact->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_provider_phone->SetToolTip( _("Your helpdesk phone number") ); - sb_provider_helpdesk_inner->Add( m_provider_phone, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sb_provider_helpdesk_inner->Add( m_provider_phone, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) ); - sb_provider_helpdesk->Add( sb_provider_helpdesk_inner, 0, wxEXPAND, 5 ); + sb_provider_helpdesk->Add( sb_provider_helpdesk_inner, 0, wxEXPAND, FromDIP(5) ); - sb_provider_contact_vert->Add( sb_provider_helpdesk, 0, wxEXPAND|wxALL, 5 ); + sb_provider_contact_vert->Add( sb_provider_helpdesk, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_provider_contact_horiz->Add( sb_provider_contact_vert, 1, wxEXPAND, 5 ); + sb_provider_contact_horiz->Add( sb_provider_contact_vert, 1, wxEXPAND, FromDIP(5) ); - sb_provider_contact->Add( sb_provider_contact_horiz, 1, wxEXPAND, 5 ); + sb_provider_contact->Add( sb_provider_contact_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_provider_contact ); @@ -571,7 +571,7 @@ wxEAPProviderContactInfoPanelBase::~wxEAPProviderContactInfoPanelBase() { } -wxEAPProviderIDPanelBase::wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +wxEAPProviderIDPanelBase::wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { wxStaticBoxSizer* sb_provider_id; sb_provider_id = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Provider Unique Identifier") ), wxVERTICAL ); @@ -580,51 +580,51 @@ wxEAPProviderIDPanelBase::wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID sb_provider_id_horiz = new wxBoxSizer( wxHORIZONTAL ); m_provider_id_icon = new wxStaticBitmap( sb_provider_id->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_provider_id_horiz->Add( m_provider_id_icon, 0, wxALL, 5 ); + sb_provider_id_horiz->Add( m_provider_id_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_provider_id_vert; sb_provider_id_vert = new wxBoxSizer( wxVERTICAL ); m_provider_id_label_outer = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Assign your organization a unique ID to allow sharing the same credential set across different network profiles."), wxDefaultPosition, wxDefaultSize, 0 ); - m_provider_id_label_outer->Wrap( 440 ); - sb_provider_id_vert->Add( m_provider_id_label_outer, 0, wxALL|wxEXPAND, 5 ); + m_provider_id_label_outer->Wrap( FromDIP(440) ); + sb_provider_id_vert->Add( m_provider_id_label_outer, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_provider_namespace; sb_provider_namespace = new wxBoxSizer( wxVERTICAL ); m_provider_namespace_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("&Namespace:"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_namespace_label->Wrap( -1 ); - sb_provider_namespace->Add( m_provider_namespace_label, 0, wxBOTTOM, 5 ); + sb_provider_namespace->Add( m_provider_namespace_label, 0, wxBOTTOM, FromDIP(5) ); wxString m_provider_namespaceChoices[] = { _("urn:RFC4282:realm"), _("urn:uuid") }; int m_provider_namespaceNChoices = sizeof( m_provider_namespaceChoices ) / sizeof( wxString ); m_provider_namespace = new wxChoice( sb_provider_id->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_provider_namespaceNChoices, m_provider_namespaceChoices, 0 ); m_provider_namespace->SetSelection( 0 ); - sb_provider_namespace->Add( m_provider_namespace, 0, wxEXPAND, 5 ); + sb_provider_namespace->Add( m_provider_namespace, 0, wxEXPAND, FromDIP(5) ); - sb_provider_id_vert->Add( sb_provider_namespace, 0, wxEXPAND|wxALL, 5 ); + sb_provider_id_vert->Add( sb_provider_namespace, 0, wxEXPAND|wxALL, FromDIP(5) ); wxBoxSizer* sb_provider_id_inner; sb_provider_id_inner = new wxBoxSizer( wxVERTICAL ); m_provider_id_label = new wxStaticText( sb_provider_id->GetStaticBox(), wxID_ANY, _("Provider unique &identifier:"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_id_label->Wrap( -1 ); - sb_provider_id_inner->Add( m_provider_id_label, 0, wxBOTTOM, 5 ); + sb_provider_id_inner->Add( m_provider_id_label, 0, wxBOTTOM, FromDIP(5) ); m_provider_id = new wxTextCtrl( sb_provider_id->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_provider_id->SetToolTip( _("Your organization ID to assign same credentials from other profiles") ); - sb_provider_id_inner->Add( m_provider_id, 0, wxEXPAND, 5 ); + sb_provider_id_inner->Add( m_provider_id, 0, wxEXPAND, FromDIP(5) ); - sb_provider_id_vert->Add( sb_provider_id_inner, 0, wxEXPAND|wxALL, 5 ); + sb_provider_id_vert->Add( sb_provider_id_inner, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_provider_id_horiz->Add( sb_provider_id_vert, 1, wxEXPAND, 5 ); + sb_provider_id_horiz->Add( sb_provider_id_vert, 1, wxEXPAND, FromDIP(5) ); - sb_provider_id->Add( sb_provider_id_horiz, 1, wxEXPAND, 5 ); + sb_provider_id->Add( sb_provider_id_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_provider_id ); @@ -635,7 +635,7 @@ wxEAPProviderIDPanelBase::~wxEAPProviderIDPanelBase() { } -wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) +wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style, const wxString& name ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style, name ) { wxStaticBoxSizer* sb_provider_lock; sb_provider_lock = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration Lock") ), wxVERTICAL ); @@ -644,33 +644,33 @@ wxEAPProviderLockPanelBase::wxEAPProviderLockPanelBase( wxWindow* parent, wxWind sb_provider_lock_horiz = new wxBoxSizer( wxHORIZONTAL ); m_provider_lock_icon = new wxStaticBitmap( sb_provider_lock->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_provider_lock_horiz->Add( m_provider_lock_icon, 0, wxALL, 5 ); + sb_provider_lock_horiz->Add( m_provider_lock_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_provider_lock_vert; sb_provider_lock_vert = new wxBoxSizer( wxVERTICAL ); m_provider_lock_label = new wxStaticText( sb_provider_lock->GetStaticBox(), wxID_ANY, _("Your configuration can be locked to prevent accidental modification by end-users. Users will only be allowed to enter credentials."), wxDefaultPosition, wxDefaultSize, 0 ); - m_provider_lock_label->Wrap( 440 ); - sb_provider_lock_vert->Add( m_provider_lock_label, 0, wxALL|wxEXPAND, 5 ); + m_provider_lock_label->Wrap( FromDIP(440) ); + sb_provider_lock_vert->Add( m_provider_lock_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_provider_lock_inner; sb_provider_lock_inner = new wxBoxSizer( wxVERTICAL ); m_provider_lock = new wxCheckBox( sb_provider_lock->GetStaticBox(), wxID_ANY, _("&Lock this configuration and prevent any further modification via user interface."), wxDefaultPosition, wxDefaultSize, 0 ); - sb_provider_lock_inner->Add( m_provider_lock, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_provider_lock_inner->Add( m_provider_lock, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_provider_lock_note = new wxStaticText( sb_provider_lock->GetStaticBox(), wxID_ANY, _("(Warning: Once locked, you can not revert using this dialog!)"), wxDefaultPosition, wxDefaultSize, 0 ); m_provider_lock_note->Wrap( -1 ); - sb_provider_lock_inner->Add( m_provider_lock_note, 0, wxALIGN_RIGHT, 5 ); + sb_provider_lock_inner->Add( m_provider_lock_note, 0, wxALIGN_RIGHT, FromDIP(5) ); - sb_provider_lock_vert->Add( sb_provider_lock_inner, 0, wxEXPAND|wxALL, 5 ); + sb_provider_lock_vert->Add( sb_provider_lock_inner, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_provider_lock_horiz->Add( sb_provider_lock_vert, 1, wxEXPAND, 5 ); + sb_provider_lock_horiz->Add( sb_provider_lock_vert, 1, wxEXPAND, FromDIP(5) ); - sb_provider_lock->Add( sb_provider_lock_horiz, 1, wxEXPAND, 5 ); + sb_provider_lock->Add( sb_provider_lock_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_provider_lock ); @@ -690,20 +690,20 @@ wxEAPProviderSelectDialogBase::wxEAPProviderSelectDialogBase( wxWindow* parent, m_banner = new wxEAPBannerPanel( this ); - sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_content->Add( m_banner, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_providers = new wxBoxSizer( wxVERTICAL ); - m_providers->SetMinSize( wxSize( 350,-1 ) ); + m_providers->SetMinSize( FromDIP(wxSize( 350,-1 )) ); - sb_content->Add( m_providers, 1, wxEXPAND|wxALL, 5 ); + sb_content->Add( m_providers, 1, wxEXPAND|wxALL, FromDIP(5) ); m_buttons = new wxStdDialogButtonSizer(); m_buttonsCancel = new wxButton( this, wxID_CANCEL ); m_buttons->AddButton( m_buttonsCancel ); m_buttons->Realize(); - sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, 5 ); + sb_content->Add( m_buttons, 0, wxEXPAND|wxALL, FromDIP(5) ); this->SetSizer( sb_content ); diff --git a/lib/EAPBase_UI/res/wxEAP_UI.h b/lib/EAPBase_UI/res/wxEAP_UI.h index 49c33d1..2df7c1b 100644 --- a/lib/EAPBase_UI/res/wxEAP_UI.h +++ b/lib/EAPBase_UI/res/wxEAP_UI.h @@ -150,7 +150,7 @@ class wxEAPNotePanelBase : public wxPanel public: - wxEAPNotePanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL|wxBORDER_SIMPLE, const wxString& name = wxEmptyString ); + wxEAPNotePanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL|wxBORDER_SIMPLE, const wxString& name = wxEmptyString ); ~wxEAPNotePanelBase(); }; @@ -187,7 +187,7 @@ class wxEAPCredentialsConfigPanelBase : public wxPanel public: - wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxEAPCredentialsConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxEAPCredentialsConfigPanelBase(); }; @@ -215,7 +215,7 @@ class wxPasswordCredentialsPanelBase : public wxEAPCredentialsPanelBase public: - wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxPasswordCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxPasswordCredentialsPanelBase(); }; @@ -237,7 +237,7 @@ class wxIdentityCredentialsPanelBase : public wxEAPCredentialsPanelBase public: - wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxIdentityCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxIdentityCredentialsPanelBase(); }; @@ -265,7 +265,7 @@ class wxEAPProviderContactInfoPanelBase : public wxPanel public: - wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxEAPProviderContactInfoPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxEAPProviderContactInfoPanelBase(); }; @@ -287,7 +287,7 @@ class wxEAPProviderIDPanelBase : public wxPanel public: - wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxEAPProviderIDPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxEAPProviderIDPanelBase(); }; @@ -307,7 +307,7 @@ class wxEAPProviderLockPanelBase : public wxPanel public: - wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + wxEAPProviderLockPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~wxEAPProviderLockPanelBase(); }; diff --git a/lib/EAPBase_UI/src/EAP_UI.cpp b/lib/EAPBase_UI/src/EAP_UI.cpp index 4debe20..c5065f7 100644 --- a/lib/EAPBase_UI/src/EAP_UI.cpp +++ b/lib/EAPBase_UI/src/EAP_UI.cpp @@ -66,7 +66,7 @@ void wxEAPGeneralDialog::AddContent(wxPanel **contents, size_t content_count) { if (content_count) { for (size_t i = 0; i < content_count; i++) - m_panels->Add(contents[i], 0, wxALL|wxEXPAND, 5); + m_panels->Add(contents[i], 0, wxALL|wxEXPAND, FromDIP(5)); this->Layout(); this->GetSizer()->Fit(this); @@ -138,11 +138,11 @@ void wxEAPNotePanel::CreateContactFields(const eap::config_provider &prov) if (!prov.m_help_email.empty() || !prov.m_help_web.empty() || !prov.m_help_phone.empty()) { m_provider_notice = new wxStaticText(this, wxID_ANY, wxString::Format(_("For additional help and instructions, please contact %s at:"), !prov.m_name.empty() ? prov.m_name.c_str() : _("your provider")), wxDefaultPosition, wxDefaultSize, 0); - m_provider_notice->Wrap(449); - m_note_vert->Add(m_provider_notice, 0, wxUP|wxLEFT|wxRIGHT|wxEXPAND, 5); + m_provider_notice->Wrap(FromDIP(449)); + m_note_vert->Add(m_provider_notice, 0, wxUP|wxLEFT|wxRIGHT|wxEXPAND, FromDIP(5)); wxFlexGridSizer* sb_contact_tbl; - sb_contact_tbl = new wxFlexGridSizer(0, 2, 5, 5); + sb_contact_tbl = new wxFlexGridSizer(0, 2, FromDIP(5), FromDIP(5)); sb_contact_tbl->AddGrowableCol(1); sb_contact_tbl->SetFlexibleDirection(wxBOTH); sb_contact_tbl->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); @@ -153,36 +153,36 @@ void wxEAPNotePanel::CreateContactFields(const eap::config_provider &prov) m_help_web_label = new wxStaticText(this, wxID_ANY, wxT("\xb6"), wxDefaultPosition, wxDefaultSize, 0); m_help_web_label->Wrap(-1); m_help_web_label->SetFont(font_wingdings); - sb_contact_tbl->Add(m_help_web_label, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_web_label, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); m_help_web_value = new wxHyperlinkCtrl(this, wxID_ANY, prov.m_help_web, prov.m_help_web, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); m_help_web_value->SetToolTip(_("Open the default web browser")); - sb_contact_tbl->Add(m_help_web_value, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_web_value, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); } if (!prov.m_help_email.empty()) { m_help_email_label = new wxStaticText(this, wxID_ANY, wxT("\x2a"), wxDefaultPosition, wxDefaultSize, 0); m_help_email_label->Wrap(-1); m_help_email_label->SetFont(font_wingdings); - sb_contact_tbl->Add(m_help_email_label, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_email_label, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); m_help_email_value = new wxHyperlinkCtrl(this, wxID_ANY, prov.m_help_email, wxString(wxT("mailto:")) + prov.m_help_email, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); m_help_email_value->SetToolTip(_("Open your e-mail program")); - sb_contact_tbl->Add(m_help_email_value, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_email_value, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); } if (!prov.m_help_phone.empty()) { m_help_phone_label = new wxStaticText(this, wxID_ANY, wxT("\x29"), wxDefaultPosition, wxDefaultSize, 0); m_help_phone_label->Wrap(-1); m_help_phone_label->SetFont(font_wingdings); - sb_contact_tbl->Add(m_help_phone_label, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_phone_label, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); m_help_phone_value = new wxHyperlinkCtrl(this, wxID_ANY, prov.m_help_phone, wxString(wxT("tel:")) + GetPhoneNumber(prov.m_help_phone.c_str()), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE); m_help_phone_value->SetToolTip(_("Dial the phone number")); - sb_contact_tbl->Add(m_help_phone_value, 0, wxEXPAND|wxALIGN_TOP, 5); + sb_contact_tbl->Add(m_help_phone_value, 0, wxEXPAND|wxALIGN_TOP, FromDIP(5)); } - m_note_vert->Add(sb_contact_tbl, 0, wxLEFT|wxRIGHT|wxDOWN|wxEXPAND, 5); + m_note_vert->Add(sb_contact_tbl, 0, wxLEFT|wxRIGHT|wxDOWN|wxEXPAND, FromDIP(5)); } } @@ -202,7 +202,7 @@ wxEAPProviderLockedPanel::wxEAPProviderLockedPanel(const eap::config_provider &p m_note_label->SetLabel(wxString::Format(_("%s has pre-set parts of this configuration. Those parts are locked to prevent accidental modification."), !prov.m_name.empty() ? prov.m_name.c_str() : _("Your provider"))); - m_note_label->Wrap(449); + m_note_label->Wrap(FromDIP(449)); CreateContactFields(prov); @@ -227,7 +227,7 @@ wxEAPCredentialWarningPanel::wxEAPCredentialWarningPanel(const eap::config_provi status == eap::config_method::status_cred_changing ? _("Previous attempt to connect reported your credentials are being changed.") : _("Previous attempt to connect failed.")) + " " + _("Please, make sure your credentials are correct, or try again later.")); - m_note_label->Wrap(449); + m_note_label->Wrap(FromDIP(449)); CreateContactFields(prov); @@ -249,7 +249,7 @@ wxEAPCredentialLogWarningPanel::wxEAPCredentialLogWarningPanel(wxWindow* parent) m_note_label->SetLabel(wxString::Format(_("The %s version installed on this computer logs credentials in visible and easy to read way."), wxT(PRODUCT_NAME_STR)) + " " + _("Please, reconsider necessity to enter your credentials.")); - m_note_label->Wrap(449); + m_note_label->Wrap(FromDIP(449)); this->Layout(); } @@ -265,7 +265,7 @@ wxEAPConfigWindow::wxEAPConfigWindow(eap::config_provider &prov, eap::config_met m_cfg(cfg), wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL) { - this->SetScrollRate(5, 5); + this->SetScrollRate(FromDIP(5), FromDIP(5)); // Connect Events this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPConfigWindow::OnInitDialog)); @@ -448,7 +448,7 @@ wxEAPProviderSelectDialog::wxEAPProviderSelectDialog(eap::config_connection &cfg // Iterate over providers. for (auto cfg_prov = cfg.m_providers.cbegin(), cfg_prov_end = cfg.m_providers.cend(); cfg_prov != cfg_prov_end; ++cfg_prov) { wxCommandLinkButton *btn = new wxCommandLinkButton(this, wxID_ANY, wxEAPGetProviderName(cfg_prov->m_name)); - m_providers->Add(btn, 0, wxALL|wxEXPAND, 5); + m_providers->Add(btn, 0, wxALL|wxEXPAND, FromDIP(5)); btn->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(wxEAPProviderSelectDialog::OnProvSelect), new wxVariant((void*)&*cfg_prov), this); } diff --git a/lib/EapHost_UI/res/wxEapHost_UI.cpp b/lib/EapHost_UI/res/wxEapHost_UI.cpp index cad9d41..cba832f 100644 --- a/lib/EapHost_UI/res/wxEapHost_UI.cpp +++ b/lib/EapHost_UI/res/wxEapHost_UI.cpp @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////// -wxEapHostMethodConfigPanelBase::wxEapHostMethodConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +wxEapHostMethodConfigPanelBase::wxEapHostMethodConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { wxStaticBoxSizer* sb_method; sb_method = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Inner EAP Method") ), wxVERTICAL ); @@ -20,14 +20,14 @@ wxEapHostMethodConfigPanelBase::wxEapHostMethodConfigPanelBase( wxWindow* parent sb_method_horiz = new wxBoxSizer( wxHORIZONTAL ); m_method_icon = new wxStaticBitmap( sb_method->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_method_horiz->Add( m_method_icon, 0, wxALL, 5 ); + sb_method_horiz->Add( m_method_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_method_vert; sb_method_vert = new wxBoxSizer( wxVERTICAL ); m_method_label = new wxStaticText( sb_method->GetStaticBox(), wxID_ANY, _("Select and configure inner EAP method"), wxDefaultPosition, wxDefaultSize, 0 ); - m_method_label->Wrap( 440 ); - sb_method_vert->Add( m_method_label, 0, wxALL|wxEXPAND, 5 ); + m_method_label->Wrap( FromDIP(440) ); + sb_method_vert->Add( m_method_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_method_inner; sb_method_inner = new wxBoxSizer( wxHORIZONTAL ); @@ -35,19 +35,19 @@ wxEapHostMethodConfigPanelBase::wxEapHostMethodConfigPanelBase( wxWindow* parent wxArrayString m_methodChoices; m_method = new wxChoice( sb_method->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_methodChoices, 0 ); m_method->SetSelection( 0 ); - sb_method_inner->Add( m_method, 1, wxRIGHT|wxEXPAND, 5 ); + sb_method_inner->Add( m_method, 1, wxRIGHT|wxEXPAND, FromDIP(5) ); m_settings = new wxButton( sb_method->GetStaticBox(), wxID_ANY, _("&Settings"), wxDefaultPosition, wxDefaultSize, 0 ); - sb_method_inner->Add( m_settings, 0, 0, 5 ); + sb_method_inner->Add( m_settings, 0, 0, FromDIP(5) ); - sb_method_vert->Add( sb_method_inner, 0, wxEXPAND|wxALL, 5 ); + sb_method_vert->Add( sb_method_inner, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_method_horiz->Add( sb_method_vert, 1, wxEXPAND, 5 ); + sb_method_horiz->Add( sb_method_vert, 1, wxEXPAND, FromDIP(5) ); - sb_method->Add( sb_method_horiz, 1, wxEXPAND, 5 ); + sb_method->Add( sb_method_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_method ); diff --git a/lib/EapHost_UI/res/wxEapHost_UI.h b/lib/EapHost_UI/res/wxEapHost_UI.h index ae707e6..694960c 100644 --- a/lib/EapHost_UI/res/wxEapHost_UI.h +++ b/lib/EapHost_UI/res/wxEapHost_UI.h @@ -49,7 +49,7 @@ class wxEapHostMethodConfigPanelBase : public wxPanel public: - wxEapHostMethodConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxEapHostMethodConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxEapHostMethodConfigPanelBase(); }; diff --git a/lib/EapHost_UI/src/EapHost_UI.cpp b/lib/EapHost_UI/src/EapHost_UI.cpp index 87baa03..3b149a5 100644 --- a/lib/EapHost_UI/src/EapHost_UI.cpp +++ b/lib/EapHost_UI/src/EapHost_UI.cpp @@ -152,7 +152,7 @@ wxEapHostConfigPanel::wxEapHostConfigPanel(const eap::config_provider &prov, eap sb_content = new wxBoxSizer( wxVERTICAL ); m_method = new wxEapHostMethodConfigPanel(prov, cfg, this); - sb_content->Add(m_method, 0, wxEXPAND, 5); + sb_content->Add(m_method, 0, wxEXPAND, FromDIP(5)); this->SetSizer(sb_content); this->Layout(); diff --git a/lib/GTC_UI/res/wxGTC_UI.cpp b/lib/GTC_UI/res/wxGTC_UI.cpp index 9637e78..7dcdabd 100644 --- a/lib/GTC_UI/res/wxGTC_UI.cpp +++ b/lib/GTC_UI/res/wxGTC_UI.cpp @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////// -wxGTCResponsePanelBase::wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +wxGTCResponsePanelBase::wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { m_sb_response = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("GTC Challenge") ), wxVERTICAL ); @@ -19,39 +19,39 @@ wxGTCResponsePanelBase::wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id, sb_response_horiz = new wxBoxSizer( wxHORIZONTAL ); m_response_icon = new wxStaticBitmap( m_sb_response->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_response_horiz->Add( m_response_icon, 0, wxALL, 5 ); + sb_response_horiz->Add( m_response_icon, 0, wxALL, FromDIP(5) ); m_sb_response_vert = new wxBoxSizer( wxVERTICAL ); m_response_label = new wxStaticText( m_sb_response->GetStaticBox(), wxID_ANY, _("Please provide your response."), wxDefaultPosition, wxDefaultSize, 0 ); - m_response_label->Wrap( 440 ); - m_sb_response_vert->Add( m_response_label, 0, wxALL|wxEXPAND, 5 ); + m_response_label->Wrap( FromDIP(440) ); + m_sb_response_vert->Add( m_response_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxFlexGridSizer* sb_response_tbl; - sb_response_tbl = new wxFlexGridSizer( 0, 2, 5, 5 ); + sb_response_tbl = new wxFlexGridSizer( 0, 2, FromDIP(5), FromDIP(5) ); sb_response_tbl->AddGrowableCol( 1 ); sb_response_tbl->SetFlexibleDirection( wxBOTH ); sb_response_tbl->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_challenge = new wxStaticText( m_sb_response->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_challenge = new wxStaticText( m_sb_response->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, FromDIP(0) ); m_challenge->Wrap( -1 ); m_challenge->SetToolTip( _("Server challenge") ); - sb_response_tbl->Add( m_challenge, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sb_response_tbl->Add( m_challenge, 0, wxALIGN_CENTER_VERTICAL, FromDIP(5) ); m_response = new wxTextCtrl( m_sb_response->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_response->SetToolTip( _("Enter your response here") ); - sb_response_tbl->Add( m_response, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sb_response_tbl->Add( m_response, 2, wxEXPAND|wxALIGN_CENTER_VERTICAL, FromDIP(5) ); - m_sb_response_vert->Add( sb_response_tbl, 0, wxEXPAND|wxALL, 5 ); + m_sb_response_vert->Add( sb_response_tbl, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_response_horiz->Add( m_sb_response_vert, 1, wxEXPAND, 5 ); + sb_response_horiz->Add( m_sb_response_vert, 1, wxEXPAND, FromDIP(5) ); - m_sb_response->Add( sb_response_horiz, 0, wxEXPAND, 5 ); + m_sb_response->Add( sb_response_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( m_sb_response ); @@ -62,19 +62,19 @@ wxGTCResponsePanelBase::~wxGTCResponsePanelBase() { } -wxGTCConfigPanelBase::wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +wxGTCConfigPanelBase::wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { wxBoxSizer* sb_vertical; sb_vertical = new wxBoxSizer( wxVERTICAL ); m_auth_mode_label = new wxStaticText( this, wxID_ANY, _("EAP-GTC authentication &mode:"), wxDefaultPosition, wxDefaultSize, 0 ); m_auth_mode_label->Wrap( -1 ); - sb_vertical->Add( m_auth_mode_label, 0, wxBOTTOM, 5 ); + sb_vertical->Add( m_auth_mode_label, 0, wxBOTTOM, FromDIP(5) ); m_auth_mode = new wxChoicebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT ); m_auth_mode->SetToolTip( _("Select EAP-GTC authentication mode from the list") ); - sb_vertical->Add( m_auth_mode, 1, wxEXPAND, 5 ); + sb_vertical->Add( m_auth_mode, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_vertical ); diff --git a/lib/GTC_UI/res/wxGTC_UI.h b/lib/GTC_UI/res/wxGTC_UI.h index 039dadf..1376ae2 100644 --- a/lib/GTC_UI/res/wxGTC_UI.h +++ b/lib/GTC_UI/res/wxGTC_UI.h @@ -46,7 +46,7 @@ class wxGTCResponsePanelBase : public wxPanel public: - wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxGTCResponsePanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxGTCResponsePanelBase(); }; @@ -68,7 +68,7 @@ class wxGTCConfigPanelBase : public wxPanel public: - wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxGTCConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxGTCConfigPanelBase(); }; diff --git a/lib/GTC_UI/src/GTC_UI.cpp b/lib/GTC_UI/src/GTC_UI.cpp index a1f7ef5..5849b4c 100644 --- a/lib/GTC_UI/src/GTC_UI.cpp +++ b/lib/GTC_UI/src/GTC_UI.cpp @@ -135,7 +135,7 @@ wxGTCResponsePanel::wxGTCResponsePanel(winstd::sanitizing_wstring &response, con // Set challenge label. m_challenge->SetLabelText(challenge); - m_challenge->Wrap(200); + m_challenge->Wrap(FromDIP(200)); this->Layout(); } diff --git a/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp b/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp index 9e7eea0..d78118f 100644 --- a/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp +++ b/lib/MSCHAPv2_UI/src/MSCHAPv2_UI.cpp @@ -31,7 +31,7 @@ wxMSCHAPv2ConfigPanel::wxMSCHAPv2ConfigPanel(const eap::config_provider &prov, e sb_content = new wxBoxSizer( wxVERTICAL ); m_credentials = new wxMSCHAPv2CredentialsConfigPanel(prov, cfg, this, _("MSCHAPv2 User ID and Password")); - sb_content->Add(m_credentials, 0, wxEXPAND, 5); + sb_content->Add(m_credentials, 0, wxEXPAND, FromDIP(5)); this->SetSizer(sb_content); this->Layout(); diff --git a/lib/PAP_UI/src/PAP_UI.cpp b/lib/PAP_UI/src/PAP_UI.cpp index a9980cf..b53a932 100644 --- a/lib/PAP_UI/src/PAP_UI.cpp +++ b/lib/PAP_UI/src/PAP_UI.cpp @@ -31,7 +31,7 @@ wxPAPConfigPanel::wxPAPConfigPanel(const eap::config_provider &prov, eap::config sb_content = new wxBoxSizer( wxVERTICAL ); m_credentials = new wxPAPCredentialsConfigPanel(prov, cfg, this, _("PAP User ID and Password")); - sb_content->Add(m_credentials, 0, wxEXPAND, 5); + sb_content->Add(m_credentials, 0, wxEXPAND, FromDIP(5)); this->SetSizer(sb_content); this->Layout(); diff --git a/lib/TLS_UI/res/wxTLS_UI.cpp b/lib/TLS_UI/res/wxTLS_UI.cpp index 04cbfc5..9d50fca 100644 --- a/lib/TLS_UI/res/wxTLS_UI.cpp +++ b/lib/TLS_UI/res/wxTLS_UI.cpp @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////// -wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { wxStaticBoxSizer* sb_server_trust; sb_server_trust = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Server Trust") ), wxVERTICAL ); @@ -20,26 +20,26 @@ wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindow sb_server_trust_horiz = new wxBoxSizer( wxHORIZONTAL ); m_server_trust_icon = new wxStaticBitmap( sb_server_trust->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_server_trust_horiz->Add( m_server_trust_icon, 0, wxALL, 5 ); + sb_server_trust_horiz->Add( m_server_trust_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_server_trust_vert; sb_server_trust_vert = new wxBoxSizer( wxVERTICAL ); m_server_trust_label = new wxStaticText( sb_server_trust->GetStaticBox(), wxID_ANY, _("Describe the servers you trust to prevent credential interception in case of man-in-the-middle attacks."), wxDefaultPosition, wxDefaultSize, 0 ); - m_server_trust_label->Wrap( 440 ); - sb_server_trust_vert->Add( m_server_trust_label, 0, wxALL|wxEXPAND, 5 ); + m_server_trust_label->Wrap( FromDIP(440) ); + sb_server_trust_vert->Add( m_server_trust_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_root_ca; sb_root_ca = new wxBoxSizer( wxVERTICAL ); m_root_ca_lbl = new wxStaticText( sb_server_trust->GetStaticBox(), wxID_ANY, _("Acceptable Certificate Authorities:"), wxDefaultPosition, wxDefaultSize, 0 ); m_root_ca_lbl->Wrap( -1 ); - sb_root_ca->Add( m_root_ca_lbl, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_root_ca->Add( m_root_ca_lbl, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_root_ca = new wxListBox( sb_server_trust->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SORT ); m_root_ca->SetToolTip( _("Server's certificate must be issued by one of certificate authorities listed here") ); - sb_root_ca->Add( m_root_ca, 1, wxEXPAND|wxBOTTOM, 5 ); + sb_root_ca->Add( m_root_ca, 1, wxEXPAND|wxBOTTOM, FromDIP(5) ); wxBoxSizer* sb_root_ca_btn; sb_root_ca_btn = new wxBoxSizer( wxHORIZONTAL ); @@ -47,48 +47,48 @@ wxTLSServerTrustPanelBase::wxTLSServerTrustPanelBase( wxWindow* parent, wxWindow m_root_ca_add_store = new wxButton( sb_server_trust->GetStaticBox(), wxID_ANY, _("Add CA from Store..."), wxDefaultPosition, wxDefaultSize, 0 ); m_root_ca_add_store->SetToolTip( _("Adds a new certificate authority from the certificate store to the list") ); - sb_root_ca_btn->Add( m_root_ca_add_store, 0, wxRIGHT, 5 ); + sb_root_ca_btn->Add( m_root_ca_add_store, 0, wxRIGHT, FromDIP(5) ); m_root_ca_add_file = new wxButton( sb_server_trust->GetStaticBox(), wxID_ANY, _("Add CA from File..."), wxDefaultPosition, wxDefaultSize, 0 ); m_root_ca_add_file->SetToolTip( _("Adds a new certificate authority from the file to the list") ); - sb_root_ca_btn->Add( m_root_ca_add_file, 0, wxRIGHT|wxLEFT, 5 ); + sb_root_ca_btn->Add( m_root_ca_add_file, 0, wxRIGHT|wxLEFT, FromDIP(5) ); m_root_ca_remove = new wxButton( sb_server_trust->GetStaticBox(), wxID_ANY, _("&Remove CA"), wxDefaultPosition, wxDefaultSize, 0 ); m_root_ca_remove->SetToolTip( _("Removes selected certificate authorities from the list") ); - sb_root_ca_btn->Add( m_root_ca_remove, 0, wxLEFT, 5 ); + sb_root_ca_btn->Add( m_root_ca_remove, 0, wxLEFT, FromDIP(5) ); - sb_root_ca->Add( sb_root_ca_btn, 0, wxALIGN_RIGHT, 5 ); + sb_root_ca->Add( sb_root_ca_btn, 0, wxALIGN_RIGHT, FromDIP(5) ); - sb_server_trust_vert->Add( sb_root_ca, 1, wxEXPAND|wxALL, 5 ); + sb_server_trust_vert->Add( sb_root_ca, 1, wxEXPAND|wxALL, FromDIP(5) ); wxBoxSizer* sb_server_names; sb_server_names = new wxBoxSizer( wxVERTICAL ); m_server_names_label = new wxStaticText( sb_server_trust->GetStaticBox(), wxID_ANY, _("Acceptable server &names:"), wxDefaultPosition, wxDefaultSize, 0 ); m_server_names_label->Wrap( -1 ); - sb_server_names->Add( m_server_names_label, 0, wxBOTTOM, 5 ); + sb_server_names->Add( m_server_names_label, 0, wxBOTTOM, FromDIP(5) ); m_server_names = new wxTextCtrl( sb_server_trust->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_server_names->SetToolTip( _("A semicolon delimited list of acceptable server FQDN names; blank to skip name check; Unicode characters allowed") ); - sb_server_names->Add( m_server_names, 0, wxEXPAND|wxBOTTOM, 5 ); + sb_server_names->Add( m_server_names, 0, wxEXPAND|wxBOTTOM, FromDIP(5) ); m_server_names_note = new wxStaticText( sb_server_trust->GetStaticBox(), wxID_ANY, _("(Example: foo.bar.com;server2.bar.com)"), wxDefaultPosition, wxDefaultSize, 0 ); m_server_names_note->Wrap( -1 ); - sb_server_names->Add( m_server_names_note, 0, wxALIGN_RIGHT, 5 ); + sb_server_names->Add( m_server_names_note, 0, wxALIGN_RIGHT, FromDIP(5) ); - sb_server_trust_vert->Add( sb_server_names, 0, wxEXPAND|wxALL, 5 ); + sb_server_trust_vert->Add( sb_server_names, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_server_trust_horiz->Add( sb_server_trust_vert, 1, wxEXPAND, 5 ); + sb_server_trust_horiz->Add( sb_server_trust_vert, 1, wxEXPAND, FromDIP(5) ); - sb_server_trust->Add( sb_server_trust_horiz, 1, wxEXPAND, 5 ); + sb_server_trust->Add( sb_server_trust_horiz, 1, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_server_trust ); @@ -113,7 +113,7 @@ wxTLSServerTrustPanelBase::~wxTLSServerTrustPanelBase() } -wxTLSCredentialsPanelBase::wxTLSCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxEAPCredentialsPanelBase( parent, id, pos, size, style ) +wxTLSCredentialsPanelBase::wxTLSCredentialsPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxEAPCredentialsPanelBase( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { m_sb_credentials = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("User Certificate") ), wxVERTICAL ); @@ -121,41 +121,41 @@ wxTLSCredentialsPanelBase::wxTLSCredentialsPanelBase( wxWindow* parent, wxWindow sb_credentials_horiz = new wxBoxSizer( wxHORIZONTAL ); m_credentials_icon = new wxStaticBitmap( m_sb_credentials->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, 5 ); + sb_credentials_horiz->Add( m_credentials_icon, 0, wxALL, FromDIP(5) ); m_sb_credentials_vert = new wxBoxSizer( wxVERTICAL ); m_certificate_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Please select your &certificate to use for authentication."), wxDefaultPosition, wxDefaultSize, 0 ); - m_certificate_label->Wrap( 440 ); - m_sb_credentials_vert->Add( m_certificate_label, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + m_certificate_label->Wrap( FromDIP(440) ); + m_sb_credentials_vert->Add( m_certificate_label, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, FromDIP(5) ); wxArrayString m_certificateChoices; m_certificate = new wxChoice( m_sb_credentials->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_certificateChoices, wxCB_SORT ); m_certificate->SetSelection( 0 ); m_certificate->SetToolTip( _("Client certificate to use for authentication") ); - m_sb_credentials_vert->Add( m_certificate, 0, wxEXPAND|wxALL, 5 ); + m_sb_credentials_vert->Add( m_certificate, 0, wxEXPAND|wxALL, FromDIP(5) ); wxBoxSizer* sb_identity; sb_identity = new wxBoxSizer( wxVERTICAL ); m_identity_label = new wxStaticText( m_sb_credentials->GetStaticBox(), wxID_ANY, _("Custom &identity:"), wxDefaultPosition, wxDefaultSize, 0 ); m_identity_label->Wrap( -1 ); - sb_identity->Add( m_identity_label, 0, wxBOTTOM, 5 ); + sb_identity->Add( m_identity_label, 0, wxBOTTOM, FromDIP(5) ); m_identity = new wxTextCtrl( m_sb_credentials->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_identity->SetToolTip( _("Your identity (username@domain) to override one from certificate; or blank to use one provided in certificate") ); - sb_identity->Add( m_identity, 0, wxEXPAND, 5 ); + sb_identity->Add( m_identity, 0, wxEXPAND, FromDIP(5) ); - m_sb_credentials_vert->Add( sb_identity, 0, wxEXPAND|wxALL, 5 ); + m_sb_credentials_vert->Add( sb_identity, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, 5 ); + sb_credentials_horiz->Add( m_sb_credentials_vert, 1, wxEXPAND, FromDIP(5) ); - m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, 5 ); + m_sb_credentials->Add( sb_credentials_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( m_sb_credentials ); diff --git a/lib/TLS_UI/res/wxTLS_UI.h b/lib/TLS_UI/res/wxTLS_UI.h index 4faf32c..e38fed0 100644 --- a/lib/TLS_UI/res/wxTLS_UI.h +++ b/lib/TLS_UI/res/wxTLS_UI.h @@ -63,7 +63,7 @@ class wxTLSServerTrustPanelBase : public wxPanel public: - wxTLSServerTrustPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxTLSServerTrustPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxTLSServerTrustPanelBase(); }; @@ -90,7 +90,7 @@ class wxTLSCredentialsPanelBase : public wxEAPCredentialsPanelBase public: - wxTLSCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxTLSCredentialsPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxTLSCredentialsPanelBase(); }; diff --git a/lib/TLS_UI/src/TLS_UI.cpp b/lib/TLS_UI/src/TLS_UI.cpp index 534efe9..81e25c1 100644 --- a/lib/TLS_UI/src/TLS_UI.cpp +++ b/lib/TLS_UI/src/TLS_UI.cpp @@ -320,10 +320,10 @@ wxTLSConfigPanel::wxTLSConfigPanel(const eap::config_provider &prov, eap::config sb_content = new wxBoxSizer( wxVERTICAL ); m_server_trust = new wxTLSServerTrustPanel(prov, cfg, this); - sb_content->Add(m_server_trust, 0, wxDOWN|wxEXPAND, 5); + sb_content->Add(m_server_trust, 0, wxDOWN|wxEXPAND, FromDIP(5)); m_credentials = new wxTLSCredentialsConfigPanel(prov, cfg, this, _("User Certificate")); - sb_content->Add(m_credentials, 0, wxUP|wxEXPAND, 5); + sb_content->Add(m_credentials, 0, wxUP|wxEXPAND, FromDIP(5)); this->SetSizer(sb_content); this->Layout(); diff --git a/lib/TTLS_UI/res/wxTTLS_UI.cpp b/lib/TTLS_UI/res/wxTTLS_UI.cpp index dadfdcd..74f0fbd 100644 --- a/lib/TTLS_UI/res/wxTTLS_UI.cpp +++ b/lib/TTLS_UI/res/wxTTLS_UI.cpp @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////// -wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, const wxPoint& pos, long style ) : wxPanel( parent, id, pos, parent->FromDIP(wxSize( 500,-1 )), style ) { wxStaticBoxSizer* sb_outer_identity; sb_outer_identity = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Outer Identity") ), wxVERTICAL ); @@ -20,14 +20,14 @@ wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, c sb_outer_identity_horiz = new wxBoxSizer( wxHORIZONTAL ); m_outer_identity_icon = new wxStaticBitmap( sb_outer_identity->GetStaticBox(), wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - sb_outer_identity_horiz->Add( m_outer_identity_icon, 0, wxALL, 5 ); + sb_outer_identity_horiz->Add( m_outer_identity_icon, 0, wxALL, FromDIP(5) ); wxBoxSizer* sb_outer_identity_vert; sb_outer_identity_vert = new wxBoxSizer( wxVERTICAL ); m_outer_identity_label = new wxStaticText( sb_outer_identity->GetStaticBox(), wxID_ANY, _("Select the user ID supplicant introduces itself as to authenticator:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_outer_identity_label->Wrap( 440 ); - sb_outer_identity_vert->Add( m_outer_identity_label, 0, wxALL|wxEXPAND, 5 ); + m_outer_identity_label->Wrap( FromDIP(440) ); + sb_outer_identity_vert->Add( m_outer_identity_label, 0, wxALL|wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_outer_identity_radio; sb_outer_identity_radio = new wxBoxSizer( wxVERTICAL ); @@ -35,12 +35,12 @@ wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, c m_outer_identity_same = new wxRadioButton( sb_outer_identity->GetStaticBox(), wxID_ANY, _("&True identity"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_outer_identity_same->SetToolTip( _("Use my true user name") ); - sb_outer_identity_radio->Add( m_outer_identity_same, 1, wxEXPAND, 5 ); + sb_outer_identity_radio->Add( m_outer_identity_same, 1, wxEXPAND, FromDIP(5) ); m_outer_identity_empty = new wxRadioButton( sb_outer_identity->GetStaticBox(), wxID_ANY, _("Use &empty outer identity"), wxDefaultPosition, wxDefaultSize, 0 ); m_outer_identity_empty->SetToolTip( _("Ommit my user name and use @mydomain.org only") ); - sb_outer_identity_radio->Add( m_outer_identity_empty, 1, wxEXPAND, 5 ); + sb_outer_identity_radio->Add( m_outer_identity_empty, 1, wxEXPAND, FromDIP(5) ); wxBoxSizer* sb_outer_identity_custom; sb_outer_identity_custom = new wxBoxSizer( wxHORIZONTAL ); @@ -48,24 +48,24 @@ wxTTLSConfigPanelBase::wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id, c m_outer_identity_custom = new wxRadioButton( sb_outer_identity->GetStaticBox(), wxID_ANY, _("&Custom outer identity:"), wxDefaultPosition, wxDefaultSize, 0 ); m_outer_identity_custom->SetToolTip( _("Specify custom outer identity") ); - sb_outer_identity_custom->Add( m_outer_identity_custom, 0, wxEXPAND, 5 ); + sb_outer_identity_custom->Add( m_outer_identity_custom, 0, wxEXPAND, FromDIP(5) ); m_outer_identity_custom_val = new wxTextCtrl( sb_outer_identity->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_outer_identity_custom_val->SetToolTip( _("Custom outer identity to use") ); - sb_outer_identity_custom->Add( m_outer_identity_custom_val, 1, wxEXPAND, 5 ); + sb_outer_identity_custom->Add( m_outer_identity_custom_val, 1, wxEXPAND, FromDIP(5) ); - sb_outer_identity_radio->Add( sb_outer_identity_custom, 1, wxEXPAND, 5 ); + sb_outer_identity_radio->Add( sb_outer_identity_custom, 1, wxEXPAND, FromDIP(5) ); - sb_outer_identity_vert->Add( sb_outer_identity_radio, 0, wxEXPAND|wxALL, 5 ); + sb_outer_identity_vert->Add( sb_outer_identity_radio, 0, wxEXPAND|wxALL, FromDIP(5) ); - sb_outer_identity_horiz->Add( sb_outer_identity_vert, 1, wxEXPAND, 5 ); + sb_outer_identity_horiz->Add( sb_outer_identity_vert, 1, wxEXPAND, FromDIP(5) ); - sb_outer_identity->Add( sb_outer_identity_horiz, 0, wxEXPAND, 5 ); + sb_outer_identity->Add( sb_outer_identity_horiz, 0, wxEXPAND, FromDIP(5) ); this->SetSizer( sb_outer_identity ); diff --git a/lib/TTLS_UI/res/wxTTLS_UI.h b/lib/TTLS_UI/res/wxTTLS_UI.h index d6dd7bf..cb82b98 100644 --- a/lib/TTLS_UI/res/wxTTLS_UI.h +++ b/lib/TTLS_UI/res/wxTTLS_UI.h @@ -50,7 +50,7 @@ class wxTTLSConfigPanelBase : public wxPanel public: - wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,-1 ), long style = wxTAB_TRAVERSAL ); + wxTTLSConfigPanelBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, long style = wxTAB_TRAVERSAL ); ~wxTTLSConfigPanelBase(); }; diff --git a/lib/TTLS_UI/src/TTLS_UI.cpp b/lib/TTLS_UI/src/TTLS_UI.cpp index 060dc31..ffb7667 100644 --- a/lib/TTLS_UI/src/TTLS_UI.cpp +++ b/lib/TTLS_UI/src/TTLS_UI.cpp @@ -113,12 +113,12 @@ wxTTLSConfigWindow::wxTTLSConfigWindow(eap::config_provider &prov, eap::config_m sb_content = new wxBoxSizer( wxVERTICAL ); if (m_prov.m_read_only) - sb_content->Add(new wxEAPProviderLockedPanel(m_prov, this), 0, wxALL|wxEXPAND, 5); + sb_content->Add(new wxEAPProviderLockedPanel(m_prov, this), 0, wxALL|wxEXPAND, FromDIP(5)); m_inner_title = new wxStaticText(this, wxID_ANY, _("Inner Authentication"), wxDefaultPosition, wxDefaultSize, 0); m_inner_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString)); m_inner_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) ); - sb_content->Add(m_inner_title, 0, wxALL|wxALIGN_RIGHT, 5); + sb_content->Add(m_inner_title, 0, wxALL|wxALIGN_RIGHT, FromDIP(5)); m_inner_type = new wxChoicebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_DEFAULT); m_inner_type->SetToolTip( _("Select inner authentication method from the list") ); @@ -134,26 +134,26 @@ wxTTLSConfigWindow::wxTTLSConfigWindow(eap::config_provider &prov, eap::config_m wxEapHostConfigPanel *panel_eaphost = new wxEapHostConfigPanel(m_prov, m_cfg_eaphost, m_inner_type); m_inner_type->AddPage(panel_eaphost, _("Other EAP methods...")); #endif - sb_content->Add(m_inner_type, 0, wxALL|wxEXPAND, 5); + sb_content->Add(m_inner_type, 0, wxALL|wxEXPAND, FromDIP(5)); - sb_content->Add(20, 20, 1, wxALL|wxEXPAND, 5); + sb_content->Add(FromDIP(20), FromDIP(20), 1, wxALL|wxEXPAND, FromDIP(5)); m_outer_title = new wxStaticText(this, wxID_ANY, _("Outer Authentication"), wxDefaultPosition, wxDefaultSize, 0); m_outer_title->SetFont(wxFont(18, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString)); m_outer_title->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTION ) ); - sb_content->Add(m_outer_title, 0, wxALL|wxALIGN_RIGHT, 5); + sb_content->Add(m_outer_title, 0, wxALL|wxALIGN_RIGHT, FromDIP(5)); m_outer_identity = new wxTTLSConfigPanel(m_prov, dynamic_cast(m_cfg), this); - sb_content->Add(m_outer_identity, 0, wxALL|wxEXPAND, 5); + sb_content->Add(m_outer_identity, 0, wxALL|wxEXPAND, FromDIP(5)); m_tls = new wxTLSConfigPanel(m_prov, dynamic_cast(m_cfg), this); - sb_content->Add(m_tls, 0, wxALL|wxEXPAND, 5); + sb_content->Add(m_tls, 0, wxALL|wxEXPAND, FromDIP(5)); wxSize size = sb_content->CalcMin(); - if (size.y > 500) { + if (size.y > FromDIP(500)) { // Increase the width to allow space for vertical scroll bar (to prevent horizontal one) and truncate the height. size.x += wxSystemSettings::GetMetric(wxSYS_VSCROLL_X, this); - size.y = 500; + size.y = FromDIP(500); } this->SetMinSize(size);