Fix remaining static box sizer problems (hopefully) and also fix a few other, minor dialogue layout problems.

Originally committed to SVN as r1590.
This commit is contained in:
Niels Martin Hansen 2007-09-24 17:40:03 +00:00
parent 3fd97b551f
commit 0dd60ed25a
8 changed files with 35 additions and 29 deletions

View File

@ -65,14 +65,19 @@ void AssExporter::DrawSettings(wxWindow *parent,wxSizer *AddTo) {
FilterList::iterator begin = AssExportFilterChain::GetFilterList()->begin();
FilterList::iterator end = AssExportFilterChain::GetFilterList()->end();
for (FilterList::iterator cur=begin;cur!=end;cur++) {
// Make sure to construct static box sizer first, so it won't overlap
// the controls on wxMac.
box = new wxStaticBoxSizer(wxVERTICAL,parent,(*cur)->RegisterName);
window = (*cur)->GetConfigDialogWindow(parent);
if (window) {
box = new wxStaticBoxSizer(wxVERTICAL,parent,(*cur)->RegisterName);
box->Add(window,0,wxEXPAND,0);
AddTo->Add(box,0,wxEXPAND | wxLEFT | wxRIGHT | wxBOTTOM,5);
AddTo->Show(box,false);
Sizers[(*cur)->RegisterName] = box;
}
else {
delete box;
}
}
}

View File

@ -53,6 +53,7 @@ DialogExport::DialogExport (wxWindow *parent)
: wxDialog (parent, -1, _("Export"), wxDefaultPosition, wxSize(200,100), wxCAPTION | wxCLOSE_BOX, _T("Export"))
{
// Filter list
wxSizer *TopSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Filters"));
Export = new AssExporter(AssFile::top);
wxArrayString filters = Export->GetAllFilterNames();
FilterList = new wxCheckListBox(this, Filter_List_Box, wxDefaultPosition, wxSize(200,100), filters);
@ -102,7 +103,6 @@ DialogExport::DialogExport (wxWindow *parent)
}
// Top sizer
wxSizer *TopSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Filters"));
TopSizer->Add(FilterList,1,wxEXPAND,0);
TopSizer->Add(TopButtons,0,wxEXPAND,0);
TopSizer->Add(Description,0,wxEXPAND | wxTOP,5);

View File

@ -52,6 +52,11 @@ DialogPasteOver::DialogPasteOver (wxWindow *parent)
// Script mode
int mode = 1; // ASS
// Label and list sizer
wxSizer *ListSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Fields"));
wxStaticText *label = new wxStaticText(this,-1,_("Please select the fields that you want to paste over:"),wxDefaultPosition,wxDefaultSize);
ListSizer->Add(label,0,wxEXPAND,0);
// List box
wxArrayString choices;
choices.Add(_("Layer"));
@ -71,16 +76,11 @@ DialogPasteOver::DialogPasteOver (wxWindow *parent)
choices.Add(_("Effect"));
choices.Add(_("Text"));
ListBox = new wxCheckListBox(this,-1,wxDefaultPosition,wxSize(250,170), choices);
ListSizer->Add(ListBox,0,wxEXPAND|wxTOP,5);
// Load checked items
for (unsigned int i=0;i<choices.Count();i++) ListBox->Check(i,Options.AsBool(wxString::Format(_T("Paste Over #%i"),i)));
// Label and list sizer
wxStaticText *label = new wxStaticText(this,-1,_("Please select the fields that you want to paste over:"),wxDefaultPosition,wxDefaultSize);
wxSizer *ListSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Fields"));
ListSizer->Add(label,0,wxEXPAND,0);
ListSizer->Add(ListBox,0,wxEXPAND|wxTOP,5);
// Top buttons
wxSizer *TopButtonSizer = new wxBoxSizer(wxHORIZONTAL);
TopButtonSizer->Add(new wxButton(this, Paste_Over_All, _("All")),1,0,0);

View File

