TGPopupMenu


class description - source file - inheritance tree

class TGPopupMenu : public TGFrame


    protected:
virtual void DoRedraw() void DrawCheckMark(GContext_t gc, Int_t l, Int_t t, Int_t r, Int_t b) virtual void DrawEntry(TGMenuEntry* entry) void DrawRCheckMark(GContext_t gc, Int_t l, Int_t t, Int_t r, Int_t b) void DrawTrianglePattern(GContext_t gc, Int_t l, Int_t t, Int_t r, Int_t b) public:
TGPopupMenu TGPopupMenu(const TGWindow* p, UInt_t w = 10, UInt_t h = 10, UInt_t options = 0) TGPopupMenu TGPopupMenu(TGPopupMenu&) virtual void ~TGPopupMenu() virtual void Activate(TGMenuEntry* entry) void AddEntry(TGHotString* s, Int_t id, void* ud = 0, const TGPicture* p = 0) void AddEntry(const char* s, Int_t id, void* ud = 0, const TGPicture* p = 0) void AddLabel(TGHotString* s, const TGPicture* p = 0) void AddLabel(const char* s, const TGPicture* p = 0) void AddPopup(TGHotString* s, TGPopupMenu* popup) void AddPopup(const char* s, TGPopupMenu* popup) void AddSeparator() virtual void Associate(const TGWindow* w) void CheckEntry(Int_t id) TClass* Class() void DefaultEntry(Int_t id) void DisableEntry(Int_t id) virtual void DrawBorder() void EnableEntry(Int_t id) Int_t EndMenu(void*& userData) virtual Bool_t HandleButton(Event_t* event) virtual Bool_t HandleCrossing(Event_t* event) virtual Bool_t HandleMotion(Event_t* event) virtual Bool_t HandleTimer(TTimer* t) virtual TClass* IsA() const Bool_t IsEntryChecked(Int_t id) Bool_t IsEntryEnabled(Int_t id) Bool_t IsEntryRChecked(Int_t id) void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer) void RCheckEntry(Int_t id, Int_t IDfirst, Int_t IDlast) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void UnCheckEntry(Int_t id)

Data Members

protected:
TList* fEntryList list of menu entries TGMenuEntry* fCurrent currently selected menu entry Bool_t fStick stick mode (popup menu stays sticked on screen) Bool_t fHasGrab true if menu has grabbed pointer UInt_t fXl Max width of all menu entries UInt_t fWidth width of popup menu UInt_t fHeight height of popup menu TTimer* fDelay delay before poping up cascading menu GContext_t fNormGC normal drawing graphics context GContext_t fSelGC graphics context for drawing selections GContext_t fSelbackGC graphics context for drawing selection background FontStruct_t fFontStruct font to draw menu entries FontStruct_t fHifontStruct font to draw highlighted entries const TGWindow* fMsgWindow window which handles menu events static GContext_t fgDefaultGC static GContext_t fgDefaultSelectedGC static GContext_t fgDefaultSelectedBackgroundGC static FontStruct_t fgDefaultFontStruct static FontStruct_t fgHilightFontStruct static Cursor_t fgDefaultCursor static Pixmap_t fgCheckmark static Pixmap_t fgRadiomark


See also

TRootContextMenu

Class Description

                                                                      
 TGMenuBar, TGPopupMenu, TGMenuTitle and TGMenuEntry                  
                                                                      
 This header contains all different menu classes.                     
                                                                      
 Selecting a menu item will generate the event:                       
 kC_COMMAND, kCM_MENU, menu id, user data.                            
                                                                      


TGPopupMenu(const TGWindow *p, UInt_t w, UInt_t h, UInt_t options) : TGFrame(p, w, h, options)
 Create a popup menu.

~TGPopupMenu()
 Delete a popup menu.

void AddEntry(TGHotString *s, Int_t id, void *ud, const TGPicture *p)
 Add a menu entry. The hotstring is adopted by the menu (actually by
 the TGMenuEntry) and deleted when possible. A possible picture is
 borrowed from the picture pool and therefore not adopted.

void AddEntry(const char *s, Int_t id, void *ud, const TGPicture *p)
 Add a menu entry. The string s in not adopted.

void AddSeparator()
 Add a menu separator to the menu.

void AddLabel(TGHotString *s, const TGPicture *p)
 Add a menu label to the menu. The hotstring is adopted by the menu
 (actually by the TGMenuEntry) and deleted when possible. A possible
 picture is borrowed from the picture pool and therefore not adopted.

void AddLabel(const char *s, const TGPicture *p)
 Add a menu label to the menu. The string s in not adopted.

void AddPopup(TGHotString *s, TGPopupMenu *popup)
 Add a (cascading) popup menu to a popup menu. The hotstring is adopted
 by the menu (actually by the TGMenuEntry) and deleted when possible.

void AddPopup(const char *s, TGPopupMenu *popup)
 Add a (cascading) popup menu to a popup menu. The string s is not
 adopted.

void PlaceMenu(Int_t x, Int_t y, Bool_t stick_mode, Bool_t grab_pointer)
 Popup a popup menu. If stick mode is true keep the menu up. If
 grab_pointer is true the pointer will be grabbed, which means that
 all pointer events will go to the popup menu, idependent of in
 which window the pointer is.

Int_t EndMenu(void *&userData)
 Close menu and return ID of selected menu item.
 In case of cascading menus, recursively close all menus.

Bool_t HandleButton(Event_t *event)
 Handle button event in the popup menu.

Bool_t HandleCrossing(Event_t *event)
 Handle pointer crossing event in popup menu.

Bool_t HandleMotion(Event_t *event)
 Handle pointer motion event in popup menu.

void Activate(TGMenuEntry *entry)
 Activate a menu entry in a popup menu.

Bool_t HandleTimer(TTimer *)
 If TPopupDelayTimer times out popup cascading popup menu (if it is
 still the current entry).

void DoRedraw()
 Draw popup menu.

void DrawEntry(TGMenuEntry *entry)
 Draw popup menu entry.

void DrawBorder()
 Draw border round popup menu.

void DrawTrianglePattern(GContext_t gc, Int_t l, Int_t t, Int_t r, Int_t b)
 Draw triangle pattern. Used for menu entries that are of type
 kMenuPopup (i.e. cascading menus).

void DrawCheckMark(GContext_t gc, Int_t l, Int_t t, Int_t, Int_t b)
 Draw check mark. Used for checked button type menu entries.

void DrawRCheckMark(GContext_t gc, Int_t l, Int_t t, Int_t r, Int_t b)
 Draw radio check mark. Used for radio button type menu entries.

void DefaultEntry(Int_t id)
 Set default entry (default entries are drawn with bold text).

void EnableEntry(Int_t id)
 Enable entry.

void DisableEntry(Int_t id)
 Disable entry (disabled entries appear in a sunken relieve).

Bool_t IsEntryEnabled(Int_t id)
 Return true if menu entry is enabled.

void CheckEntry(Int_t id)
 Check a menu entry (i.e. add a check mark in front of it).

void UnCheckEntry(Int_t id)
 Uncheck menu entry (i.e. remove check mark).

Bool_t IsEntryChecked(Int_t id)
 Return true if menu item is checked.

void RCheckEntry(Int_t id, Int_t IDfirst, Int_t IDlast)
 Radio-select entry (note that they cannot be unselected,
 the selection must be moved to another entry instead).

Bool_t IsEntryRChecked(Int_t id)
 Return true if menu item has radio check mark.



Inline Functions


               void Associate(const TGWindow* w)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
        TGPopupMenu TGPopupMenu(TGPopupMenu&)


Author: Fons Rademakers 09/01/98
Last update: 2.23/02 02/09/99 15.54.27 by Rene Brun
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - 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.