| 1 |
////////////////////////////////////////////////////////////////////// |
| 2 |
// This file was auto-generated by codelite's wxCrafter Plugin |
| 3 |
// wxCrafter project file: wxcrafter.wxcp |
| 4 |
// Do not modify this file by hand! |
| 5 |
////////////////////////////////////////////////////////////////////// |
| 6 |
|
| 7 |
#include "wxcrafter.h" |
| 8 |
|
| 9 |
|
| 10 |
// Declare the bitmap loading function |
| 11 |
extern void wxC9ED9InitBitmapResources(); |
| 12 |
|
| 13 |
static bool bBitmapLoaded = false; |
| 14 |
|
| 15 |
|
| 16 |
MainFrameBaseClass::MainFrameBaseClass(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style) |
| 17 |
: wxFrame(parent, id, title, pos, size, style) |
| 18 |
{ |
| 19 |
if ( !bBitmapLoaded ) { |
| 20 |
// We need to initialise the default bitmap handler |
| 21 |
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler); |
| 22 |
wxC9ED9InitBitmapResources(); |
| 23 |
bBitmapLoaded = true; |
| 24 |
} |
| 25 |
|
| 26 |
wxBoxSizer* boxSizer1 = new wxBoxSizer(wxVERTICAL); |
| 27 |
this->SetSizer(boxSizer1); |
| 28 |
|
| 29 |
m_mainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1,-1)), wxTAB_TRAVERSAL); |
| 30 |
|
| 31 |
boxSizer1->Add(m_mainPanel, 1, wxEXPAND, WXC_FROM_DIP(5)); |
| 32 |
|
| 33 |
wxBoxSizer* boxSizer11 = new wxBoxSizer(wxVERTICAL); |
| 34 |
m_mainPanel->SetSizer(boxSizer11); |
| 35 |
|
| 36 |
wxFlexGridSizer* flexGridSizer15 = new wxFlexGridSizer(0, 2, 0, 0); |
| 37 |
flexGridSizer15->SetFlexibleDirection( wxBOTH ); |
| 38 |
flexGridSizer15->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); |
| 39 |
flexGridSizer15->AddGrowableCol(0); |
| 40 |
flexGridSizer15->AddGrowableCol(1); |
| 41 |
|
| 42 |
boxSizer11->Add(flexGridSizer15, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5)); |
| 43 |
|
| 44 |
m_buttonConnect = new wxButton(m_mainPanel, wxID_CONNECT, _("Connect"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1,-1)), 0); |
| 45 |
|
| 46 |
flexGridSizer15->Add(m_buttonConnect, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); |
| 47 |
|
| 48 |
m_buttonDisconnect = new wxButton(m_mainPanel, wxID_DISCONNECT, _("Disconnect"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1,-1)), 0); |
| 49 |
|
| 50 |
flexGridSizer15->Add(m_buttonDisconnect, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); |
| 51 |
|
| 52 |
m_buttonList = new wxButton(m_mainPanel, wxID_LIST, _("List folders"), wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1,-1)), 0); |
| 53 |
|
| 54 |
flexGridSizer15->Add(m_buttonList, 0, wxALL|wxEXPAND, WXC_FROM_DIP(5)); |
| 55 |
|
| 56 |
m_stc = new wxStyledTextCtrl(m_mainPanel, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(m_mainPanel, wxSize(-1,-1)), 0); |
| 57 |
// Configure the fold margin |
| 58 |
m_stc->SetMarginType (4, wxSTC_MARGIN_SYMBOL); |
| 59 |
m_stc->SetMarginMask (4, wxSTC_MASK_FOLDERS); |
| 60 |
m_stc->SetMarginSensitive(4, true); |
| 61 |
m_stc->SetMarginWidth (4, 16); |
| 62 |
|
| 63 |
m_stc->SetProperty(wxT("fold"),wxT("1")); |
| 64 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN); |
| 65 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_ARROW); |
| 66 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_BACKGROUND); |
| 67 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_BACKGROUND); |
| 68 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_ARROW); |
| 69 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN); |
| 70 |
m_stc->MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_BACKGROUND); |
| 71 |
// Configure the tracker margin |
| 72 |
m_stc->SetMarginWidth(1, 0); |
| 73 |
|
| 74 |
// Configure the symbol margin |
| 75 |
m_stc->SetMarginType (2, wxSTC_MARGIN_SYMBOL); |
| 76 |
m_stc->SetMarginMask (2, ~(wxSTC_MASK_FOLDERS)); |
| 77 |
m_stc->SetMarginWidth(2, 0); |
| 78 |
m_stc->SetMarginSensitive(2, true); |
| 79 |
|
| 80 |
// Configure the line numbers margin |
| 81 |
int m_stc_PixelWidth = 4 + 5 *m_stc->TextWidth(wxSTC_STYLE_LINENUMBER, wxT("9")); |
| 82 |
m_stc->SetMarginType(0, wxSTC_MARGIN_NUMBER); |
| 83 |
m_stc->SetMarginWidth(0,m_stc_PixelWidth); |
| 84 |
|
| 85 |
// Configure the line symbol margin |
| 86 |
m_stc->SetMarginType(3, wxSTC_MARGIN_FORE); |
| 87 |
m_stc->SetMarginMask(3, 0); |
| 88 |
m_stc->SetMarginWidth(3,0); |
| 89 |
// Select the lexer |
| 90 |
m_stc->SetLexer(wxSTC_LEX_NULL); |
| 91 |
// Set default font / styles |
| 92 |
m_stc->StyleClearAll(); |
| 93 |
m_stc->SetWrapMode(0); |
| 94 |
m_stc->SetIndentationGuides(0); |
| 95 |
m_stc->SetKeyWords(0, wxT("")); |
| 96 |
m_stc->SetKeyWords(1, wxT("")); |
| 97 |
m_stc->SetKeyWords(2, wxT("")); |
| 98 |
m_stc->SetKeyWords(3, wxT("")); |
| 99 |
m_stc->SetKeyWords(4, wxT("")); |
| 100 |
|
| 101 |
boxSizer11->Add(m_stc, 1, wxALL|wxEXPAND, WXC_FROM_DIP(5)); |
| 102 |
|
| 103 |
m_menuBar = new wxMenuBar(0); |
| 104 |
this->SetMenuBar(m_menuBar); |
| 105 |
|
| 106 |
m_name6 = new wxMenu(); |
| 107 |
m_menuBar->Append(m_name6, _("File")); |
| 108 |
|
| 109 |
m_menuItem7 = new wxMenuItem(m_name6, wxID_EXIT, _("Exit\tAlt-X"), _("Quit"), wxITEM_NORMAL); |
| 110 |
m_name6->Append(m_menuItem7); |
| 111 |
|
| 112 |
m_name8 = new wxMenu(); |
| 113 |
m_menuBar->Append(m_name8, _("Help")); |
| 114 |
|
| 115 |
m_menuItem9 = new wxMenuItem(m_name8, wxID_ABOUT, _("About..."), wxT(""), wxITEM_NORMAL); |
| 116 |
m_name8->Append(m_menuItem9); |
| 117 |
|
| 118 |
SetName(wxT("MainFrameBaseClass")); |
| 119 |
SetSize(-1,-1); |
| 120 |
if (GetSizer()) { |
| 121 |
GetSizer()->Fit(this); |
| 122 |
} |
| 123 |
if(GetParent()) { |
| 124 |
CentreOnParent(wxBOTH); |
| 125 |
} else { |
| 126 |
CentreOnScreen(wxBOTH); |
| 127 |
} |
| 128 |
#if wxVERSION_NUMBER >= 2900 |
| 129 |
if(!wxPersistenceManager::Get().Find(this)) { |
| 130 |
wxPersistenceManager::Get().RegisterAndRestore(this); |
| 131 |
} else { |
| 132 |
wxPersistenceManager::Get().Restore(this); |
| 133 |
} |
| 134 |
#endif |
| 135 |
// Connect events |
| 136 |
m_buttonConnect->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnConnect), NULL, this); |
| 137 |
m_buttonConnect->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnConnectUI), NULL, this); |
| 138 |
m_buttonDisconnect->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnDisconnect), NULL, this); |
| 139 |
m_buttonDisconnect->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnDisconnectUI), NULL, this); |
| 140 |
m_buttonList->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnList), NULL, this); |
| 141 |
m_buttonList->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnListUI), NULL, this); |
| 142 |
this->Connect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this); |
| 143 |
this->Connect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this); |
| 144 |
|
| 145 |
} |
| 146 |
|
| 147 |
MainFrameBaseClass::~MainFrameBaseClass() |
| 148 |
{ |
| 149 |
m_buttonConnect->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnConnect), NULL, this); |
| 150 |
m_buttonConnect->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnConnectUI), NULL, this); |
| 151 |
m_buttonDisconnect->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnDisconnect), NULL, this); |
| 152 |
m_buttonDisconnect->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnDisconnectUI), NULL, this); |
| 153 |
m_buttonList->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainFrameBaseClass::OnList), NULL, this); |
| 154 |
m_buttonList->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(MainFrameBaseClass::OnListUI), NULL, this); |
| 155 |
this->Disconnect(m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnExit), NULL, this); |
| 156 |
this->Disconnect(m_menuItem9->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainFrameBaseClass::OnAbout), NULL, this); |
| 157 |
|
| 158 |
} |