creaImageIO_lib
creaImageIO::WxEditFieldsPanel Class Reference

#include <creaImageIOWxEditFieldsPanel.h>

Inheritance diagram for creaImageIO::WxEditFieldsPanel:
Collaboration diagram for creaImageIO::WxEditFieldsPanel:

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. More...
 
void OnEdit (wxCommandEvent &event)
 Saves the configuration. More...
 
void OnComboChange (wxCommandEvent &event)
 

Private Attributes

tree::Nodenode
 
std::vector< std::string > names
 
std::vector< std::string > keys
 
wxDialog * dialog
 
WxGimmickViewmView
 
wxComboBox * attributes
 
wxStaticText * actualVal
 
wxTextCtrl * newVal
 

Detailed Description

Definition at line 44 of file creaImageIOWxEditFieldsPanel.h.

Constructor & Destructor Documentation

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 
)

fix warning: unused variable cp

fix warning: unused variable av

fix warning: unused variable nv

Definition at line 38 of file creaImageIOWxEditFieldsPanel.cpp.

References actualVal, attributes, creaImageIO::tree::Node::GetAttribute(), GimmickDebugMessage, creaImageIO::ID_COMBO, keys, names, newVal, node, and OnEdit().

41  : wxPanel( parent,
42  -1, wxDefaultPosition,
43  wxDefaultSize,
44  wxRESIZE_BORDER |
45  wxSYSTEM_MENU |
46  wxCLOSE_BOX |
47  wxMAXIMIZE_BOX |
48  wxMINIMIZE_BOX |
49  wxCAPTION
50  ),
51  dialog(dial),
52  node (nod),
53  names(name),
54  keys(key),
55  mView(view)
56  {
57  GimmickDebugMessage(1,"WxCustomizeConfigPanel::WxCustomizeConfigPanel"
58  <<std::endl);
60  wxStaticText * cp=new wxStaticText(this,-1,_T(" Attribute to change: "), wxPoint(5,10));
61  wxArrayString as;
62  std::vector<std::string>::const_iterator it;
63  for(it=names.begin();it!=names.end();++it)
64  {
65  as.Add(crea::std2wx(*it));
66  }
67  attributes=new wxComboBox(this, ID_COMBO, crea::std2wx(names.front()), wxPoint(110, 10), wxDefaultSize,as);
68  std::string val=node->GetAttribute(keys[0]);
69  if(val.compare("")==0){val="?";}
70 
72  wxStaticText * av=new wxStaticText(this,-1,_T(" Current Value: "), wxPoint(5,40));
73  actualVal=new wxStaticText(this,-1,crea::std2wx(val), wxPoint(110,40));
74 
76  wxStaticText * nv=new wxStaticText(this,-1,_T(" New Value: "), wxPoint(5,70));
77  newVal=new wxTextCtrl(this, wxID_ANY, crea::std2wx(val), wxPoint(110,70), wxSize(220,20));
78 
79  wxButton *save = new wxButton(this,wxID_ANY,_T("Save Changes"), wxPoint(5,100) );
80  Connect( save->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxEditFieldsPanel::OnEdit );
81 
82  Layout();
83  }

Here is the call graph for this function:

creaImageIO::WxEditFieldsPanel::~WxEditFieldsPanel ( )

Destructor.

Definition at line 86 of file creaImageIOWxEditFieldsPanel.cpp.

References GimmickDebugMessage.

87  {
88  GimmickDebugMessage(1,"WxEditFieldsPanel::~WxEditFieldsPanel"
89  <<std::endl);
90  }

Member Function Documentation

void creaImageIO::WxEditFieldsPanel::OnComboChange ( wxCommandEvent &  event)

Definition at line 104 of file creaImageIOWxEditFieldsPanel.cpp.

References actualVal, attributes, creaImageIO::tree::Node::GetAttribute(), keys, newVal, and node.

105  {
106  std::string val=node->GetAttribute(keys[attributes->GetSelection()]);
107  if(val.compare("")==0){val="?";}
108  actualVal->SetLabel(crea::std2wx(val));
109  newVal->SetValue(crea::std2wx(val));
110  }

Here is the call graph for this function:

void creaImageIO::WxEditFieldsPanel::OnEdit ( wxCommandEvent &  event)

Saves the configuration.

Definition at line 92 of file creaImageIOWxEditFieldsPanel.cpp.

References attributes, dialog, keys, mView, names, newVal, node, and creaImageIO::WxGimmickView::OnFieldsEdited().

Referenced by WxEditFieldsPanel().

93  {
94  std::string val=crea::wx2std(newVal->GetValue());
95  int sel=attributes->GetSelection();
96  if(sel==-1)
97  {
98  sel=0;
99  }
100  mView->OnFieldsEdited(node,names[sel],keys[sel],val);
101  dialog->Destroy();
102  }

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

wxStaticText* creaImageIO::WxEditFieldsPanel::actualVal
private

Definition at line 67 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), and WxEditFieldsPanel().

wxComboBox* creaImageIO::WxEditFieldsPanel::attributes
private

Definition at line 66 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().

wxDialog* creaImageIO::WxEditFieldsPanel::dialog
private

Definition at line 64 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnEdit().

std::vector<std::string> creaImageIO::WxEditFieldsPanel::keys
private

Definition at line 63 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().

WxGimmickView* creaImageIO::WxEditFieldsPanel::mView
private

Definition at line 65 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnEdit().

std::vector<std::string> creaImageIO::WxEditFieldsPanel::names
private

Definition at line 62 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnEdit(), and WxEditFieldsPanel().

wxTextCtrl* creaImageIO::WxEditFieldsPanel::newVal
private

Definition at line 68 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().

tree::Node* creaImageIO::WxEditFieldsPanel::node
private

Definition at line 61 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), OnEdit(), and WxEditFieldsPanel().


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