library: libGui
#include "TGFrame.h"

TGCompositeFrame


class description - source file - inheritance tree (.ps)

class TGCompositeFrame : public TGFrame

Inheritance Chart:
TObject
<-
TGObject
<-
TGWindow
TQObject
<-
TGFrame
<-
TGCompositeFrame
<-
TG16ColorSelector
TGColorPopup
TGComboBox
<-
TGFontTypeComboBox
TGFSComboBox
TGLineStyleComboBox
TGLineWidthComboBox
TGComboBoxPopup
TGContainer
<-
TGListTree
 [more...]

    protected:
virtual Bool_t HandleEditEvent(Event_t*) virtual Bool_t OnContextMenu(Event_t*) public:
TGCompositeFrame(const TGWindow* p, UInt_t w, UInt_t h, UInt_t options = 0, Pixel_t back = GetDefaultFrameBackground()) TGCompositeFrame(TGClient* c, Window_t id, const TGWindow* parent = 0) TGCompositeFrame(const TGCompositeFrame&) virtual ~TGCompositeFrame() virtual void AddFrame(TGFrame* f, TGLayoutHints* l = 0) virtual void ChangeOptions(UInt_t options) static TClass* Class() virtual void Cleanup() virtual UInt_t GetDefaultHeight() const virtual TGDimension GetDefaultSize() const virtual UInt_t GetDefaultWidth() const virtual TGFrame* GetFrameFromPoint(Int_t x, Int_t y) TGLayoutManager* GetLayoutManager() const TList* GetList() Int_t GetState(TGFrame* f) const virtual Bool_t HandleButton(Event_t*) virtual Bool_t HandleCrossing(Event_t*) virtual Bool_t HandleDoubleClick(Event_t*) virtual Bool_t HandleFocusChange(Event_t*) virtual Bool_t HandleKey(Event_t*) virtual Bool_t HandleMotion(Event_t*) virtual Bool_t HandleSelection(Event_t*) virtual void HideFrame(TGFrame* f) virtual TClass* IsA() const Bool_t IsArranged(TGFrame* f) const Bool_t IsArranged(TGFrameElement* ptr) const virtual Bool_t IsComposite() const virtual Bool_t IsEditable() const virtual Bool_t IsLayoutBroken() const Bool_t IsVisible(TGFrame* f) const Bool_t IsVisible(TGFrameElement* ptr) const virtual void Layout() virtual void MapSubwindows() virtual Bool_t MustCleanup() const virtual void Print(Option_t* option) const virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t) virtual void RemoveFrame(TGFrame* f) virtual void SavePrimitive(ofstream& out, Option_t* option) virtual void SetCleanup(Bool_t on = kTRUE) virtual void SetEditable(Bool_t on = kTRUE) virtual void SetLayoutBroken(Bool_t on = kTRUE) void SetLayoutManager(TGLayoutManager* l) virtual void ShowFrame(TGFrame* f) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) virtual Bool_t TranslateCoordinates(TGFrame* child, Int_t x, Int_t y, Int_t& fx, Int_t& fy)

Data Members


    protected:
TGLayoutManager* fLayoutManager layout manager TList* fList container of frame elements Bool_t fLayoutBroken no layout manager is used Bool_t fCleanup if kTRUE Cleanup() is called in destructor static TContextMenu* fgContextMenu context menu for setting GUI attributes static TGLayoutHints* fgDefaultHints default hints used by AddFrame()

Class Description

                                                                      
 TGFrame, TGCompositeFrame, TGVerticalFrame, TGHorizontalFrame,       
 TGMainFrame, TGTransientFrame and TGGroupFrame                       
                                                                      
 The frame classes describe the different "dressed" GUI windows.      
                                                                      
 The TGFrame class is a subclasses of TGWindow, and is used as base   
 class for some simple widgets (buttons, labels, etc.).               
 It provides:                                                         
  - position & dimension fields                                       
  - an 'options' attribute (see constant above)                       
  - a generic event handler                                           
  - a generic layout mechanism                                        
  - a generic border                                                  
                                                                      
 The TGCompositeFrame class is the base class for composite widgets   
 (menu bars, list boxes, etc.).                                       
 It provides:                                                         
  - a layout manager                                                  
  - a frame container (TList *)                                       
                                                                      
 The TGVerticalFrame and TGHorizontalFrame are composite frame that   
 layout their children in vertical or horizontal way.                 
                                                                      
 The TGMainFrame class defines top level windows that interact with   
 the system Window Manager.                                           
                                                                      
 The TGTransientFrame class defines transient windows that typically  
 are used for dialogs windows.                                        
                                                                      
 The TGGroupFrame is a composite frame with a border and a title.     
 It is typically used to group a number of logically related widgets  
 visually together.                                                   
                                                                      
/* */


TGCompositeFrame(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options, ULong_t back) : TGFrame(p, w, h, options, back)
 Create a composite frame. A composite frame has in addition to a TGFrame
 also a layout manager and a list of child frames.

