Example #1
0
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();
}
Example #2
0
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);
}