Skip to content

Commit

Permalink
use FWCompactVerticalLayout and listen for FWEventItem changes so tha…
Browse files Browse the repository at this point in the history
…t Layout can be rerun
  • Loading branch information
Dr15Jones committed Mar 18, 2009
1 parent f691c67 commit 8ae8843
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Fireworks/Core/interface/FWSummaryManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
// Original Author: Chris Jones
// Created: Tue Mar 4 09:35:58 EST 2008
// $Id: FWSummaryManager.h,v 1.5 2009/01/23 21:35:41 amraktad Exp $
// $Id: FWSummaryManager.h,v 1.6 2009/03/04 17:07:27 chrjones Exp $
//

// system include files
Expand Down Expand Up @@ -66,6 +66,7 @@ class FWSummaryManager

void selectionChanged(const FWSelectionManager&);
void newItem(FWEventItem* iItem);
void itemChanged(const FWEventItem*);
void removeAllItems();
void changesDone();

Expand All @@ -76,6 +77,7 @@ class FWSummaryManager
TGCompositeFrame* m_pack;
std::vector<FWCollectionSummaryWidget*> m_collectionWidgets;
FWGUIManager* m_guiManager;
bool m_itemChanged;
};


Expand Down
18 changes: 16 additions & 2 deletions Fireworks/Core/src/FWSummaryManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// Original Author: Chris Jones
// Created: Tue Mar 4 09:35:32 EST 2008
// $Id: FWSummaryManager.cc,v 1.7 2009/01/23 21:35:44 amraktad Exp $
// $Id: FWSummaryManager.cc,v 1.8 2009/03/04 17:07:26 chrjones Exp $
//

// system include files
Expand All @@ -27,6 +27,7 @@
#include "Fireworks/Core/src/FWCollectionSummaryWidget.h"
#include "Fireworks/Core/interface/FWDataCategories.h"

#include "Fireworks/Core/src/FWCompactVerticalLayout.h"

//
// constants, enums and typedefs
Expand All @@ -44,7 +45,8 @@ FWSummaryManager::FWSummaryManager(TGFrame* iParent,
FWEventItemsManager* eim,
FWGUIManager* gm,
FWModelChangeManager* cm) :
m_guiManager(gm)
m_guiManager(gm),
m_itemChanged(false)
{
sm->selectionChanged_.connect(boost::bind(&FWSummaryManager::selectionChanged,this,_1));
eim->newItem_.connect(boost::bind(&FWSummaryManager::newItem,
Expand All @@ -53,6 +55,7 @@ FWSummaryManager::FWSummaryManager(TGFrame* iParent,


m_pack = new TGVerticalFrame(iParent);
m_pack->SetLayoutManager( new FWCompactVerticalLayout(m_pack));
const unsigned int backgroundColor=0x2f2f2f;
m_pack->SetBackgroundColor(backgroundColor);
/*m_eventObjects = new TEveElementList("Physics Objects");
Expand Down Expand Up @@ -96,6 +99,7 @@ FWSummaryManager::newItem(FWEventItem* iItem)
m_pack->AddFrame(lst, hints);
m_collectionWidgets.push_back(lst);
iItem->goingToBeDestroyed_.connect(boost::bind(&FWSummaryManager::itemDestroyed,this,_1));
iItem->itemChanged_.connect(boost::bind(&FWSummaryManager::itemChanged,this,_1));
lst->Connect("requestForInfo(FWEventItem*)","FWSummaryManager",this,"requestForInfo(FWEventItem*)");
lst->Connect("requestForFilter(FWEventItem*)","FWSummaryManager",this,"requestForFilter(FWEventItem*)");
lst->Connect("requestForErrorInfo(FWEventItem*)","FWSummaryManager",this,"requestForError(FWEventItem*)");
Expand All @@ -113,6 +117,12 @@ FWSummaryManager::itemDestroyed(const FWEventItem* iItem)
m_collectionWidgets[iItem->id()]=0;
}

void
FWSummaryManager::itemChanged(const FWEventItem*)
{
m_itemChanged = true;
}

void
FWSummaryManager::removeAllItems()
{
Expand All @@ -137,6 +147,10 @@ FWSummaryManager::selectionChanged(const FWSelectionManager& iSM)
void
FWSummaryManager::changesDone()
{
if(m_itemChanged) {
m_pack->Layout();
m_itemChanged=false;
}
}

void
Expand Down

0 comments on commit 8ae8843

Please sign in to comment.