Make GUI DPI-aware
This commit is contained in:
@@ -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 );
|
||||
|
@@ -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();
|
||||
|
||||
};
|
||||
|
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user