creaImageIO::WxGimmickDialog w(0,
-1,
- _T("WxGimmickDialog test"),
+ _T("Select image(s) - Gimmick! (c) CREATIS-LRMN 2008"),
wxDefaultPosition,
wxSize(1200,800),
image_type,
// 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(""));
- mJustStarted = true;
+ // 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);
+
}
//================================================================
void WxGimmick::OnPopUpSettings(wxCommandEvent& event)
{
WxGimmickSettingsDialog* s =
- new WxGimmickSettingsDialog(this);
+ new WxGimmickSettingsDialog(this,&mSettings);
s->ShowModal();
delete s;
}
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();
+ */
}
//====================================================================
#include <creaImageIODicomDatabase.h>
// wx
-#include "wx/wx.h"
-#include "wx/image.h"
-#include "wx/imaglist.h"
+#include <creaWx.h>
+#include <wx/image.h>
+#include <wx/imaglist.h>
#include <wx/splitter.h>
+#include <wx/notebook.h>
#include "treelistctrl.h"
// dicom fields view panel
// Help
- WxGimmickHelpWindow* mHelpWindow;
+ WxGimmickHelp* mHelp;
bool mJustStarted;
int mFirstDicomDatabaseIconIndex;
WxGimmickFieldsView* mFieldsView;
+ wxNotebook* mwxNotebook;
+
wxSplitterWindow *mSplitter1;
wxSplitterWindow *mSplitter2;
//================================================================
//================================================================
- WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent)
+ WxGimmickSettingsDialog::WxGimmickSettingsDialog(wxWindow *parent,
+ WxGimmickSettings* settings)
:
wxDialog( parent,
-1,
wxMAXIMIZE_BOX |
wxMINIMIZE_BOX |
wxCAPTION
- )
+ ),
+ mSettings(settings)
{
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
+
+
wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK|wxCANCEL);
mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
mCancelButton = (wxButton*)FindWindowById(GetEscapeId(), this);
//================================================================
//================================================================
- WxGimmickHelpWindow::WxGimmickHelpWindow(wxWindow *parent)
+ WxGimmickHelp::WxGimmickHelp(wxWindow *parent)
:
- wxDialog( parent,
+ wxPanel( parent, -1)
+ /*
-1,
_T("Gimmick! Help"),
wxDefaultPosition,
)
+ */
{
- SetBackgroundColour(*wxBLUE);
+ // SetBackgroundColour(*wxBLUE);
wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
wxFONTWEIGHT_NORMAL,
false);
- wxTextAttr mwxInputTextAttr;
- mwxInputTextAttr.SetFont(*FixedFont);
- mwxInputTextAttr.SetBackgroundColour(*wxBLUE);
- mwxInputTextAttr.SetTextColour(*wxWHITE);
- mText->SetDefaultStyle(mwxInputTextAttr);
- mText->SetBackgroundColour(*wxBLUE);
+ // 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 += " Welcome to Gimmick !\n";
+ tip += " ( Give me my medical images quick ! )\n\n\n";
+ tip += " To start you must create a 'Collection' :\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 += " 3) Select :\n";
+ tip += " * 'Scan Directory' to add all images of a directory or\n";
+ tip += " * '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 += " Remember then that *ALL ACTIONS* in Gimmick!\n";
+ tip += " are done by right clicking on the DICOM tree elements\n";
tip += "\n";
tip += " Enjoy!\n";
sizer->Add(mText,1,wxGROW);
-
+ /*
wxSizer* bsizer = CreateSeparatedButtonSizer(wxOK);
mOkButton = (wxButton*)FindWindowById(GetAffirmativeId(), this);
-
+
sizer->Add ( bsizer, 0, wxGROW );
-
+ */
SetSizer(sizer);
SetAutoLayout(true);
//================================================================
//================================================================
- WxGimmickHelpWindow::~WxGimmickHelpWindow()
+ WxGimmickHelp::~WxGimmickHelp()
{
}
//================================================================
class WxGimmickSettingsDialog : public wxDialog
{
public:
- WxGimmickSettingsDialog(wxWindow *parent);
+ WxGimmickSettingsDialog(wxWindow *parent,WxGimmickSettings* settings);
~WxGimmickSettingsDialog();
+ WxGimmickSettings* mSettings;
wxButton* mOkButton;
wxButton* mCancelButton;
//================================================================
- class WxGimmickHelpWindow : public wxDialog
+ class WxGimmickHelp : public wxPanel
{
public:
- WxGimmickHelpWindow(wxWindow *parent);
- ~WxGimmickHelpWindow();
+ WxGimmickHelp(wxWindow *parent);
+ ~WxGimmickHelp();
wxTextCtrl* mText;
wxButton* mOkButton;