X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fsrc%2FbbtkWxGUIPackageBrowser2.cxx;h=67b46851c3379ac6e5a72c202625152637cff3e8;hb=f100e08be509bf719146f96c717567f858022648;hp=21fc26d2e584a6a39bd9453a682bb83572a31f10;hpb=e269992d2d446784afc40073782311deaa25008f;p=bbtk.git diff --git a/kernel/src/bbtkWxGUIPackageBrowser2.cxx b/kernel/src/bbtkWxGUIPackageBrowser2.cxx index 21fc26d..67b4685 100644 --- a/kernel/src/bbtkWxGUIPackageBrowser2.cxx +++ b/kernel/src/bbtkWxGUIPackageBrowser2.cxx @@ -133,7 +133,7 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) EnableContextMenu(); #endif } - + void WxGUIBlackBoxList::Insert(BlackBoxDescriptor::Pointer d) { if (GetColumnCount()!=3) @@ -170,6 +170,7 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) */ } + void WxGUIBlackBoxList::OnCacheHint(wxListEvent& event) { @@ -260,7 +261,7 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) info.m_itemId = event.m_itemIndex; info.m_col = 0; info.m_mask = wxLIST_MASK_DATA; - wxString sendtext(_T("")); + wxString sendtext(_T("")); if ( GetItem(info) ) { // TO DO : STORE SMART PTR ? @@ -270,16 +271,19 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) //DFGO -> To identify it is a box sendtext += crea::std2wx("box:"); sendtext += crea::std2wx(d->GetFullTypeName()); + sendtext += _T(""); +// printf("EED WxGUIBlackBoxList::OnBeginDrag <%s>%d <%s>%d\n", (const char*)sendtext.mb_str(),sendtext.Len() , d->GetFullTypeName().c_str() , d->GetFullTypeName().length() ); } - } - else - { + + } else { wxFAIL_MSG(wxT("wxListCtrl::GetItem() failed")); } wxTextDataObject tdo(sendtext); +// printf("EED WxGUIBlackBoxList::OnBeginDrag <%s>\n",(const char*) tdo.GetText().mb_str() ); + wxDropSource tds(tdo, this); - tds.DoDragDrop(); + tds.DoDragDrop( ); // const wxPoint& pt = event.m_pointDrag; @@ -609,6 +613,7 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) //================================================================ WxGUIBlackBoxInfo::WxGUIBlackBoxInfo(wxWindow* parent) : +// wxPanel(parent, -1,wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE), wxPanel(parent, -1), mDescriptor() { @@ -623,9 +628,7 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) mCategory = new wxStaticText(this,-1,_T("")); sizer->Add(mCategory,0,wxGROW); - wxBoxSizer *inputs = - new wxStaticBoxSizer - ( new wxStaticBox(this, wxID_ANY, _T("Inputs")), wxVERTICAL ); + wxBoxSizer *inputs = new wxStaticBoxSizer ( new wxStaticBox(this, wxID_ANY, _T("Inputs")), wxVERTICAL ); mInputList = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, @@ -635,24 +638,35 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) inputs->Add(mInputList,1,wxGROW); sizer->Add(inputs,1,wxGROW); - wxBoxSizer *outputs = - new wxStaticBoxSizer - ( new wxStaticBox(this, wxID_ANY, _T("Outputs")), wxVERTICAL ); + wxBoxSizer *outputs = new wxStaticBoxSizer ( new wxStaticBox(this, wxID_ANY, _T("Outputs")), wxVERTICAL ); mOutputList = new wxListCtrl(this, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT //wxLC_LIST - | wxSUNKEN_BORDER); + | wxBORDER_SUNKEN); +// | wxFULL_REPAINT_ON_RESIZE | wxVSCROLL); outputs->Add(mOutputList,1,wxGROW); sizer->Add(outputs,1,wxGROW); SetSizer(sizer); +// sizer->FitInside(this); + Connect( this->GetId(), wxEVT_ERASE_BACKGROUND , (wxObjectEventFunction) (void (WxGUIBlackBoxInfo::*)(wxEvent&)) &WxGUIBlackBoxInfo::OnEraseBackGround ); + + SetAutoLayout(true); Layout(); } //================================================================ + + void WxGUIBlackBoxInfo::OnEraseBackGround( wxEvent& ) + { + mInputList->ClearBackground(); + mOutputList->ClearBackground(); + } + + //================================================================ void WxGUIBlackBoxInfo::UpdateInfo(BlackBoxDescriptor* descr) @@ -807,6 +821,17 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) id_fc3 }; + //================================================================ + void WxGUIPackageBrowser2::OnEraseBackGround( wxEvent& ) + { + mBoxList->ClearBackground(); + ClearBackground(); + Refresh(); +// Update(); + } + //================================================================ + + //================================================================ WxGUIPackageBrowser2::WxGUIPackageBrowser2( wxWindow *parent, WxGUIPackageBrowser2User* user ) @@ -824,8 +849,8 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) wxLC_REPORT //wxLC_LIST | wxSUNKEN_BORDER); mBoxList->SetUser(this); - mBoxList->SetBackgroundColour(*wxWHITE); + Connect( GetId(), wxEVT_SIZE , (wxObjectEventFunction) (void (WxGUIPackageBrowser2::*)(wxEvent&)) &WxGUIPackageBrowser2::OnEraseBackGround ); // JGRR & CM DISABLED CLOSE BUTTON m_mgr.AddPane(mBoxList, @@ -961,8 +986,9 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) Layout(); } - //================================================================ + + //================================================================ Factory::Pointer WxGUIPackageBrowser2::GetFactory() { return mFactory; @@ -1040,9 +1066,9 @@ int wxCALLBACK MyCompareFunction(long item1, long item2, long WXUNUSED(sortData) //================================================================ void WxGUIPackageBrowser2::RebuildList() { - mBoxList->Hide(); +// mBoxList->Hide(); mBoxList->ClearAll(); - + mBoxList->ClearBackground(); const Factory::PackageMapType& M = mFactory->GetPackageMap(); Factory::PackageMapType::const_iterator i; for (i=M.begin();i!=M.end();++i)