OpenASIP 2.2
Loading...
Searching...
No Matches
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
ImplementationParameterDialog Class Reference

#include <ImplementationParameterDialog.hh>

Inheritance diagram for ImplementationParameterDialog:
Inheritance graph
Collaboration diagram for ImplementationParameterDialog:
Collaboration graph

Public Member Functions

 ImplementationParameterDialog (wxWindow *parent, wxWindowID id, HDB::FUImplementation::Parameter &implementation)
 
virtual ~ImplementationParameterDialog ()
 

Private Types

enum  {
  ID_LABEL_NAME = 10000 , ID_NAME , ID_LABEL_TYPE , ID_TYPE ,
  ID_LABEL_VALUE , ID_VALUE , ID_LINE
}
 Enumerated IDs for dialog widgets. More...
 

Private Member Functions

void onOK (wxCommandEvent &event)
 
wxSizer * createContents (wxWindow *parent, bool call_fit, bool set_sizer)
 Creates the dialog contents.
 

Private Attributes

HDB::FUImplementation::Parameterparameter_
 FU port implementation to modify.
 
wxString name_
 
wxString type_
 
wxString value_
 

Detailed Description

Dialog for editing FU port implementations.

Definition at line 44 of file ImplementationParameterDialog.hh.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

Constructor & Destructor Documentation

◆ ImplementationParameterDialog()

ImplementationParameterDialog::ImplementationParameterDialog ( wxWindow *  parent,
wxWindowID  id,
HDB::FUImplementation::Parameter implementation 
)

The Constructor.

Parameters
parentParent window of the dialog.
idWindow identifier for the dialog window.
parameterFU implementation parameter to modify.

Definition at line 52 of file ImplementationParameterDialog.cc.

53 :
54 wxDialog(parent, id, _T("Parameter")),
55 parameter_(parameter) {
56
57 createContents(this, true, true);
58
62
63 FindWindow(ID_NAME)->SetValidator(wxTextValidator(wxFILTER_ASCII, &name_));
64 FindWindow(ID_TYPE)->SetValidator(wxTextValidator(wxFILTER_ASCII, &type_));
65 FindWindow(ID_VALUE)->SetValidator(
66 wxTextValidator(wxFILTER_ASCII, &value_));
67
68 TransferDataToWindow();
69}
wxSizer * createContents(wxWindow *parent, bool call_fit, bool set_sizer)
Creates the dialog contents.
HDB::FUImplementation::Parameter & parameter_
FU port implementation to modify.
static wxString toWxString(const std::string &source)
std::string value
Value of the parameter.
Definition HDBTypes.hh:49
std::string type
Type of the parameter.
Definition HDBTypes.hh:48
std::string name
Name of the parameter.
Definition HDBTypes.hh:47

References WxConversion::toWxString().

Here is the call graph for this function:

◆ ~ImplementationParameterDialog()

ImplementationParameterDialog::~ImplementationParameterDialog ( )
virtual

The Destructor.

Definition at line 74 of file ImplementationParameterDialog.cc.

74 {
75}

Member Function Documentation

◆ createContents()

wxSizer * ImplementationParameterDialog::createContents ( wxWindow *  parent,
bool  call_fit,
bool  set_sizer 
)
private

Creates the dialog contents.

Creates the dialog contents.

Definition at line 116 of file ImplementationParameterDialog.cc.

