CanvasTabs Class Reference

#include <CanvasViewer.h>

List of all members.

Public Member Functions

 CanvasTabs (TGCompositeFrame *parent)
void AdoptTab (const char *label, CanvasTab *ctab)
void DoTab (Int_t tab)
TGTab & GetTabs ()

Private Attributes

TGCompositeFrame * fParent
TGTab * fTab
std::vector< CanvasTab * > fCTabs

Detailed Description

Manage the tabs

Definition at line 51 of file CanvasViewer.h.


Constructor & Destructor Documentation

CanvasTabs::CanvasTabs ( TGCompositeFrame *  parent  ) 

Definition at line 22 of file CanvasViewer.cxx.

References fParent, and fTab.

00023 {
00024     fParent = parent;
00025     fTab = new TGTab(parent,800,800);
00026     TGLayoutHints *lh = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
00027                                           kLHintsExpandY, 2, 2, 5, 1);
00028     parent->AddFrame(fTab, lh);
00029     
00030     fTab->Connect("Selected(Int_t)", "CanvasTabs", this, "DoTab(Int_t)");
00031 
00032 }


Member Function Documentation

void CanvasTabs::AdoptTab ( const char *  label,
CanvasTab ctab 
)

Definition at line 34 of file CanvasViewer.cxx.

References fCTabs, fParent, fTab, and CanvasTab::Init().

Referenced by BDQViewer::BDQViewer().

00035 {
00036     TGCompositeFrame *tf = fTab->AddTab(label);
00037     
00038     TGCompositeFrame *cf = new TGCompositeFrame(tf, 800, 800, kVerticalFrame);
00039     
00040     TGLayoutHints* lh = new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX |
00041                                           kLHintsExpandY, 5, 5, 5, 5);
00042     
00043     TRootEmbeddedCanvas *rec = new TRootEmbeddedCanvas(label, cf, 800,800);
00044     cf->AddFrame(rec,lh);
00045     tf->AddFrame(cf,lh);
00046     
00047     fTab->Layout();
00048     
00049     TCanvas* can = rec->GetCanvas();
00050     can->cd();
00051     ctab->Init(can);
00052     fCTabs.push_back(ctab);
00053     
00054     //fTab->MapSubwindows();
00055     //fTab->Layout();
00056     
00057     fParent->Resize(800,800);
00058     //fParent->Layout();
00059     fParent->MapSubwindows();
00060 }

void CanvasTabs::DoTab ( Int_t  tab  ) 

Definition at line 62 of file CanvasViewer.cxx.

References fCTabs.

00063 {
00064     fCTabs[tab]->Expose();
00065 }

TGTab& CanvasTabs::GetTabs (  )  [inline]

Definition at line 64 of file CanvasViewer.h.

Referenced by BDQViewer::BDQViewer().

00064 {  return *fTab; }


Member Data Documentation

std::vector<CanvasTab*> CanvasTabs::fCTabs [private]

Definition at line 56 of file CanvasViewer.h.

Referenced by AdoptTab(), and DoTab().

TGCompositeFrame* CanvasTabs::fParent [private]

Definition at line 54 of file CanvasViewer.h.

Referenced by AdoptTab(), and CanvasTabs().

TGTab* CanvasTabs::fTab [private]

Definition at line 55 of file CanvasViewer.h.

Referenced by AdoptTab(), and CanvasTabs().


The documentation for this class was generated from the following files:

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1