t_wxext.cpp

Go to the documentation of this file.
00001 /*****************************************************************************\
00002 *                                                                             *
00003 *  Name   : wx_ext tester                                                     *
00004 *  Author : Chris Koeritz                                                     *
00005 *  Author : Aaron Buchanan                                                    *
00006 *                                                                             *
00007 *******************************************************************************
00008 * Copyright (c) 2005-$now By Author.  This program is free software; you can  *
00009 * redistribute it and/or modify it under the terms of the GNU General Public  *
00010 * License as published by the Free Software Foundation; either version 2 of   *
00011 * the License or (at your option) any later version.  This is online at:      *
00012 *     http://www.fsf.org/copyleft/gpl.html                                    *
00013 * Please send any updates to: fred@gruntose.com                               *
00014 \*****************************************************************************/
00015 
00016 #include "t_wxext_frame.h"
00017 
00018 #include <basis/portable.h>
00019 #include <data_struct/static_memory_gremlin.h>
00020 #include <wx_ext/definitions_wx.h>
00021 
00022 #include <basis/trap_new.addin>
00023 #include <wx/app.h>
00024 #include <wx/icon.h>
00025 #include <basis/untrap_new.addin>
00026 
00027 // the application icon (under Windows and OS/2 it is in resources and even
00028 // though we could still include the XPM here it would be unused)
00029 #if !defined(__WXMSW__) && !defined(__WXPM__)
00030   #include "sample.xpm"
00031 #endif
00032 
00033 HOOPLE_STARTUP_CODE;
00034 
00035 // Define a new application type, each program should derive a class from wxApp
00036 class MyApp : public wxApp
00037 {
00038 public:
00039   virtual bool OnInit();
00040 };
00041 
00042 // Create a new application object: this macro will allow wxWidgets to create
00043 // the application object during program execution (it's better than using a
00044 // static object for many reasons) and also implements the accessor function
00045 // wxGetApp() which will return the reference of the right type (i.e. MyApp and
00046 // not wxApp).
00047 IMPLEMENT_APP(MyApp)
00048 
00049 bool MyApp::OnInit()
00050 {
00051   // create the main application window
00052   t_wxext_frame *frame = new t_wxext_frame("Test for wx_ext", "t_wxext");
00053   // set the frame icon
00054   frame->SetIcon(wxICON(sample));
00055 
00056   // and show it (the frames, unlike simple controls, are not shown when
00057   // created initially)
00058   frame->Show(true);
00059 
00060   // success: wxApp::OnRun() will be called which will enter the main message
00061   // loop and the application will run. If we returned false here, the
00062   // application would exit immediately.
00063   return true;
00064 }
00065 

Generated on Fri Nov 21 04:30:04 2008 for HOOPLE Libraries by  doxygen 1.5.1