]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/wx-console/main.cpp
Add wx-console directory
[bacula/bacula] / bacula / src / wx-console / main.cpp
1 /*
2  *
3  *    Bacula wx GUI application
4  *
5  *    Nicolas Boichat, April 2004
6  *
7  */
8 /*
9    Copyright (C) 2004 Kern Sibbald and John Walker
10
11    This program is free software; you can redistribute it and/or
12    modify it under the terms of the GNU General Public License
13    as published by the Free Software Foundation; either version 2
14    of the License, or (at your option) any later version.
15
16    This program is distributed in the hope that it will be useful,
17    but WITHOUT ANY WARRANTY; without even the implied warranty of
18    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19    GNU General Public License for more details.
20
21    You should have received a copy of the GNU General Public License
22    along with this program; if not, write to the Free Software
23    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24  */
25
26 // ============================================================================
27 // declarations
28 // ============================================================================
29
30 // ----------------------------------------------------------------------------
31 // headers
32 // ----------------------------------------------------------------------------
33
34 #include "wx/wxprec.h"
35
36 #ifdef __BORLANDC__
37    #pragma hdrstop
38 #endif
39
40 // for all others, include the necessary headers (this file is usually all you
41 // need because it includes almost all "standard" wxWindows headers)
42 #ifndef WX_PRECOMP
43    #include "wx/wx.h"
44 #endif
45
46 #include "wxbmainframe.h"
47
48 #include "csprint.h"
49
50 // ----------------------------------------------------------------------------
51 // resources
52 // ----------------------------------------------------------------------------
53
54
55 class MyApp : public wxApp
56 {
57 public:
58    virtual bool OnInit();
59 };
60
61 IMPLEMENT_APP(MyApp)
62
63 // ============================================================================
64 // implementation
65 // ============================================================================
66
67 // ----------------------------------------------------------------------------
68 // the application class
69 // ----------------------------------------------------------------------------
70
71 // 'Main program' equivalent: the program execution "starts" here
72 bool MyApp::OnInit()
73 {
74    wxbMainFrame *frame = wxbMainFrame::CreateInstance(_T("Minimal wxWindows App"),
75                          wxPoint(50, 50), wxSize(780, 500));
76
77    frame->Show(TRUE);
78
79    frame->StartConsoleThread();
80
81    csprint("Console started !\n");
82
83    return TRUE;
84 }