Public Member Functions | Private Attributes

creaImageIO::WxEditFieldsPanel Class Reference
[Top level graphical user interfaces]

#include <creaImageIOWxEditFieldsPanel.h>

Collaboration diagram for creaImageIO::WxEditFieldsPanel:
Collaboration graph
[legend]

List of all members.

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::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 16 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 
)

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(); 
  }

Here is the call graph for this function:

creaImageIO::WxEditFieldsPanel::~WxEditFieldsPanel (  ) 

Destructor.

Definition at line 55 of file creaImageIOWxEditFieldsPanel.cpp.

References GimmickDebugMessage.

  {
    GimmickDebugMessage(1,"WxEditFieldsPanel::~WxEditFieldsPanel"
                 <<std::endl);
  }


Member Function Documentation

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));
  }

Here is the call graph for this function:

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();
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 39 of file creaImageIOWxEditFieldsPanel.h.

Referenced by OnComboChange(), and WxEditFieldsPanel().

Definition at line 38 of file creaImageIOWxEditFieldsPanel.h.

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

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().

Definition at line 40 of file creaImageIOWxEditFieldsPanel.h.

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

Definition at line 33 of file creaImageIOWxEditFieldsPanel.h.

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


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