// Sort function. // The function is passed the client data of the two items, // plus another general client data value which in this case // we use for the column index. int CALLBACK ecRunTestsSummaryDialog::SummarySortFunc(long data1, long data2, long col) { wxString str1 = wxListCtrlGetItemTextColumn(* m_listCtrl, data1, col); wxString str2 = wxListCtrlGetItemTextColumn(* m_listCtrl, data2, col); int ret = str1.CmpNoCase(str2); return ret; }
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(); }