| 1 | // $Header$ |
|---|
| 2 | /*************************************************************************** |
|---|
| 3 | * Copyright (C) 2006 by Guy Rutenberg * |
|---|
| 4 | * guyrutenberg@gmail.com * |
|---|
| 5 | * * |
|---|
| 6 | * This program is free software; you can redistribute it and/or modify * |
|---|
| 7 | * it under the terms of the GNU General Public License as published by * |
|---|
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
|---|
| 9 | * (at your option) any later version. * |
|---|
| 10 | * * |
|---|
| 11 | * This program is distributed in the hope that it will be useful, * |
|---|
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
|---|
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
|---|
| 14 | * GNU General Public License for more details. * |
|---|
| 15 | * * |
|---|
| 16 | * You should have received a copy of the GNU General Public License * |
|---|
| 17 | * along with this program; if not, write to the * |
|---|
| 18 | * Free Software Foundation, Inc., * |
|---|
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | |
|---|
| 22 | |
|---|
| 23 | // This is the main source file for the project. It includes the creation of the main window |
|---|
| 24 | // but all other stuff is done on other files. |
|---|
| 25 | |
|---|
| 26 | /* |
|---|
| 27 | PREFIX and DATA_DIR are passed by the make file to the program and hold the the |
|---|
| 28 | path prefix and datadir path accordingly. |
|---|
| 29 | */ |
|---|
| 30 | |
|---|
| 31 | /* |
|---|
| 32 | * If PORTABLE is defined, Open Yahtzee will be compiled for the Portable Edition. Add "-DPORTABLE" to the CXXFLAGS when compiling. |
|---|
| 33 | */ |
|---|
| 34 | |
|---|
| 35 | #include "wx/wx.h" |
|---|
| 36 | #include "MainFrame.h" |
|---|
| 37 | // #ifdef WIN32 |
|---|
| 38 | // #include openyahtzee.rc |
|---|
| 39 | // #endif |
|---|
| 40 | |
|---|
| 41 | |
|---|
| 42 | // Declare the application class |
|---|
| 43 | class MyApp : public wxApp |
|---|
| 44 | { |
|---|
| 45 | public: |
|---|
| 46 | // Called on application startup |
|---|
| 47 | virtual bool OnInit(); |
|---|
| 48 | }; |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | // Implements MyApp& GetApp() |
|---|
| 53 | DECLARE_APP(MyApp) /*just to satisfy kdevelop*/; |
|---|
| 54 | // Give wxWidgets the means to create a MyApp object |
|---|
| 55 | IMPLEMENT_APP(MyApp) /*just to satisfy kdevelop*/; |
|---|
| 56 | // Initialize the application |
|---|
| 57 | |
|---|
| 58 | bool MyApp::OnInit() |
|---|
| 59 | { |
|---|
| 60 | //load all image handlers |
|---|
| 61 | ::wxInitAllImageHandlers(); |
|---|
| 62 | |
|---|
| 63 | // Create the main application window |
|---|
| 64 | MainFrame *frame = new MainFrame(wxT("Open Yahtzee"), wxDefaultSize, wxDEFAULT_FRAME_STYLE & (~wxRESIZE_BORDER)); |
|---|
| 65 | |
|---|
| 66 | //Show it |
|---|
| 67 | frame->Show(true); |
|---|
| 68 | return true; |
|---|
| 69 | } |
|---|