Ejemplo n.º 1
0
bool App::OnInit()
{
    bool ok = wxApp::OnInit();

    if (ok)
    {
        wxLocaleHelper::Init(&m_locale, STE_APPNAME, m_cmdLine.m_lang);
        ::wxInitAllImageHandlers();

        // Fill in the application information fields before creating wxConfig.
        SetVendorName(wxT("wxWidgets"));
        SetAppName(APP_NAME_SHORT);
    #if (wxVERSION_NUMBER >= 2900)
        SetAppDisplayName(APP_NAME_DISPLAY);
    #endif

        // Create a document manager
        wxDocManager* docManager = CreateDocManager();

        // create the main frame window
        MainFrame* frame = new MainFrame();
        
        ok = frame->Create(docManager, GetAppDisplayName());
        if (ok)
        {
            frame->Show();
            OpenDocuments(docManager);
        }
        else
        {
            delete frame;
        }
    }
    return ok;
}
Ejemplo n.º 2
0
static	pascal	OSErr	HandleAppleEventOdoc( const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon )
{
	AEDescList		docList;
	OSErr			err = AEGetParamDesc( theAppleEvent, keyDirectObject, typeAEList, &docList );
	require_noerr( err, CantGetDocList );

	err	= OpenDocuments( docList );
	AEDisposeDesc( &docList );

CantGetDocList:
  	return( err );
}