117 {
118
119 wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL );
120
121 wxFlexGridSizer *item1 = new wxFlexGridSizer( 2, 0, 0 );
122
123 wxStaticText *item2 = new wxStaticText( parent, ID_LABEL_NAME, wxT("Name:"), wxDefaultPosition, wxDefaultSize, 0 );
124 item1->Add( item2, 0, wxALIGN_RIGHT|wxALL, 5 );
125
126 wxTextCtrl *item3 = new wxTextCtrl( parent, ID_NAME, wxT(""), wxDefaultPosition, wxSize(200,-1), 0 );
127 item1->Add( item3, 0, wxALIGN_CENTER|wxALL, 5 );
128
129 wxStaticText *item4 = new wxStaticText( parent, ID_LABEL_TYPE, wxT("Type:"), wxDefaultPosition, wxDefaultSize, 0 );
130 item1->Add( item4, 0, wxALIGN_RIGHT|wxALL, 5 );
131
132 wxTextCtrl *item5 = new wxTextCtrl( parent, ID_TYPE, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
133 item1->Add( item5, 0, wxGROW|wxALL, 5 );
134
135 wxStaticText *item6 = new wxStaticText( parent, ID_LABEL_VALUE, wxT("Value:"), wxDefaultPosition, wxDefaultSize, 0 );
136 item1->Add( item6, 0, wxALIGN_RIGHT|wxALL, 5 );
137
138 wxTextCtrl *item7 = new wxTextCtrl( parent, ID_VALUE, wxT(""), wxDefaultPosition, wxSize(80,-1), 0 );
139 item1->Add( item7, 0, wxGROW|wxALL, 5 );
140
141 item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
142
143 wxStaticLine *item8 = new wxStaticLine( parent, ID_LINE, wxDefaultPosition, wxSize(20,-1), wxLI_HORIZONTAL );
144 item0->Add( item8, 0, wxGROW|wxALL, 5 );
145
146 wxBoxSizer *item9 = new wxBoxSizer( wxHORIZONTAL );
147
148 wxButton *item10 = new wxButton( parent, wxID_CANCEL, wxT("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
149 item9->Add( item10, 0, wxALIGN_CENTER, 5 );
150
151 wxButton *item11 = new wxButton( parent, wxID_OK, wxT("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
152 item9->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
153
154 item0->Add( item9, 0, wxALL, 5 );
155
156 if (set_sizer)
157 {
158 parent->SetSizer( item0 );
159 if (call_fit)
160 item0->SetSizeHints( parent );
161 }
162
163 return item0;
164}

References ID_LABEL_NAME, ID_LABEL_TYPE, ID_LABEL_VALUE, ID_LINE, ID_NAME, ID_TYPE, and ID_VALUE.

◆ onOK()

void ImplementationParameterDialog::onOK ( wxCommandEvent &  event)
private

Event handler for the dialog OK-button.

Definition at line 82 of file ImplementationParameterDialog.cc.

82 {
83
84 TransferDataFromWindow();
85
86 name_ = name_.Trim(true).Trim(false);
87 type_ = type_.Trim(true).Trim(false);
88 value_ = value_.Trim(true).Trim(false);
89
90
91 if (name_.IsEmpty()) {
92 wxString message = _T("Name field must not be empty.");
93 ErrorDialog dialog(this, message);
94 dialog.ShowModal();
95 return;
96 }
97
98 if (type_.IsEmpty()) {
99 wxString message = _T("Type field must not be empty.");
100 ErrorDialog dialog(this, message);
101 dialog.ShowModal();
102 return;
103 }
104
108
109 EndModal(wxID_OK);
110}
static std::string toString(const wxString &source)

References HDB::Parameter::name, name_, parameter_, WxConversion::toString(), HDB::Parameter::type, type_, HDB::Parameter::value, and value_.

Here is the call graph for this function:

Member Data Documentation

◆ name_

wxString ImplementationParameterDialog::name_
private

Definition at line 72 of file ImplementationParameterDialog.hh.

Referenced by onOK().

◆ parameter_

HDB::FUImplementation::Parameter& ImplementationParameterDialog::parameter_
private

FU port implementation to modify.

Definition at line 70 of file ImplementationParameterDialog.hh.

Referenced by onOK().

◆ type_

wxString ImplementationParameterDialog::type_
private

Definition at line 73 of file ImplementationParameterDialog.hh.

Referenced by onOK().

◆ value_

wxString ImplementationParameterDialog::value_
private

Definition at line 74 of file ImplementationParameterDialog.hh.

Referenced by onOK().


The documentation for this class was generated from the following files: