#include <vtkCamera.h>
#include <vtkRenderer.h>
-#include<wx/filefn.h>
+#include <wx/filefn.h>
+//#include <wx/tipwin.h>
using namespace crea;
- //================================================================
- class WxGimmickSettingsDialog : public wxDialog
- {
- public:
- WxGimmickSettingsDialog(wxWindow *parent);
- ~WxGimmickSettingsDialog();
-
-
- };
- //================================================================
-
-
// Image sizer
wxBoxSizer *isizer = new wxBoxSizer(wxHORIZONTAL );
mPanelImage->SetSizer( isizer );
-
+
+ // Notebook
+ mwxNotebook = new wxNotebook(mSplitter2,
+ -1,wxDefaultPosition, wxDefaultSize, 0);
+
+
+
// Fields view (bottom)
- mFieldsView = new WxGimmickFieldsView(mSplitter2,-1,
+ mFieldsView = new WxGimmickFieldsView(mwxNotebook,-1,
wxDefaultPosition,
wxDefaultSize,0);
GetSettings().BgColour(DicomNode::Series),
GetSettings().Colour(DicomNode::Image),
GetSettings().BgColour(DicomNode::Image));
+ mwxNotebook->AddPage( mFieldsView, _T("Dicom fields"));
-
-
+ // Help
+ mHelp = new WxGimmickHelp(mwxNotebook);
+ mwxNotebook->AddPage( mHelp, _T("Help"));
+
+ // Splitting
int wsize = size.GetWidth();
int hsize = size.GetHeight();
int previewhsize = 150;
int previewwsize = 400;
mSplitter2->SetMinimumPaneSize( previewhsize );
- mSplitter2->SplitHorizontally( mPanelImage, mFieldsView,
+ mSplitter2->SplitHorizontally( mPanelImage, mwxNotebook, //mFieldsView,
hsize - previewhsize);
rsizer->Add( mSplitter2,1,wxGROW ,0);
ShowImage(mReader.GetImage(""));
+ // Show help if no collection
+ if (GetDicomDatabaseList().size()==0)
+ {
+ mwxNotebook->SetSelection(1);
+ }
+ else
+ {
+ mwxNotebook->SetSelection(0);
+ }
+ // mJustStarted = true;
}
//================================================================
}
}
+ if (GetDicomDatabaseList().size()==0) mFieldsView->UpdateFields(db);
GetDicomDatabaseList().push_back(db);
UpdateDicomDatabaseView(db);
+
}
//================================================================
wxBusyCursor busy;
// std::cout << "WxGimmick : Reading config"<<std::endl;
- // std::cout << "==> Loading collections from '"<<mDatabaseListFile
+ // std::cout <<
+ creaMessage("Gimmick!",1,"Gimmick! : ==> Loading collections from '"<<mDatabaseListFile<<"'"<<std::endl);
// <<"'"<<std::endl;
std::ifstream s;
}
else
{
- // std::cout << " ... ERROR !"<<std::endl;
+ creaMessage("Gimmick!",1," ==> ERROR opening collection '"<<tokens[0]<<"'"<<std::endl);
delete db;
}
}
}
else
{
- std::cout << "ERROR opening "<<mDatabaseListFile<<std::endl;
+ creaMessage("Gimmick!",1," ==> File does not exist. It will be created on exit (if you already ran Gimmick! and exited normally, this is not normal. Send a bug report).");
}
}
if (data->IsDicomNode())
{
- /*
+
// LG : BUGGY
+ /*
std::string str("&Remove ");
str += data->GetDicomNode()->GetTypeName();
menu.Append(PopUp_Remove, std2wx(str));
// Pop up menu callbacks
void WxGimmick::OnPopUpAbout(wxCommandEvent& event)
{
- wxMessageBox( _T("Give me my medical images quick ! \n\n (c) CREATIS-LRMN 2008\n"),
+ wxMessageBox( _T("Give me my medical images quick ! \n\n (c) CREATIS-LRMN 2008\n laurent.guigues@creatis.insa-lyon.fr"),
_T("Gimmick!"),
wxOK | wxICON_INFORMATION, this);
}
void WxGimmick::OnPopUpSettings(wxCommandEvent& event)
{
WxGimmickSettingsDialog* s =
- new WxGimmickSettingsDialog(this);
+ new WxGimmickSettingsDialog(this,&mSettings);
s->ShowModal();
delete s;
}
void WxGimmick::OnInternalIdle()
{
ProcessImageEvents();
+ /*
+ if (mJustStarted)
+ {
+
+ mJustStarted = false;
+ }
+ */
+ //
}
//================================================================
}
-
-
-
-
+ //====================================================================
+ void WxGimmick::ShowHelp()
+ {
+ /*
+ if (mHelpWindow==0)
+ {
+ mHelpWindow = new WxGimmickHelpWindow(this);
+ }
+ mHelpWindow->CenterOnParent();
+ mHelpWindow->ShowModal();
+ */
+ }
+ //====================================================================
- //================================================================
- //================================================================
- //================================================================
- //================================================================
-
- //================================================================
- WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent)
- :
- wxDialog( parent,
- -1,
- _T("Settings"),
- wxDefaultPosition,
- wxSize(400,400),
- wxRESIZE_BORDER |
- wxSYSTEM_MENU |
- wxCLOSE_BOX |
- wxMAXIMIZE_BOX |
- wxMINIMIZE_BOX |
- wxCAPTION
- )
- {
- }
- //================================================================
-
- //================================================================
- WxGimmickSettingsDialog::~WxGimmickSettingsDialog()
- {
- }
- //================================================================
-
-
-
+