Program: bbtk
Module: $RCSfile: bbtkWxGUIPackageBrowser2.cxx,v $
Language: C++
- Date: $Date: 2009/06/08 14:50:04 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2010/03/25 15:24:50 $
+ Version: $Revision: 1.14 $
=========================================================================*/
/* ---------------------------------------------------------------------
void WxGUIBlackBoxList::OnBeginDrag(wxListEvent& event)
{
+ std::cout<<"RaC DRAG TABLE"<<std::endl;
+ wxString text = this->GetItemText(event.GetIndex());
+ wxListItem info;
+ info.m_itemId = event.m_itemIndex;
+ info.m_col = 0;
+ info.m_mask = wxLIST_MASK_DATA;
+ if ( GetItem(info) )
+ {
+ // TO DO : STORE SMART PTR ?
+ BlackBoxDescriptor* d = (BlackBoxDescriptor*)(info.GetData());
+ if (d!=0)
+ {
+ //mUser->WxGUIBlackBoxListUserOnSelected(d);
+ text = d->GetAuthor();
+ }
+ }
+ else
+ {
+ wxFAIL_MSG(wxT("wxListCtrl::GetItem() failed"));
+ }
+
+
+ wxTextDataObject tdo(wxString::Format("%s %d",text,123456));
+ wxDropSource tds(tdo, this);
+ tds.DoDragDrop();
// const wxPoint& pt = event.m_pointDrag;
//wxLogMessage( wxT("OnBeginDrag at (%d, %d), item %ld."),
void WxGUIPackageBrowser2::WxGUIBlackBoxListUserOnSelected
( BlackBoxDescriptor* d)
{
+ //RaC
+ _actualSelected=d;
+
mBoxInfo->UpdateInfo(d);
std::string title = d->GetPackage()->GetName()+"::"+d->GetTypeName();
m_mgr.GetPane(mBoxInfo).Caption(std2wx(title));
m_mgr.Update();
}
+ //================================================================
+
+ //================================================================
+ BlackBoxDescriptor* WxGUIPackageBrowser2::GetActualSelected()
+ {
+ return _actualSelected;
+ }
+
+
//================================================================
//================================================================
mFactory = F;
RebuildList();
}
+
//================================================================
//================================================================
Program: bbtk
Module: $RCSfile: bbtkWxGUIPackageBrowser2.h,v $
Language: C++
- Date: $Date: 2008/10/17 08:18:15 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2010/03/25 15:24:50 $
+ Version: $Revision: 1.7 $
=========================================================================*/
/* ---------------------------------------------------------------------
#include "bbtkInterpreter.h"
#include <wx/aui/aui.h>
+//Drag and drop
+#include <wx/dnd.h>
+#include <wx/dataobj.h>
#include "wx/listctrl.h"
// not all ports have support for EVT_CONTEXT_MENU yet, don't define
// USE_CONTEXT_MENU for those which don't
// User callback when a box is selected in the list
void WxGUIBlackBoxListUserOnSelected( BlackBoxDescriptor* );
+
+ //RaC
+ BlackBoxDescriptor* GetActualSelected();
private:
wxAuiManager m_mgr;
wxCheckBox* mShowAdaptorsFilter;
wxCheckBox* mShowGUIsFilter;
+ //RaC
+ BlackBoxDescriptor *_actualSelected;
+
DECLARE_EVENT_TABLE()
};
//================================================================