@ -61,6 +61,7 @@ DialogProperties::DialogProperties (wxWindow *parent)
AssFile *subs = AssFile::top;
// Script details crap
wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script"));
wxStaticText *TitleLabel = new wxStaticText(this,-1,_("Title:"));
TitleEdit = new wxTextCtrl(this,-1,subs->GetScriptInfo(_T("Title")),wxDefaultPosition,wxSize(200,20));
wxStaticText *OrigScriptLabel = new wxStaticText(this,-1,_("Original script:"));
@ -77,7 +78,6 @@ DialogProperties::DialogProperties (wxWindow *parent)
UpdatedEdit = new wxTextCtrl(this,-1,subs->GetScriptInfo(_T("Script Updated By")),wxDefaultPosition,wxSize(200,20));
wxStaticText *UpdateDetailsLabel = new wxStaticText(this,-1,_("Update details:"));
UpdateDetailsEdit = new wxTextCtrl(this,-1,subs->GetScriptInfo(_T("Update Details")),wxDefaultPosition,wxSize(200,20));
wxSizer *TopSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Script"));
wxFlexGridSizer *TopSizerGrid = new wxFlexGridSizer(0,2,5,5);
TopSizerGrid->Add(TitleLabel,0,wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL,0);
TopSizerGrid->Add(TitleEdit,1,wxEXPAND,0);

View File

@ -53,6 +53,11 @@ wxDialog (parent,-1,_("Select"),wxDefaultPosition,wxDefaultSize,wxCAPTION)
// Variables
grid = _grid;
// Static-box sizers before anything else
wxSizer *MatchSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Match"));
wxSizer *MatchTopSizer = new wxBoxSizer(wxHORIZONTAL);
wxSizer *DialogueSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Match dialogues/comments"));
// Matches box
Matches = new wxRadioButton(this,-1,_("Matches"),wxDefaultPosition,wxDefaultSize,wxRB_GROUP);
DoesntMatch = new wxRadioButton(this,-1,_("Doesn't Match"),wxDefaultPosition,wxDefaultSize,0);
@ -83,8 +88,6 @@ wxDialog (parent,-1,_("Select"),wxDefaultPosition,wxDefaultSize,wxCAPTION)
Action = new wxRadioBox(this,-1,_("Action"),wxDefaultPosition,wxDefaultSize,actions,1);
// Matches box sizer
wxSizer *MatchSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Match"));
wxSizer *MatchTopSizer = new wxBoxSizer(wxHORIZONTAL);
MatchTopSizer->Add(Matches,0,wxEXPAND|wxRIGHT,5);
MatchTopSizer->Add(DoesntMatch,0,wxEXPAND,0);
MatchTopSizer->AddStretchSpacer(1);
@ -96,7 +99,6 @@ wxDialog (parent,-1,_("Select"),wxDefaultPosition,wxDefaultSize,wxCAPTION)
MatchSizer->Add(RegExp,0,wxTOP|wxEXPAND,5);
// Dialogues / Comments box
wxSizer *DialogueSizer = new wxStaticBoxSizer(wxHORIZONTAL,this,_("Match dialogues/comments"));
DialogueSizer->Add(MatchDialogues,0, wxRIGHT|wxEXPAND,5);
DialogueSizer->Add(MatchComments,0, wxEXPAND);

View File

