bool AbstractApp::OnInit() {
    // initialize globals
    TrenchBroom::IO::PakManager::sharedManager = new TrenchBroom::IO::PakManager();
    TrenchBroom::Model::AliasManager::sharedManager = new TrenchBroom::Model::AliasManager();
    TrenchBroom::Model::BspManager::sharedManager = new TrenchBroom::Model::BspManager();

	m_docManager = new DocManager();
    m_docManager->FileHistoryLoad(*wxConfig::Get());

    new wxDocTemplate(m_docManager,
                      wxT("Quake map document"),
                      wxT("*.map"),
                      wxEmptyString,
                      wxT("map"),
                      wxT("Quake map document"),
                      wxT("TrenchBroom editor view"),
                      CLASSINFO(TrenchBroom::Model::MapDocument),
                      CLASSINFO(TrenchBroom::View::EditorView)
                      );

    // load file system handlers
    wxFileSystem::AddHandler(new wxMemoryFSHandler());

    // load image handles
    wxImage::AddHandler(new wxGIFHandler());
    wxImage::AddHandler(new wxPNGHandler());

    TrenchBroom::IO::FileManager fileManager;
    String helpPath = fileManager.appendPath(fileManager.resourceDirectory(), "Documentation");

    m_helpController = new wxExtHelpController();
    m_helpController->Initialize(helpPath);

    return true;
}
示例#2
0
bool AbstractApp::OnInit() {
    m_preferencesFrame = NULL;
    
    // initialize globals
    TrenchBroom::IO::PakManager::sharedManager = new TrenchBroom::IO::PakManager();
    TrenchBroom::Model::AliasManager::sharedManager = new TrenchBroom::Model::AliasManager();
    TrenchBroom::Model::BspManager::sharedManager = new TrenchBroom::Model::BspManager();
    
	m_docManager = new DocManager();
    m_docManager->FileHistoryLoad(*wxConfig::Get());
    
    new wxDocTemplate(m_docManager,
                      wxT("Quake map document"),
#if defined __linux__ // appears to be a bug in wxWidgets' file dialog, on Linux it will only allow lowercase extensions
                      wxT("*.*"),
#else
                      wxT("*.map"),
#endif
                      wxEmptyString,
                      wxT("map"),
                      wxT("Quake map document"),
                      wxT("TrenchBroom editor view"),
                      CLASSINFO(TrenchBroom::Model::MapDocument),
                      CLASSINFO(TrenchBroom::View::EditorView)
                      );
    
    // load file system handlers
    wxFileSystem::AddHandler(new wxMemoryFSHandler());
    
    // load image handles
    wxImage::AddHandler(new wxGIFHandler());
    wxImage::AddHandler(new wxPNGHandler());
    
    TrenchBroom::IO::FileManager fileManager;
    String helpPath = fileManager.appendPath(fileManager.resourceDirectory(), "Documentation");
    
    m_helpController = new wxExtHelpController();
    m_helpController->Initialize(helpPath);
    
    return true;
}