#include <creaImageIOWxEditFieldsPanel.h>

Public Member Functions | |
| WxEditFieldsPanel () | |
| WxEditFieldsPanel (wxWindow *parent, wxDialog *dial, WxGimmickView *view, tree::Node *nod, const std::vector< std::string > name, const std::vector< std::string > key) | |
| ~WxEditFieldsPanel () | |
| Destructor. | |
| void | OnEdit (wxCommandEvent &event) |
| Saves the configuration. | |
| void | OnComboChange (wxCommandEvent &event) |
Private Attributes | |
| tree::Node * | node |
| std::vector< std::string > | names |
| std::vector< std::string > | keys |
| wxDialog * | dialog |
| WxGimmickView * | mView |
| wxComboBox * | attributes |
| wxStaticText * | actualVal |
| wxTextCtrl * | newVal |
Definition at line 16 of file creaImageIOWxEditFieldsPanel.h.
| creaImageIO::WxEditFieldsPanel::WxEditFieldsPanel | ( | ) |
| creaImageIO::WxEditFieldsPanel::WxEditFieldsPanel | ( | wxWindow * | parent, | |
| wxDialog * | dial, | |||
| WxGimmickView * | view, | |||
| tree::Node * | nod, | |||
| const std::vector< std::string > | name, | |||
| const std::vector< std::string > | key | |||
| ) |
Definition at line 10 of file creaImageIOWxEditFieldsPanel.cpp.
References actualVal, attributes, creaImageIO::tree::Node::GetAttribute(), GimmickDebugMessage, creaImageIO::ID_COMBO, keys, names, newVal, node, and OnEdit().
: wxPanel( parent,
-1, wxDefaultPosition,
wxDefaultSize,
wxRESIZE_BORDER |
wxSYSTEM_MENU |
wxCLOSE_BOX |
wxMAXIMIZE_BOX |
wxMINIMIZE_BOX |
wxCAPTION
),
dialog(dial),
node (nod),
names(name),
keys(key),
mView(view)
{
GimmickDebugMessage(1,"WxCustomizeConfigPanel::WxCustomizeConfigPanel"
<<std::endl);
wxStaticText * cp=new wxStaticText(this,-1,_T(" Attribute to change: "), wxPoint(5,10));
wxArrayString as;
std::vector<std::string>::const_iterator it;
for(it=names.begin();it!=names.end();++it)
{
as.Add(crea::std2wx(*it));
}
attributes=new wxComboBox(this, ID_COMBO, crea::std2wx(names.front()), wxPoint(110, 10), wxDefaultSize,as);
std::string val=node->GetAttribute(keys[0]);
if(val.compare("")==0){val="?";}
wxStaticText * av=new wxStaticText(this,-1,_T(" Current Value: "), wxPoint(5,40));
actualVal=new wxStaticText(this,-1,crea::std2wx(val), wxPoint(110,40));
wxStaticText * nv=new wxStaticText(this,-1,_T(" New Value: "), wxPoint(5,70));
newVal=new wxTextCtrl(this, wxID_ANY, crea::std2wx(val), wxPoint(110,70), wxSize(220,20));
wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(5,100) );
Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxEditFieldsPanel::OnEdit );
Layout();
}

| creaImageIO::WxEditFieldsPanel::~WxEditFieldsPanel | ( | ) |
Destructor.
Definition at line 55 of file creaImageIOWxEditFieldsPanel.cpp.
References GimmickDebugMessage.
{
GimmickDebugMessage(1,"WxEditFieldsPanel::~WxEditFieldsPanel"
<<std::endl);
}
| void creaImageIO::WxEditFieldsPanel::OnComboChange | ( | wxCommandEvent & | event | ) |
Definition at line 73 of file creaImageIOWxEditFieldsPanel.cpp.
References actualVal, attributes, creaImageIO::tree::Node::GetAttribute(), keys, newVal, and node.
{
std::string val=node->GetAttribute(keys[attributes->GetSelection()]);
if(val.compare("")==0){val="?";}
actualVal->SetLabel(crea::std2wx(val));
newVal->SetValue(crea::std2wx(val));
}

| void creaImageIO::WxEditFieldsPanel::OnEdit | ( | wxCommandEvent & | event | ) |
Saves the configuration.
Definition at line 61 of file creaImageIOWxEditFieldsPanel.cpp.
References attributes, dialog, keys, mView, names, newVal, node, and creaImageIO::WxGimmickView::OnFieldsEdited().
Referenced by WxEditFieldsPanel().
{
std::string val=crea::wx2std(newVal->GetValue());
int sel=attributes->GetSelection();
if(sel==-1)
{
sel=0;
}
mView->OnFieldsEdited(node,names[sel],keys[sel],val);
dialog->Destroy();
}


wxStaticText* creaImageIO::WxEditFieldsPanel::actualVal [private] |
Definition at line 39 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnComboChange(), and WxEditFieldsPanel().
wxComboBox* creaImageIO::WxEditFieldsPanel::attributes [private] |
Definition at line 38 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().
wxDialog* creaImageIO::WxEditFieldsPanel::dialog [private] |
Definition at line 36 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnEdit().
std::vector<std::string> creaImageIO::WxEditFieldsPanel::keys [private] |
Definition at line 35 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().
Definition at line 37 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnEdit().
std::vector<std::string> creaImageIO::WxEditFieldsPanel::names [private] |
Definition at line 34 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnEdit(), and WxEditFieldsPanel().
wxTextCtrl* creaImageIO::WxEditFieldsPanel::newVal [private] |
Definition at line 40 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().
tree::Node* creaImageIO::WxEditFieldsPanel::node [private] |
Definition at line 33 of file creaImageIOWxEditFieldsPanel.h.
Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().
1.7.1