Beispiel #1
0
void ReadALConfig(void)
{
    WCHAR buffer[PATH_MAX];
    const WCHAR *str;
    FILE *f;

    if(SHGetSpecialFolderPathW(NULL, buffer, CSIDL_APPDATA, FALSE) != FALSE)
    {
        size_t p = lstrlenW(buffer);
        _snwprintf(buffer+p, PATH_MAX-p, L"\\alsoft.ini");

        TRACE("Loading config %ls...\n", buffer);
        f = _wfopen(buffer, L"rt");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=_wgetenv(L"ALSOFT_CONF")) != NULL && *str)
    {
        TRACE("Loading config %ls...\n", str);
        f = _wfopen(str, L"rt");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
}
Beispiel #2
0
void ReadALConfig(void)
{
    al_string ppath = AL_STRING_INIT_STATIC();
    WCHAR buffer[MAX_PATH];
    const WCHAR *str;
    FILE *f;

    if(SHGetSpecialFolderPathW(NULL, buffer, CSIDL_APPDATA, FALSE) != FALSE)
    {
        al_string filepath = AL_STRING_INIT_STATIC();
        alstr_copy_wcstr(&filepath, buffer);
        alstr_append_cstr(&filepath, "\\alsoft.ini");

        TRACE("Loading config %s...\n", alstr_get_cstr(filepath));
        f = al_fopen(alstr_get_cstr(filepath), "rt");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
        alstr_reset(&filepath);
    }

    GetProcBinary(&ppath, NULL);
    if(!alstr_empty(ppath))
    {
        alstr_append_cstr(&ppath, "\\alsoft.ini");
        TRACE("Loading config %s...\n", alstr_get_cstr(ppath));
        f = al_fopen(alstr_get_cstr(ppath), "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=_wgetenv(L"ALSOFT_CONF")) != NULL && *str)
    {
        al_string filepath = AL_STRING_INIT_STATIC();
        alstr_copy_wcstr(&filepath, str);

        TRACE("Loading config %s...\n", alstr_get_cstr(filepath));
        f = al_fopen(alstr_get_cstr(filepath), "rt");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
        alstr_reset(&filepath);
    }

    alstr_reset(&ppath);
}
Beispiel #3
0
void ReadALConfig(void)
{
    const char *str;
    FILE *f;

    cfgBlocks = calloc(1, sizeof(ConfigBlock));
    cfgBlocks->name = strdup("general");
    cfgCount = 1;

#ifdef _WIN32
    if(SHGetSpecialFolderPathA(NULL, buffer, CSIDL_APPDATA, FALSE) != FALSE)
    {
        size_t p = strlen(buffer);
        snprintf(buffer+p, sizeof(buffer)-p, "\\alsoft.ini");
        f = fopen(buffer, "rt");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
#else
    f = fopen("/etc/openal/alsoft.conf", "r");
    if(f)
    {
        LoadConfigFromFile(f);
        fclose(f);
    }
    if((str=getenv("HOME")) != NULL && *str)
    {
        snprintf(buffer, sizeof(buffer), "%s/.alsoftrc", str);
        f = fopen(buffer, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
#endif
    if((str=getenv("ALSOFT_CONF")) != NULL && *str)
    {
        f = fopen(str, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
}
psMainWidget::psMainWidget() : psCmdBase(NULL, NULL, PawsManager::GetSingleton().GetObjectRegistry()),
                               entTypes(PawsManager::GetSingleton().GetObjectRegistry())
{
    cel = NULL;
    chatWindow = NULL;
    locked = false;
    entTypes.LoadConfigFromFile();
    lastWidget = 0;
    LoadConfigFromFile();
}
Beispiel #5
0
void ReadALConfig(void)
{
    FILE *f;

    cfgBlocks = calloc(1, sizeof(ConfigBlock));
    cfgBlocks->name = strdup("general");
    cfgCount = 1;

#ifdef _WIN32
#else
    f = fopen("/etc/openal/alsoft.conf", "r");
    if(!f)
    {
        f = fopen("/etc/openal/config", "r");
        if(f)
            AL_PRINT("Reading /etc/openal/config; this file is deprecated\n"
                     "\tPlease rename it to /etc/openal/alsoft.conf\n");
    }
    if(f)
    {
        LoadConfigFromFile(f);
        fclose(f);
    }
    if(getenv("HOME") && *(getenv("HOME")))
    {
        snprintf(buffer, sizeof(buffer), "%s/.alsoftrc", getenv("HOME"));
        f = fopen(buffer, "r");
        if(!f)
        {
            snprintf(buffer, sizeof(buffer), "%s/.openalrc", getenv("HOME"));
            f = fopen(buffer, "r");
            if(f)
                AL_PRINT("Reading ~/.openalrc; this file is deprecated\n"
                         "\tPlease rename it to ~/.alsoftrc\n");
        }
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
#endif
}
Beispiel #6
0
LameAI::LameAI(Player* player)
{
    //m_vUnits = new vector<UNIT*>();
    //m_vBuildings = new vector<BUILDING*>();
    m_fUpdatetime = 0.0f;
    m_fUpdateInterval = 1.0f;
    m_UnitRatio = 0.4f;
    m_UnitRatio2 = 0.1f;
    m_UnitLimit = 100;
    m_BuildingLimit = 16;
    m_BaseSpread = 25;
    m_pPlayer = player;
    LoadConfigFromFile();
    AssetCollection::registerListener(this);
    m_fUpdatetime = (float)((::rand() / (float)RAND_MAX)) * m_fUpdateInterval;
}
Beispiel #7
0
gui::SImageGUISkinConfig LoadGUISkinFromFile( io::IFileSystem* fileSystem, video::IVideoDriver* driver, const core::stringc& filename )
{
    gui::SImageGUISkinConfig skin;

    CConfigMap* cfg = LoadConfigFromFile(fileSystem, filename);
    if ( !cfg )
        return skin;

    core::stringc context = GetContextPathFromFilename(filename);
    
    ParseGUIElementStyle( driver, cfg, skin.Button, "Button", context );
    ParseGUIElementStyle( driver, cfg, skin.ButtonPressed, "ButtonPressed", context );
    ParseGUIElementStyle( driver, cfg, skin.SunkenPane, "SunkenPane", context );
    ParseGUIElementStyle( driver, cfg, skin.Window, "Window", context );
    ParseGUIElementStyle( driver, cfg, skin.ProgressBar, "ProgressBar", context );
    ParseGUIElementStyle( driver, cfg, skin.ProgressBarFilled, "ProgressBarFilled", context );

    delete cfg;

    return skin;
}
Beispiel #8
0
void CMedalCfgMgr::Initialize()
{
    LoadConfigFromFile();
}
Beispiel #9
0
void ReadALConfig(void)
{
    char buffer[PATH_MAX];
    const char *str;
    FILE *f;

    str = "/etc/openal/alsoft.conf";

    TRACE("Loading config %s...\n", str);
    f = al_fopen(str, "r");
    if(f)
    {
        LoadConfigFromFile(f);
        fclose(f);
    }

    if(!(str=getenv("XDG_CONFIG_DIRS")) || str[0] == 0)
        str = "/etc/xdg";
    strncpy(buffer, str, sizeof(buffer)-1);
    buffer[sizeof(buffer)-1] = 0;
    /* Go through the list in reverse, since "the order of base directories
     * denotes their importance; the first directory listed is the most
     * important". Ergo, we need to load the settings from the later dirs
     * first so that the settings in the earlier dirs override them.
     */
    while(1)
    {
        char *next = strrchr(buffer, ':');
        if(next) *(next++) = 0;
        else next = buffer;

        if(next[0] != '/')
            WARN("Ignoring XDG config dir: %s\n", next);
        else
        {
            size_t len = strlen(next);
            strncpy(next+len, "/alsoft.conf", buffer+sizeof(buffer)-next-len);
            buffer[sizeof(buffer)-1] = 0;

            TRACE("Loading config %s...\n", next);
            f = al_fopen(next, "r");
            if(f)
            {
                LoadConfigFromFile(f);
                fclose(f);
            }
        }
        if(next == buffer)
            break;
    }

    if((str=getenv("HOME")) != NULL && *str)
    {
        snprintf(buffer, sizeof(buffer), "%s/.alsoftrc", str);

        TRACE("Loading config %s...\n", buffer);
        f = al_fopen(buffer, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=getenv("XDG_CONFIG_HOME")) != NULL && str[0] != 0)
        snprintf(buffer, sizeof(buffer), "%s/%s", str, "alsoft.conf");
    else
    {
        buffer[0] = 0;
        if((str=getenv("HOME")) != NULL && str[0] != 0)
            snprintf(buffer, sizeof(buffer), "%s/.config/%s", str, "alsoft.conf");
    }
    if(buffer[0] != 0)
    {
        TRACE("Loading config %s...\n", buffer);
        f = al_fopen(buffer, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=getenv("ALSOFT_CONF")) != NULL && *str)
    {
        TRACE("Loading config %s...\n", str);
        f = al_fopen(str, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }
}
Beispiel #10
0
void ReadALConfig(void)
{
    al_string confpaths = AL_STRING_INIT_STATIC();
    al_string fname = AL_STRING_INIT_STATIC();
    const char *str;
    FILE *f;

    str = "/etc/openal/alsoft.conf";

    TRACE("Loading config %s...\n", str);
    f = al_fopen(str, "r");
    if(f)
    {
        LoadConfigFromFile(f);
        fclose(f);
    }

    if(!(str=getenv("XDG_CONFIG_DIRS")) || str[0] == 0)
        str = "/etc/xdg";
    alstr_copy_cstr(&confpaths, str);
    /* Go through the list in reverse, since "the order of base directories
     * denotes their importance; the first directory listed is the most
     * important". Ergo, we need to load the settings from the later dirs
     * first so that the settings in the earlier dirs override them.
     */
    while(!alstr_empty(confpaths))
    {
        char *next = strrchr(alstr_get_cstr(confpaths), ':');
        if(next)
        {
            size_t len = next - alstr_get_cstr(confpaths);
            alstr_copy_cstr(&fname, next+1);
            VECTOR_RESIZE(confpaths, len, len+1);
            VECTOR_ELEM(confpaths, len) = 0;
        }
        else
        {
            alstr_reset(&fname);
            fname = confpaths;
            AL_STRING_INIT(confpaths);
        }

        if(alstr_empty(fname) || VECTOR_FRONT(fname) != '/')
            WARN("Ignoring XDG config dir: %s\n", alstr_get_cstr(fname));
        else
        {
            if(VECTOR_BACK(fname) != '/') alstr_append_cstr(&fname, "/alsoft.conf");
            else alstr_append_cstr(&fname, "alsoft.conf");

            TRACE("Loading config %s...\n", alstr_get_cstr(fname));
            f = al_fopen(alstr_get_cstr(fname), "r");
            if(f)
            {
                LoadConfigFromFile(f);
                fclose(f);
            }
        }
        alstr_clear(&fname);
    }

    if((str=getenv("HOME")) != NULL && *str)
    {
        alstr_copy_cstr(&fname, str);
        if(VECTOR_BACK(fname) != '/') alstr_append_cstr(&fname, "/.alsoftrc");
        else alstr_append_cstr(&fname, ".alsoftrc");

        TRACE("Loading config %s...\n", alstr_get_cstr(fname));
        f = al_fopen(alstr_get_cstr(fname), "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=getenv("XDG_CONFIG_HOME")) != NULL && str[0] != 0)
    {
        alstr_copy_cstr(&fname, str);
        if(VECTOR_BACK(fname) != '/') alstr_append_cstr(&fname, "/alsoft.conf");
        else alstr_append_cstr(&fname, "alsoft.conf");
    }
    else
    {
        alstr_clear(&fname);
        if((str=getenv("HOME")) != NULL && str[0] != 0)
        {
            alstr_copy_cstr(&fname, str);
            if(VECTOR_BACK(fname) != '/') alstr_append_cstr(&fname, "/.config/alsoft.conf");
            else alstr_append_cstr(&fname, ".config/alsoft.conf");
        }
    }
    if(!alstr_empty(fname))
    {
        TRACE("Loading config %s...\n", alstr_get_cstr(fname));
        f = al_fopen(alstr_get_cstr(fname), "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    alstr_clear(&fname);
    GetProcBinary(&fname, NULL);
    if(!alstr_empty(fname))
    {
        if(VECTOR_BACK(fname) != '/') alstr_append_cstr(&fname, "/alsoft.conf");
        else alstr_append_cstr(&fname, "alsoft.conf");

        TRACE("Loading config %s...\n", alstr_get_cstr(fname));
        f = al_fopen(alstr_get_cstr(fname), "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    if((str=getenv("ALSOFT_CONF")) != NULL && *str)
    {
        TRACE("Loading config %s...\n", str);
        f = al_fopen(str, "r");
        if(f)
        {
            LoadConfigFromFile(f);
            fclose(f);
        }
    }

    alstr_reset(&fname);
    alstr_reset(&confpaths);
}
void CAvConfigManager::Initialize()
{
	m_timer = new TimerConfManager();
	m_change = av_false;
	m_config_data.reserve(512 * 1024);
	AvConfigReader reader;
	bool load_flag = false;
	std::string ConfigPath; 
	av_bool abRet = CAvDevice::GetEnv(std::string(EKey_ConfigsPath), ConfigPath);
	if (abRet == av_true){
		SetAvConfigPath(ConfigPath);
	}

	if (av_true == LoadConfigFromFile(m_ConfigFullPatch.c_str(), m_config_data)){
		load_flag = reader.parse(m_config_data, m_total);
	}
	if (false == load_flag) {
		av_msg("Load Configfile1 failed\n");
		if (av_true == LoadConfigFromFile(m_ConfigFullPatchBu.c_str(), m_config_data)){
			load_flag = reader.parse(m_config_data, m_total);
		}
	}
	if (false == load_flag){
		av_error("Load all config file failed\n");
	}


	m_name_configIndex.clear();

	m_name_configIndex.insert(ConfIndexValueType("DeviceUart", CONF_DEVICE_UART));
	LoadConfig("DeviceUart", m_config_device_uart);

	
	m_name_configIndex.insert(ConfIndexValueType("Capture", CONF_CAPTURE_FORMATS));
	LoadConfig("Capture", m_ConfigCapture);


	m_name_configIndex.insert(ConfIndexValueType("Image", CONF_IMAGE_FORMATS));
	LoadConfig("Image", m_ConfigImage);

	m_name_configIndex.insert(ConfIndexValueType("Enocde", CONF_ENCODE_FORMATS));
	LoadConfig("Enocde", m_ConfigEncode);

	m_name_configIndex.insert(ConfIndexValueType("Cover", CONF_ENCODE_COVER));
	LoadConfig("Cover", m_ConfigCover);

	m_name_configIndex.insert(ConfIndexValueType("WaterMarking", CONF_ENCODE_WATERMARKING));
	LoadConfig("WaterMarking", m_ConfigWaterMark);

	m_name_configIndex.insert(ConfIndexValueType("AlarmIo", CONF_ALARM_IO));
	LoadConfig("AlarmIo", m_ConfigAlarmIo);
	
	m_name_configIndex.insert(ConfIndexValueType("AlarmMd", CONF_ALARM_MD));
	LoadConfig("AlarmMd", m_ConfigAlarmMd);

	m_name_configIndex.insert(ConfIndexValueType("NetComm", CONF_NET_COMM));
	LoadConfig("NetComm", m_ConfigNetComm);

	m_name_configIndex.insert(ConfIndexValueType("NetProtocol", CONF_NETPROTOCOL));
	LoadConfig("NetProtocol", m_ConfigNetProtocol);

	m_name_configIndex.insert(ConfIndexValueType("Audio", CONF_AUDIO));
	LoadConfig("Audio", m_ConfigAudio);
	


	//User Manager
	m_name_configIndex.insert(ConfIndexValueType("UserManager", CONF_USER_MANAGER));
	LoadConfig("UserManager", m_config_user_manager);
	//Net Server Email
	m_name_configIndex.insert(ConfIndexValueType("NetServerSmtp", CONF_NET_SER_EMAIL));
	LoadConfig("NetServerSmtp", m_confignet_smtp);

	//ftp
	m_name_configIndex.insert(ConfIndexValueType("NetServerFtp", CONF_NET_SER_FTP));
	LoadConfig("NetServerFtp", m_confignet_ftp);
	m_name_configIndex.insert(ConfIndexValueType("NetServerDdns", CONF_NET_SER_DDNS));
	LoadConfig("NetServerDdns", m_confignet_ddns);
	m_name_configIndex.insert(ConfIndexValueType("NetServerUpnp", CONF_NET_SER_UPNP));
	LoadConfig("NetServerUpnp", m_confignet_upnp);
	m_name_configIndex.insert(ConfIndexValueType("NetServerNtp", CONF_NET_SER_NTP));
	LoadConfig("NetServerNtp", m_confignet_ntp);

	if (false == load_flag){
		Save();
	}
	
}
Beispiel #12
0
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
	tcGameEngineInit::Init(this);

    SetBackgroundColour(wxColour("white"));

    wxMenu *menuFile = new wxMenu;

    menuFile->Append(ID_OpenDatabase, _T("&Open database"));
    menuFile->Append(ID_SaveDatabase, _T("&Save database"));
    menuFile->AppendSeparator();
    menuFile->Append(ID_About, _T("&About..."));
    menuFile->AppendSeparator();
    menuFile->Append(ID_Quit, _T("E&xit") );

    wxMenuBar *menuBar = new wxMenuBar;
    menuBar->Append( menuFile, _T("&File") );


    wxMenu* menuTools = new wxMenu;
    menuTools->Append(ID_CheckForErrors, _T("&Check for errors"));
    menuTools->Append(ID_CheckSetups, _T("Check platform &setups"));
    menuTools->Append(ID_ECMEvaluation, _T("&ECM evaluation"));
    menuBar->Append(menuTools, _T("&Tools"));

    SetMenuBar( menuBar );

    CreateStatusBar();
    SetStatusText( _T("GCB2 dbeditor started") );


    notebook = new wxNotebook(this, NOTEBOOK_ID, wxDefaultPosition, wxDefaultSize, wxNB_TOP | wxNB_MULTILINE, "MainNotebook");


    tcBaseViewer* subViewer = new tcBaseViewer(notebook, "sub", "SubViewer");
    subViewer->AddPage("Sub", "config/sub_form.xml");
    subViewer->AddGridPage("Launchers", "config/platform_launcher_grid.xml");
    subViewer->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    subViewer->AddGridPage("Magazines", "config/platform_magazine_grid.xml");
    subViewer->AddSetupPanel("Setup");
    subViewer->AddGridPage("Names", "config/platform_names_grid.xml");
    notebook->AddPage(subViewer, "Sub", true);

    tcBaseViewer* shipViewer = new tcBaseViewer(notebook, "ship", "ShipViewer");
    shipViewer->AddPage("Ship", "config/ship_form.xml");
    shipViewer->AddGridPage("Launchers", "config/platform_launcher_grid.xml");
    shipViewer->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    shipViewer->AddGridPage("Magazines", "config/platform_magazine_grid.xml");
    shipViewer->AddSetupPanel("Setup");
    shipViewer->AddGridPage("Names", "config/platform_names_grid.xml");
    notebook->AddPage(shipViewer, "Ship", true);

    tcBaseViewer* groundViewer = new tcBaseViewer(notebook, "ground", "GroundViewer");
    groundViewer->AddPage("Ground", "config/ground_form.xml");
    groundViewer->AddGridPage("Launchers", "config/platform_launcher_grid.xml");
    groundViewer->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    groundViewer->AddGridPage("Magazines", "config/platform_magazine_grid.xml");
    groundViewer->AddSetupPanel("Setup");
    groundViewer->AddGridPage("Names", "config/platform_names_grid.xml");
    notebook->AddPage(groundViewer, "Ground", true);

    tcBaseViewer* airViewer = new tcBaseViewer(notebook, "air", "AirViewer");
    airViewer->AddPage("Air", "config/air_form.xml");
    airViewer->AddPage("Tables", "config/airtable_form.xml");
    airViewer->AddGridPage("Launchers", "config/platform_launcher_grid.xml");
    airViewer->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    airViewer->AddGridPage("Magazines", "config/platform_magazine_grid.xml");
    airViewer->AddSetupPanel("Setup");
    notebook->AddPage(airViewer, "Air", true);

    tcBaseViewer* simpleairViewer = new tcBaseViewer(notebook, "simpleair", "SimpleAirViewer");
    simpleairViewer->AddPage("SimpleAir", "config/simpleair_form.xml");
    simpleairViewer->AddGridPage("Launchers", "config/platform_launcher_grid.xml");
    simpleairViewer->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    simpleairViewer->AddGridPage("Magazines", "config/platform_magazine_grid.xml");
    simpleairViewer->AddSetupPanel("Setup");
    notebook->AddPage(simpleairViewer, "SimpleAir", true);

    tcBaseViewer* radarViewer = new tcBaseViewer(notebook, "radar", "RadarViewer");
    radarViewer->AddPage("radar", "config/radar_form.xml");
    notebook->AddPage(radarViewer, "Radar", false);

    tcBaseViewer* sonarViewer = new tcBaseViewer(notebook, "sonar", "SonarViewer");
    sonarViewer->AddPage("sonar", "config/sonar_form.xml");
	sonarViewer->AddPage("range calc", "config/sonar_calc_form.xml");
    notebook->AddPage(sonarViewer, "Sonar", false);

    tcBaseViewer* esmViewer = new tcBaseViewer(notebook, "esm", "ESMViewer");
    esmViewer->AddPage("esm", "config/esm_form.xml");
    notebook->AddPage(esmViewer, "ESM", false);

    tcBaseViewer* ecmViewer = new tcBaseViewer(notebook, "ecm", "ECMViewer");
    ecmViewer->AddPage("ecm", "config/ecm_form.xml");
    notebook->AddPage(ecmViewer, "ECM", false);

    tcBaseViewer* optical = new tcBaseViewer(notebook, "optical", "OpticalViewer");
    optical->AddPage("optical", "config/optical_form.xml");
    notebook->AddPage(optical, "Optical", false);

    tcBaseViewer* torpedo = new tcBaseViewer(notebook, "torpedo", "TorpedoViewer");
    torpedo->AddPage("torpedo", "config/torpedo_form.xml");
    notebook->AddPage(torpedo, "Torpedo", false);

    tcBaseViewer* missile = new tcBaseViewer(notebook, "missile", "MissileViewer");
    missile->AddPage("missile", "config/missile_form.xml");
    missile->AddPage("profile", "config/missile_profile_form.xml");
	missile->AddPage("calc", "config/missile_calc_form.xml");
    notebook->AddPage(missile, "Missile", false);

    tcBaseViewer* bmissile = new tcBaseViewer(notebook, "ballistic_missile", "BMissileViewer");
    bmissile->AddPage("ballistic missile", "config/ballisticmissile_form.xml");
    notebook->AddPage(bmissile, "Ballistic Missile", false);

    tcBaseViewer* ballistic = new tcBaseViewer(notebook, "ballistic", "BallisticViewer");
    ballistic->AddPage("ballistic", "config/ballistic_form.xml");
    notebook->AddPage(ballistic, "Ballistic", false);

    tcBaseViewer* launcherConfig = new tcBaseViewer(notebook, "launcher_configuration", "LauncherConfigViewer");
    launcherConfig->AddGridPage("launcher_config", "config/launcher_config_grid.xml");
    notebook->AddPage(launcherConfig, "Launcher Config", false);

    tcBaseViewer* stores = new tcBaseViewer(notebook, "stores", "StoresViewer");
    stores->AddPage("stores", "config/stores_form.xml");
    notebook->AddPage(stores, "Stores", false);

    tcBaseViewer* magazineLoadout = new tcBaseViewer(notebook, "magazine_loadout", "MagazineLoadoutViewer");
    magazineLoadout->AddGridPage("magazine_loadout", "config/magazine_loadout_grid.xml");
    notebook->AddPage(magazineLoadout, "Magazine Loadouts", false);

    tcBaseViewer* airComplement = new tcBaseViewer(notebook, "air_complement", "AirComplementViewer");
    airComplement->AddGridPage("air_complement", "config/air_complement_grid.xml");
    notebook->AddPage(airComplement, "Air Complements", false);

    tcBaseViewer* cm = new tcBaseViewer(notebook, "cm", "CMViewer");
    cm->AddPage("cm", "config/cm_form.xml");
    notebook->AddPage(cm, "CM", false);

    tcBaseViewer* flightport = new tcBaseViewer(notebook, "flightport", "FlightportViewer");
    flightport->AddPage("flightport", "config/flightport_form.xml");
    notebook->AddPage(flightport, "Flightport", false);

    tcBaseViewer* sonobuoy = new tcBaseViewer(notebook, "sonobuoy", "SonobuoyViewer");
    sonobuoy->AddPage("sonobuoy", "config/sonobuoy_form.xml");
    sonobuoy->AddGridPage("Sensors", "config/platform_sensor_grid.xml");
    notebook->AddPage(sonobuoy, "Sonobuoy", false);

    toolPanel = new tcToolPanel(notebook);
    notebook->AddPage(toolPanel, "Import/Export", false);

    LoadConfigFromFile();


    wxString autoOpenPath = lastDatabasePath + wxString("\\") + lastDatabaseFile;
    if (autoOpenPath.size() > 3)
    {
        try
        {
            tcDatabaseManager::Get()->Open(autoOpenPath.ToStdString());
            UpdatePages();
            wxString msg = wxString("Editing ") + autoOpenPath;
            SetStatusText(msg);
        }
        catch (...)
        {
        }
    }

    tcGridPanel::eventFrame = this;

	//wxWindow::bypassEraseBkgnd = false;
}