1 /////////////////////////////////////////////////////////////////////////////
2 // Name: MainFrame.cxx
3 // Purpose:
4 // Author: Federico Pinna
5 // Modified by:
6 // Created: 05/02/04 23:19:32
7 // RCS-ID:
8 // Copyright: (c) 2004 Reitek S.p.A.
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma implementation "MainFrame.h"
14 #endif
15
16 #ifdef __BORLANDC__
17 #pragma hdrstop
18 #endif
19
20 ////@begin includes
21 ////@end includes
22
23 #include "main.h"
24
25 ////@begin XPM images
26 ////@end XPM images
27
28 /*!
29 * MainFrame type definition
30 */
31
IMPLEMENT_CLASS(MainFrame,wxFrame)32 IMPLEMENT_CLASS( MainFrame, wxFrame )
33
34 /*!
35 * MainFrame event table definition
36 */
37
38 BEGIN_EVENT_TABLE( MainFrame, wxFrame )
39
40 ////@begin MainFrame event table entries
41 EVT_MENU( ID_MENU, MainFrame::OnConnect )
42
43 EVT_MENU( ID_MENU1, MainFrame::OnDisconnect )
44
45 EVT_MENU( ID_MENU2, MainFrame::OnQuit )
46
47 ////@end MainFrame event table entries
48
49 END_EVENT_TABLE()
50
51 /*!
52 * MainFrame constructors
53 */
54
55 MainFrame::MainFrame( )
56 {
57 }
58
MainFrame(wxWindow * parent,wxWindowID id,const wxString & caption,const wxPoint & pos,const wxSize & size,long style)59 MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
60 {
61 Create( parent, id, caption, pos, size, style );
62 }
63
64 /*!
65 * MainFrame creator
66 */
67
Create(wxWindow * parent,wxWindowID id,const wxString & caption,const wxPoint & pos,const wxSize & size,long style)68 bool MainFrame::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
69 {
70 ////@begin MainFrame member initialisation
71 m_RosterTree = NULL;
72 ////@end MainFrame member initialisation
73
74 ////@begin MainFrame creation
75 wxFrame::Create( parent, id, caption, pos, size, style );
76
77 CreateControls();
78 Centre();
79 ////@end MainFrame creation
80 return PTrue;
81 }
82
83 /*!
84 * Control creation for MainFrame
85 */
86
CreateControls()87 void MainFrame::CreateControls()
88 {
89 ////@begin MainFrame content construction
90
91 MainFrame* item1 = this;
92
93 wxStatusBar* item8 = new wxStatusBar( item1, ID_STATUSBAR, wxST_SIZEGRIP|wxNO_BORDER );
94 item8->SetFieldsCount(2);
95 item1->SetStatusBar(item8);
96
97 wxPanel* item9 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxSize(100, 80), wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
98
99 wxGridSizer* item10 = new wxGridSizer(1, 1, 0, 0);
100 item9->SetSizer(item10);
101 item9->SetAutoLayout(PTrue);
102
103 wxTreeCtrl* item11 = new wxTreeCtrl( item9, ID_TREECTRL, wxDefaultPosition, wxSize(100, 100), wxTR_HAS_BUTTONS |wxTR_HIDE_ROOT|wxTR_SINGLE );
104 m_RosterTree = item11;
105 item10->Add(item11, 0, wxGROW|wxGROW, 5);
106
107 wxMenuBar* menuBar = new wxMenuBar;
108
109 wxMenu* item3 = new wxMenu;
110 item3->Append(ID_MENU, _("Connect"), _T(""), wxITEM_NORMAL);
111 item3->Append(ID_MENU1, _("&Disconnect"), _T(""), wxITEM_NORMAL);
112 item3->AppendSeparator();
113 item3->Append(ID_MENU2, _("E&xit"), _T(""), wxITEM_NORMAL);
114 menuBar->Append(item3, _("File"));
115 item1->SetMenuBar(menuBar);
116
117 ////@end MainFrame content construction
118 }
119
120 /*!
121 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU
122 */
123
OnConnect(wxCommandEvent & event)124 void MainFrame::OnConnect( wxCommandEvent& event )
125 {
126 // Insert custom code here
127 event.Skip();
128 }
129
130 /*!
131 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU1
132 */
133
OnDisconnect(wxCommandEvent & event)134 void MainFrame::OnDisconnect( wxCommandEvent& event )
135 {
136 // Insert custom code here
137 event.Skip();
138 }
139
140 /*!
141 * wxEVT_COMMAND_MENU_SELECTED event handler for ID_MENU2
142 */
143
OnQuit(wxCommandEvent & event)144 void MainFrame::OnQuit( wxCommandEvent& event )
145 {
146 // Insert custom code here
147 event.Skip();
148 }
149
150 /*!
151 * Should we show tooltips?
152 */
153
ShowToolTips()154 bool MainFrame::ShowToolTips()
155 {
156 return PTrue;
157 }
158