Wizard::Wizard( wxWindow* parent, const wxString& archive )
: wxWizard(parent, wxID_ANY, _("Wizard"))
{
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize );
wxWizardPageSimple* rcModWizPageSelect = new wxWizardPageSimple( this );
m_pages.Add( rcModWizPageSelect );
wxBoxSizer* bSizer1;
bSizer1 = new wxBoxSizer( wxVERTICAL );
m_bitmap2 = new wxStaticBitmap( rcModWizPageSelect, wxID_ANY, wxBitmap( wxT("data/img.jpg"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap2->SetMinSize( wxSize( 586,192 ) );
bSizer1->Add( m_bitmap2, 0, wxALL|wxEXPAND|wxFIXED_MINSIZE, 5 );
wxStaticBoxSizer* sbSizer1;
sbSizer1 = new wxStaticBoxSizer( new wxStaticBox( rcModWizPageSelect, wxID_ANY, _("Select Archive") ), wxVERTICAL );
rcModArchivePicker = new wxFilePickerCtrl( rcModWizPageSelect, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.zip"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN );
sbSizer1->Add( rcModArchivePicker, 0, wxALL|wxEXPAND, 5 );
bSizer1->Add( sbSizer1, 1, wxALL|wxEXPAND, 5 );
rcModWizPageSelect->SetSizer( bSizer1 );
rcModWizPageSelect->Layout();
bSizer1->Fit( rcModWizPageSelect );
wxWizardPageSimple* rcModWizPageProgress = new wxWizardPageSimple( this );
m_pages.Add( rcModWizPageProgress );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
m_bitmap1 = new wxStaticBitmap( rcModWizPageProgress, wxID_ANY, wxBitmap( wxT("data/img.jpg"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 );
m_bitmap1->SetMinSize( wxSize( 586,192 ) );
bSizer2->Add( m_bitmap1, 0, wxALL|wxEXPAND|wxFIXED_MINSIZE, 5 );
wxStaticBoxSizer* sbSizer2;
sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( rcModWizPageProgress, wxID_ANY, _("Please Wait") ), wxVERTICAL );
rcModInstallProgress = new wxGauge( rcModWizPageProgress, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL|wxGA_SMOOTH );
rcModInstallProgress->SetValue( 0 );
sbSizer2->Add( rcModInstallProgress, 0, wxALL|wxEXPAND, 5 );
bSizer2->Add( sbSizer2, 1, wxALL|wxEXPAND, 5 );
rcModWizPageProgress->SetSizer( bSizer2 );
rcModWizPageProgress->Layout();
bSizer2->Fit( rcModWizPageProgress );
this->Centre( wxBOTH );
for ( unsigned int i = 1; i < m_pages.GetCount(); i++ )
{
m_pages.Item( i )->SetPrev( m_pages.Item( i - 1 ) );
m_pages.Item( i - 1 )->SetNext( m_pages.Item( i ) );
}
}
我尝试制作一个漂亮的向导对话框,但最小尺寸被忽略了,整体框架比我的图像小得多。图像的大小为 586x192。
wxFormBuilder 中的预览看起来不错,但生成的代码看起来完全不同。这里有 2 张图片: http : //i.stack.imgur.com/tbOzP.png http://i.stack.imgur.com/B3vVf.png
谁能帮我这个?