GimmickDebugMessage(1,
" Level "<<level+1
<<std::endl);
-
- GimmickMessage(1,
- " Event type "<<event.GetEventType()
- <<std::endl);
/*
if(event.m_itemIndex!=0)
{*/
{
if ( GetCtrl(level) == senderCtrl ) break;
}
- clientpt.x+=(mColumnSelected)*(GetCtrl(0)->GetColumnWidth(mColumnSelected));
+ for(int i=0;i<mColumnSelected;i++)
+ {
+ clientpt.x+=GetCtrl(level)->GetColumnWidth(i);
+ }
for(int i=0;i<level;i++)
{
clientpt.x+=GetSplitter(i)->GetSashPosition();
}
}
- //================================================================
- void WxTreeView::OnBeginLabelEdit(wxListEvent& event)
- {
- GimmickDebugMessage(7,
- "WxTreeView::OnBeginLabelEdit"
- <<std::endl);
- if(event.m_itemIndex!=0)
- {
- event.Veto();
- }
-
- }
-
- //================================================================
- void WxTreeView::OnEndLabelEdit(wxListEvent& event)
- {
- GimmickDebugMessage(7,
- "WxTreeView::OnEndLabelEdit"
- <<std::endl);
- wxObject* ctrl = event.GetEventObject();
- unsigned int level = 0;
- for (level = 0; level<mLevelList.size(); ++level)
- {
- if ( GetCtrl(level) == ctrl ) break;
- }
- std::string filter = crea::wx2std(event.m_item.m_text.c_str());
-
- std::string att;
-
- long it = -1;
- UpdateLevel(level+1);
-
- for ( ;; )
- {
- bool contains=false;
- it = GetCtrl(level)->GetNextItem(it,
- wxLIST_NEXT_ALL);
- if ( it == -1 )
- break;
- if(it!=0)
- {
- long adr = GetCtrl(level)->GetItemData(it);
- for (int j=1;j<GetCtrl(level)->GetColumnCount()-1&&!contains;j++)
- {
- tree::Node* nod = ((ItemData*)adr)->node;
- att=(*nod).GetAttribute(mLevelList[level].key[j-1]);
-
- if(att.find(filter)<900)
- {
- contains=true;
- }
- }
- if(!contains)
- {
- GetCtrl(level)->DeleteItem(it);
- }
- }
- }
- GetGimmickView()->ClearSelection();
- //GetCtrl(level)->DeleteAllItems();
-
- }
+
//================================================================
void WxTreeView::ValidateSelectedImages(bool isSelection)
{
BEGIN_EVENT_TABLE(MyListCtrl, wxListCtrl)
EVT_LIST_BEGIN_DRAG(LIST_CTRL, MyListCtrl::OnBeginDrag)
EVT_LIST_BEGIN_RDRAG(LIST_CTRL, MyListCtrl::OnBeginRDrag)
- */
+
EVT_LIST_BEGIN_LABEL_EDIT(-1, WxTreeView::OnBeginLabelEdit)
EVT_LIST_END_LABEL_EDIT(-1, WxTreeView::OnEndLabelEdit)
- /*
+
EVT_LIST_DELETE_ITEM(LIST_CTRL, MyListCtrl::OnDeleteItem)
EVT_LIST_DELETE_ALL_ITEMS(LIST_CTRL, MyListCtrl::OnDeleteAllItems)
#if WXWIN_COMPATIBILITY_2_4
/// Callback for column click
void OnColClick(wxListEvent& event);
- /// Callback for first item edition
- void OnBeginLabelEdit(wxListEvent& event);
-
- /// Callback when first item edition ends
- void OnEndLabelEdit(wxListEvent& event);
-
/// Callback when the user needs the items sorted
void OnPopupSort(wxCommandEvent& event);