MGR: On MS Windows, fix Attach Wizard to scale according to users DPI setting.

This commit is contained in:
Charlie Fenton 2014-09-10 06:31:05 -07:00
parent e17d4944ab
commit e49232d087
1 changed files with 23 additions and 12 deletions

View File

@ -200,13 +200,18 @@ void CProjectInfoPage::CreateControls()
{
////@begin CProjectInfoPage content construction
#ifdef __WXMAC__
#define LISTBOXWIDTH 225
#define DESCRIPTIONSWIDTH 350
#else
#define LISTBOXWIDTH 150
#define DESCRIPTIONSWIDTH 200
#define DESCRIPTIONSWIDTH ADJUSTFORXDPI(200)
#endif
bool bCategoryFound = false;
wxArrayString aCategories;
ALL_PROJECTS_LIST pl;
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
wxASSERT(wxDynamicCast(pDoc, CMainDocument));
CProjectInfoPage* itemWizardPage23 = this;
wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxVERTICAL);
@ -228,9 +233,7 @@ void CProjectInfoPage::CreateControls()
itemFlexGridSizer4->AddGrowableCol(0);
itemBoxSizer24->Add(itemFlexGridSizer4, 0, wxGROW|wxALL, 0);
wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(2, 2, 0, 0);
itemFlexGridSizer6->AddGrowableRow(1);
itemFlexGridSizer6->AddGrowableCol(1);
wxFlexGridSizer* itemFlexGridSizer6 = new wxFlexGridSizer(2, 0, 0);
itemFlexGridSizer4->Add(itemFlexGridSizer6, 0, wxGROW|wxALL, 0);
wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxVERTICAL);
@ -239,9 +242,17 @@ void CProjectInfoPage::CreateControls()
m_pProjectCategoriesStaticCtrl = new wxStaticText( itemWizardPage23, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
itemBoxSizer7->Add(m_pProjectCategoriesStaticCtrl, 0, wxALIGN_LEFT|wxRIGHT|wxBOTTOM, 5);
wxArrayString m_pProjectCategoriesCtrlStrings;
m_pProjectCategoriesCtrl = new wxComboBox( itemWizardPage23, ID_CATEGORIES, wxT(""), wxDefaultPosition, wxSize(LISTBOXWIDTH, -1), m_pProjectCategoriesCtrlStrings, wxCB_READONLY
#ifndef __WXMAC__ // wxCB_SORT is not available in wxCocoa 2.9.5
// We must populate the combo box before our sizers can calculate its width.
// The combo box will be repopulated in CProjectInfoPage::OnPageChanged(),
// so we don't need to worry about duplicate entries here.
// Get the project list
pDoc->rpc.get_all_projects_list(pl);
for (int i=0; i<pl.projects.size(); i++) {
wxString strGeneralArea = wxGetTranslation(wxString(pl.projects[i]->general_area.c_str(), wxConvUTF8));
aCategories.Add(strGeneralArea);
}
m_pProjectCategoriesCtrl = new wxComboBox( itemWizardPage23, ID_CATEGORIES, wxT(""), wxDefaultPosition, wxDefaultSize, aCategories, wxCB_READONLY
#ifndef __WXMAC__ // wxCB_SORT is not available in wxCocoa 3.0
|wxCB_SORT
#endif
);
@ -256,16 +267,16 @@ void CProjectInfoPage::CreateControls()
itemBoxSizer7->Add(itemFlexGridSizer11, 0, wxGROW|wxALL, 0);
wxArrayString m_pProjectsCtrlStrings;
m_pProjectsCtrl = new wxListBox( itemWizardPage23, ID_PROJECTS, wxDefaultPosition, wxSize(LISTBOXWIDTH, 175), m_pProjectsCtrlStrings, wxLB_SINGLE|wxLB_SORT );
m_pProjectsCtrl = new wxListBox( itemWizardPage23, ID_PROJECTS, wxDefaultPosition, wxSize(-1, ADJUSTFORYDPI(175)), m_pProjectsCtrlStrings, wxLB_SINGLE|wxLB_SORT );
itemFlexGridSizer11->Add(m_pProjectsCtrl, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
m_pProjectDetailsStaticCtrl = new wxStaticBox(itemWizardPage23, wxID_ANY, wxT(""));
wxStaticBoxSizer* itemStaticBoxSizer13 = new wxStaticBoxSizer(m_pProjectDetailsStaticCtrl, wxVERTICAL);
itemFlexGridSizer6->Add(itemStaticBoxSizer13, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
m_pProjectDetailsDescriptionCtrl = new wxTextCtrl( itemWizardPage23, ID_PROJECTDESCRIPTION, wxT(""), wxDefaultPosition, wxSize(DESCRIPTIONSWIDTH, 100), wxTE_MULTILINE|wxTE_READONLY );
// wxPanel* ProjectDetailsDescriptionPanel = new wxPanel(m_pProjectDetailsStaticCtrl, wxID_ANY, wxDefaultPosition, wxSize(DESCRIPTIONSWIDTH, ADJUSTFORYDPI(100)));
m_pProjectDetailsDescriptionCtrl = new wxTextCtrl( itemWizardPage23, ID_PROJECTDESCRIPTION, wxT(""), wxDefaultPosition, wxSize(DESCRIPTIONSWIDTH, ADJUSTFORYDPI(100)), wxTE_MULTILINE|wxTE_READONLY );
itemStaticBoxSizer13->Add(m_pProjectDetailsDescriptionCtrl, 0, wxGROW|wxLEFT|wxTOP|wxBOTTOM, 5);
wxFlexGridSizer* itemFlexGridSizer16 = new wxFlexGridSizer(2, 0, 0);
itemFlexGridSizer16->AddGrowableCol(1);
itemStaticBoxSizer13->Add(itemFlexGridSizer16, 0, wxGROW|wxALL, 0);