Skip to content

Commit

Permalink
Merge pull request #13942 from alja/80x-polishing
Browse files Browse the repository at this point in the history
80x Fireworks: Optimize redrawing on restore of configuration
  • Loading branch information
davidlange6 committed Apr 6, 2016
2 parents c32369e + 93d5a78 commit 525fc74
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 19 deletions.
7 changes: 3 additions & 4 deletions Fireworks/Core/src/CmsShowEDI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ CmsShowEDI::CmsShowEDI(const TGWindow* p, UInt_t w, UInt_t h, FWSelectionManager

TGVerticalFrame* vf = new TGVerticalFrame(this);
AddFrame(vf, new TGLayoutHints(kLHintsExpandX|kLHintsExpandY, 0, 0, 0, 0));
FWDialogBuilder builder(vf);
FWDialogBuilder builder(vf, 0, true);

builder.indent(0)
builder.indent(0).expand(true, false)
.addLabel(" ", 14, 2, &m_objectLabel)
.vSpacer()
// .vSpacer()
.tabs(&m_tabs)
.beginTab("Graphics")
.indent(3)
Expand Down Expand Up @@ -170,7 +170,6 @@ CmsShowEDI::CmsShowEDI(const TGWindow* p, UInt_t w, UInt_t h, FWSelectionManager
TGCompositeFrame* cf = m_tabs->GetTabContainer(0);
m_settersFrame = new TGVerticalFrame(cf);
m_settersFrame->SetCleanup(kDeepCleanup);
// m_settersFrame->SetBackgroundColor(0xff00ff);
cf->AddFrame(m_settersFrame, new TGLayoutHints(kLHintsExpandX| kLHintsExpandY ));

SetWindowName("Collection Controller");
Expand Down
6 changes: 4 additions & 2 deletions Fireworks/Core/src/CmsShowMain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -700,8 +700,10 @@ CmsShowMain::setupDataHandling()
{
m_navigator->firstEvent();
checkPosition();
draw();
setupConfiguration();
if (configurationManager()->getIgnore())
guiManager()->initEmpty();
else
setupConfiguration();
}
else {
if (configFilename()[0] == '\0') {
Expand Down
1 change: 1 addition & 0 deletions Fireworks/Core/src/CmsShowMainFrame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ CmsShowMainFrame::CmsShowMainFrame(const TGWindow *p,UInt_t w,UInt_t h,FWGUIMana
{
const unsigned int backgroundColor=0x2f2f2f;
const unsigned int textColor= 0xb3b3b3;
gClient->SetStyle("classic");

CSGAction *openData = new CSGAction(this, cmsshow::sOpenData.c_str());
CSGAction *appendData = new CSGAction(this, cmsshow::sAppendData.c_str());
Expand Down
28 changes: 21 additions & 7 deletions Fireworks/Core/src/FWDialogBuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ FWLayoutBuilder::newRow(void)
m_framesStack.back()->AddFrame(m_currentFrame, m_currentHints);
return *this;
}



FWLayoutBuilder &
FWLayoutBuilder::indent(int left /*= 2*/, int right /* = -1*/)
Expand Down Expand Up @@ -196,6 +198,17 @@ FWLayoutBuilder::nextFrame()
return currentFrame();
}

void
FWLayoutBuilder::frameForTab()
{
m_currentFrame = new TGVerticalFrame(m_framesStack.back());
m_currentFrame->SetBackgroundColor(0x000000);
m_framesStack.back()->AddFrame(m_currentFrame, new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
// m_frameStack.push_back(m_currentFrame);
}



/** Helper class to construct dialogs in a more readable ways.
Encapsulated TGUI layout hiccups and exposes the developer an API which
Expand Down Expand Up @@ -453,13 +466,14 @@ FWDialogBuilder::addHSeparator(size_t horizontalPadding /*= 4*/,
FWDialogBuilder &
FWDialogBuilder::tabs(TGTab **out)
{
// Calls to tabs cannot be nested within the same builder. Multiple
// builders are used to support nested tabs.
assert(!m_tabs);
expand(true, true);
m_tabs = new TGTab(nextFrame());
currentFrame()->AddFrame(m_tabs, nextHints());
expand(true, true);

// m_currentFrame = new TGVerticalFrame(m_framesStack.back());
//m_framesStack.back()->AddFrame(m_currentFrame, new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
frameForTab();

m_tabs = new TGTab(currentFrame());
currentFrame()->AddFrame(m_tabs, new TGLayoutHints(kLHintsExpandX| kLHintsExpandY));
//expand(true, true);
return extract(m_tabs, out);
}

Expand Down
1 change: 1 addition & 0 deletions Fireworks/Core/src/FWDialogBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class FWLayoutBuilder
TGLayoutHints *nextHints();
TGCompositeFrame *nextFrame();
TGVerticalFrame *verticalFrame();
void frameForTab();

private:
TGCompositeFrame *m_window;
Expand Down
13 changes: 8 additions & 5 deletions Fireworks/Core/src/FWGUIManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1276,18 +1276,14 @@ FWGUIManager::setWindowInfoFrom(const FWConfiguration& iFrom,

void
FWGUIManager::setFrom(const FWConfiguration& iFrom) {
gEve->DisableRedraw();
// main window
if (m_viewSecPack) subviewDestroyAll();

const FWConfiguration* mw = iFrom.valueForKey(kMainWindow);
assert(mw != 0);
// Window needs to mapped before moving, otherwise move can lead
// to wrong results on some window managers.
m_cmsShowMainFrame->MapWindow();
setWindowInfoFrom(*mw, m_cmsShowMainFrame);
m_cmsShowMainFrame->MapSubwindows();
m_cmsShowMainFrame->Layout();
m_cmsShowMainFrame->MapRaised();

// set from view reading area info nd view info
float_t leftWeight =1;
Expand Down Expand Up @@ -1402,6 +1398,13 @@ FWGUIManager::setFrom(const FWConfiguration& iFrom) {

// disable first docked view
checkSubviewAreaIconState(0);

m_cmsShowMainFrame->MapWindow();
setWindowInfoFrom(*mw, m_cmsShowMainFrame);
m_cmsShowMainFrame->MapSubwindows();
m_cmsShowMainFrame->Layout();
m_cmsShowMainFrame->MapRaised();

}

void
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/src/FWGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ FWGeometry::loadMap( const char* fileName )
if (path.EndsWith(":/")) path.Resize(path.Length() -2);

if (m_versionInfo.productionTag)
fwLog( fwlog::kInfo ) << Form("Load %s %s from %s\n", tree->GetName(), m_versionInfo.productionTag->GetName(), path.Data());
fwLog( fwlog::kInfo ) << Form("Load %s %s from %s\n", tree->GetName(), m_versionInfo.productionTag->GetTitle(), path.Data());
else
fwLog( fwlog::kInfo ) << Form("Load %s from %s\n", tree->GetName(), path.Data());

Expand Down

0 comments on commit 525fc74

Please sign in to comment.