#include #include #include // Icons #include "../src/icons/database.xpm" #include "../src/icons/folder.xpm" #include "../src/icons/dicomdir.xpm" #include "../src/icons/patient.xpm" #include "../src/icons/study.xpm" #include "../src/icons/series.xpm" #include "../src/icons/image.xpm" #include "../src/icons/root.xpm" #include namespace creaImageIO { //====================================================================== // The ids of the different tools enum { TOOL_ADDFILE_ID = 1 }; //====================================================================== //================================================================ // const int icon_number = 8; // Icon ids typedef enum { Icon_Root, Icon_Database, Icon_Folder, Icon_DicomDir, Icon_Patient, Icon_Study, Icon_Series, Icon_Image } icon_id; //================================================================ //================================================================ /* const icon_id Icon[5] = { Icon_Database, Icon_Patient, Icon_Study, Icon_Series, Icon_Image }; */ //================================================================ //====================================================================== // CTor WxGimmickView::WxGimmickView(Gimmick* gimmick, wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, int image_type, int number_of_threads) : wxPanel(parent,id,pos,size), GimmickView(gimmick) { GimmickDebugMessage(1,"WxGimmickView::WxGimmickView" <Add( mToolBar ,0, wxGROW ,0); // Split part below toolbar into notebook for views and panel // for preview, messages... mSplitter = new wxSplitterWindow( this , -1); // Notebook mNotebook = new wxNotebook(mSplitter, -1,wxDefaultPosition, wxDefaultSize, 0); // Create the views CreateTreeViews(); // Bottom panel mBottomPanel = new wxPanel(mSplitter,-1); // Splitting int hsize = size.GetHeight(); int bottom_minsize = 200; mSplitter->SetMinimumPaneSize( viewsminsize ); mSplitter->SplitHorizontally( mNotebook, mBottomPanel, hsize - bottom_minsize); sizer->Add( mSplitter,1,wxGROW ,0); SetSizer( sizer ); SetAutoLayout(true); Layout(); } //====================================================================== //====================================================================== /// Destructor WxGimmickView::~WxGimmickView() { GimmickDebugMessage(1,"WxGimmickView::~WxGimmickView" <AddTool( TOOL_ADDFILE_ID, _T("Add file"), mIcon->GetBitmap(Icon_Database), _T("Add file") ); //const wxBitmap& bitmap1, const wxString& shortHelpString = "", wxItemKind kind = wxITEM_NORMAL) mToolBar->Realize(); } //====================================================================== //====================================================================== /// Create the tree view for TreeHandler provided void WxGimmickView::CreateTreeView( TreeHandler* h) { std::string name(h->GetTree().GetAttribute("Name")); GimmickMessage(2,"Creating the tree view for '"<< name<<"'"<AddPage( view, crea::std2wx(name) ); } //====================================================================== //================================================= void WxGimmickView::CreateIconList() { // Size of the icons; int size = 32; wxIcon icons[20]; // should correspond to Icon_xxx enum icons[Icon_Patient] = wxIcon(patient_xpm); icons[Icon_Study] = wxIcon(study_xpm); icons[Icon_Series] = wxIcon(series_xpm); icons[Icon_Image] = wxIcon(image_xpm); icons[Icon_Database] = wxIcon(database_xpm); icons[Icon_Folder] = wxIcon(folder_xpm); icons[Icon_DicomDir] = wxIcon(dicomdir_xpm); icons[Icon_Root] = wxIcon(root_xpm); unsigned int NbIcons = 8; // Make an image list containing small icons mIcon = new wxImageList(size,size,true); // Make all icons the same size = size of the first one int sizeOrig = icons[0].GetWidth(); for ( size_t i = 0; i < NbIcons; i++ ) { if ( size == sizeOrig ) { mIcon->Add(icons[i]); } else { mIcon->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size))); } } } //================================================= } // EO namespace creaImageIO