void MainFrame::RaceEventUpdated(){
	UpdateAnalyzerView();
	m_datalogPlayer.DatalogSessionsUpdated();
	m_datalogPlayer.RequeryAll();
	UpdateCommControls();
	NotifyConfigChanged();
	SyncControls();
	UpdateConfigFileStatus();
	SetStatusMessage("Race Event Loaded");
}
Beispiel #2
0
LRESULT CHilighterManageDlg::OnBnClickedButtonDeleteHl(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    int index = m_list.GetSelectedIndex();
    if (index < 0) return 0;

    hilighters_t& hls = CConfig::Instance()->GetConfig().hls;
    delete hls[(size_t)index].f;
    hls.erase(hls.begin() + index);
    m_list.DeleteItem(index);
    SyncControls();

    return 0;
}
void MainFrame::LoadInitialConfig(){

	if (m_appOptions.GetAutoLoadConfig()){
		ReadRaceCaptureConfig();
	}
	else{
		SetStatusMessage("Default Config Loaded");
	}
	NotifyConfigChanged();
	m_configModified = false;
	UpdateCommControls();
	SyncControls();
	UpdateConfigFileStatus();
}
Beispiel #4
0
LRESULT CHilighterManageDlg::OnBnClickedButtonAddHl(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
    CHilighterEditDlg dlg;
    if (dlg.DoModal() == IDOK)
    {
        hilighters_t& hls = CConfig::Instance()->GetConfig().hls;
        hilighter hl = dlg.GetHilighter();
        int index = m_list.GetSelectedIndex() + 1;
        hls.insert(hls.begin() + index, hl);
        m_list.InsertItem(index, hl.name.c_str());
        m_list.SetItemText(index, 1, LOG_SAMPLE_TEXT);
        SyncControls();
    }

    return 0;
}
Beispiel #5
0
LRESULT CHilighterManageDlg::OnInitDialog(HWND, LPARAM)
{
    CDialogResize<CHilighterManageDlg>::DlgResize_Init();
    m_list = GetDlgItem(IDC_LIST);
    m_list.SetExtendedListViewStyle(LVS_EX_GRIDLINES);

    struct ColumnInfo
    {
        LPCWSTR name;
        int width;
    } ci[] =
    {
        {L"高亮名", 100},
        {L"预览", 300}
    };
    for (int i = 0; i < _countof(ci); i++)
    {
        m_list.AddColumn(ci[i].name, i);
        m_list.SetColumnWidth(i, ci[i].width);
    }

    const hilighters_t& hls = CConfig::Instance()->GetConfig().hls;

    int index = 0;
    for (hilighters_t::const_iterator it = hls.begin(); it != hls.end(); ++it, ++index)
    {
        m_list.InsertItem(index, it->name.c_str());
        m_list.SetItemText(index, 1, LOG_SAMPLE_TEXT);
    }
    if (m_list.GetItemCount() > 0)
    {
        m_list.SelectItem(0);
    }

    SyncControls();
    CenterWindow();

    return FALSE;
}
void MainFrame::LoadConfigurationFile(const wxString fileName){

	RaceCaptureConfigFileReader reader;

	reader.SetFileName(fileName);

	try{
		reader.ReadConfiguration(m_currentConfig);
		if (m_currentConfigFileName) delete m_currentConfigFileName;
		m_currentConfigFileName = new wxString(fileName);
		m_configModified = false;
		UpdateCommControls();
		NotifyConfigChanged();
		SyncControls();
		UpdateConfigFileStatus();
		SetStatusMessage("RaceCapture Configuration Loaded");
	}
	catch( FileAccessException &e ){
		wxMessageDialog dlg(this, wxString::Format("Failed to load RaceCapture Configuration:\n\n%s", e.GetMessage().ToAscii()), "Error loading", wxOK | wxICON_HAND);
		dlg.ShowModal();
		return;
	}
	UpdateConfigFileStatus();
}
void MainFrame::ConfigModified(){
	SyncControls();
}
Beispiel #8
0
LRESULT CHilighterManageDlg::OnLvnItemchangedList(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/)
{
//	LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
    SyncControls();
    return 0;
}