OpenASIP  2.0
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ProDeOptionsDialog Class Reference

#include <ProDeOptionsDialog.hh>

Inheritance diagram for ProDeOptionsDialog:
Inheritance graph
Collaboration diagram for ProDeOptionsDialog:
Collaboration graph

Public Member Functions

 ProDeOptionsDialog (wxWindow *parent, ProDeOptions &options, CommandRegistry &registry)
 
virtual ~ProDeOptionsDialog ()
 
- Public Member Functions inherited from OptionsDialog
 OptionsDialog (wxWindow *parent, GUIOptions &options, CommandRegistry &commandRegisry)
 
virtual ~OptionsDialog ()
 

Private Types

enum  { ID_UNDO_LEVELS, ID_LABEL_UNDO_LEVELS }
 

Private Member Functions

void readProDeOptions ()
 
void writeProDeOptions ()
 
void onOK (wxCommandEvent &event)
 
void onHelp (wxCommandEvent &event)
 
wxSizer * createGeneralPage (wxWindow *parent, bool callFit, bool set_sizer)
 

Private Attributes

wxWindow * parent_
 parent window of the dialog More...
 
ProDeOptionsoptions_
 current editor options More...
 
wxSpinCtrl * undoStackSize_
 Undo levels. More...
 

Additional Inherited Members

- Protected Member Functions inherited from OptionsDialog
void addPage (wxPanel *page, const wxString &title)
 
virtual void readOptions ()
 
virtual void writeOptions ()
 
- Protected Attributes inherited from OptionsDialog
wxNotebook * notebook_
 Notebook containing dialog pages. More...
 

Detailed Description

Dialog for editing ProDeOptions.

Definition at line 48 of file ProDeOptionsDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
ID_UNDO_LEVELS 
ID_LABEL_UNDO_LEVELS 

Definition at line 75 of file ProDeOptionsDialog.hh.

75  {
78  };

Constructor & Destructor Documentation

◆ ProDeOptionsDialog()

ProDeOptionsDialog::ProDeOptionsDialog ( wxWindow *  parent,
ProDeOptions options,
CommandRegistry registry 
)

The Constructor.

Parameters
parentParent window of the dialog.
optionsOptions to be modified.

Definition at line 62 of file ProDeOptionsDialog.cc.

63  :
64  OptionsDialog(parent, options, registry),
65  parent_(parent), options_(options) {
66 
67  wxPanel* generalPage = new wxPanel(notebook_, -1);
68  createGeneralPage(generalPage, true, true);
69  addPage(generalPage, _T("General"));
70 
71  undoStackSize_ = dynamic_cast<wxSpinCtrl*>(FindWindow(ID_UNDO_LEVELS));
72 
74 
75 }

◆ ~ProDeOptionsDialog()

ProDeOptionsDialog::~ProDeOptionsDialog ( )
virtual

The Destructor.

Definition at line 81 of file ProDeOptionsDialog.cc.

81  {
82 }

Member Function Documentation

◆ createGeneralPage()

wxSizer * ProDeOptionsDialog::createGeneralPage ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the 'General' page for the dialog.

This function was initially generated by wxDesigner.

Returns
Main sizer of the created contents.
Parameters
parentThe dialog window.
call_fitIf true, fits the contents inside the dialog.
set_sizerIf true, sets the main sizer as dialog contents.

Definition at line 133 of file ProDeOptionsDialog.cc.

134  {
135 
136  wxBoxSizer *item0 = new wxBoxSizer( wxHORIZONTAL );
137 
138  item0->Add( 50, 20, 0, wxALIGN_CENTER|wxALL, 5 );
139 
140  wxStaticText *item1 = new wxStaticText( parent, ID_LABEL_UNDO_LEVELS, wxT("Undo levels:"), wxDefaultPosition, wxDefaultSize, 0 );
141  item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
142 
143  wxSpinCtrl *item2 = new wxSpinCtrl( parent, ID_UNDO_LEVELS, wxT("1"), wxDefaultPosition, wxSize(-1,-1), 0, 1, 100, 0 );
144  item0->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
145 
146  if (set_sizer)
147  {
148  parent->SetSizer( item0 );
149  if (call_fit)
150  item0->SetSizeHints( parent );
151  }
152 
153  return item0;
154 }

