More docblocks\!

This commit is contained in:
Timothy Warren 2015-05-04 20:33:01 -04:00
parent 5302e5f679
commit 042be6734c

View File

@ -205,12 +205,22 @@ void MainFrame::BindEvents()
Bind(wxEVT_COMMAND_MENU_SELECTED, &MainFrame::OnAbout, this, wxID_ABOUT); Bind(wxEVT_COMMAND_MENU_SELECTED, &MainFrame::OnAbout, this, wxID_ABOUT);
} }
/**
* Create a new document
*
* @return void
*/
void MainFrame::OnNew(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnNew(wxCommandEvent &WXUNUSED(event))
{ {
this->EnableEditControls(); this->EnableEditControls();
notebook->AddTab(); notebook->AddTab();
} }
/**
* Open existing document(s)
*
* @return void
*/
void MainFrame::OnOpen(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnOpen(wxCommandEvent &WXUNUSED(event))
{ {
wxArrayString filelist; wxArrayString filelist;
@ -233,6 +243,12 @@ void MainFrame::OnOpen(wxCommandEvent &WXUNUSED(event))
this->EnableEditControls(true); this->EnableEditControls(true);
} }
/**
* Event handler for file saving checks on tab close
*
* @param wxAuiNotebookEvent& event
* @return void
*/
void MainFrame::OnClose(wxAuiNotebookEvent &event) void MainFrame::OnClose(wxAuiNotebookEvent &event)
{ {
int current_tab = notebook->GetSelection(); int current_tab = notebook->GetSelection();
@ -244,8 +260,8 @@ void MainFrame::OnClose(wxAuiNotebookEvent &event)
if (editor->IsModified()) if (editor->IsModified())
{ {
int Msgbox_Choice = wxMessageBox( int Msgbox_Choice = wxMessageBox(
_T("File has not been saved, save file before closing?"), "File has not been saved, save file before closing?",
_T("Modified File"), "Modified File",
wxYES_NO | wxCANCEL | wxICON_QUESTION, wxYES_NO | wxCANCEL | wxICON_QUESTION,
this this
); );
@ -259,7 +275,7 @@ void MainFrame::OnClose(wxAuiNotebookEvent &event)
editor->SaveFile(); editor->SaveFile();
if (editor->IsModified()) if (editor->IsModified())
{ {
wxMessageBox(_("File could not be saved"), _("Error"), wxOK | wxICON_EXCLAMATION); wxMessageBox(TYRO_SAVE_ERROR, TYRO_SAVE_ERROR_CAPTION, wxOK | wxICON_EXCLAMATION);
return event.Veto(); return event.Veto();
} }
} }
@ -280,6 +296,11 @@ void MainFrame::OnClosed(wxAuiNotebookEvent &WXUNUSED(event))
} }
} }
/**
* Close the current tab via the toolbar or menu
*
* @return void
*/
void MainFrame::OnCloseTab(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnCloseTab(wxCommandEvent &WXUNUSED(event))
{ {
int current_tab = notebook->GetSelection(); int current_tab = notebook->GetSelection();
@ -292,12 +313,23 @@ void MainFrame::OnCloseTab(wxCommandEvent &WXUNUSED(event))
} }
} }
/**
* Close all the open tabs
*
* @return void
*/
void MainFrame::OnCloseAll(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnCloseAll(wxCommandEvent &WXUNUSED(event))
{ {
notebook->DeleteAllPages(); notebook->DeleteAllPages();
this->EnableEditControls(false); this->EnableEditControls(false);
} }
/**
* Save the current document
*
* @param wxCommandEvent& event
* @return void
*/
void MainFrame::OnSave(wxCommandEvent &event) void MainFrame::OnSave(wxCommandEvent &event)
{ {
EditPane *editor = notebook->GetCurrentEditor(); EditPane *editor = notebook->GetCurrentEditor();
@ -312,6 +344,11 @@ void MainFrame::OnSave(wxCommandEvent &event)
editor->SaveFile(); editor->SaveFile();
} }
/**
* Save the current document with a new name
*
* @return void
*/
void MainFrame::OnSaveAs(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnSaveAs(wxCommandEvent &WXUNUSED(event))
{ {
EditPane *editor = notebook->GetCurrentEditor(); EditPane *editor = notebook->GetCurrentEditor();
@ -425,6 +462,11 @@ void MainFrame::OnToggleWhitespace(wxCommandEvent& event)
editor->SetViewWhiteSpace(flag); editor->SetViewWhiteSpace(flag);
} }
/**
* Show the find dialog
*
* @return void
*/
void MainFrame::OnEditFind(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnEditFind(wxCommandEvent &WXUNUSED(event))
{ {
if (findDlg) if (findDlg)
@ -443,6 +485,11 @@ void MainFrame::OnEditFind(wxCommandEvent &WXUNUSED(event))
} }
} }
/**
* Show the find/replace dialog
*
* @return void
*/
void MainFrame::OnEditReplace(wxCommandEvent &WXUNUSED(event)) void MainFrame::OnEditReplace(wxCommandEvent &WXUNUSED(event))
{ {
if (replaceDlg) if (replaceDlg)
@ -464,7 +511,9 @@ void MainFrame::OnEditReplace(wxCommandEvent &WXUNUSED(event))
/** /**
* Handles events coming from find dialog * Handles events coming from find dialog
* @param event *
* @param wxFindDialogEvent& event
* @return void
*/ */
void MainFrame::OnFindDialog(wxFindDialogEvent &event) void MainFrame::OnFindDialog(wxFindDialogEvent &event)
{ {
@ -543,6 +592,12 @@ void MainFrame::OnFindDialog(wxFindDialogEvent &event)
} }
} }
/**
* Toggle line wrap
*
* @param wxCommandEvent& event
* @return void
*/
void MainFrame::OnToggleLineWrap(wxCommandEvent &event) void MainFrame::OnToggleLineWrap(wxCommandEvent &event)
{ {
EditPane *editor = notebook->GetCurrentEditor(); EditPane *editor = notebook->GetCurrentEditor();