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