1 #include <creaImageIOWxTreeView.h>
2 #include <creaImageIOGimmickView.h>
3 #include <creaImageIOSystem.h>
4 #include <wx/splitter.h>
6 #include <boost/date_time/gregorian/gregorian.hpp>
9 const std::string empty_string("");
11 //=====================================================================
14 //=====================================================================
15 /// Data stored by the list items
18 ItemData() : node(0), id(-1), attr(&empty_string) {}
19 // The corresponding Node
23 // The pointer on the current attribute string to sort on
24 const std::string* attr;
25 // Was the item previously selected ?
26 // Useful for reselecting the item after sort
29 //=====================================================================
31 //=====================================================================
33 //=====================================================================
34 ///Comparing function for ordering algorithm. Takes parameters as strings.
35 int wxCALLBACK CompareFunctionStrings(long item1, long item2, long sortData)
37 creaImageIO::ItemData* data1 = (creaImageIO::ItemData*)item1;
38 creaImageIO::ItemData* data2 = (creaImageIO::ItemData*)item2;
40 const std::string& s1(*(data1->attr));
41 const std::string& s2(*(data2->attr));
63 //=====================================================================
65 //=====================================================================
66 ///Comparing function for ordering algorithm. Takes parameters as ints.
67 int wxCALLBACK CompareFunctionInts(long item1, long item2, long sortData)
69 creaImageIO::ItemData* data1 = (creaImageIO::ItemData*)item1;
70 creaImageIO::ItemData* data2 = (creaImageIO::ItemData*)item2;
72 const std::string& s1(*(data1->attr));
73 const std::string& s2(*(data2->attr));
75 int val1=atoi(s1.c_str());
76 int val2=atoi(s2.c_str());
101 //=====================================================================
104 //=====================================================================
105 namespace creaImageIO
107 //=====================================================================
109 WxTreeView::WxTreeView(TreeHandler* handler,
110 GimmickView* gimmick,
113 : wxPanel(parent,id),
114 TreeView(handler,gimmick)
116 GimmickDebugMessage(1,"WxTreeView::WxTreeView"
120 // Split part below toolbar into notebook for views and panel
121 // for preview, messages...
123 // mSplitter = new wxSplitterWindow( this , -1);
126 wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
128 int ctrl_style = wxLC_REPORT | wxLC_VRULES;
129 int col_style = wxLIST_FORMAT_LEFT;
131 // Creating the ListCtrl for the levels > 0 (not for Root level)
133 i < handler->GetTree().GetNumberOfLevels() -1;
137 GimmickDebugMessage(5,"Creating view for level "<<i
140 level.SelectedUpToDate = true;
141 level.SortColumn = 0;
143 // If the first level : parent = this
144 wxWindow* sparent = this;
145 // else parent = last splitter
147 sparent = mLevelList[i-1].wxSplitter;
149 level.wxSplitter = new wxSplitterWindow( sparent , -1);
152 level.wxSplitter->Show(false);
154 // level.wxSplitter->SetMinimumPaneSize(100);
156 wxListCtrl* ctrl = new wxListCtrl(level.wxSplitter,
162 level.wxSplitter->Initialize(ctrl);
164 // Create the columns : one for each attribute of the level
168 tree::LevelDescriptor::AttributeDescriptorListType::const_iterator a;
169 for (a = handler->GetTree().GetAttributeDescriptorList(i+1).begin();
170 a != handler->GetTree().GetAttributeDescriptorList(i+1).end();
175 GimmickDebugMessage(5,"Creating column "<<col<<" : "
179 if(a->GetFlags()!=creaImageIO::tree::AttributeDescriptor::PRIVATE)
182 if(a->GetName()=="UNKNOWN")
185 title += handler->GetTree().GetLevelDescriptor(i+1).GetName();
186 if (title[title.size()-1]!='s')
194 std::string temp = a->GetKey();
195 if (temp.compare("ID") != 0)
198 ctrl->InsertColumn(col,
203 level.key.push_back(a->GetKey());
208 mLevelList.push_back(level);
214 wxMenuItem* m1=menu->Append(wxID_ANY, _T("&Sort ascending"));
215 wxMenuItem* m2=menu->Append(wxID_ANY, _T("&Sort descending"));
216 wxMenuItem* m3=menu->Append(wxID_ANY, _T("&Filter"));
217 mAscendingID=m1->GetId();
218 mDescendingID=m2->GetId();
219 mFilterID=m3->GetId();
220 Connect( mAscendingID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnPopupSort) );
221 Connect( mDescendingID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnPopupSort) );
222 Connect( mFilterID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(WxTreeView::OnPopupFilter) );
224 #endif // wxUSE_MENUS
227 /// Initialize the first level splitter
229 sizer->Add( mLevelList[0].wxSplitter ,1, wxGROW ,0);
230 // mColumnSelected=1;
235 mIgnoreSelectedChanged = false;
237 //CreateColorPalette();
245 //=====================================================================
247 //=====================================================================
249 WxTreeView::~WxTreeView()
251 GimmickDebugMessage(1,"WxTreeView::~WxTreeView"
254 //=====================================================================
258 //=====================================================================
259 const std::vector<tree::Node*>& WxTreeView::GetSelected(int level)
261 // if (GetSelectedUpToDate(level))
264 // the selection of upper level
265 std::vector<tree::Node*>& sel(mLevelList[level-1].Selected);
270 sel.push_back(GetTreeHandler()->GetTree().GetTree());
274 int n = GetCtrl(l-1)->GetItemCount();
275 for (int i = 0; i < n; i++)
277 if ( GetCtrl(l-1)->GetItemState(i,wxLIST_STATE_SELECTED))
279 long adr = GetCtrl(l-1)->GetItemData(i);
280 tree::Node* n = ((ItemData*)adr)->node;
283 std::vector<tree::Node*>::iterator it;
285 it = sel.insert ( it , n );
301 // return mLevelList[level-1].Selected;
305 //=====================================================================
307 //=====================================================================
308 ///Removes selected nodes on last selected level
310 void WxTreeView::RemoveSelected()
312 unsigned int tempLevel = mLastLevel;
314 const std::vector<tree::Node*>& sel=GetSelected(mLastLevel+1);
315 // if no selection, no remove action.
319 std::stringstream out;
320 std::string levelName=GetTreeHandler()->GetTree().GetLevelDescriptor(mLastLevel).GetName();
323 if(sel.size()>1&&levelName.at(levelName.size()-1)!='s')
330 out<<" "<<GetTreeHandler()->GetTree().GetLevelDescriptor(mLastLevel).GetName()<<"?";
332 if (wxMessageBox(crea::std2wx(out.str()),
334 wxYES_NO,this ) == wxYES)
340 GetGimmickView()->modifyValidationSignal(false);
341 bool needRefresh=false;
342 std::vector<tree::Node*>::const_iterator i;
343 for (i=sel.begin(); i!=sel.end(); ++i)
350 if((*i)->GetParent()->GetNumberOfChildren()<2)
354 GetTreeHandler()->Remove(*i);
357 if(needRefresh && mLastLevel>1)
359 UpdateLevel(mLastLevel-2);
361 else if(mLastLevel>1)
363 UpdateLevel(mLastLevel-1);
367 UpdateLevel(mLastLevel);
373 // no need to incremente level
374 mLastLevel = tempLevel;
380 //=====================================================================
383 //=====================================================================
384 /// Updates a level of the view (adds or removes children, etc.)
385 void WxTreeView::UpdateLevel( int level )
387 GimmickDebugMessage(1,
388 GetTreeHandler()->GetTree().GetLabel()
389 <<"WxTreeView::UpdateLevel(level "
395 RecursiveUpdateLevel(level);
397 for (i=0; i<level-1; i++)
399 if (!GetSplitter(i)->IsSplit())
400 GetSplitter(i)->SplitVertically( GetCtrl(i), GetSplitter(i+1),
403 if (GetSplitter(i)->IsSplit()) GetSplitter(i)->Unsplit();
406 //=====================================================================
408 //=====================================================================
409 /// Recursive method called upon by UpdateLevel to refresh all windows
410 void WxTreeView::RecursiveUpdateLevel( int level )
412 GimmickDebugMessage(1,
413 GetTreeHandler()->GetTree().GetLabel()
414 <<"WxTreeView::RecursiveUpdateLevel(level "
419 const std::vector<tree::Node*>& sel(GetSelected(level));
423 // to speed up inserting we hide the control temporarily
425 GetCtrl(l)->DeleteAllItems();
427 std::vector<tree::Node*>::const_iterator i;
429 for (i=sel.begin(); i!=sel.end(); ++i)
431 GimmickDebugMessage(1,
432 "adding children of '"
438 //Adds items and sets their attributes
440 GetTreeHandler()->LoadChildren(*i,1);
441 tree::Node::ChildrenListType::reverse_iterator j;
442 for (j = (*i)->GetChildrenList().rbegin();
443 j!= (*i)->GetChildrenList().rend();
446 GimmickDebugMessage(1,
453 item.SetMask(wxLIST_MASK_STATE |
455 // wxLIST_MASK_IMAGE |
457 // wxLIST_MASK_WIDTH |
461 ItemData* data = new ItemData;
469 GetCtrl(l)->InsertItem(item);
472 for (int k=0; k<GetCtrl(l)->GetColumnCount(); ++k)
475 // Temporary correction : it works but no explanation about the problem FCY
477 val = (*j)->GetAttribute("NumberOfChildren");
479 val = (*j)->GetAttribute(mLevelList[l].key[k]);
480 if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isDateEntry()) // Date
482 boost::gregorian::date d1(boost::gregorian::from_undelimited_string(val));
483 val = to_iso_extended_string(d1);
485 else if(((*j)->GetAttributeDescriptor(mLevelList[l].key[k])).isTimeEntry()) // Time
487 if (val != "" || val != " ")
488 val = val.substr(0,2) + " : " + val.substr(2,2) + " : " + val.substr(4,2);
494 if (val.size()==0) val = "?";
495 item.SetText( crea::std2wx(val));
497 GetCtrl(l)->SetItem(item);
506 //=====================================================================
509 //================================================================
510 void WxTreeView::OnItemDeSelected(wxListEvent& event)
512 GimmickDebugMessage(1,
513 GetTreeHandler()->GetTree().GetLabel()
514 <<" WxTreeView::OnItemDeselected"<<std::endl);
515 // retrieve the level
516 wxObject* obj = event.GetEventObject();
517 unsigned int level = 0;
518 for (level = 0; level<mLevelList.size(); ++level)
520 if ( GetCtrl(level) == obj ) break;
522 SetSelectedUpToDate(level,false);
523 // to allow a first selection in images TreeView
524 if (level==mLevelList.size()-1)
525 OnItemSelected(event);
527 //================================================================
529 //================================================================
530 void WxTreeView::OnItemSelected(wxListEvent& event)
532 GimmickDebugMessage(1,
533 GetTreeHandler()->GetTree().GetLabel()
534 <<" WxTreeView::OnItemSelected"<<std::endl);
536 if (mIgnoreSelectedChanged)
538 GimmickDebugMessage(1,
539 " mIgnoreSelectedChanged true: returning"
547 info.m_itemId = event.m_itemIndex;
548 mLastSelected = event.m_itemIndex;
549 // retrieve the level
550 wxObject* obj = event.GetEventObject();
551 unsigned int level = 0;
552 for (level = 0; level<mLevelList.size(); ++level)
554 if ( GetCtrl(level) == obj ) break;
557 GimmickDebugMessage(1,
561 // Update the children level (if selection not at last level)
562 if (level<mLevelList.size()-1)
565 UpdateLevel( level + 2 );
566 // Reset the viewer setting the default image
567 GetGimmickView()->ClearSelection();
569 // Select all images if the selection is at series level
570 if (level==mLevelList.size()-2) SelectAll(level+1);
571 // Validate selected images if the selection is at image level
572 if (level==(mLevelList.size()-1)) //&&mProcess)
574 if(event.GetEventType()==10145)
576 ValidateSelectedImages (true);
580 ValidateSelectedImages (false);
585 //================================================================
587 //================================================================
588 void WxTreeView::SelectAll(int level)
591 // int level=mLevelList.size()-1;
594 item = GetCtrl(level)->GetNextItem(item,
599 if(item==(GetCtrl(level)->GetItemCount()-1))
601 mIgnoreSelectedChanged = false;//mProcess=true;
605 mIgnoreSelectedChanged = true;// mProcess=false;
607 GetCtrl(level)->SetItemState(item,wxLIST_STATE_SELECTED, wxLIST_MASK_STATE
608 | wxLIST_MASK_TEXT |wxLIST_MASK_IMAGE | wxLIST_MASK_DATA | wxLIST_MASK_WIDTH | wxLIST_MASK_FORMAT);
612 //================================================================
613 //================================================================
615 void WxTreeView::OnColClick(wxListEvent& event)
617 mColumnSelected = event.m_col;
619 clientpt.x = wxGetMousePosition().x - this->GetScreenPosition().x;
620 clientpt.y = wxGetMousePosition().y - this->GetScreenPosition().y;
621 senderCtrl = event.GetEventObject();
622 unsigned int level = 0;
623 for (level = 0; level<mLevelList.size(); ++level)
625 if ( GetCtrl(level) == senderCtrl ) break;
627 PopupMenu(menu, clientpt);
631 //================================================================
632 //================================================================
634 void WxTreeView::OnPopupFilter(wxCommandEvent& event)
637 GimmickDebugMessage(7,
638 "WxTreeView::OnEndLabelEdit"
640 wxObject* ctrl = event.GetEventObject();
641 unsigned int level = 0;
642 for (level = 0; level<mLevelList.size(); ++level)
644 if ( GetCtrl(level) == senderCtrl ) break;
646 std::string filter = crea::wx2std(wxGetTextFromUser(_T("Enter the filter to apply"), _T("Filter On Column")));
651 UpdateLevel(level+1);
653 std::vector<long> items;
658 it = GetCtrl(level)->GetNextItem(it,
663 long adr = GetCtrl(level)->GetItemData(it);
664 tree::Node* nod = ((ItemData*)adr)->node;
665 att=(*nod).GetAttribute(mLevelList[level].key[mColumnSelected]);
668 if(att.find(filter)>900)
680 items.push_back(it-del);
684 std::vector<long>::iterator iter;
685 for(iter=items.begin();iter!=items.end();++iter)
687 GetCtrl(level)->DeleteItem(*iter);
689 GetGimmickView()->ClearSelection();
691 //================================================================
693 //================================================================
694 void WxTreeView::OnPopupSort(wxCommandEvent& event)
697 unsigned int level = 0;
698 for (level = 0; level<mLevelList.size(); ++level)
700 if ( GetCtrl(level) == senderCtrl ) break;
702 mLevelList[level].SortColumn = mColumnSelected;
704 if(event.GetId()==mAscendingID)
706 mLevelList[level].SortAscending = true;
708 else if(event.GetId()==mDescendingID)
710 mLevelList[level].SortAscending = false;
715 //================================================================
717 //================================================================
718 void WxTreeView::SortLevel(int level)
720 GimmickDebugMessage(1,
721 "WxTreeView::SortLevel("
724 //Obtain the column name and the level that needs to be organized
726 // int l = level - 1;
727 //Sets the data for the items to be sorted
731 int n = GetCtrl(level)->GetItemCount();
732 for (int i = 0; i < n; i++)
735 //Gets current item data
736 ItemData* data = (ItemData*)GetCtrl(level)->GetItemData(i);
738 //Extracts the node and the type of attribute
739 tree::Node* nod = data->node;
742 (*nod).GetAttributeDescriptor
743 (mLevelList[level].key[mLevelList[level].SortColumn])
746 //Obtains the organizing attribute
747 data->attr = & (*nod).GetAttribute
748 (mLevelList[level].key[mLevelList[level].SortColumn]);
750 data->selected = false;
751 if (GetCtrl(level)->GetItemState(i,wxLIST_STATE_SELECTED)>0)
753 data->selected = true;
758 GimmickDebugMessage(1,
759 "WxTreeView::OnSort : "
760 <<nbselected<<" selected before sorting"
763 mIgnoreSelectedChanged = true;
765 if (mLevelList[level].SortAscending)
770 GetCtrl(level)->SortItems(CompareFunctionInts, 0);
774 GetCtrl(level)->SortItems(CompareFunctionStrings, 0);
782 GetCtrl(level)->SortItems(CompareFunctionInts, 1);
786 GetCtrl(level)->SortItems(CompareFunctionStrings, 1);
791 // Reselects the unselected
792 n = GetCtrl(level)->GetItemCount();
794 for (int i = 0; i < n; i++)
797 //Gets current item data
798 ItemData* data = (ItemData*)GetCtrl(level)->GetItemData(i);
803 // item = GetCtrl(level)->GetNextItem(item,wxLIST_NEXT_ALL);
804 // if ( item == -1 ) break;
805 //Gets current item data
806 // ItemData* data = (ItemData*)GetCtrl(level)->GetItemData(item);
814 // if it is the last one we must process the selection
815 mIgnoreSelectedChanged = false;
817 GetCtrl(level)->SetItemState(i,
818 wxLIST_STATE_SELECTED,
824 | wxLIST_MASK_FORMAT);
826 if (GetCtrl(level)->GetItemState(i,wxLIST_STATE_SELECTED)>0)
833 mIgnoreSelectedChanged = false;
834 GimmickDebugMessage(1,
835 "WxTreeView::SortLevel : "
836 <<after<<" selected after sorting"
840 //================================================================
843 //================================================================
844 void WxTreeView::ValidateSelectedImages(bool isSelection)
846 GimmickDebugMessage(7,
847 "WxTreeView::ValidateSelectedImages"
849 const std::vector<tree::Node*>& sel(GetSelected(mLevelList.size()+1));
850 GetGimmickView()->OnSelectionChange(sel,
851 isSelection,(mLastSelected-1),
852 !mIgnoreSelectedChanged);
855 //================================================================
858 //================================================================
859 void WxTreeView::GetNodes(std::vector<tree::Node*>& nodes, bool direction)
861 long item = mLastSelected;
862 int level=mLevelList.size()-1;
863 //Gets current item data
864 long adr = GetCtrl(level)->GetItemData(item);
866 tree::Node* nod = ((ItemData*)adr)->node;
871 item = GetCtrl(level)->GetNextItem(item,
876 item = GetCtrl(level)->GetNextItem(item,
879 if ( item == -1 || item==0 )
883 if(GetCtrl(level)->GetItemState(item, wxLIST_STATE_SELECTED)==0 )
885 adr = GetCtrl(level)->GetItemData(item);
886 nod = ((ItemData*)adr)->node;
887 nodes.push_back(nod);
892 //================================================================
893 //=================================================
894 void WxTreeView::OnKeyDown(wxListEvent &event)
896 if(event.GetKeyCode() == WXK_DELETE)
901 GetGimmickView()->ClearSelection();
905 //================================================================
907 //================================================================
908 // Should be in another place : not specific !
909 void WxTreeView::GetSelectedAsString(std::vector<std::string>&s)
911 int level=mLevelList.size();
912 const std::vector<tree::Node*>& sel=GetSelected(level+1);
913 std::vector<tree::Node*>::const_iterator i;
915 for (i=sel.begin(); i!=sel.end(); ++i)
917 std::string filename=(*i)->GetAttribute("FullFileName");
918 s.push_back(filename);
922 //================================================================
923 void WxTreeView::SetColor(int l, int item)
926 GetCtrl(l)->SetItemTextColour(item, wxColourDatabase().Find
927 (crea::std2wx(mColorPalette[colorId])));
928 GetCtrl(l)->SetItemState(item,wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED, wxLIST_STATE_SELECTED); /*
930 //Setting the color according to the parent
933 item.SetBackgroundColour
934 (wxColourDatabase().Find
935 (crea::std2wx(mColorPalette[colorId])));
938 (*j,wxColourDatabase().Find
939 (crea::std2wx(mColorPalette[colorId]))));
949 else if(l!=mLevelList.size()-1)
951 item.SetBackgroundColour(mColorMap[*i]);
952 mColorMap.insert(NodeColorPair(*j,mColorMap[*i]));
956 item.SetBackgroundColour(mColorMap[*i]);
959 //================================================================
960 void WxTreeView::CreateColorPalette()
962 GimmickDebugMessage(6,"WxTreeView::CreateColorPalette");
963 mColorPalette.push_back("WHITE");
964 mColorPalette.push_back("LIGHT GREY");
965 mColorPalette.push_back("AQUAMARINE");
966 mColorPalette.push_back("MEDIUM FOREST GREEN");
967 mColorPalette.push_back("INDIAN RED");
968 mColorPalette.push_back("KHAKI");
969 mColorPalette.push_back("ORANGE");
970 mColorPalette.push_back("LIGHT BLUE");
971 mColorPalette.push_back("LIGHT STEEL BLUE");
972 mColorPalette.push_back("PINK");
973 mColorPalette.push_back("PLUM");
974 mColorPalette.push_back("PURPLE");
975 mColorPalette.push_back("RED");
976 mColorPalette.push_back("SEA GREEN");
977 mColorPalette.push_back("SIENNA");
978 mColorPalette.push_back("SKY BLUE");
979 mColorPalette.push_back("SLATE BLUE");
980 mColorPalette.push_back("SPRING GREEN");
981 mColorPalette.push_back("TAN");
982 mColorPalette.push_back("THISTLE");
983 mColorPalette.push_back("TURQUOISE");
984 mColorPalette.push_back("VIOLET");
985 mColorPalette.push_back("VIOLET RED");
986 mColorPalette.push_back("WHEAT");
987 mColorPalette.push_back("YELLOW");
988 mColorPalette.push_back("YELLOW GREEN");
989 mColorPalette.push_back("BLUE");
990 mColorPalette.push_back("BLUE VIOLET");
991 mColorPalette.push_back("BROWN");
992 mColorPalette.push_back("CADET BLUE");
993 mColorPalette.push_back("CORAL");
994 mColorPalette.push_back("CORNFLOWER BLUE");
995 mColorPalette.push_back("CYAN");
996 mColorPalette.push_back("DARK GREY");
997 mColorPalette.push_back("DARK GREEN");
998 mColorPalette.push_back("DARK OLIVE GREEN");
999 mColorPalette.push_back("DARK ORCHID");
1000 mColorPalette.push_back("DARK SLATE BLUE");
1001 mColorPalette.push_back("DARK SLATE GREY");
1002 mColorPalette.push_back("DARK TURQUOISE");
1003 mColorPalette.push_back("FIREBRICK");
1004 mColorPalette.push_back("FOREST GREEN");
1005 mColorPalette.push_back("GOLD");
1006 mColorPalette.push_back("GOLDENROD");
1007 mColorPalette.push_back("GREY");
1008 mColorPalette.push_back("GREEN");
1009 mColorPalette.push_back("GREEN YELLOW");
1010 mColorPalette.push_back("LIME GREEN");
1011 mColorPalette.push_back("MAGENTA");
1012 mColorPalette.push_back("MAROON");
1013 mColorPalette.push_back("MEDIUM AQUAMARINE");
1014 mColorPalette.push_back("MEDIUM BLUE");
1015 mColorPalette.push_back("MEDIUM GOLDENROD");
1016 mColorPalette.push_back("MEDIUM ORCHID");
1017 mColorPalette.push_back("MEDIUM SEA GREEN");
1018 mColorPalette.push_back("MEDIUM SLATE BLUE");
1019 mColorPalette.push_back("MEDIUM SPRING GREEN");
1020 mColorPalette.push_back("MEDIUM TURQUOISE");
1021 mColorPalette.push_back("MEDIUM VIOLET RED");
1022 mColorPalette.push_back("MIDNIGHT BLUE");
1023 mColorPalette.push_back("NAVY");
1024 mColorPalette.push_back("ORANGE RED");
1025 mColorPalette.push_back("ORCHID, PALE GREEN");
1026 mColorPalette.push_back("STEEL BLUE");
1027 mColorPalette.push_back("BLACK");
1031 //================================================================
1032 BEGIN_EVENT_TABLE(WxTreeView, wxPanel)
1034 EVT_SIZE(MyFrame::OnSize)
1036 EVT_MENU(LIST_QUIT, MyFrame::OnQuit)
1037 EVT_MENU(LIST_ABOUT, MyFrame::OnAbout)
1038 EVT_MENU(LIST_LIST_VIEW, MyFrame::OnListView)
1039 EVT_MENU(LIST_REPORT_VIEW, MyFrame::OnReportView)
1040 EVT_MENU(LIST_ICON_VIEW, MyFrame::OnIconView)
1041 EVT_MENU(LIST_ICON_TEXT_VIEW, MyFrame::OnIconTextView)
1042 EVT_MENU(LIST_SMALL_ICON_VIEW, MyFrame::OnSmallIconView)
1043 EVT_MENU(LIST_SMALL_ICON_TEXT_VIEW, MyFrame::OnSmallIconTextView)
1044 EVT_MENU(LIST_VIRTUAL_VIEW, MyFrame::OnVirtualView)
1045 EVT_MENU(LIST_SMALL_VIRTUAL_VIEW, MyFrame::OnSmallVirtualView)
1047 EVT_MENU(LIST_FOCUS_LAST, MyFrame::OnFocusLast)
1048 EVT_MENU(LIST_TOGGLE_FIRST, MyFrame::OnToggleFirstSel)
1049 EVT_MENU(LIST_DESELECT_ALL, MyFrame::OnDeselectAll)
1050 EVT_MENU(LIST_SELECT_ALL, MyFrame::OnSelectAll)
1051 EVT_MENU(LIST_DELETE, MyFrame::OnDelete)
1052 EVT_MENU(LIST_ADD, MyFrame::OnAdd)
1053 EVT_MENU(LIST_EDIT, MyFrame::OnEdit)
1054 EVT_MENU(LIST_DELETE_ALL, MyFrame::OnDeleteAll)
1055 EVT_MENU(LIST_SORT, MyFrame::OnSort)
1056 EVT_MENU(LIST_SET_FG_COL, MyFrame::OnSetFgColour)
1057 EVT_MENU(LIST_SET_BG_COL, MyFrame::OnSetBgColour)
1058 EVT_MENU(LIST_TOGGLE_MULTI_SEL, MyFrame::OnToggleMultiSel)
1059 EVT_MENU(LIST_SHOW_COL_INFO, MyFrame::OnShowColInfo)
1060 EVT_MENU(LIST_SHOW_SEL_INFO, MyFrame::OnShowSelInfo)
1061 EVT_MENU(LIST_FREEZE, MyFrame::OnFreeze)
1062 EVT_MENU(LIST_THAW, MyFrame::OnThaw)
1063 EVT_MENU(LIST_TOGGLE_LINES, MyFrame::OnToggleLines)
1064 EVT_MENU(LIST_MAC_USE_GENERIC, MyFrame::OnToggleMacUseGeneric)
1066 EVT_UPDATE_UI(LIST_SHOW_COL_INFO, MyFrame::OnUpdateShowColInfo)
1067 EVT_UPDATE_UI(LIST_TOGGLE_MULTI_SEL, MyFrame::OnUpdateToggleMultiSel)
1070 BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
1071 EVT_LIST_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnBeginDrag)
1072 EVT_LIST_BEGIN_RDRAG(LIST_CTRL, MyListCtrl::OnBeginRDrag)
1074 EVT_LIST_BEGIN_LABEL_EDIT(-1, WxTreeView::OnBeginLabelEdit)
1075 EVT_LIST_END_LABEL_EDIT(-1, WxTreeView::OnEndLabelEdit)
1077 EVT_LIST_DELETE_ITEM(LIST_CTRL, MyListCtrl::OnDeleteItem)
1078 EVT_LIST_DELETE_ALL_ITEMS(LIST_CTRL, MyListCtrl::OnDeleteAllItems)
1079 #if WXWIN_COMPATIBILITY_2_4
1080 EVT_LIST_GET_INFO(LIST_CTRL, MyListCtrl::OnGetInfo)
1081 EVT_LIST_SET_INFO(LIST_CTRL, MyListCtrl::OnSetInfo)
1084 EVT_LIST_KEY_DOWN(-1, WxTreeView::OnKeyDown)
1085 EVT_LIST_ITEM_SELECTED(-1, WxTreeView::OnItemSelected)
1087 EVT_LIST_ITEM_DESELECTED(-1, WxTreeView::OnItemDeSelected)
1089 EVT_LIST_KEY_DOWN(LIST_CTRL, MyListCtrl::OnListKeyDown)
1090 EVT_LIST_ITEM_ACTIVATED(LIST_CTRL, MyListCtrl::OnActivated)
1091 EVT_LIST_ITEM_FOCUSED(LIST_CTRL, MyListCtrl::OnFocused)
1093 EVT_LIST_COL_RIGHT_CLICK(-1, WxTreeView::OnColClick)
1095 EVT_LIST_COL_CLICK(-1, WxTreeView::OnColClick)
1097 //EVT_LEFT_DOWN(WxTreeView::OnMouseClick)
1099 EVT_LIST_COL_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnColBeginDrag)
1100 EVT_LIST_COL_DRAGGING(LIST_CTRL, MyListCtrl::OnColDragging)
1101 EVT_LIST_COL_END_DRAG(LIST_CTRL, MyListCtrl::OnColEndDrag)
1103 EVT_LIST_CACHE_HINT(LIST_CTRL, MyListCtrl::OnCacheHint)
1105 #if USE_CONTEXT_MENU
1106 EVT_CONTEXT_MENU(MyListCtrl::OnContextMenu)
1108 EVT_CHAR(MyListCtrl::OnChar)
1110 EVT_RIGHT_DOWN(MyListCtrl::OnRightClick)
1114 } // EO namespace creaImageIO