Public Member Functions | Private Member Functions | Private Attributes

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

#include <creaImageIOWxOutputDlg.h>

List of all members.

Public Member Functions

 WxOutputDlg (wxWindow *parent, const std::vector< std::string > filenames, int i_dim, bool single)
 CTor.
 ~WxOutputDlg ()
 DTor.
const std::string getAsking ()
 Get selected storage.
const std::string getDim ()

Private Member Functions

void OnOk (wxCommandEvent &event)
 Validate selected storage.
void OnChange (wxCommandEvent &event)

Private Attributes

std::vector< wxCheckBox * > checkOut
wxCheckBox * checkAsking

Detailed Description

WxOutputDlg allows to select the different output format

Definition at line 18 of file creaImageIOWxOutputDlg.h.


Constructor & Destructor Documentation

creaImageIO::WxOutputDlg::WxOutputDlg ( wxWindow *  parent,
const std::vector< std::string >  filenames,
int  i_dim,
bool  single 
)

CTor.

Definition at line 6 of file creaImageIOWxOutputDlg.cpp.

References checkAsking, checkOut, OnChange(), and OnOk().

    : wxDialog(parent, -1,_T("OUTPUT FORMAT"), wxDefaultPosition, wxSize(350,450))
   {

                int size = filenames.size();
                
                int deflt = 1;

                std::string sentence;
                sentence = "You select";
                std::string sentence2 = "You have the possibility to select output format :";
                int nbsent= 0;
                std::vector<std::string> outsentences;
                if (size == 1)
                {
                   sentence += " 1 ";
                }
                else
                {
                   sentence += " n ";
                }
                if(single)
                {
                        sentence += " single frames";
                }
                else
                {
                        sentence += " multi-frames"; 
                }
                sentence += " as output";
          
                
                if (size == 1)
                {
                        if(single)
                        {
                                outsentences.push_back("It shall be a single file with a single 2D frmae");
                        }
                        else
                        {
                                outsentences.push_back("It shall be  multiple files with 2D frames");
                                outsentences.push_back("It shall be a single file with 3D frames");
                        }                       
                }
                else
                {
                        if(single)
                        {
                                outsentences.push_back("It shall be a single file with 3D frames");
                                outsentences.push_back("It shall be  multiple files with 2D frames");
                        }
                        else
                        {
                                outsentences.push_back("It shall be a single file with (3D+t) frames");
                                outsentences.push_back("It shall be  multiple (n+t) files with 2D frames");
                                outsentences.push_back("It shall be  multiple (n) files with (2D+t) frames");
                                outsentences.push_back("It shall be a multiple (t) files with (2D+n) frames");
                                deflt = 3;
                        }
                
                }
                if(i_dim != -1)
                {
                        deflt = i_dim;
                }


          int start_point = 45;
          wxStaticText * ExportText=new wxStaticText(this,-1,crea::std2wx(sentence), wxPoint(5,10));
          
          std::vector<std::string>::iterator it = outsentences.begin();
          for(int i = 0;it != outsentences.end(); it++, i++, start_point += 45)
          {
                 wxCheckBox *check = new wxCheckBox(this, -1, crea::std2wx((*it)), wxPoint(5,start_point) );
                 if(i == deflt)
                         check->SetValue(true);
                 else
                         check->SetValue(false);
                  Connect( check->GetId(), wxEVT_COMMAND_CHECKBOX_CLICKED, (wxObjectEventFunction) &WxOutputDlg::OnChange );
                  checkOut.push_back(check);
          }
          
         checkAsking = new wxCheckBox(this, -1, _T("Do you want to save this output and no more asking"), wxPoint(5,start_point) );

          // VALIDATION BUTTON
          wxButton *Ok = new wxButton(this, -1,_T("OK"), wxPoint(5,start_point+20) );
          Connect( Ok->GetId(), wxEVT_COMMAND_BUTTON_CLICKED , (wxObjectEventFunction) &WxOutputDlg::OnOk ); 
        
          wxButton *Cancel = new wxButton(this, wxID_CANCEL,_T("CANCEL"), wxPoint(100,start_point+20) );
          Layout(); 
          
        }

Here is the call graph for this function:

creaImageIO::WxOutputDlg::~WxOutputDlg (  ) 

DTor.

Definition at line 99 of file creaImageIOWxOutputDlg.cpp.

{}


Member Function Documentation

const std::string creaImageIO::WxOutputDlg::getAsking (  ) 

Get selected storage.

Definition at line 140 of file creaImageIOWxOutputDlg.cpp.

References checkAsking.

        { 
                if(checkAsking->GetValue())
                        return "false"; 
                else
                        return "true";
        }

const std::string creaImageIO::WxOutputDlg::getDim (  ) 

Definition at line 123 of file creaImageIOWxOutputDlg.cpp.

References checkOut.

        {
                char res[2];
                std::vector<wxCheckBox*>::iterator it = checkOut.begin();
            for(int i = 1;it != checkOut.end(); it++, i++)
            {
                        if( (*it)->GetValue() )
                        {
                                sprintf(res,"%d", i);
                        }
                        else
                        {
                                
                        }
                }
                return res;
        }

void creaImageIO::WxOutputDlg::OnChange ( wxCommandEvent &  event  )  [private]

Definition at line 107 of file creaImageIOWxOutputDlg.cpp.

References checkOut.

Referenced by WxOutputDlg().

        {
                std::vector<wxCheckBox*>::iterator it = checkOut.begin();

                for(int i = 0;it != checkOut.end(); it++, i++)
                {
                        if( (*it)->GetId() == event.GetId())
                        {
                        }
                        else
                        {
                                (*it)->SetValue(false);
                        }
                }
        }

Here is the caller graph for this function:

void creaImageIO::WxOutputDlg::OnOk ( wxCommandEvent &  event  )  [private]

Validate selected storage.

Definition at line 101 of file creaImageIOWxOutputDlg.cpp.

Referenced by WxOutputDlg().

        {
                Close();
                SetReturnCode(wxID_OK);
        }       

Here is the caller graph for this function:


Member Data Documentation

Definition at line 38 of file creaImageIOWxOutputDlg.h.

Referenced by getAsking(), and WxOutputDlg().

std::vector<wxCheckBox*> creaImageIO::WxOutputDlg::checkOut [private]

Definition at line 35 of file creaImageIOWxOutputDlg.h.

Referenced by getDim(), OnChange(), and WxOutputDlg().


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