Started adding non-functional help buttons to dialogs and replacing buttons with wxStdDialogButtonSizer.

Originally committed to SVN as r1297.
This commit is contained in:
Rodrigo Braz Monteiro 2007-06-23 07:27:09 +00:00
parent d5a42097ff
commit b28eeabc47
2 changed files with 15 additions and 16 deletions

View File

@ -316,20 +316,14 @@ DialogStyleEditor::DialogStyleEditor (wxWindow *parent, AssStyle *_style, Subtit
// Buttons // Buttons
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); wxStdDialogButtonSizer *ButtonSizer = new wxStdDialogButtonSizer();
ButtonSizer->AddStretchSpacer(1);
wxButton *okButton = new wxButton(this, wxID_OK); wxButton *okButton = new wxButton(this, wxID_OK);
#ifndef __WXMAC__
ButtonSizer->Add(okButton,0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5);
#else
ButtonSizer->Add(new wxButton(this, wxID_APPLY),0,wxRIGHT,5);
ButtonSizer->Add(new wxButton(this, wxID_CANCEL),0,wxRIGHT,5);
ButtonSizer->Add(okButton,0,wxRIGHT,5);
#endif
okButton->SetDefault(); okButton->SetDefault();
ButtonSizer->AddButton(new wxButton(this, wxID_APPLY));
ButtonSizer->AddButton(new wxButton(this, wxID_CANCEL));
ButtonSizer->AddButton(new wxButton(this, wxID_HELP));
ButtonSizer->AddButton(okButton);
ButtonSizer->Realize();
// Left side sizer // Left side sizer
wxSizer *LeftSizer = new wxBoxSizer(wxVERTICAL); wxSizer *LeftSizer = new wxBoxSizer(wxVERTICAL);
@ -352,7 +346,7 @@ DialogStyleEditor::DialogStyleEditor (wxWindow *parent, AssStyle *_style, Subtit
// General Layout // General Layout
MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer = new wxBoxSizer(wxVERTICAL);
MainSizer->Add(ControlSizer,1,wxALL | wxALIGN_CENTER | wxEXPAND,5); MainSizer->Add(ControlSizer,1,wxALL | wxALIGN_CENTER | wxEXPAND,5);
MainSizer->Add(ButtonSizer,0,wxBOTTOM | wxALIGN_CENTER | wxEXPAND,5); MainSizer->Add(ButtonSizer,0,wxBOTTOM | wxEXPAND,5);
// Set sizer // Set sizer
MainSizer->SetSizeHints(this); MainSizer->SetSizeHints(this);

View File

@ -133,15 +133,20 @@ DialogStyleManager::DialogStyleManager (wxWindow *parent,SubtitlesGrid *_grid)
CurrentCopy->Disable(); CurrentCopy->Disable();
CurrentDelete->Disable(); CurrentDelete->Disable();
// Buttons
wxStdDialogButtonSizer *buttonSizer = new wxStdDialogButtonSizer();
buttonSizer->AddButton(new wxButton(this,wxID_HELP));
buttonSizer->SetCancelButton(new wxButton(this, wxID_CLOSE));
buttonSizer->Realize();
// General layout // General layout
wxSizer *StylesSizer = new wxBoxSizer(wxHORIZONTAL); wxSizer *StylesSizer = new wxBoxSizer(wxHORIZONTAL);
StylesSizer->Add(StorageBox,0,wxRIGHT | wxEXPAND,5); StylesSizer->Add(StorageBox,0,wxRIGHT | wxEXPAND,5);
StylesSizer->Add(CurrentBox,0,wxLEFT | wxEXPAND,0); StylesSizer->Add(CurrentBox,0,wxLEFT | wxEXPAND,0);
wxButton *CloseButton = new wxButton(this, wxID_CLOSE, _T(""), wxDefaultPosition, wxSize(100,25));
MainSizer = new wxBoxSizer(wxVERTICAL); MainSizer = new wxBoxSizer(wxVERTICAL);
MainSizer->Add(CatalogBox,0,wxEXPAND | wxLEFT | wxRIGHT | wxTOP,5); MainSizer->Add(CatalogBox,0,wxEXPAND | wxLEFT | wxRIGHT | wxTOP,5);
MainSizer->Add(StylesSizer,0,wxEXPAND | wxALL,5); MainSizer->Add(StylesSizer,1,wxEXPAND | wxALL,5);
MainSizer->Add(CloseButton,0,wxBOTTOM | wxALIGN_CENTER,5); MainSizer->Add(buttonSizer,0,wxBOTTOM | wxEXPAND,5);
// Set sizer // Set sizer
SetSizer(MainSizer); SetSizer(MainSizer);