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(); }
void PlotItem::SetGridLinesColor (const QColor& color) { SetNewValue (color, GridLinesColor_, [this] { emit gridLinesColorChanged (); }); }
void PlotItem::SetBackground (const QColor& bg) { SetNewValue (bg, BackgroundColor_, [this] { emit backgroundChanged (); }); }
void PlotItem::SetTextColor (const QColor& color) { SetNewValue (color, TextColor_, [this] { emit textColorChanged (); }); }
void PlotItem::SetBottomAxisTitle (const QString& title) { SetNewValue (title, BottomAxisTitle_, [this] { emit bottomAxisTitleChanged (); }); }
void PlotItem::SetPlotTitle (const QString& title) { SetNewValue (title, PlotTitle_, [this] { emit plotTitleChanged (); }); }
void PlotItem::SetLeftAxisTitle (const QString& title) { SetNewValue (title, LeftAxisTitle_, [this] { emit leftAxisTitleChanged (); }); }
void PlotItem::SetBottomAxisEnabled (bool enabled) { SetNewValue (enabled, BottomAxisEnabled_, [this] { emit bottomAxisEnabledChanged (); }); }
void PlotItem::SetLeftAxisEnabled (bool enabled) { SetNewValue (enabled, LeftAxisEnabled_, [this] { emit leftAxisEnabledChanged (); }); }
void PlotItem::SetYMinorGridEnabled (bool val) { SetNewValue (val, YMinorGridEnabled_, [this] { emit yMinorGridChanged (); }); }
void PlotItem::SetMaxYValue (double val) { SetNewValue (val, MaxYValue_, [this] { emit maxYValueChanged (); }); }