]> Creatis software - creaImageIO.git/blob - src2/creaImageIOWxTreeView.cpp
829549a2212feca51e2c8847897be80b15bde201
[creaImageIO.git] / src2 / creaImageIOWxTreeView.cpp
1 #include <creaImageIOWxTreeView.h>
2 #include <creaImageIOSystem.h>
3 #include <wx/splitter.h>
4 int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData))
5 {
6     // inverse the order
7     if (item1 < item2)
8         return -1;
9     if (item1 > item2)
10         return 1;
11
12     return 0;
13 }
14 namespace creaImageIO
15 {
16   //=====================================================================
17   // CTor
18   WxTreeView::WxTreeView(TreeHandler* handler,
19                          wxWindow* parent,
20                          const wxWindowID id)
21     : wxPanel(parent,id),
22       TreeView(handler)
23   {
24     GimmickDebugMessage(1,"WxTreeView::WxTreeView"
25                         <<std::endl);
26
27     
28     // Split part below toolbar into notebook for views and panel
29     // for preview, messages...
30     // TO DO : Splitter
31     //    mSplitter = new wxSplitterWindow( this , -1);
32
33     // Global sizer
34     wxBoxSizer  *sizer = new wxBoxSizer(wxHORIZONTAL);
35     
36     int ctrl_style = wxLC_REPORT | wxLC_VRULES;
37     int col_style = wxLIST_FORMAT_LEFT;
38
39     // Creating the ListCtrl for the levels > 0 (not for Root level)
40     for (int i = 1;
41          i < handler->GetTree().GetNumberOfLevels();
42          ++i)
43       {
44
45         GimmickDebugMessage(5,"Creating view for level "<<i
46                             <<std::endl);
47         LevelType level;
48
49         // If the first level : parent = this
50         wxWindow* sparent = this;
51         // else parent = last splitter
52         if (i>1) sparent = mLevelList[i-2].wxSplitter;
53
54         level.wxSplitter = new wxSplitterWindow( sparent , -1);
55         //          level.wxSplitter->SetMinimumPaneSize(100);
56         
57         wxListCtrl* ctrl = new wxListCtrl(level.wxSplitter,
58                                           i,
59                                           wxDefaultPosition, 
60                                           wxDefaultSize,
61                                           ctrl_style);
62         level.wxCtrl = ctrl;
63         level.wxSplitter->Initialize(ctrl);
64
65         // Create the columns : one for each attribute of the level
66         int col = 0;
67                         //ctrl->InsertItem(0, "1");
68         
69         tree::LevelDescriptor::AttributeDescriptorListType::const_iterator a;
70         for (a  = handler->GetTree().GetAttributeDescriptorList(i).begin();
71              a != handler->GetTree().GetAttributeDescriptorList(i).end();
72              ++a)
73           {
74                   if(col==0)
75                   {
76                     wxListItem it;
77                     it.SetTextColour(*wxRED);
78                     it.SetText(_T("#C"));
79                     it.SetColumn(col);
80                     //              ctrl->InsertColumn(col, _("Children"), col_style);
81                     ctrl->InsertColumn(col,it);
82                     //ctrl->InsertItem(0, "1");
83                     //level.key.push_back(_("Children"));
84                     //level.key.push_back(handler->GetTree().GetChildrenList().size());
85                     col++;
86                   }
87                   
88                 GimmickDebugMessage(5,"Creating column "<<col<<" : "
89                                 <<a->GetName()
90                                 <<std::endl);
91                 ctrl->InsertColumn(col, 
92                                 crea::std2wx(a->GetName()),
93                                 col_style);
94                 level.key.push_back(a->GetKey());
95                 //          ctrl->SetColumnWidth(col, wxLIST_AUTOSIZE );
96                 col++;
97                 
98                 
99           }
100           
101         mLevelList.push_back(level);
102       }
103     
104
105     /// Initialize the first level splitter
106  
107       sizer->Add( mLevelList[0].wxSplitter ,1, wxGROW  ,0);
108
109     UpdateLevel(1);
110
111     SetSizer( sizer );     
112     SetAutoLayout(true);
113     Layout();
114
115   }
116   //=====================================================================
117
118   //=====================================================================
119   /// Destructor
120   WxTreeView::~WxTreeView()
121   {
122     GimmickDebugMessage(1,"WxTreeView::~WxTreeView"
123                         <<std::endl);
124   }
125   //=====================================================================
126   
127   
128   //=====================================================================
129   struct ItemData
130   {
131     tree::Node* node;
132   };
133  
134   //=====================================================================
135    std::vector<tree::Node*> WxTreeView::GetSelected(int level)
136   {
137     int l = level - 1;
138     // the selection of upper level
139     std::vector<tree::Node*> sel;
140         
141     if (level == 1) 
142       {
143         sel.push_back(GetTreeHandler()->GetTree().GetTree());
144       }
145     else 
146       {
147         int n = GetCtrl(l-1)->GetItemCount();
148         for (int i = 0; i < n; i++)
149           {
150             if ( GetCtrl(l-1)->GetItemState(i,wxLIST_STATE_SELECTED))
151               {
152                 long adr = GetCtrl(l-1)->GetItemData(i);
153                 tree::Node* n = ((ItemData*)adr)->node;
154                 sel.push_back(n);
155               }
156           }     
157       }
158         
159           return sel;
160   }
161
162   //=====================================================================
163   
164   ///Removes selected nodes on given level
165   void WxTreeView::RemoveSelected( int level )
166   {
167           std::vector<tree::Node*> sel=GetSelected(level+1);
168           bool erase=false;
169           if (wxMessageBox(_T("Delete file(s) ?"),
170                          _T("Remove Files"),
171                          wxYES_NO,this ) == wxYES)
172           {
173             erase = true;
174           }
175           if(erase)
176           {
177                 std::vector<tree::Node*>::iterator i;
178                 for (i=sel.begin(); i!=sel.end(); ++i)
179                 {
180                         GimmickDebugMessage(2,
181                                         "deleting '"
182                                         <<(*i)->GetLabel()
183                                         <<"'"<<level
184                                         <<std::endl);
185                                 GetTreeHandler()->Remove(*i);
186                 }
187
188                 UpdateLevel(level);
189           }
190           
191   }
192     
193
194   //=====================================================================
195
196  
197   //=====================================================================
198   /// 
199   void WxTreeView::UpdateLevel( int level )
200   {
201     GimmickDebugMessage(1,
202                         GetTreeHandler()->GetTree().GetLabel()
203                         <<" view : updating level "<<level
204                         <<std::endl);
205     
206     wxBusyCursor busy;
207     RecursiveUpdateLevel(level);
208     int i;
209     for (i=0; i<level-1; i++)
210       {
211         if (!GetSplitter(i)->IsSplit()) 
212           GetSplitter(i)->SplitVertically(  GetCtrl(i), GetSplitter(i+1),
213                                             100 );
214       }
215     if (GetSplitter(i)->IsSplit()) GetSplitter(i)->Unsplit();    
216     
217   }
218   //=====================================================================
219   
220   /// 
221   void WxTreeView::RecursiveUpdateLevel( int level )
222   {
223           GimmickDebugMessage(2,
224                         GetTreeHandler()->GetTree().GetLabel()
225                         <<" view : updating level (recursive)"<<level
226                         <<std::endl);
227
228
229     std::vector<tree::Node*> sel=GetSelected(level);
230
231           int l = level - 1;
232  
233     // to speed up inserting we hide the control temporarily
234     GetCtrl(l)->Hide();
235     GetCtrl(l)->DeleteAllItems();
236     
237     std::vector<tree::Node*>::iterator i;
238     for (i=sel.begin(); i!=sel.end(); ++i)
239       {
240         GimmickDebugMessage(2,
241                             "adding children of '"
242                             <<(*i)->GetLabel()
243                             <<"'"<<level
244                             <<std::endl);
245         
246         //Adds columns
247         GetTreeHandler()->LoadChildren(*i,1);
248         tree::Node::ChildrenListType::reverse_iterator j;
249         for (j = (*i)->GetChildrenList().rbegin(); 
250              j!= (*i)->GetChildrenList().rend(); 
251              ++j)
252           {
253             wxListItem item;
254             item.SetMask(wxLIST_MASK_STATE | 
255                          wxLIST_MASK_TEXT |
256                          //                      wxLIST_MASK_IMAGE |
257                          wxLIST_MASK_DATA |
258                          //                      wxLIST_MASK_WIDTH |
259                          wxLIST_MASK_FORMAT
260                          );
261
262             ItemData* data = new ItemData;
263             data->node = *j;
264             item.SetData(data);
265             
266           
267             long id = GetCtrl(l)->InsertItem(item);
268
269             std::ostringstream oss;
270             int n= GetTreeHandler()->GetNumberOfChildren(*j);
271             
272             oss << n;
273             std::string s(oss.str());
274             
275             item.SetText( crea::std2wx(s));
276             //      item.SetTextColour(*wxRED);
277             //      item.SetBackgroundColour(*wxBLACK); 
278             item.SetColumn(0);
279             GetCtrl(l)->SetItem(item);
280             //      GetCtrl(l)->SetItem(id,0, crea::std2wx(s));
281             //      GetCtrl(l)->SetColumnWidth(0, wxLIST_AUTOSIZE );
282
283           for (int k=1; k<GetCtrl(l)->GetColumnCount(); k++)
284               {
285
286                 std::string val = (*j)->GetAttribute(mLevelList[l].key[k-1]);
287                 if (val.size()==0) val = "?";
288                 item.SetText( crea::std2wx(val));
289                 //              item.SetTextColour(*wxBLACK);
290                 //              item.SetBackgroundColour(*wxWHITE); 
291                 item.SetColumn(k);
292                 GetCtrl(l)->SetItem(item);
293
294                 //              GetCtrl(l)->SetItem(id,k, crea::std2wx(val));
295                 // GetCtrl(l)->SetColumnWidth(k, wxLIST_AUTOSIZE );
296                 
297               }
298             
299           }
300       }
301     
302     GetCtrl(l)->Show();
303
304     
305     if (level<mLevelList.size()) UpdateLevel(level+1);
306  }
307   //=====================================================================
308
309
310   //================================================================
311   void WxTreeView::OnSelectedChanged(wxListEvent& event)
312   { 
313     GimmickDebugMessage(1,
314                         GetTreeHandler()->GetTree().GetLabel()
315                         <<" view : item selected "
316                         <<std::endl);
317
318     wxListItem info;
319     info.m_itemId = event.m_itemIndex;
320     
321
322     // retrieve the level
323     wxObject* obj = event.GetEventObject();   
324     unsigned int level = 0;
325     for (level = 0; level<mLevelList.size(); ++level)
326       {
327         if ( GetCtrl(level) == obj ) break;
328       }
329     GimmickDebugMessage(1,
330                         " Level "<<level+1
331                         <<std::endl);
332     if (level<mLevelList.size()-1) UpdateLevel( level + 2 ); 
333         if (level==mLevelList.size()-1) ValidateSelectedImages ();
334
335   }
336   //================================================================
337
338 //================================================================
339   void WxTreeView::OnColClick(wxListEvent& event)
340   { 
341           /*
342         //Obtain the column name and the level that needs to be organized
343         int colNum=event.m_col;
344     GimmickMessage(1,
345                         " Column " <<event.m_col
346                         <<std::endl);
347
348         
349     wxObject* ctrl = event.GetEventObject(); 
350         unsigned int level = 0;
351     for (level = 0; level<mLevelList.size(); ++level)
352       {
353         if ( GetCtrl(level) == ctrl ) break;
354       }
355
356           wxBusyCursor busy;
357     std::vector<tree::Node*> sel=GetSelected(level+1);
358
359         tree::Node* nodes[20];
360
361           int l = level - 1;
362  
363     // to speed up inserting we hide the control temporarily
364     GetCtrl(level)->Hide();
365     GetCtrl(level)->DeleteAllItems();
366     
367     std::vector<tree::Node*>::iterator i;
368         int num=0;
369     for (i=sel.begin(); i!=sel.end(); ++i)
370       {
371         
372                 //Adds columns
373                 GetTreeHandler()->LoadChildren(*i,1);
374                 tree::Node::ChildrenListType::reverse_iterator j;
375                 
376                 for (j = (*i)->GetChildrenList().rbegin(); 
377                         j!= (*i)->GetChildrenList().rend(); 
378                         ++j)
379                         {
380                                 nodes[num]=*j;
381                                 num++;
382                         }
383       }
384         
385           //Sorting elements
386           int k, m; 
387           tree::Node* index;
388           
389         
390         for (k=1; k<num; ++k)
391         {
392                 index = nodes[k];
393                 m = k;
394                 GimmickMessage(1,
395                         "Comparison Key 1: "
396                             <<(nodes[m-1])->GetAttribute(mLevelList[level].key[colNum-1])
397                                 <<"Comparison Key 2: "<<(index)->GetAttribute(mLevelList[level].key[colNum-1])
398                             <<std::endl);
399                 while ((m > 0) && ((nodes[m-1])->GetAttribute(mLevelList[level].key[colNum-1]) > 
400                                                    (index)->GetAttribute(mLevelList[level].key[colNum-1])))
401                 {
402                 nodes[m] = nodes[m-1];
403                 m = m - 1;
404                 }
405                 nodes[m] = index;
406         }
407
408         for (m=0; m<num; ++m)
409         {
410                 tree::Node* node=nodes[m];
411             wxListItem item;
412             item.SetMask(wxLIST_MASK_STATE | 
413                          wxLIST_MASK_TEXT |
414                          //                      wxLIST_MASK_IMAGE |
415                          wxLIST_MASK_DATA |
416                          //                      wxLIST_MASK_WIDTH |
417                          wxLIST_MASK_FORMAT
418                          );
419
420             long id = GetCtrl(level)->InsertItem(item);
421                 int n;
422                 if ((node)->GetChildrenLoaded()) 
423                 {
424                         n=(node)->GetChildrenList().size();
425                 }
426                 else
427                 {
428                         n= GetTreeHandler()->GetNumberOfChildren(node);
429                 }
430                 std::ostringstream oss;
431                 
432                 oss << n;
433                 std::string s(oss.str());
434
435                 GetCtrl(level)->SetItem(id,0, crea::std2wx(s));
436                 GetCtrl(level)->SetColumnWidth(0, wxLIST_AUTOSIZE );
437                 
438           for (int k=1; k<GetCtrl(level)->GetColumnCount(); k++)
439               {
440                 std::string val = (node)->GetAttribute(mLevelList[level].key[k-1]);
441                 if (val.size()==0) val = "?";
442                 GetCtrl(level)->SetItem(id,k, crea::std2wx(val));
443                 GetCtrl(level)->SetColumnWidth(k, wxLIST_AUTOSIZE );
444                 
445               }
446             
447           }
448
449     
450     GetCtrl(level)->Show();
451 */
452   }
453   //================================================================
454
455   void WxTreeView::ValidateSelectedImages()
456   {
457         int level=mLevelList.size();
458         std::vector<tree::Node*> sel=GetSelected(level+1);
459         bool valid=true;
460         if(sel.size()>0)
461         {
462                 std::vector<tree::Node*>::iterator i;
463                 std::string row;
464                 std::string col;
465                 std::string plane;
466                 
467                 //Validation between image sizes
468                 for (i=sel.begin(); i!=sel.end() && valid; ++i)
469                 {
470                         if(i==sel.begin())
471                         {
472                                 row=(*i)->GetAttribute(mLevelList[level-1].key[1]);
473                                 col=(*i)->GetAttribute(mLevelList[level-1].key[2]);
474                                 plane=(*i)->GetAttribute(mLevelList[level-1].key[3]);
475                         }
476                         else
477                         {
478                                 if(((*i)->GetAttribute(mLevelList[level-1].key[1]))!=row ||
479                                         ((*i)->GetAttribute(mLevelList[level-1].key[2]))!=col ||
480                                         ((*i)->GetAttribute(mLevelList[level-1].key[3]))!=plane)
481                                         {
482                                                 valid=false;
483                                         }
484                         }
485                 }
486
487                 GimmickMessage(1,
488                         "State check: Planes:" 
489                         <<plane<<" Cols: "
490                         <<col<<" Rows:"
491                                 <<row<<" "
492                                 << std::endl);
493                 //Dimention validation
494                 //Compatibility with maximum 
495                         if(valid)
496                         {       
497                                 int rows;
498                                 int cols;
499                                 int planes;
500                                 std::string s;
501                                 std::istringstream t(s);
502                                 s=row;
503                                 t >> rows;
504                                 if(row==""){rows=1;}
505                                 s=col;
506                                 t >> cols;
507                                 if(col==""){cols=1;}
508                                 s=plane;
509                                 t >> planes;
510                                 if(plane==""){planes=1;}
511
512                                 int dim = 0;
513                                 if (planes>1) dim=3;
514                                 else if (cols>1) dim=2;
515                                 else if (rows>1) dim=1;
516                             
517                                 if (dim == 0) 
518                                 {
519                                 GimmickMessage(1,
520                                         "Unknown image dimension : cannot select !" 
521                                         <<dim<<" "
522                                         <<plane<<" "
523                                         <<col<<" "
524                                         <<row<<" "
525                                         << std::endl);
526                                         valid= false;
527                                 }
528                                 else if (dim>GetMaxDimension())
529                                 {
530                                         GimmickMessage(1,"Selecting "<<dim<<"D images is not allowed !" 
531                                         << std::endl);
532                                         valid= false;
533                                 }
534                                 if ( dim == GetMaxDimension() )
535                                 {
536                                         GimmickMessage(1,"Cannot add this image to selection : would result in a "
537                                                                         <<dim+1<<"D image !" << std::endl);
538                                         valid= false;
539                                 }
540                                 if ( dim < GetMinDimension() && sel.size()<2 )
541                                 {
542                                         GimmickMessage(1,"Cannot build the selection as it would result in a "
543                                                                         <<dim<<"D image, and the minimum is"<<GetMinDimension()<<"D!" << std::endl);
544                                         valid= false;
545                                 }
546                         }
547           }
548         else
549         {
550                 GimmickMessage(1,"Cannot have 0 images selected"<< std::endl);
551                 valid=false;
552         }
553         
554                 //Send an event telling wether the selection is valid or not
555                 wxCommandEvent event( 0, GetId() );
556                 event.SetEventObject( this );
557                 if(valid)
558                 {event.SetInt(0);}
559                 else
560                 {event.SetInt(1);}
561                 GetEventHandler()->ProcessEvent( event );
562           
563         
564   }
565
566   //================================================================
567
568
569   vtkImageData* WxTreeView::GetSelectedImage(int dim)
570   {
571           /*
572                 wxArrayTreeItemIds id;
573     // TO DO : TEST THAT STYLE IS MULTIPLE 
574     unsigned int nb = mTreeListCtrl->GetSelections(id);
575     f.clear();
576
577     // Collect the brute vector of Image nodes
578     std::vector<DicomNode*> im;
579     for (unsigned int i=0; i<nb; ++i)
580       {
581         TreeItemData *data = 
582           (TreeItemData *)mTreeListCtrl->GetItemData(id[i]);
583         if ((data) && (data->IsDicomNode()))
584           {
585             if (data->GetDicomNode()->GetType()==DicomNode::Image)
586               {
587                 im.push_back ( data->GetDicomNode() );
588
589               }
590             else if (data->GetDicomNode()->GetType()==DicomNode::Series)
591               {
592                 DicomNode::ChildrenListType::iterator j;
593                 for (j =data->GetDicomNode()->GetChildrenList().begin();
594                      j!=data->GetDicomNode()->GetChildrenList().end();
595                      j++) 
596                   {
597                     im.push_back ( *j );
598                   }
599               }
600           }
601       }
602     // Create the output data
603     if (im.size()==1) 
604       {
605         // Only one image : give it
606         vtkImageData* out = vtkImageData::New();
607         out->ShallowCopy(mReader.GetImage(im.front()->ImageGetFullFileName()));
608         f.push_back( out );
609       }
610     else if (im.size()>1)
611       {
612         vtkImageData* first = mReader.GetImage( im.front()->ImageGetFullFileName() );
613         if (first->GetDataDimension()==2) 
614           {     
615             // n2D to 3D
616             vtkImageData* out = vtkImageData::New();
617             out->CopyStructure(first);  
618             out->SetScalarType(first->GetScalarType());
619             int ext[6];
620             first->GetExtent(ext);
621             ext[5] = im.size();
622             out->SetExtent(ext);
623             // LG : TODO : Z Spacing  ?
624             
625             out->AllocateScalars();
626             
627             //first->Print(std::cout);
628             //      out->Print(std::cout);
629             
630             int dim[3];
631             first->GetDimensions(dim);
632             unsigned long imsize = 
633               ( (unsigned long)first->GetScalarPointer(0,1,0)
634                 - (unsigned long)first->GetScalarPointer(0,0,0))
635               *dim[1];
636
637             int slice = 0;
638             std::vector<DicomNode*>::iterator it;
639             for (it=im.begin(); it!=im.end(); ++it) 
640               {
641                 //std::cout << "copying slice "<<slice <<std::endl;
642                 vtkImageData* cur = mReader.GetImage( (*it)->ImageGetFullFileName() );
643                 
644                 void* src = cur->GetScalarPointer(0,0,0);
645                 void* dst = out->GetScalarPointer(0,0,slice);
646                 //              std::cout << "src="<<src<<std::endl;
647                 //              std::cout << "dst="<<dst<<std::endl;
648                 //              std::cout << "siz="<<imsize<<std::endl;
649                 memcpy(dst,src,imsize);
650
651                 slice++;
652               }
653             f.push_back(out);
654           }
655         else 
656           {
657             // n3D
658             std::vector<DicomNode*>::iterator it;
659             for (it=im.begin(); it!=im.end(); ++it) 
660               {
661                 vtkImageData* out = vtkImageData::New();
662                 out->ShallowCopy(mReader.GetImage((*it)->ImageGetFullFileName()));
663                 f.push_back(out);
664               }
665           }
666       }
667           */
668         return NULL;
669   }
670
671   void WxTreeView::GetSelectedImages(std::vector<vtkImageData*>& s, int dim)
672   {
673
674   }
675   BEGIN_EVENT_TABLE(WxTreeView, wxPanel)
676   /*
677     EVT_SIZE(MyFrame::OnSize)
678
679     EVT_MENU(LIST_QUIT, MyFrame::OnQuit)
680     EVT_MENU(LIST_ABOUT, MyFrame::OnAbout)
681     EVT_MENU(LIST_LIST_VIEW, MyFrame::OnListView)
682     EVT_MENU(LIST_REPORT_VIEW, MyFrame::OnReportView)
683     EVT_MENU(LIST_ICON_VIEW, MyFrame::OnIconView)
684     EVT_MENU(LIST_ICON_TEXT_VIEW, MyFrame::OnIconTextView)
685     EVT_MENU(LIST_SMALL_ICON_VIEW, MyFrame::OnSmallIconView)
686     EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView)
687     EVT_MENU(LIST_VIRTUAL_VIEW, MyFrame::OnVirtualView)
688     EVT_MENU(LIST_SMALL_VIRTUAL_VIEW, MyFrame::OnSmallVirtualView)
689
690     EVT_MENU(LIST_FOCUS_LAST, MyFrame::OnFocusLast)
691     EVT_MENU(LIST_TOGGLE_FIRST, MyFrame::OnToggleFirstSel)
692     EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll)
693     EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll)
694     EVT_MENU(LIST_DELETE, MyFrame::OnDelete)
695     EVT_MENU(LIST_ADD, MyFrame::OnAdd)
696     EVT_MENU(LIST_EDIT, MyFrame::OnEdit)
697     EVT_MENU(LIST_DELETE_ALL, MyFrame::OnDeleteAll)
698     EVT_MENU(LIST_SORT, MyFrame::OnSort)
699     EVT_MENU(LIST_SET_FG_COL, MyFrame::OnSetFgColour)
700     EVT_MENU(LIST_SET_BG_COL, MyFrame::OnSetBgColour)
701     EVT_MENU(LIST_TOGGLE_MULTI_SEL, MyFrame::OnToggleMultiSel)
702     EVT_MENU(LIST_SHOW_COL_INFO, MyFrame::OnShowColInfo)
703     EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo)
704     EVT_MENU(LIST_FREEZE, MyFrame::OnFreeze)
705     EVT_MENU(LIST_THAW, MyFrame::OnThaw)
706     EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines)
707     EVT_MENU(LIST_MAC_USE_GENERIC, MyFrame::OnToggleMacUseGeneric)
708
709     EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo)
710     EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel)
711 END_EVENT_TABLE()
712
713 BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
714     EVT_LIST_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnBeginDrag)
715     EVT_LIST_BEGIN_RDRAG(LIST_CTRL, MyListCtrl::OnBeginRDrag)
716     EVT_LIST_BEGIN_LABEL_EDIT(LIST_CTRL, MyListCtrl::OnBeginLabelEdit)
717     EVT_LIST_END_LABEL_EDIT(LIST_CTRL, MyListCtrl::OnEndLabelEdit)
718     EVT_LIST_DELETE_ITEM(LIST_CTRL, MyListCtrl::OnDeleteItem)
719     EVT_LIST_DELETE_ALL_ITEMS(LIST_CTRL, MyListCtrl::OnDeleteAllItems)
720 #if WXWIN_COMPATIBILITY_2_4
721     EVT_LIST_GET_INFO(LIST_CTRL, MyListCtrl::OnGetInfo)
722     EVT_LIST_SET_INFO(LIST_CTRL, MyListCtrl::OnSetInfo)
723 #endif
724   */
725     EVT_LIST_ITEM_SELECTED(-1, WxTreeView::OnSelectedChanged)
726   
727     EVT_LIST_ITEM_DESELECTED(-1, WxTreeView::OnSelectedChanged)
728         /*
729     EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnListKeyDown)
730     EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated)
731     EVT_LIST_ITEM_FOCUSED(LIST_CTRL, MyListCtrl::OnFocused)
732
733     EVT_LIST_COL_RIGHT_CLICK(LIST_CTRL, MyListCtrl::OnColRightClick)
734         */
735     EVT_LIST_COL_CLICK(-1, WxTreeView::OnColClick)
736         /*
737     EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnColBeginDrag)
738     EVT_LIST_COL_DRAGGING(LIST_CTRL, MyListCtrl::OnColDragging)
739     EVT_LIST_COL_END_DRAG(LIST_CTRL, MyListCtrl::OnColEndDrag)
740
741     EVT_LIST_CACHE_HINT(LIST_CTRL, MyListCtrl::OnCacheHint)
742
743 #if USE_CONTEXT_MENU
744     EVT_CONTEXT_MENU(MyListCtrl::OnContextMenu)
745 #endif
746     EVT_CHAR(MyListCtrl::OnChar)
747
748     EVT_RIGHT_DOWN(MyListCtrl::OnRightClick)
749   */
750 END_EVENT_TABLE()
751   
752 } // EO namespace creaImageIO
753
754