///Callback method on a selection
void WxGimmickReaderDialog::OnValid(wxCommandEvent& event)
{
+ mView->SetMessage(event.GetString());
if (event.GetInt()==0)
{mOkButton->Enable(true);}
else
// Bottom panel
mBottomPanel = new wxPanel(mSplitter,-1);
-
+ mText = new wxStaticText(mBottomPanel, wxID_ANY, wxT("Status: Welcome to Gimmick!"));
+
// Splitting
int hsize = size.GetHeight();
- int bottom_minsize = 200;
+ int bottom_minsize = 20;
mSplitter->SetMinimumPaneSize( bottom_minsize );
mSplitter->SplitHorizontally( mNotebook, mBottomPanel,
}
//=================================================
+ //=================================================
+ void WxGimmickView::SetMessage(wxString& mess)
+ {
+ wxBusyCursor busy;
+ mText->SetLabel("Status: "+mess);
+ }
+ //=================================================
+
//=================================================
void WxGimmickView::OnRemove(wxCommandEvent& event)
{
EVT_TOOL(TOOL_ADDFILES_ID, WxGimmickView::OnAddFiles)
EVT_TOOL(TOOL_ADDDIR_ID, WxGimmickView::OnAddDir)
EVT_TOOL(TOOL_REMOVE_ID, WxGimmickView::OnRemove)
- END_EVENT_TABLE()
+ END_EVENT_TABLE()
//=================================================
} // EO namespace creaImageIO
/// Returns the selected Images so that they comply with the given parameter(4D)
//(overloaded from GimmickView)
void GetSelectedImages(std::vector<vtkImageData*>& s, int dim);
+ /// Sets the message state
+ void SetMessage(wxString& mess);
protected:
/// Creates the tool bar
wxSplitterWindow* mSplitter;
wxPanel* mBottomPanel;
+ wxStaticText * mText;
wxNotebook* mNotebook;
/// The list of icons
void OnAddDir(wxCommandEvent& event);
/// Callback for removing files
void OnRemove(wxCommandEvent& event);
- /// Display a message box with the last addition statistics
+ /// Display a message box with the last addition statistics
void DisplayAddSummary();
/// AddProgress Gimmick callback
void OnAddProgress( Gimmick::AddProgress& );
+
/// Progress dialog
wxProgressDialog* mProgressDialog;
//The selection's maximum dimension
int level=mLevelList.size();
std::vector<tree::Node*> sel=GetSelected(level+1);
bool valid=true;
+ std::string mess;
if(sel.size()>0)
{
std::vector<tree::Node*>::iterator i;
std::string col;
std::string plane;
+
//Validation between image sizes
for (i=sel.begin(); i!=sel.end() && valid; ++i)
{
((*i)->GetAttribute(mLevelList[level-1].key[2]))!=col ||
((*i)->GetAttribute(mLevelList[level-1].key[3]))!=plane)
{
+ mess="The selected images are not compatible.";
valid=false;
}
}
}
- GimmickMessage(1,
- "State check: Planes:"
- <<plane<<" Cols: "
- <<col<<" Rows:"
- <<row<<" "
- << std::endl);
//Dimention validation
//Compatibility with maximum
if(valid)
if (dim == 0)
{
- GimmickMessage(1,
- "Unknown image dimension : cannot select !"
- <<dim<<" "
- <<plane<<" "
- <<col<<" "
- <<row<<" "
- << std::endl);
+ mess="Unknown image dimension : cannot select !";
valid= false;
}
else if (dim>GetMaxDimension())
{
- GimmickMessage(1,"Selecting "<<dim<<"D images is not allowed !"
- << std::endl);
+ mess="Selecting ";
+ mess+=dim;
+ mess+="D images is not allowed !";
valid= false;
}
if ( dim == GetMaxDimension() )
{
- GimmickMessage(1,"Cannot add this image to selection : would result in a "
- <<dim+1<<"D image !" << std::endl);
+ mess="Cannot add this image to selection : would result in a ";
+ mess+=(dim+1);
+ mess+="D image!";
+
valid= false;
}
if ( dim < GetMinDimension() && sel.size()<2 )
{
- GimmickMessage(1,"Cannot build the selection as it would result in a "
- <<dim<<"D image, and the minimum is"<<GetMinDimension()<<"D!" << std::endl);
+ mess="Cannot build the selection as it would result in a ";
+ mess+=dim;
+ mess+="D image, and the minimum is ";
+ mess+=GetMinDimension();
+ mess+="D!";
valid= false;
}
}
}
else
{
+ mess="Cannot have 0 images selected";
GimmickMessage(1,"Cannot have 0 images selected"<< std::endl);
valid=false;
}
wxCommandEvent event( 0, GetId() );
event.SetEventObject( this );
if(valid)
- {event.SetInt(0);}
+ {
+ mess="Selection OK !";
+ event.SetInt(0);
+ }
else
{event.SetInt(1);}
+ event.SetString(wxT(mess));
GetEventHandler()->ProcessEvent( event );