TGCompositeFrame(TGClient *c, Window_t id, const TGWindow *parent) : TGFrame(c, id, parent)
 Create a frame using an externally created window. For example
 to register the root window (called by TGClient), or a window
 created via TVirtualX::InitWindow() (id is obtained with TVirtualX::GetWindowID()).

~TGCompositeFrame()
 Delete a composite frame.

Bool_t IsEditable() const
 Return kTRUE if frame is being edited.

void SetEditable(Bool_t on)
 Switch ON/OFF edit mode.
 If edit mode is ON it is possible:

  1. embed other ROOT GUI application (a la ActiveX)

  For example:
    TGMainFrame *m = new TGMainFrame(gClient->GetRoot(), 500, 500);
    m->SetEditable();
    gSystem->Load("$ROOTSYS/test/Aclock"); // load Aclock demo
    Aclock a;
    gROOT->Macro("$ROOTSYS/tutorials/guitest.C");
    m->SetEditable(0);
    m->MapWindow();

  2. ... to be continued

Bool_t HandleEditEvent(Event_t *)
 Edit events allow to move, resize, remove frames
 from the composite frame.

Bool_t OnContextMenu(Event_t *event)
 Handle context menu

void Cleanup()
 Cleanup and delete all objects contained in this composite frame.
 This will delete all objects added via AddFrame().
 CAUTION: all objects (frames and layout hints) must be unique, i.e.
 cannot be shared.

void SetCleanup(Bool_t on)
 If fCleanup is kTRUE Cleanup() method is called automatically at destructor

void SetLayoutManager(TGLayoutManager *l)
 Set the layout manager for the composite frame.
 The layout manager is adopted by the frame and will be deleted
 by the frame.

void SetLayoutBroken(Bool_t on)
  set broken layout. No Layout method is called

void ChangeOptions(UInt_t options)
 Change composite frame options. Options is an OR of the EFrameTypes.

void AddFrame(TGFrame *f, TGLayoutHints *l)
 Add frame to the composite frame using the specified layout hints.
 If no hints are specified default hints TGLayoutHints(kLHintsNormal,0,0,0,0)
 will be used. Most of the time, however, you will want to provide
 specific hints. User specified hints can be reused many times
 and need to be destroyed by the user. The added frames cannot not be
 added to different composite frames but still need to be deleted by
 the user.

void RemoveFrame(TGFrame *f)
 Remove frame from composite frame.

void MapSubwindows()
 Map all sub windows that are part of the composite frame.

void HideFrame(TGFrame *f)
 Hide sub frame.

void ShowFrame(TGFrame *f)
 Show sub frame.

Int_t GetState(TGFrame *f) const
 Get state of sub frame.

Bool_t IsVisible(TGFrame *f) const
 Get state of sub frame.

Bool_t IsArranged(TGFrame *f) const
 Get state of sub frame.

void Layout()
 Layout the elements of the composite frame.

void Print(Option_t *option) const
 Print all frames in this composite frame.

TGFrame* GetFrameFromPoint(Int_t x, Int_t y)
 Get frame located at specified point.

Bool_t TranslateCoordinates(TGFrame *child, Int_t x, Int_t y, Int_t &fx, Int_t &fy)
 Translate coordinates to child frame.

void SavePrimitive(ofstream &out, Option_t *option)
 Save a composite frame widget as a C++ statement(s) on output stream out



Inline Functions


                  UInt_t GetDefaultWidth() const
                  UInt_t GetDefaultHeight() const
             TGDimension GetDefaultSize() const
                  Bool_t HandleButton(Event_t*)
                  Bool_t HandleDoubleClick(Event_t*)
                  Bool_t HandleCrossing(Event_t*)
                  Bool_t HandleMotion(Event_t*)
                  Bool_t HandleKey(Event_t*)
                  Bool_t HandleFocusChange(Event_t*)
                  Bool_t HandleSelection(Event_t*)
                  Bool_t ProcessMessage(Long_t, Long_t, Long_t)
        TGLayoutManager* GetLayoutManager() const
                  Bool_t IsVisible(TGFrameElement* ptr) const
                  Bool_t IsArranged(TGFrameElement* ptr) const
                  Bool_t IsComposite() const
                  Bool_t IsLayoutBroken() const
                  Bool_t MustCleanup() const
                  TList* GetList()
                 TClass* Class()
                 TClass* IsA() const
                    void ShowMembers(TMemberInspector& insp, char* parent)
                    void Streamer(TBuffer& b)
                    void StreamerNVirtual(TBuffer& b)
        TGCompositeFrame TGCompositeFrame(const TGCompositeFrame&)


Author: Fons Rademakers 03/01/98
Last update: root/gui:$Name: $:$Id: TGFrame.cxx,v 1.59 2004/06/25 17:15:23 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.