library: libGui #include "TGListView.h"

# TGListView

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

## class TGListView : public TGCanvas

| Inheritance Chart:
`TObject`
| <- | `TGObject`
| <- | `TGWindow`
`TQObject`
| <- | `TGFrame`
| <- | `TGCanvas`
| <- | `TGListView` |

        protected:

          static FontStruct_t GetDefaultFontStruct()
           static const TGGC& GetDefaultGC() const

        public:

                              TGListView(const TGWindow* p, UInt_t w, UInt_t h, UInt_t options = kSunkenFrame|kDoubleBorder, Pixel_t back = GetDefaultFrameBackground())
                              TGListView(const TGListView&)
                      virtual ~TGListView()
               static TClass* Class()
                 virtual void Clicked(TGLVEntry* entry, Int_t btn)
                 virtual void Clicked(TGLVEntry* entry, Int_t btn, Int_t x, Int_t y)
                 virtual void DoubleClicked(TGLVEntry* entry, Int_t btn)
                 virtual void DoubleClicked(TGLVEntry* entry, Int_t btn, Int_t x, Int_t y)
          virtual const char* GetHeader(Int_t idx) const
                EListViewMode GetViewMode() const
              virtual TClass* IsA() const
                 virtual void Layout()
               virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
                 virtual void SavePrimitive(ofstream& out, Option_t* option)
                 virtual void SelectionChanged()
                 virtual void SetContainer(TGFrame* f)
                 virtual void SetDefaultHeaders()
                 virtual void SetHeader(const char* s, Int_t hmode, Int_t cmode, Int_t idx)
                 virtual void SetHeaders(Int_t ncolumns)
                 virtual void SetViewMode(EListViewMode viewMode)
                 virtual void ShowMembers(TMemberInspector& insp, char* parent)
                 virtual void Streamer(TBuffer& b)
                         void StreamerNVirtual(TBuffer& b)

### Data Members

        protected:

                         Int_t fNColumns      number of columns
                        Int_t* fColumns       column width
                        Int_t* fJmode         column text alignment
                 EListViewMode fViewMode      view mode if list view widget
                   TGDimension fMaxSize       maximum item size
                TGTextButton** fColHeader     column headers for in detailed mode
                    GContext_t fNormGC        drawing graphics context
                  FontStruct_t fFontStruct    text font
          static const TGFont* fgDefaultFont
                  static TGGC* fgDefaultGC

## Class Description

     TGListView, TGLVContainer and TGLVEntry

     A list view is a widget that can contain a number of items
     arranged in a grid or list. The items can be represented either
     by a string or by an icon.

     The TGListView is user callable. The other classes are service
     classes of the list view.

     A list view can generate the following events:
     kC_CONTAINER, kCT_SELCHANGED, total items, selected items.
     kC_CONTAINER, kCT_ITEMCLICK, which button, location (y<<16|x).
     kC_CONTAINER, kCT_ITEMDBLCLICK, which button, location (y<<16|x).

TGListView(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options, ULong_t back) : TGCanvas(p, w, h, options, back)

     Create a list view widget.

~TGListView()

     Delete a list view widget.

void SetHeaders(Int_t ncolumns)

     Set number of headers, i.e. columns that will be shown in detailed view.
     This method must be followed by exactly ncolumns SetHeader() calls,
     making sure that every header (i.e. idx) is set (for and example see
     SetDefaultHeaders()).

void SetHeader(const char *s, Int_t hmode, Int_t cmode, Int_t idx)

     Set header button idx [0-fNColumns>, hmode is the x text alignmode
     (ETextJustification) for the header text and cmode is the x text
     alignmode for the item text.

const char* GetHeader(Int_t idx) const

     Returns name of header idx. If illegal idx or header not set for idx
     0 is returned.

void SetDefaultHeaders()

     Default headers are: Name, Attributes, Size, Owner, Group, Modified.
     The default is good for file system items.

void SetViewMode(EListViewMode viewMode)

     Set list view mode.

void SetContainer(TGFrame *f)

     Set list view container. Container must be at least of type
     TGLVContainer.

void Layout()

     Layout list view components (container and contents of container).

Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)

     Handle messages generated by the list view components.

void Clicked(TGLVEntry *entry, Int_t btn)

     Emit Clicked() signal.

void Clicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)

     Emit Clicked() signal.

void DoubleClicked(TGLVEntry *entry, Int_t btn)

     Emit DoubleClicked() signal.

void DoubleClicked(TGLVEntry *entry, Int_t btn, Int_t x, Int_t y)

     Emit DoubleClicked() signal.

FontStruct_t GetDefaultFontStruct()

const TGGC& GetDefaultGC()

void SavePrimitive(ofstream &out, Option_t *option)

     Save a list view widget as a C++ statement(s) on output stream out.

### Inline Functions

            EListViewMode GetViewMode() const
                     void SelectionChanged()
                  TClass* Class()
                  TClass* IsA() const
                     void ShowMembers(TMemberInspector& insp, char* parent)
                     void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
               TGListView TGListView(const TGListView&)

Author: Fons Rademakers 17/01/98
Last update: root/gui:$Name: $:$Id: TGListView.cxx,v 1.31 2005/05/27 12:24:44 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *