ecConfigItem *ecConflictListCtrl::AssociatedItem(int nRow,int nCol) { const CdlConflict conflict = (CdlConflict) GetItemData (nRow); wxASSERT (conflict != NULL); ecConfigItem *pItem=NULL; switch(nCol) { case 2: { const CdlGoalExpression goal = dynamic_cast<CdlGoalExpression> (conflict->get_property ()); if (! goal) // if the item is not a goal expression break; // do nothing const CdlExpression expression = goal->get_expression (); if (1 == expression->references.size ()) // if the property contains a single reference { // assume that the reference is to another user visible node and try to find it const wxString strName(expression->references [0].get_destination_name ().c_str()); pItem = wxGetApp().GetConfigToolDoc ()->Find(strName); } } break; case 0: pItem = wxGetApp().GetConfigToolDoc ()->Find(wxString(conflict->get_node ()->get_name ().c_str())); break; default: break; } return pItem; }
void ecPropertyListCtrl::OnDoubleClick(wxMouseEvent& event) { // Double-clicked the item int flags; long item = HitTest(event.GetPosition(), flags); if (item > -1) { const wxString strText = wxListCtrlGetItemTextColumn(*this, item,0); if(strText == wxT("File")){ m_pti->ViewHeader(); } else if (strText == wxT("URL")) { m_pti->ViewURL(); } } // TODO #if 0 int pos=GetMessagePos(); CPoint pt(GET_X_LPARAM(pos),GET_Y_LPARAM(pos)); ScreenToClient(&pt); int nItem=HitTest(pt,NULL); if(GetItemData(nItem)>1){ // This is a property row const CdlGoalExpression goal = dynamic_cast<CdlGoalExpression> ((CdlProperty) GetItemData (nItem)); if (goal){ // This is a rule row const CdlExpression expression = goal->get_expression (); if (1 == expression->references.size ()) // if the property contains a single reference { // assume that the reference is to another user visible node and try to find it std::string macro_name = expression->references [0].get_destination_name (); CConfigItem * pItem = CConfigTool::GetConfigToolDoc ()->Find (CString (macro_name.c_str ())); if (pItem) // the referenced node was found so select it { CConfigTool::GetControlView()->GetTreeCtrl().SelectItem(pItem->HItem()); } } } } else { const CString strText(GetItemText(nItem,0)); if(strText==FieldTypeImage[File]){ m_pti->ViewHeader(); } else if (strText==FieldTypeImage[URL]) { m_pti->ViewURL(); } } #endif event.Skip(); }
void CPropertiesList::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult) { // Double-clicked the item // We do not use the parameters on the OnDblClk handlers in order to preserve compatibility // between pre- and post-4.71 comctrl32.dll versions. int pos=GetMessagePos(); CPoint pt(GET_X_LPARAM(pos),GET_Y_LPARAM(pos)); ScreenToClient(&pt); int nItem=HitTest(pt,NULL); if(GetItemData(nItem)>1){ // This is a property row const CdlGoalExpression goal = dynamic_cast<CdlGoalExpression> ((CdlProperty) GetItemData (nItem)); if (goal){ // This is a rule row const CdlExpression expression = goal->get_expression (); if (1 == expression->references.size ()) // if the property contains a single reference { // assume that the reference is to another user visible node and try to find it std::string macro_name = expression->references [0].get_destination_name (); CConfigItem * pItem = CConfigTool::GetConfigToolDoc ()->Find (CString (macro_name.c_str ())); if (pItem) // the referenced node was found so select it { CConfigTool::GetControlView()->GetTreeCtrl().SelectItem(pItem->HItem()); } } } } else { const CString strText(GetItemText(nItem,0)); if(strText==FieldTypeImage[File]){ m_pti->ViewHeader(); } else if (strText==FieldTypeImage[URL]) { m_pti->ViewURL(); } } UNUSED_ALWAYS(pResult); UNUSED_ALWAYS(pNMHDR); }