Browse CVS Repository
Annotation of /malonnote/mnFrame.cpp
Parent Directory
| Revision Log
| Revision Graph
Revision 1.29 -
( hide annotations)
( download)
( as text)
Mon Jan 23 13:37:10 2006 UTC
(18 years, 2 months ago)
by maloninc
Branch: MAIN
CVS Tags: rel_1_7_1, HEAD
Changes since 1.28: +0 -1 lines
File MIME type: text/x-c++src
fixing bug about MNDOC without double quotation.
| 1 |
maloninc |
1.28 |
#include <wx/wx.h> |
| 2 |
maloninc |
1.7 |
#include <wx/regex.h> |
| 3 |
maloninc |
1.13 |
#include <wx/tokenzr.h> |
| 4 |
maloninc |
1.20 |
#include <wx/xrc/xmlres.h> |
| 5 |
maloninc |
1.1 |
#include "mnDef.h" |
| 6 |
|
|
#include "mnFrame.h" |
| 7 |
maloninc |
1.23 |
#include "mnNotePanel.h" |
| 8 |
|
|
#include "mnNotePanelController.h" |
| 9 |
maloninc |
1.1 |
|
| 10 |
|
|
|
| 11 |
maloninc |
1.20 |
mnFrame::mnFrame(wxWindow* parent) |
| 12 |
maloninc |
1.1 |
{ |
| 13 |
maloninc |
1.20 |
wxXmlResource::Get()->LoadFrame(this, parent, wxT("mnFrame")); |
| 14 |
maloninc |
1.1 |
|
| 15 |
|
|
#ifdef __WXMSW__ |
| 16 |
|
|
wxIcon icon(wxT(APP_ICON_NAME), wxBITMAP_TYPE_ICO_RESOURCE); |
| 17 |
|
|
SetIcon(icon); |
| 18 |
|
|
#endif |
| 19 |
|
|
|
| 20 |
maloninc |
1.20 |
/* init members */ |
| 21 |
|
|
searchTextCtrl = XRCCTRL(*this, "searchTextCtrl", wxTextCtrl); |
| 22 |
maloninc |
1.23 |
noteBook = XRCCTRL(*this, "noteBook", wxNotebook); |
| 23 |
maloninc |
1.26 |
|
| 24 |
maloninc |
1.28 |
CreateStatusBar(); |
| 25 |
maloninc |
1.18 |
} |
| 26 |
maloninc |
1.13 |
|
| 27 |
maloninc |
1.27 |
void mnFrame::setFocusToSearchTextCtrl() |
| 28 |
|
|
{ |
| 29 |
|
|
searchTextCtrl->SetFocus(); |
| 30 |
|
|
} |
| 31 |
|
|
|
| 32 |
maloninc |
1.23 |
void mnFrame::addNotePanel(wxString* dirName) |
| 33 |
maloninc |
1.18 |
{ |
| 34 |
maloninc |
1.23 |
mnNotePanel* panel = new mnNotePanel(noteBook, dirName); |
| 35 |
maloninc |
1.28 |
wxFileName fileName(*dirName); |
| 36 |
|
|
|
| 37 |
|
|
noteBook->AddPage(panel, fileName.GetName(), true); // only filename as page title |
| 38 |
maloninc |
1.13 |
|
| 39 |
maloninc |
1.27 |
setFocusToSearchTextCtrl(); |
| 40 |
maloninc |
1.13 |
} |
| 41 |
maloninc |
1.1 |
|
| 42 |
maloninc |
1.25 |
void mnFrame::removeSelectedNotePanel() |
| 43 |
|
|
{ |
| 44 |
|
|
noteBook->DeletePage(noteBook->GetSelection()); |
| 45 |
|
|
} |
| 46 |
|
|
|
| 47 |
maloninc |
1.23 |
mnNotePanel* mnFrame::getNotePanel() |
| 48 |
maloninc |
1.17 |
{ |
| 49 |
maloninc |
1.23 |
int selection = noteBook->GetSelection(); |
| 50 |
maloninc |
1.17 |
|
| 51 |
maloninc |
1.23 |
return (mnNotePanel*)noteBook->GetPage(selection); |
| 52 |
maloninc |
1.17 |
} |
| 53 |
maloninc |
1.24 |
|
| 54 |
|
|
wxNotebook* mnFrame::getNotebook() |
| 55 |
|
|
{ |
| 56 |
|
|
return noteBook; |
| 57 |
|
|
} |
|