ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtEventSidebar.cxx
Go to the documentation of this file.
1 #include "AtEventSidebar.h"
2 
3 #include "AtSidebarFrames.h" // for AtSidebarFrame, AtSidebarBranchControl
4 
5 #include <FairLogger.h>
6 
7 #include <TGClient.h> // for TGClient, gClient
8 #include <TGLayout.h> // for TGLayoutHints, kLHintsExpandX
9 
10 #include <algorithm> // for max
12 {
13  for (auto frame : fFrames)
14  frame->FillFrame();
15 
16  MapSubwindows();
17  Resize();
18  MapWindow();
19 }
20 
21 AtEventSidebar::AtEventSidebar(UInt_t options) : TGMainFrame(gClient->GetRoot(), 1000, 600, options)
22 {
23  SetWindowName("XX GUI");
24  SetCleanup(kDeepCleanup);
25  fExpandX = options & kVerticalFrame;
26 }
27 
29 {
30  if (frame->GetParent() != this)
31  LOG(fatal) << "Cannot pass a sidebar frame whose parent (" << frame->GetParent() << ") isn't the sidebar ("
32  << this << ")";
33 
34  fFrames.push_back(frame);
35  if (fExpandX)
36  TGMainFrame::AddFrame(frame, new TGLayoutHints(kLHintsExpandX));
37  else
38  TGMainFrame::AddFrame(frame, new TGLayoutHints(kLHintsExpandY));
39  frame->Layout();
40 }
41 
43 {
44  for (auto frame : fFrames)
45  frame->UsePictureButtons(val);
46 }
AtEventSidebar::AddSidebarFrame
void AddSidebarFrame(AtSidebarFrame *frame)
Definition: AtEventSidebar.cxx:28
AtSidebarFrame
Definition: AtSidebarFrames.h:30
AtEventSidebar.h
AtEventSidebar::UsePictureButtons
void UsePictureButtons(bool val)
Definition: AtEventSidebar.cxx:42
AtEventSidebar::AtEventSidebar
AtEventSidebar(UInt_t options=kVerticalFrame)
Definition: AtEventSidebar.cxx:21
AtSidebarFrames.h
AtEventSidebar::FillFrames
void FillFrames()
Actually generate content of the frames once Init has run.
Definition: AtEventSidebar.cxx:11