OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
menugadg.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition TMenuGadget class
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_MENUGADGET_H)
10#define OWL_MENUGADGET_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/textgadg.h>
18#include <owl/menu.h>
19
20
21namespace owl {
22
23#include <owl/preclass.h>
24
25/// \addtogroup gadgets
26/// @{
27/// \class TMenuGadget
28// ~~~~~ ~~~~~~~~~~~
29/// TMenuGadget is a text gadget that, when pressed, acts as a pop-up menu.
31 public:
32 TMenuGadget(TMenu& menu, TWindow* window, int id = 0,
33 TBorderStyle borderStyle = TGadget::ButtonUp,
34 LPTSTR text = 0, TFont* font = 0);
36
37 // Override from TGadget
38 //
39 virtual void LButtonDown(uint modKeys, const TPoint& p);
40 /// Added support for Flat Style
41 //
42 virtual void PaintBorder(TDC& dc);
43 virtual void GetDesiredSize(TSize& size);
44
45 //
46 /// Added support for Hot text
47 virtual TColor GetEnabledColor() const;
48
49 private:
50 TPopupMenu* PopupMenu;
51 TWindow* CmdTarget;
52};
53/// @}
54
55#include <owl/posclass.h>
56
57
58} // OWL namespace
59
60
61#endif // OWL_MENUGADGET_H
Class wrapper for management of color values.
Definition color.h:245
TDC is the root class for GDI DC wrappers.
Definition dc.h:64
TFont derived from TGdiObject provides constructors for creating font objects from explicit informati...
Definition gdiobjec.h:296
TBorderStyle
Gadget border styles.
Definition gadget.h:127
@ ButtonUp
Button in up position.
Definition gadget.h:134
virtual void GetDesiredSize(TSize &size)
Definition menugadg.cpp:64
virtual void PaintBorder(TDC &dc)
Added support for Flat Style.
Definition menugadg.cpp:79
virtual void LButtonDown(uint modKeys, const TPoint &p)
Shows a pop-up menu on LButtonDown.
Definition menugadg.cpp:50
virtual TColor GetEnabledColor() const
Added support for Hot text.
Definition menugadg.cpp:96
TMenuGadget(TMenu &menu, TWindow *window, int id=0, TBorderStyle borderStyle=TGadget::ButtonUp, TCHAR *text=0, TFont *font=0)
Creates the pop-up menu and initializes the text gadget.
Definition menugadg.cpp:22
The TMenu class encapsulates window menus.
Definition menu.h:77
TPoint is a support class, derived from tagPOINT.
Definition geometry.h:87
TPopupMenu creates an empty pop-up menu to add to an existing window or pop-up menu.
Definition menu.h:189
The tagSIZE struct is defined as.
Definition geometry.h:234
TTextGadget(int id=0, TBorderStyle=Recessed, TAlign=Left, uint numChars=10, LPCTSTR text=0, TFont *font=0)
Constructs a TTextGadget object with the specified ID, border style, and alignment.
Definition textgadg.cpp:25
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition window.h:414
Definition of Window Menu encapsulation class.
Object Windows Library (OWLNext Core).
Definition animctrl.h:22
unsigned int uint
Definition number.h:25
#define _OWLCLASS
Definition defs.h:338
Definition of text gadget class TGadget.