////////////////////////////////////////////////////////////////////////////////
// Name:        demo.cpp (generated and maintained by wxWorkshop's RAD)
// Purpose:     
// Author:      
// Modified by:
// Created:     02/19/01 06:50:41
// RCS-ID:      $ Id$
// Copyright:   (c) 
// Licence:   	
//////////////////////////////////////////////////////////////////////////////////

// %%INFO-{
// { TEMPL = "wxWindows C++ Application" WND_RES = "MyFrameRes" MENU_RES = "" DECL_FILE = "" CLASS = "MyApp" RES_FILE = "demo.xrc" }
// %%INFO-}

#ifdef __GNUG__
    #pragma implementation "demo.cpp"
    #pragma interface ""
#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


#include "wx/xml/xmlres.h"
#include "wx/wspp/init.h"

// Define a new application type, each program should derive a class from wxApp
class MyApp : public wxApp
{
public:
    // override base class virtuals
    // ----------------------------

    // this one is called on application startup and is a good place for the app
    // initialization (doing it here and not in the ctor allows to have an error
    // return: if OnInit() returns false, the application terminates)
    virtual bool OnInit();
};

// Create a new application object: this macro will allow wxWindows to create
// the application object during program execution (it's better than using a
// static object for many reasons) and also declares the accessor function
// wxGetApp() which will return the reference of the right type (i.e. MyApp and
// not wxApp)
IMPLEMENT_APP(MyApp)

// ============================================================================
// implementation
// ============================================================================

/***** Implementation for class MyApp *****/

// 'Main program' equivalent: the program execution "starts" here
bool MyApp::OnInit()
{
	/***** debug ******/
	#if 1
		wxFrame* mpLogFrm = new wxFrame( NULL,-1,"Log", wxDefaultPosition, wxSize(500,200) );
		wxTextCtrl *textCtrl = new wxTextCtrl(mpLogFrm, -1, "",wxDefaultPosition,wxDefaultSize, wxTE_MULTILINE | wxSUNKEN_BORDER);
		wxLogTextCtrl *logWindow = new wxLogTextCtrl(textCtrl);
		delete wxLog::SetActiveTarget(logWindow);
		mpLogFrm->SetSize( 0,0, 150, 200 );
		mpLogFrm->Show(TRUE);
	#endif
	/*******************************/

	// %%APP_INIT-{
	InitWSPP();
	wxTheXmlResource->InitAllHandlers();
	wxTheXmlResource->Load("demo.xrc"); 
	
	//wxMessageBox( "Starting Demo...dadiiii" );
	
	// load and show Application's main-window
	wxWindow* wnd = wxTheXmlResource->LoadWindow( "MyFrameRes", TRUE );
    // %%APP_INIT-}

    // success: wxApp::OnRun() will be called which will enter the main message
    // loop and the application will run. If we returned FALSE here, the
    // application would exit immediately.
    return TRUE;
    
}