References ID_LABEL_UNDO_LEVELS, and ID_UNDO_LEVELS.

◆ onHelp()

void ProDeOptionsDialog::onHelp ( wxCommandEvent &  event)
private

◆ onOK()

void ProDeOptionsDialog::onOK ( wxCommandEvent &  event)
private

Validates input in the controls, and updates the options.

Definition at line 106 of file ProDeOptionsDialog.cc.

106  {
107 
108  if (!Validate()) {
109  return;
110  }
111 
112  if (!TransferDataFromWindow()) {
113  return;
114  }
115 
116  writeOptions();
118 
119  EndModal(wxID_OK);
120 }

References OptionsDialog::writeOptions(), and writeProDeOptions().

Here is the call graph for this function:

◆ readProDeOptions()

void ProDeOptionsDialog::readProDeOptions ( )
private

Reads the options in options_ to dialog attributes.

Definition at line 88 of file ProDeOptionsDialog.cc.

88  {
90 }

References options_, ProDeOptions::undoStackSize(), and undoStackSize_.

Here is the call graph for this function:

◆ writeProDeOptions()

void ProDeOptionsDialog::writeProDeOptions ( )
private

Writes the options from dialog attributes to the current options object.

Definition at line 97 of file ProDeOptionsDialog.cc.

97  {
99 }

References options_, ProDeOptions::setUndoStackSize(), and undoStackSize_.

Referenced by onOK().

Here is the call graph for this function:

Member Data Documentation

◆ options_

ProDeOptions& ProDeOptionsDialog::options_
private

current editor options

Definition at line 69 of file ProDeOptionsDialog.hh.

Referenced by readProDeOptions(), and writeProDeOptions().

◆ parent_

wxWindow* ProDeOptionsDialog::parent_
private

parent window of the dialog

Definition at line 67 of file ProDeOptionsDialog.hh.

◆ undoStackSize_

wxSpinCtrl* ProDeOptionsDialog::undoStackSize_
private

Undo levels.

Definition at line 72 of file ProDeOptionsDialog.hh.

Referenced by readProDeOptions(), and writeProDeOptions().


The documentation for this class was generated from the following files:
ProDeOptionsDialog::createGeneralPage
wxSizer * createGeneralPage(wxWindow *parent, bool callFit, bool set_sizer)
Definition: ProDeOptionsDialog.cc:133
OptionsDialog::writeOptions
virtual void writeOptions()
Definition: OptionsDialog.cc:286
ProDeOptionsDialog::ID_LABEL_UNDO_LEVELS
@ ID_LABEL_UNDO_LEVELS
Definition: ProDeOptionsDialog.hh:77
FindWindow
Definition: FindWindow.hh:49
ProDeOptionsDialog::options_
ProDeOptions & options_
current editor options
Definition: ProDeOptionsDialog.hh:69
ProDeOptions::setUndoStackSize
void setUndoStackSize(int size)
Definition: ProDeOptions.cc:106
ProDeOptionsDialog::parent_
wxWindow * parent_
parent window of the dialog
Definition: ProDeOptionsDialog.hh:67
OptionsDialog::OptionsDialog
OptionsDialog(wxWindow *parent, GUIOptions &options, CommandRegistry &commandRegisry)
Definition: OptionsDialog.cc:118
ProDeOptionsDialog::writeProDeOptions
void writeProDeOptions()
Definition: ProDeOptionsDialog.cc:97
OptionsDialog::notebook_
wxNotebook * notebook_
Notebook containing dialog pages.
Definition: OptionsDialog.hh:75
OptionsDialog::addPage
void addPage(wxPanel *page, const wxString &title)
Definition: OptionsDialog.cc:756
ProDeOptionsDialog::undoStackSize_
wxSpinCtrl * undoStackSize_
Undo levels.
Definition: ProDeOptionsDialog.hh:72
options
static MachInfoCmdLineOptions options
Definition: MachInfo.cc:46
ProDeOptionsDialog::ID_UNDO_LEVELS
@ ID_UNDO_LEVELS
Definition: ProDeOptionsDialog.hh:76
ProDeOptions::undoStackSize
int undoStackSize() const
Definition: ProDeOptions.cc:95
ProDeOptionsDialog::readProDeOptions
void readProDeOptions()
Definition: ProDeOptionsDialog.cc:88