Fixed Shift Times window layout and added help buttons to it and translation assistant.

Originally committed to SVN as r1704.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-13 22:25:26 +00:00
parent 62e3c7a3a6
commit 2127d100ac
4 changed files with 26 additions and 30 deletions

View file

@ -52,6 +52,7 @@
#include "main.h" #include "main.h"
#include "font_file_lister.h" #include "font_file_lister.h"
#include "utils.h" #include "utils.h"
#include "help_button.h"
/////// ///////
@ -113,17 +114,14 @@ DialogFontsCollector::DialogFontsCollector(wxWindow *parent)
// Buttons sizer // Buttons sizer
StartButton = new wxButton(this,START_BUTTON,_("&Start!")); StartButton = new wxButton(this,START_BUTTON,_("&Start!"));
CloseButton = new wxButton(this,wxID_CANCEL);
StartButton->SetDefault(); StartButton->SetDefault();
CloseButton = new wxButton(this,wxID_CANCEL,_T("Close")); wxStdDialogButtonSizer *ButtonSizer = new wxStdDialogButtonSizer();
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); ButtonSizer->AddButton(StartButton);
ButtonSizer->AddStretchSpacer(1); ButtonSizer->AddButton(CloseButton);
#ifdef __WXMAC__ ButtonSizer->AddButton(new HelpButton(this,_T("Fonts Collector")));
ButtonSizer->Add(CloseButton,0,wxRIGHT,5); ButtonSizer->SetAffirmativeButton(StartButton);
ButtonSizer->Add(StartButton); ButtonSizer->Realize();
#else
ButtonSizer->Add(StartButton,0,wxRIGHT,5);
ButtonSizer->Add(CloseButton);
#endif
// Main sizer // Main sizer
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);

View file

@ -52,6 +52,7 @@
#include "ass_dialogue.h" #include "ass_dialogue.h"
#include "subs_edit_box.h" #include "subs_edit_box.h"
#include "utils.h" #include "utils.h"
#include "help_button.h"
/////////////// ///////////////
@ -111,24 +112,16 @@ DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
// History // History
History = new wxListBox(this,-1,wxDefaultPosition,wxSize(350,100), 0, NULL, wxLB_HSCROLL); History = new wxListBox(this,-1,wxDefaultPosition,wxSize(350,100), 0, NULL, wxLB_HSCROLL);
wxButton *ClearButton = new wxButton(this,SHIFT_CLEAR_HISTORY,_("Clear"));
HistorySizer->Add(History,1,wxEXPAND,0); HistorySizer->Add(History,1,wxEXPAND,0);
HistorySizer->Add(ClearButton,0,wxEXPAND,0);
// Buttons // Buttons
wxButton *OKButton = new wxButton(this,wxID_OK); wxStdDialogButtonSizer *ButtonSizer = new wxStdDialogButtonSizer();
wxButton *CancelButton = new wxButton(this,wxID_CANCEL); ButtonSizer->AddButton(new wxButton(this,wxID_OK));
wxButton *ClearButton = new wxButton(this,SHIFT_CLEAR_HISTORY,_("Clear")); ButtonSizer->AddButton(new wxButton(this,wxID_CANCEL));
OKButton->SetDefault(); ButtonSizer->AddButton(new HelpButton(this,_T("Shift Times")));
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); ButtonSizer->Realize();
ButtonSizer->AddStretchSpacer(2);
#ifndef __WXMAC__
ButtonSizer->Add(OKButton,0,wxALIGN_CENTER|wxRIGHT,5);
ButtonSizer->Add(CancelButton,0,wxALIGN_CENTER|wxRIGHT,0);
#else
ButtonSizer->Add(CancelButton,0,wxRIGHT,5);
ButtonSizer->Add(OKButton,0,wxRIGHT,0);
#endif
ButtonSizer->AddStretchSpacer(1);
ButtonSizer->Add(ClearButton,0,wxALIGN_RIGHT|wxRIGHT,5);
// General layout // General layout
wxSizer *LeftSizer = new wxBoxSizer(wxVERTICAL); wxSizer *LeftSizer = new wxBoxSizer(wxVERTICAL);

View file

@ -49,6 +49,7 @@
#include "frame_main.h" #include "frame_main.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "utils.h" #include "utils.h"
#include "help_button.h"
/////////////// ///////////////
@ -112,12 +113,14 @@ DialogTranslation::DialogTranslation (wxWindow *parent,AssFile *_subs,SubtitlesG
KeysSizer->Add(PreviewCheck,0,wxTOP,5); KeysSizer->Add(PreviewCheck,0,wxTOP,5);
// Button sizer // Button sizer
wxSizer *ButtonSizer = new wxBoxSizer(wxHORIZONTAL); wxStdDialogButtonSizer *ButtonSizer = new wxStdDialogButtonSizer();
ButtonSizer->AddStretchSpacer(1);
wxButton *PlayButton = new wxButton(this,BUTTON_TRANS_PLAY,_("Play Audio")); wxButton *PlayButton = new wxButton(this,BUTTON_TRANS_PLAY,_("Play Audio"));
PlayButton->Enable(audio->loaded); PlayButton->Enable(audio->loaded);
ButtonSizer->Add(PlayButton,0,wxRIGHT,0); ButtonSizer->AddButton(PlayButton);
ButtonSizer->Add(new wxButton(this,wxID_CLOSE),0,wxRIGHT,0); ButtonSizer->AddButton(new wxButton(this,wxID_CANCEL));
ButtonSizer->AddButton(new HelpButton(this,_T("Translation Assistant")));
ButtonSizer->SetAffirmativeButton(PlayButton);
ButtonSizer->Realize();
// General layout // General layout
wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL); wxSizer *MainSizer = new wxBoxSizer(wxVERTICAL);

View file

@ -96,11 +96,13 @@ void HelpButton::InitStatic() {
pages = new std::map<wxString,wxString>; pages = new std::map<wxString,wxString>;
std::map<wxString,wxString> &page = *pages; std::map<wxString,wxString> &page = *pages;
page[_T("Colour Picker")] = _T("Colour_Picker"); page[_T("Colour Picker")] = _T("Colour_Picker");
page[_T("Fonts Collector")] = _T("Fonts_Collector");
page[_T("Kanji Timer")] = _T("Kanji_Timer"); page[_T("Kanji Timer")] = _T("Kanji_Timer");
page[_T("Main")] = _T(""); page[_T("Main")] = _T("");
page[_T("Options")] = _T("Options"); page[_T("Options")] = _T("Options");
page[_T("Resampler")] = _T("Resolution_Resampler"); page[_T("Resampler")] = _T("Resolution_Resampler");
page[_T("Spell Checker")] = _T("Other_Tools"); page[_T("Shift Times")] = _T("Other_Tools#Shift_Times");
page[_T("Spell Checker")] = _T("Other_Tools#Spell_Checker");
page[_T("Style Editor")] = _T("Styles"); page[_T("Style Editor")] = _T("Styles");
page[_T("Styles Manager")] = _T("Styles"); page[_T("Styles Manager")] = _T("Styles");
page[_T("Styling Assistant")] = _T("Styling_Assistant"); page[_T("Styling Assistant")] = _T("Styling_Assistant");