1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Federico Pinna
6 // Created: 05/02/04 23:19:32
8 // Copyright: (c) 2004 Reitek S.p.A.
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma implementation "MainFrame.h"
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
30 #include "MainFrame.h"
36 * MainFrame type definition
39 IMPLEMENT_CLASS( MainFrame
, wxFrame
)
42 * MainFrame event table definition
45 BEGIN_EVENT_TABLE( MainFrame
, wxFrame
)
47 ////@begin MainFrame event table entries
48 EVT_MENU( ID_MENU
, MainFrame::OnConnect
)
50 EVT_MENU( ID_MENU1
, MainFrame::OnDisconnect
)
52 EVT_MENU( ID_MENU2
, MainFrame::OnQuit
)
54 ////@end MainFrame event table entries
59 * MainFrame constructors
62 MainFrame::MainFrame( )
66 MainFrame::MainFrame( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
68 Create( parent
, id
, caption
, pos
, size
, style
);
75 bool MainFrame::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
77 ////@begin MainFrame member initialisation
79 ////@end MainFrame member initialisation
81 ////@begin MainFrame creation
82 wxFrame::Create( parent
, id
, caption
, pos
, size
, style
);
86 ////@end MainFrame creation
91 * Control creation for MainFrame
94 void MainFrame::CreateControls()
96 ////@begin MainFrame content construction
98 MainFrame
* item1
= this;
100 wxStatusBar
* item8
= new wxStatusBar( item1
, ID_STATUSBAR
, wxST_SIZEGRIP
|wxNO_BORDER
);
101 item8
->SetFieldsCount(2);
102 item1
->SetStatusBar(item8
);
104 wxPanel
* item9
= new wxPanel( item1
, ID_PANEL
, wxDefaultPosition
, wxSize(100, 80), wxSUNKEN_BORDER
|wxTAB_TRAVERSAL
);
106 wxGridSizer
* item10
= new wxGridSizer(1, 1, 0, 0);
107 item9
->SetSizer(item10
);
108 item9
->SetAutoLayout(TRUE
);
110 wxTreeCtrl
* item11
= new wxTreeCtrl( item9
, ID_TREECTRL
, wxDefaultPosition
, wxSize(100, 100), wxTR_HAS_BUTTONS
|wxTR_HIDE_ROOT
|wxTR_SINGLE
);
111 m_RosterTree
= item11
;
112 item10
->Add(item11
, 0, wxGROW
|wxGROW
, 5);
114 wxMenuBar
* menuBar
= new wxMenuBar
;
116 wxMenu
* item3
= new wxMenu
;
117 item3
->Append(ID_MENU
, _("Connect"), _T(""), wxITEM_NORMAL
);
118 item3
->Append(ID_MENU1
, _("&Disconnect"), _T(""), wxITEM_NORMAL
);
119 item3
->AppendSeparator();
120 item3
->Append(ID_MENU2
, _("E&xit"), _T(""), wxITEM_NORMAL
);
121 menuBar
->Append(item3
, _("File"));
122 item1
->SetMenuBar(menuBar
);
124 ////@end MainFrame content construction
128 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU
131 void MainFrame::OnConnect( wxCommandEvent
& event
)
133 // Insert custom code here
138 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU1
141 void MainFrame::OnDisconnect( wxCommandEvent
& event
)
143 // Insert custom code here
148 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU2
151 void MainFrame::OnQuit( wxCommandEvent
& event
)
153 // Insert custom code here
158 * Should we show tooltips?
161 bool MainFrame::ShowToolTips()