#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();
-
-
- };
- //================================================================
-
-
ShowImage(mReader.GetImage(""));
+ mJustStarted = true;
}
//================================================================
// 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::OnInternalIdle()
{
ProcessImageEvents();
+ if (mJustStarted)
+ {
+ // Show tip if no collection
+ if (GetDicomDatabaseList().size()==0)
+ {
+ ShowHelp();
+ }
+ 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()
- {
- }
- //================================================================
-
-
-
+
return n;
}
//====================================================================
+
+
+
+ //================================================================
+ //================================================================
+ //================================================================
+ //================================================================
+
+ //================================================================
+ WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent)
+ :
+ wxDialog( parent,
+ -1,
+ _T("Settings"),
+ wxDefaultPosition,
+ wxSize(400,400),
+ wxRESIZE_BORDER |
+ wxSYSTEM_MENU |
+ wxCLOSE_BOX |
+ wxMAXIMIZE_BOX |
+ wxMINIMIZE_BOX |
+ wxCAPTION
+ )
+ {
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+ wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK|wxCANCEL);
+ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
+ mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
+
+ sizer->Add ( bsizer, 0, wxGROW );
+
+ SetSizer( sizer );
+ Layout();
+ }
+ //================================================================
+
+ //================================================================
+ WxGimmickSettingsDialog::~WxGimmickSettingsDialog()
+ {
+ }
+ //================================================================
+
+
+ //================================================================
+ //================================================================
+ //================================================================
+ //================================================================
+
+ //================================================================
+ WxGimmickHelpWindow::WxGimmickHelpWindow(wxWindow *parent)
+ :
+ wxDialog( parent,
+ -1,
+ _T("Gimmick! Help"),
+ wxDefaultPosition,
+ wxSize(600,500),
+
+
+ //wxDEFAULT_FRAME_STYLE |
+ //wxFRAME_FLOAT_ON_PARENT
+
+
+ wxBORDER_SIMPLE
+ // wxRESIZE_BORDER |
+ //wxSYSTEM_MENU |
+ //wxCLOSE_BOX |
+ // wxMAXIMIZE_BOX |
+ //wxMINIMIZE_BOX |
+ //wxCAPTION
+
+
+ )
+ {
+ SetBackgroundColour(*wxBLUE);
+
+ wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+ mText = new wxTextCtrl(this,
+ -1, //ID_InputText,
+ _T(""),
+ wxDefaultPosition,
+ wxDefaultSize,
+ wxTE_READONLY |
+ wxTE_MULTILINE
+ // |wxTE_PROCESS_ENTER
+ //| wxTE_PROCESS_TAB
+ // | wxWANTS_CHARS
+ // | wxTAB_TRAVERSAL
+ );
+
+ wxFont* FixedFont = new wxFont(10,
+ wxFONTFAMILY_MODERN,
+ wxFONTSTYLE_NORMAL,
+ wxFONTWEIGHT_NORMAL,
+ false);
+
+ wxTextAttr mwxInputTextAttr;
+ mwxInputTextAttr.SetFont(*FixedFont);
+ mwxInputTextAttr.SetBackgroundColour(*wxBLUE);
+ mwxInputTextAttr.SetTextColour(*wxWHITE);
+ mText->SetDefaultStyle(mwxInputTextAttr);
+ mText->SetBackgroundColour(*wxBLUE);
+
+ std::string tip("\n");
+ tip += " Welcome to Gimmick !\n\n";
+ tip += " ( Give me my medical images quick ! )\n\n\n";
+ tip += " You do not have any image collection yet\n\n";
+ tip += " To create one :\n";
+ tip += " 1) Right click on 'Collection'\n";
+ tip += " 2) Select 'New collection'\n";
+ tip += " 3) Enter the collection file name and the collection name\n\n";
+ tip += " To add images to your collection :\n";
+ tip += " 1) Right click on your collection\n";
+ tip += " 2) Select 'Add image(s) to collection'\n";
+ tip += " 3) Select 'Scan Directory' to add all images of a directory or\n";
+ tip += " Select 'Select File(s)' to add only some selected images\n";
+ tip += " 4) Select the directory or the files to add\n";
+ tip += "\n\n";
+ tip += " Remember then that *ALL* actions in Gimmick! are accessible\n";
+ tip += " by right clicking on the elements of the view\n";
+ tip += "\n";
+ tip += " Enjoy!\n";
+
+ mText->AppendText(tip);
+
+
+ sizer->Add(mText,1,wxGROW);
+
+
+ wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK);
+ mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
+
+ sizer->Add ( bsizer, 0, wxGROW );
+
+
+ SetSizer(sizer);
+ SetAutoLayout(true);
+ Layout();
+
+
+
+ }
+ //================================================================
+
+ //================================================================
+ WxGimmickHelpWindow::~WxGimmickHelpWindow()
+ {
+ }
+ //================================================================
+
+
+
+
+
}
//================================================================
+
+ //================================================================
+ class WxGimmickSettingsDialog : public wxDialog
+ {
+ public:
+ WxGimmickSettingsDialog(wxWindow *parent);
+ ~WxGimmickSettingsDialog();
+
+ wxButton* mOkButton;
+ wxButton* mCancelButton;
+
+ };
+ //================================================================
+
+
+ //================================================================
+ class WxGimmickHelpWindow : public wxDialog
+ {
+ public:
+ WxGimmickHelpWindow(wxWindow *parent);
+ ~WxGimmickHelpWindow();
+
+ wxTextCtrl* mText;
+ wxButton* mOkButton;
+ };
+ //================================================================
+
+
} // namespace creaImageIO