void THISCLASS::OnTextUpdated(wxCommandEvent& event) {
	mNewValue = mTextCtrl->GetValue();
	ValidateNewValue();
	if (CompareNewValue()) {
		return;
	}
	SetNewValue(mTextCtrl);
}
void THISCLASS::OnButtonClicked(wxCommandEvent& event) {
	// Normalize the current path
	wxFileName current_filename=mSwisTrack->mSwisTrackCore->GetProjectFileName(mTextCtrl->GetValue());
	wxString current_fullpath;
	if (current_filename.IsOk()) {
		current_fullpath=current_filename.GetFullPath();
	}

	// Show the file open window
	long dialogStyle = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
	wxFileDialog dlg(this, wxT("Select file"), wxT(""), current_fullpath, mFileFilter, dialogStyle);
	if (dlg.ShowModal() != wxID_OK) {
		return;
	}

	// Make the path relative to the project folder or the home directory, if possible
	wxFileName filename(dlg.GetPath());
	wxFileName filename_relative_to_project(filename);
	filename_relative_to_project.MakeRelativeTo(mSwisTrack->mSwisTrackCore->GetFileName().GetPath());
	wxArrayString filename_relative_to_project_dirs = filename_relative_to_project.GetDirs();
	wxFileName filename_relative_to_home(filename);
	filename_relative_to_home.MakeRelativeTo(wxFileName::GetHomeDir());
	wxArrayString filename_relative_to_home_dirs = filename_relative_to_home.GetDirs();
	if ((filename_relative_to_project_dirs.GetCount() == 0) || (filename_relative_to_project_dirs [0] != wxT(".."))) {
		mNewValue = filename_relative_to_project.GetFullPath();
	} else if ((filename_relative_to_home_dirs.GetCount() == 0) || (filename_relative_to_home_dirs[0] != wxT(".."))) {
		filename_relative_to_home.PrependDir(wxT("~"));
		mNewValue = filename_relative_to_home.GetFullPath();
	} else {
		mNewValue = filename.GetFullPath();
	}

	// Set the new value
	ValidateNewValue();
	SetNewValue();
}
void THISCLASS::OnTextEnter(wxCommandEvent& event) {
	mNewValue = mTextCtrl->GetValue();
	ValidateNewValue();
	SetNewValue();
}
示例#4
0
	void PlotItem::SetGridLinesColor (const QColor& color)
	{
		SetNewValue (color, GridLinesColor_, [this] { emit gridLinesColorChanged (); });
	}
示例#5
0
	void PlotItem::SetBackground (const QColor& bg)
	{
		SetNewValue (bg, BackgroundColor_, [this] { emit backgroundChanged (); });
	}
示例#6
0
	void PlotItem::SetTextColor (const QColor& color)
	{
		SetNewValue (color, TextColor_, [this] { emit textColorChanged (); });
	}
示例#7
0
	void PlotItem::SetBottomAxisTitle (const QString& title)
	{
		SetNewValue (title, BottomAxisTitle_, [this] { emit bottomAxisTitleChanged (); });
	}
示例#8
0
	void PlotItem::SetPlotTitle (const QString& title)
	{
		SetNewValue (title, PlotTitle_, [this] { emit plotTitleChanged (); });
	}
示例#9
0
	void PlotItem::SetLeftAxisTitle (const QString& title)
	{
		SetNewValue (title, LeftAxisTitle_, [this] { emit leftAxisTitleChanged (); });
	}
示例#10
0
	void PlotItem::SetBottomAxisEnabled (bool enabled)
	{
		SetNewValue (enabled, BottomAxisEnabled_, [this] { emit bottomAxisEnabledChanged (); });
	}
示例#11
0
	void PlotItem::SetLeftAxisEnabled (bool enabled)
	{
		SetNewValue (enabled, LeftAxisEnabled_, [this] { emit leftAxisEnabledChanged (); });
	}
示例#12
0
	void PlotItem::SetYMinorGridEnabled (bool val)
	{
		SetNewValue (val, YMinorGridEnabled_, [this] { emit yMinorGridChanged (); });
	}
示例#13
0
	void PlotItem::SetMaxYValue (double val)
	{
		SetNewValue (val, MaxYValue_, [this] { emit maxYValueChanged (); });
	}