@ -66,12 +66,16 @@ DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
ready = true;
grid = _grid;
shiftframe = 0;
// Static-box sizers before anything else
wxSizer *TimesSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Shift by"));
wxSizer *HistorySizer = new wxStaticBoxSizer(wxVERTICAL,this,_("History"));
// Times
RadioTime = new wxRadioButton(this,RADIO_TIME,_("Time: "),wxDefaultPosition,wxSize(60,20), wxRB_GROUP);
RadioFrames = new wxRadioButton(this,RADIO_FRAME,_("Frames: "),wxDefaultPosition,wxSize(60,20));
ShiftTime = new TimeEdit(this,TEXT_SHIFT_TIME,_T(""),wxDefaultPosition,wxSize(60,20));
ShiftFrame = new wxTextCtrl(this,TEXT_SHIFT_FRAME,wxString::Format(_T("%i"),shiftframe),wxDefaultPosition,wxSize(60,20));
RadioTime = new wxRadioButton(this,RADIO_TIME,_("Time: "),wxDefaultPosition,wxDefaultSize, wxRB_GROUP);
RadioFrames = new wxRadioButton(this,RADIO_FRAME,_("Frames: "),wxDefaultPosition,wxDefaultSize);
ShiftTime = new TimeEdit(this,TEXT_SHIFT_TIME,_T(""),wxDefaultPosition,wxDefaultSize);
ShiftFrame = new wxTextCtrl(this,TEXT_SHIFT_FRAME,wxString::Format(_T("%i"),shiftframe),wxDefaultPosition,wxDefaultSize);
ShiftTime->SetToolTip(_("Enter time in h:mm:ss.cs notation"));
RadioTime->SetToolTip(_("Shift by time"));
ShiftFrame->Disable();
@ -80,12 +84,11 @@ DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
ShiftFrame->SetToolTip(_("Enter number of frames to shift by"));
RadioFrames->SetToolTip(_("Shift by frames"));
}
wxSizer *TimeSizer = new wxBoxSizer(wxHORIZONTAL);
wxSizer *FrameSizer = new wxBoxSizer(wxHORIZONTAL);
TimeSizer->Add(RadioTime,0,wxALIGN_CENTER_VERTICAL,0);
TimeSizer->Add(ShiftTime,1,wxLEFT,5);
FrameSizer->Add(RadioFrames,0,wxALIGN_CENTER_VERTICAL,0);
FrameSizer->Add(ShiftFrame,1,wxLEFT,5);
wxSizer *TimeFrameSizer = new wxFlexGridSizer(2,2,5,5);
TimeFrameSizer->Add(RadioTime,0,wxALIGN_CENTER_VERTICAL,0);
TimeFrameSizer->Add(ShiftTime,1);
TimeFrameSizer->Add(RadioFrames,0,wxALIGN_CENTER_VERTICAL,0);
TimeFrameSizer->Add(ShiftFrame,1);
// Direction
DirectionForward = new wxRadioButton(this,-1,_("Forward"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP);
@ -95,9 +98,7 @@ DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
wxSizer *DirectionSizer = new wxBoxSizer(wxHORIZONTAL);
DirectionSizer->Add(DirectionForward,1,wxEXPAND,0);
DirectionSizer->Add(DirectionBackward,1,wxLEFT | wxEXPAND,5);
wxSizer *TimesSizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Shift by"));
TimesSizer->Add(TimeSizer,0,wxEXPAND,0);
TimesSizer->Add(FrameSizer,0,wxEXPAND | wxTOP,5);
TimesSizer->Add(TimeFrameSizer,0,wxEXPAND,0);
TimesSizer->Add(DirectionSizer,0,wxEXPAND | wxTOP,5);
// Selection
@ -109,7 +110,6 @@ DialogShiftTimes::DialogShiftTimes (wxWindow *parent,SubtitlesGrid *_grid)
TimesChoice = new wxRadioBox(this,-1,_("Times"), wxDefaultPosition, wxDefaultSize, 3, TimesChoices, 3, wxRA_SPECIFY_ROWS);
// History
wxSizer *HistorySizer = new wxStaticBoxSizer(wxVERTICAL,this,_("History"));
History = new wxListBox(this,-1,wxDefaultPosition,wxSize(350,100), 0, NULL, wxLB_HSCROLL);
HistorySizer->Add(History,1,wxEXPAND,0);

View File

@ -67,6 +67,7 @@ DialogTimingProcessor::DialogTimingProcessor(wxWindow *parent,SubtitlesGrid *_gr
adjsThresTime = Options.AsText(_T("Timing processor adjascent thres"));
// Styles box
wxSizer *LeftSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Apply to styles"));
wxArrayString styles = grid->ass->GetStyles();
StyleList = new wxCheckListBox(this,TIMING_STYLE_LIST,wxDefaultPosition,wxSize(150,150),styles);
StyleList->SetToolTip(_("Select styles to process. Unchecked ones will be ignored."));
@ -170,7 +171,6 @@ DialogTimingProcessor::DialogTimingProcessor(wxWindow *parent,SubtitlesGrid *_gr
StyleButtonsSizer->Add(none,1,0,0);
// Left sizer
wxSizer *LeftSizer = new wxStaticBoxSizer(wxVERTICAL,this,_("Apply to styles"));
size_t len = StyleList->GetCount();
for (size_t i=0;i<len;i++) {
StyleList->Check(i);

View File

@ -127,8 +127,7 @@ wxWindow *AssTransformFramerateFilter::GetConfigDialogWindow(wxWindow *parent) {
MainSizer->Add(OutputSizer,0,wxEXPAND,0);
// Window
MainSizer->SetSizeHints(base);
base->SetSizer(MainSizer);
base->SetSizerAndFit(MainSizer);
return base;
}