Make the style manager dialog select the new styles when copying styles between the current script and storage, and fix a few cases where buttons were incorrectly enabled or disabled. Updates #1186.

Originally committed to SVN as r4244.
This commit is contained in:
Thomas Goyne 2010-04-24 21:48:06 +00:00
parent de459275a1
commit 5f82c5bb02

View file

@ -35,8 +35,6 @@
/// ///
////////////
// Includes
#include "config.h" #include "config.h"
#ifndef AGI_PRE #ifndef AGI_PRE
@ -226,10 +224,7 @@ DialogStyleManager::DialogStyleManager (wxWindow *parent,SubtitlesGrid *_grid)
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Destructor /// @brief Destructor
///
DialogStyleManager::~DialogStyleManager() { DialogStyleManager::~DialogStyleManager() {
int sel = CatalogList->GetSelection(); int sel = CatalogList->GetSelection();
if (sel != wxNOT_FOUND) { if (sel != wxNOT_FOUND) {
@ -241,12 +236,8 @@ DialogStyleManager::~DialogStyleManager() {
Store.Clear(); Store.Clear();
} }
/// @brief Load the catalog of stored styles
/// @brief Loads the catalog
///
void DialogStyleManager::LoadCatalog () { void DialogStyleManager::LoadCatalog () {
// Clear
CatalogList->Clear(); CatalogList->Clear();
// Create catalog if it doesn't exist // Create catalog if it doesn't exist
@ -288,53 +279,38 @@ void DialogStyleManager::LoadCatalog () {
} }
} }
/// @brief Load the list of styles from a subtitle file
/// @brief Loads style list
/// @param subs
///
void DialogStyleManager::LoadCurrentStyles (AssFile *subs) { void DialogStyleManager::LoadCurrentStyles (AssFile *subs) {
using std::list; using std::list;
AssStyle *style; AssStyle *style;
// Reset
CurrentList->Clear(); CurrentList->Clear();
styleMap.clear(); styleMap.clear();
// Add styles
for (list<AssEntry*>::iterator cur=subs->Line.begin();cur!=subs->Line.end();cur++) { for (list<AssEntry*>::iterator cur=subs->Line.begin();cur!=subs->Line.end();cur++) {
style = AssEntry::GetAsStyle(*cur); style = AssEntry::GetAsStyle(*cur);
if (style) { if (style && style->Valid) {
if (style->Valid) {
CurrentList->Append(style->name); CurrentList->Append(style->name);
styleMap.push_back(style); styleMap.push_back(style);
} }
} }
}
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Load the list of styles from the currently active storage
/// @brief DOCME
///
void DialogStyleManager::LoadStorageStyles () { void DialogStyleManager::LoadStorageStyles () {
using std::list; using std::list;
AssStyle *style;
// Reset
StorageList->Clear(); StorageList->Clear();
styleStorageMap.clear(); styleStorageMap.clear();
// Add styles
for (list<AssStyle*>::iterator cur=Store.style.begin();cur!=Store.style.end();cur++) { for (list<AssStyle*>::iterator cur=Store.style.begin();cur!=Store.style.end();cur++) {
style = *cur; AssStyle *style = *cur;
if (style) { if (style && style->Valid) {
if (style->Valid) {
StorageList->Append(style->name); StorageList->Append(style->name);
styleStorageMap.push_back(style); styleStorageMap.push_back(style);
} }
} }
}
// Flag change // Flag change
wxCommandEvent dummy; wxCommandEvent dummy;
@ -342,11 +318,7 @@ void DialogStyleManager::LoadStorageStyles () {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Enables or disables storage actions /// @brief Enables or disables storage actions
/// @param state
///
void DialogStyleManager::StorageActions (bool state) { void DialogStyleManager::StorageActions (bool state) {
StorageList->Enable(state); StorageList->Enable(state);
MoveToLocal->Enable(state); MoveToLocal->Enable(state);
@ -362,7 +334,6 @@ void DialogStyleManager::StorageActions (bool state) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/////////////// ///////////////
// Event table // Event table
BEGIN_EVENT_TABLE(DialogStyleManager, wxDialog) BEGIN_EVENT_TABLE(DialogStyleManager, wxDialog)
@ -401,21 +372,14 @@ END_EVENT_TABLE()
////////// //////////
// Events // Events
/// @brief Close /// @brief Close
/// @param event void DialogStyleManager::OnClose (wxCommandEvent &) {
///
void DialogStyleManager::OnClose (wxCommandEvent &event) {
GetPosition(&lastx, &lasty); GetPosition(&lastx, &lasty);
Close(); Close();
} }
/// @brief Change catalog entry /// @brief Change catalog entry
/// @param event void DialogStyleManager::OnChangeCatalog (wxCommandEvent &) {
///
void DialogStyleManager::OnChangeCatalog (wxCommandEvent &event) {
int sel = CatalogList->GetSelection(); int sel = CatalogList->GetSelection();
if (sel != wxNOT_FOUND) { if (sel != wxNOT_FOUND) {
StorageActions(true); StorageActions(true);
@ -430,13 +394,8 @@ void DialogStyleManager::OnChangeCatalog (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief New catalog entry button
void DialogStyleManager::OnCatalogNew (wxCommandEvent &) {
/// @brief New catalog entry
/// @param event
/// @return
///
void DialogStyleManager::OnCatalogNew (wxCommandEvent &event) {
wxString name = wxGetTextFromUser(_("New storage name:"), _("New catalog entry"), _T(""), this); wxString name = wxGetTextFromUser(_("New storage name:"), _("New catalog entry"), _T(""), this);
if (!name.empty()) { if (!name.empty()) {
// Remove bad characters from the name // Remove bad characters from the name
@ -481,12 +440,8 @@ void DialogStyleManager::OnCatalogNew (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Catalog delete /// @brief Catalog delete
/// @param event void DialogStyleManager::OnCatalogDelete (wxCommandEvent &) {
///
void DialogStyleManager::OnCatalogDelete (wxCommandEvent &event) {
int sel = CatalogList->GetSelection(); int sel = CatalogList->GetSelection();
if (sel != wxNOT_FOUND) { if (sel != wxNOT_FOUND) {
wxString name = CatalogList->GetString(sel); wxString name = CatalogList->GetString(sel);
@ -502,58 +457,37 @@ void DialogStyleManager::OnCatalogDelete (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Edit style on storage /// @brief Edit style on storage
/// @param event void DialogStyleManager::OnStorageEdit (wxCommandEvent &) {
///
void DialogStyleManager::OnStorageEdit (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = StorageList->GetSelections(selections); int n = StorageList->GetSelections(selections);
AssStyle *temp;
if (n == 1) { if (n == 1) {
temp = styleStorageMap.at(selections[0]); AssStyle *selStyle = styleStorageMap[selections[0]];
DialogStyleEditor editor(this,temp,grid,false,&Store); DialogStyleEditor editor(this,selStyle,grid,false,&Store);
int modified = editor.ShowModal(); if (editor.ShowModal()) {
if (modified) { StorageList->SetString(selections[0],selStyle->name);
//LoadStorageStyles();
StorageList->SetString(selections[0],temp->name);
Store.Save(CatalogList->GetString(CatalogList->GetSelection())); Store.Save(CatalogList->GetString(CatalogList->GetSelection()));
} }
} }
else if (n > 1) {
}
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Edit style on current script /// @brief Edit style on current script
/// @param event void DialogStyleManager::OnCurrentEdit (wxCommandEvent &) {
///
void DialogStyleManager::OnCurrentEdit (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = CurrentList->GetSelections(selections); int n = CurrentList->GetSelections(selections);
AssStyle *temp;
if (n == 1) { if (n == 1) {
temp = styleMap.at(selections[0]); AssStyle *selStyle = styleMap[selections[0]];
DialogStyleEditor editor(this,temp,grid,true,&Store); DialogStyleEditor editor(this,selStyle,grid,false,&Store);
int modified = editor.ShowModal(); if (editor.ShowModal()) {
if (modified) { CurrentList->SetString(selections[0],selStyle->name);
CurrentList->SetString(selections[0],temp->name);
} }
} }
else if (n > 1) {
}
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Selection on current script changed /// @brief Selection on current script changed
/// @param event void DialogStyleManager::OnCurrentChange (wxCommandEvent &) {
///
void DialogStyleManager::OnCurrentChange (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = CurrentList->GetSelections(selections); int n = CurrentList->GetSelections(selections);
@ -564,12 +498,8 @@ void DialogStyleManager::OnCurrentChange (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Selection on storage changed /// @brief Selection on storage changed
/// @param event void DialogStyleManager::OnStorageChange (wxCommandEvent &) {
///
void DialogStyleManager::OnStorageChange (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = StorageList->GetSelections(selections); int n = StorageList->GetSelections(selections);
@ -580,29 +510,25 @@ void DialogStyleManager::OnStorageChange (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Copy to Storage /// @brief Copy to Storage
/// @param event void DialogStyleManager::OnCopyToStorage (wxCommandEvent &) {
/// @return using std::list;
///
void DialogStyleManager::OnCopyToStorage (wxCommandEvent &event) {
// Check if there is actually a storage // Check if there is actually a storage
if (!StorageNew->IsEnabled()) { if (!StorageNew->IsEnabled()) return;
return;
}
list<wxString> copied;
wxArrayInt selections; wxArrayInt selections;
int n = CurrentList->GetSelections(selections); int n = CurrentList->GetSelections(selections);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
wxString styleName = CurrentList->GetString(selections[i]); wxString styleName = CurrentList->GetString(selections[i]);
bool addStyle = true; bool addStyle = true;
for (std::list<AssStyle *>::iterator style = Store.style.begin(); style != Store.style.end(); ++style) { for (list<AssStyle *>::iterator style = Store.style.begin(); style != Store.style.end(); ++style) {
if ((*style)->name.CmpNoCase(styleName) == 0) { if ((*style)->name.CmpNoCase(styleName) == 0) {
addStyle = false; addStyle = false;
if (wxYES == wxMessageBox(wxString::Format(_T("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?"),styleName.c_str()), _T("Style name collision."), wxYES_NO)) { if (wxYES == wxMessageBox(wxString::Format(_T("There is already a style with the name \"%s\" on the current storage. Proceed and overwrite anyway?"),styleName.c_str()), _T("Style name collision."), wxYES_NO)) {
**style = *styleMap.at(selections[i]); **style = *styleMap.at(selections[i]);
copied.push_back(styleName);
} }
break; break;
} }
@ -610,19 +536,22 @@ void DialogStyleManager::OnCopyToStorage (wxCommandEvent &event) {
if (addStyle) { if (addStyle) {
AssStyle *temp = new AssStyle(*styleMap.at(selections[i])); AssStyle *temp = new AssStyle(*styleMap.at(selections[i]));
Store.style.push_back(temp); Store.style.push_back(temp);
copied.push_back(styleName);
} }
} }
Store.Save(CatalogList->GetString(CatalogList->GetSelection())); Store.Save(CatalogList->GetString(CatalogList->GetSelection()));
LoadStorageStyles(); LoadStorageStyles();
UpdateMoveButtons(); for (list<wxString>::iterator name = copied.begin(); name != copied.end(); ++name) {
StorageList->SetStringSelection(*name, true);
}
wxCommandEvent dummy;
OnStorageChange(dummy);
} }
/// @brief Copy to Current /// @brief Copy to Current
/// @param event void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &) {
/// using std::list;
void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &event) { list<wxString> copied;
wxArrayInt selections; wxArrayInt selections;
int n = StorageList->GetSelections(selections); int n = StorageList->GetSelections(selections);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
@ -634,6 +563,7 @@ void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &event) {
addStyle = false; addStyle = false;
if (wxYES == wxMessageBox(wxString::Format(_T("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?"),styleName.c_str()), _T("Style name collision."), wxYES_NO)) { if (wxYES == wxMessageBox(wxString::Format(_T("There is already a style with the name \"%s\" on the current script. Proceed and overwrite anyway?"),styleName.c_str()), _T("Style name collision."), wxYES_NO)) {
**style = *styleStorageMap.at(selections[i]); **style = *styleStorageMap.at(selections[i]);
copied.push_back(styleName);
} }
break; break;
} }
@ -641,20 +571,21 @@ void DialogStyleManager::OnCopyToCurrent (wxCommandEvent &event) {
if (addStyle) { if (addStyle) {
AssStyle *temp = new AssStyle(*styleStorageMap.at(selections[i])); AssStyle *temp = new AssStyle(*styleStorageMap.at(selections[i]));
AssFile::top->InsertStyle(temp); AssFile::top->InsertStyle(temp);
copied.push_back(styleName);
} }
} }
LoadCurrentStyles(AssFile::top); LoadCurrentStyles(AssFile::top);
for (list<wxString>::iterator name = copied.begin(); name != copied.end(); ++name) {
CurrentList->SetStringSelection(*name, true);
}
grid->ass->FlagAsModified(_("style copy")); grid->ass->FlagAsModified(_("style copy"));
grid->CommitChanges(); grid->CommitChanges();
UpdateMoveButtons(); wxCommandEvent dummy;
OnCurrentChange(dummy);
} }
/// @brief Storage make copy /// @brief Storage make copy
/// @param event void DialogStyleManager::OnStorageCopy (wxCommandEvent &) {
///
void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
StorageList->GetSelections(selections); StorageList->GetSelections(selections);
if (selections.size() == 0) return; if (selections.size() == 0) return;
@ -676,12 +607,8 @@ void DialogStyleManager::OnStorageCopy (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Current make copy /// @brief Current make copy
/// @param event void DialogStyleManager::OnCurrentCopy (wxCommandEvent &) {
///
void DialogStyleManager::OnCurrentCopy (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
CurrentList->GetSelections(selections); CurrentList->GetSelections(selections);
if (selections.size() == 0) return; if (selections.size() == 0) return;
@ -705,12 +632,9 @@ void DialogStyleManager::OnCurrentCopy (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Copy to clipboard /// @brief Copy to clipboard
/// @param list /// @param list
/// @param v /// @param v
///
void DialogStyleManager::CopyToClipboard (wxListBox *list, std::vector<AssStyle*> v) { void DialogStyleManager::CopyToClipboard (wxListBox *list, std::vector<AssStyle*> v) {
wxString data = _T(""); wxString data = _T("");
AssStyle *s; AssStyle *s;
@ -731,7 +655,6 @@ void DialogStyleManager::CopyToClipboard (wxListBox *list, std::vector<AssStyle*
} }
/// @brief Paste from clipboard /// @brief Paste from clipboard
///
void DialogStyleManager::PasteToCurrent() { void DialogStyleManager::PasteToCurrent() {
wxString data = _T(""); wxString data = _T("");
@ -772,7 +695,6 @@ void DialogStyleManager::PasteToCurrent() {
} }
/// @brief DOCME /// @brief DOCME
///
void DialogStyleManager::PasteToStorage() { void DialogStyleManager::PasteToStorage() {
wxString data = _T(""); wxString data = _T("");
@ -808,14 +730,11 @@ void DialogStyleManager::PasteToStorage() {
delete s; delete s;
wxMessageBox(_("Could not parse style"), _("Could not parse style"), wxOK | wxICON_EXCLAMATION , this); wxMessageBox(_("Could not parse style"), _("Could not parse style"), wxOK | wxICON_EXCLAMATION , this);
} }
} }
} }
/// @brief Storage new /// @brief Storage new
/// @param event void DialogStyleManager::OnStorageNew (wxCommandEvent &) {
///
void DialogStyleManager::OnStorageNew (wxCommandEvent &event) {
AssStyle *temp = new AssStyle; AssStyle *temp = new AssStyle;
DialogStyleEditor editor(this,temp,grid,false,&Store,true); DialogStyleEditor editor(this,temp,grid,false,&Store,true);
@ -829,12 +748,8 @@ void DialogStyleManager::OnStorageNew (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Current new /// @brief Current new
/// @param event void DialogStyleManager::OnCurrentNew (wxCommandEvent &) {
///
void DialogStyleManager::OnCurrentNew (wxCommandEvent &event) {
AssStyle *temp = new AssStyle; AssStyle *temp = new AssStyle;
DialogStyleEditor editor(this,temp,grid,true,&Store,true); DialogStyleEditor editor(this,temp,grid,true,&Store,true);
@ -847,12 +762,8 @@ void DialogStyleManager::OnCurrentNew (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Storage delete /// @brief Storage delete
/// @param event void DialogStyleManager::OnStorageDelete (wxCommandEvent &) {
///
void DialogStyleManager::OnStorageDelete (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = StorageList->GetSelections(selections); int n = StorageList->GetSelections(selections);
@ -877,18 +788,15 @@ void DialogStyleManager::OnStorageDelete (wxCommandEvent &event) {
// Set buttons // Set buttons
MoveToLocal->Enable(false); MoveToLocal->Enable(false);
StorageEdit->Enable(false);
StorageCopy->Enable(false); StorageCopy->Enable(false);
StorageDelete->Enable(false); StorageDelete->Enable(false);
} }
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Current delete /// @brief Current delete
/// @param event void DialogStyleManager::OnCurrentDelete (wxCommandEvent &) {
///
void DialogStyleManager::OnCurrentDelete (wxCommandEvent &event) {
wxArrayInt selections; wxArrayInt selections;
int n = CurrentList->GetSelections(selections); int n = CurrentList->GetSelections(selections);
@ -912,6 +820,7 @@ void DialogStyleManager::OnCurrentDelete (wxCommandEvent &event) {
// Set buttons // Set buttons
MoveToStorage->Enable(false); MoveToStorage->Enable(false);
CurrentEdit->Enable(false);
CurrentCopy->Enable(false); CurrentCopy->Enable(false);
CurrentDelete->Enable(false); CurrentDelete->Enable(false);
@ -921,13 +830,8 @@ void DialogStyleManager::OnCurrentDelete (wxCommandEvent &event) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Import styles from another script /// @brief Import styles from another script
/// @param event void DialogStyleManager::OnCurrentImport(wxCommandEvent &) {
/// @return
///
void DialogStyleManager::OnCurrentImport(wxCommandEvent &event) {
// Get file name // Get file name
wxString path = Options.AsText(_T("Last open subtitles path")); wxString path = Options.AsText(_T("Last open subtitles path"));
wxString filename = wxFileSelector(_("Open subtitles file"),path,_T(""),_T(""),AssFile::GetWildcardList(0),wxFD_OPEN | wxFD_FILE_MUST_EXIST); wxString filename = wxFileSelector(_("Open subtitles file"),path,_T(""),_T(""),AssFile::GetWildcardList(0),wxFD_OPEN | wxFD_FILE_MUST_EXIST);
@ -992,10 +896,7 @@ void DialogStyleManager::OnCurrentImport(wxCommandEvent &event) {
} }
} }
/// @brief Enable or disable the move buttons
/// @brief Update move buttons
///
void DialogStyleManager::UpdateMoveButtons() { void DialogStyleManager::UpdateMoveButtons() {
// Get storage selection // Get storage selection
wxArrayInt sels; wxArrayInt sels;
@ -1010,15 +911,11 @@ void DialogStyleManager::UpdateMoveButtons() {
// Check if selection is continuous // Check if selection is continuous
bool contStor = true; bool contStor = true;
if (n) { for (int i = 1; i < n; ++i) {
int last = sels[0]; if (sels[i] != sels[i-1]+1) {
for (int i=1;i<n;i++) {
if (sels[i] != last+1) {
contStor = false; contStor = false;
break; break;
} }
last = sels[i];
}
} }
// Get current selection // Get current selection
@ -1033,15 +930,11 @@ void DialogStyleManager::UpdateMoveButtons() {
// Check if selection is continuous // Check if selection is continuous
bool contCurr = true; bool contCurr = true;
if (n) { for (int i = 1; i < n; ++i) {
int last = sels[0]; if (sels[i] != sels[i-1]+1) {
for (int i=1;i<n;i++) {
if (sels[i] != last+1) {
contCurr = false; contCurr = false;
break; break;
} }
last = sels[i];
}
} }
// Set values // Set values
@ -1057,64 +950,20 @@ void DialogStyleManager::UpdateMoveButtons() {
CurrentSort->Enable(itemsCurr > 1); CurrentSort->Enable(itemsCurr > 1);
} }
void DialogStyleManager::OnStorageMoveUp (wxCommandEvent &) { MoveStyles(true,0); }
void DialogStyleManager::OnStorageMoveTop (wxCommandEvent &) { MoveStyles(true,1); }
/// @brief Move events void DialogStyleManager::OnStorageMoveDown (wxCommandEvent &) { MoveStyles(true,2); }
/// @param event void DialogStyleManager::OnStorageMoveBottom (wxCommandEvent &) { MoveStyles(true,3); }
/// void DialogStyleManager::OnStorageSort (wxCommandEvent &) { MoveStyles(true,4); }
void DialogStyleManager::OnStorageMoveUp (wxCommandEvent &event) { MoveStyles(true,0); } void DialogStyleManager::OnCurrentMoveUp (wxCommandEvent &) { MoveStyles(false,0); }
void DialogStyleManager::OnCurrentMoveTop (wxCommandEvent &) { MoveStyles(false,1); }
/// @brief DOCME void DialogStyleManager::OnCurrentMoveDown (wxCommandEvent &) { MoveStyles(false,2); }
/// @param event void DialogStyleManager::OnCurrentMoveBottom (wxCommandEvent &) { MoveStyles(false,3); }
/// void DialogStyleManager::OnCurrentSort (wxCommandEvent &) { MoveStyles(false,4); }
void DialogStyleManager::OnStorageMoveTop (wxCommandEvent &event) { MoveStyles(true,1); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnStorageMoveDown (wxCommandEvent &event) { MoveStyles(true,2); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnStorageMoveBottom (wxCommandEvent &event) { MoveStyles(true,3); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnStorageSort (wxCommandEvent &event) { MoveStyles(true,4); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnCurrentMoveUp (wxCommandEvent &event) { MoveStyles(false,0); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnCurrentMoveTop (wxCommandEvent &event) { MoveStyles(false,1); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnCurrentMoveDown (wxCommandEvent &event) { MoveStyles(false,2); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnCurrentMoveBottom (wxCommandEvent &event) { MoveStyles(false,3); }
/// @brief DOCME
/// @param event
///
void DialogStyleManager::OnCurrentSort (wxCommandEvent &event) { MoveStyles(false,4); }
/// @brief Move function /// @brief Move function
/// @param storage /// @param storage
/// @param type /// @param type
/// @return
///
void DialogStyleManager::MoveStyles(bool storage, int type) { void DialogStyleManager::MoveStyles(bool storage, int type) {
// Variables // Variables
AssFile *subs = AssFile::top; AssFile *subs = AssFile::top;
@ -1253,11 +1102,7 @@ void DialogStyleManager::MoveStyles(bool storage, int type) {
UpdateMoveButtons(); UpdateMoveButtons();
} }
/// @brief Keydown event /// @brief Keydown event
/// @param event
///
void DialogStyleManager::OnKeyDown(wxKeyEvent &event) { void DialogStyleManager::OnKeyDown(wxKeyEvent &event) {
wxCommandEvent evt; wxCommandEvent evt;
switch(event.GetKeyCode()) { switch(event.GetKeyCode()) {
@ -1306,7 +1151,6 @@ void DialogStyleManager::OnKeyDown(wxKeyEvent &event) {
} }
break; break;
} }
} }
@ -1320,7 +1164,6 @@ int DialogStyleManager::lasty = -1;
/// @brief DialogStyleManagerEvent stuff /// @brief DialogStyleManagerEvent stuff
/// @param ctrl /// @param ctrl
///
DialogStyleManagerEvent::DialogStyleManagerEvent(DialogStyleManager *ctrl) { DialogStyleManagerEvent::DialogStyleManagerEvent(DialogStyleManager *ctrl) {
control = ctrl; control = ctrl;
} }
@ -1328,14 +1171,7 @@ BEGIN_EVENT_TABLE(DialogStyleManagerEvent, wxEvtHandler)
EVT_KEY_DOWN(DialogStyleManagerEvent::OnKeyDown) EVT_KEY_DOWN(DialogStyleManagerEvent::OnKeyDown)
END_EVENT_TABLE() END_EVENT_TABLE()
/// @brief DOCME
/// @param event
///
void DialogStyleManagerEvent::OnKeyDown(wxKeyEvent &event) { void DialogStyleManagerEvent::OnKeyDown(wxKeyEvent &event) {
control->OnKeyDown(event); //we need to access controls, so rather than make the controls public... control->OnKeyDown(event); //we need to access controls, so rather than make the controls public...
} }