OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
menu.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectWindows
3// Copyright (c) 1991, 1996 by Borland International, All Rights Reserved
4//
5/// \file
6/// Definition of Window Menu encapsulation class
7//----------------------------------------------------------------------------
8
9#if !defined(OWL_MENU_H)
10#define OWL_MENU_H
11
12#include <owl/private/defs.h>
13#if defined(BI_HAS_PRAGMA_ONCE)
14# pragma once
15#endif
16
17#include <owl/gdiobjec.h>
18#include <owl/wsyscls.h>
19
20
21namespace owl {
22
23#include <owl/preclass.h>
24
25/// \addtogroup menus
26/// @{
27
28class _OWLCLASS TXMenu;
29class _OWLCLASS TMenu;
30
31//
32/// Represents an unsigned integer or handle which identifies a new menu item.
33//
35
36// All-including mask for MENUITEMINFO
37//
38#if !defined(MIIM_ALL)
39# define MIIM_ALL (MIIM_CHECKMARKS|MIIM_DATA|MIIM_ID|MIIM_STATE|MIIM_SUBMENU|MIIM_TYPE)
40#endif
41
42
43//
44/// \class TMenuItemInfo
45// ~~~~~ ~~~~~~~~~~~~~
46class _OWLCLASS TMenuItemInfo : public MENUITEMINFO {
47 public:
49
50 /// Construct MENUITEMINFO from a specific item of a menu object.
51 /// Defaults to retrieving all information except for the type, which
52 /// require a destination buffer.
53 //
57
58 /// Construct MENUITEMINFO from a specific item of a menu object.
59 /// Similar to prior except that it also retrieves the type data.
60 //
61 TMenuItemInfo(TMenu& menu, uint posOrId, bool isPos, void* buffer,
62 uint size, uint msk = MIIM_ALL);
63};
64
65
66//
67/// \class TMenu
68// ~~~~~ ~~~~~
69/// The TMenu class encapsulates window menus. You can use TMenu member functions to
70/// construct, modify, query, and create menu objects. You can also use TMenu to add
71/// bitmaps to your menu or to specify if a menu item is checked or unchecked. TMenu
72/// includes two versions of a helper function, DeepCopy , designed to make copies
73/// of menus and insert them at a specified position on the menu bar. See the
74/// ObjectWindows Programmer's Guide for information about how to create menu
75/// objects.
76//
78 public:
83 TMenu(const void * menuTemplate);
85 virtual ~TMenu();
86
87 TMenu& operator =(const TMenu&);
88
89 void CheckValid(uint redId = IDS_MENUFAILURE);
90 virtual HMENU GetHandle() const;
91
92 operator TMenuItem() const;
93 operator HMENU() const;
94
95 bool IsOK() const;
96
97 /// \name HMENU encapsulated functions
98 /// @{
99 bool AppendMenu(uint flags, TMenuItem newItem=static_cast<unsigned int>(-1), LPCTSTR newStr=nullptr); //JJH added static cast
100 bool AppendMenu(uint flags, TMenuItem newItem, const tstring& newStr) {return AppendMenu(flags, newItem, newStr.c_str());}
101 bool AppendMenu(uint flags, TMenuItem newitem, const TBitmap& newBmp);
102 bool CheckMenuItem(uint item, uint check);
103 bool DeleteMenu(uint item, uint flags);
104 bool EnableMenuItem(uint item, uint enable);
105 uint GetMenuItemCount() const;
106 uint GetMenuItemID(int posItem) const;
107 uint GetMenuState(uint item, uint flags) const;
108 int GetMenuString(uint item, LPTSTR str, int count, uint flags) const;
109 tstring GetMenuString(uint item, uint flags) const;
110 HMENU GetSubMenu(int posItem) const;
111 bool InsertMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr = nullptr);
112 bool InsertMenu(uint item, uint flags, TMenuItem newItem, const tstring& newStr) {return InsertMenu(item, flags, newItem, newStr.c_str());}
113 bool InsertMenu(uint item, uint flags, TMenuItem newItem, const TBitmap& newBmp);
114 bool ModifyMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr = nullptr);
115 bool ModifyMenu(uint item, uint flags, TMenuItem newItem, const tstring& newStr) {return ModifyMenu(item, flags, newItem, newStr.c_str());}
116 bool ModifyMenu(uint item, uint flags, TMenuItem newItem, const TBitmap& newBmp);
117 bool RemoveMenu(uint item, uint flags);
118 bool SetMenuItemBitmaps(uint item, uint flags,
119 const TBitmap* bmpUnchecked=nullptr,
120 const TBitmap* bmpChecked=nullptr);
121 /// @}
122
123 /// \name Encapsulation of new functionality introduced with Win95
124 /// @{
125 uint GetDefaultItem(bool getPos, uint flags) const;
126 bool SetDefaultItem(uint posOrId, bool isPos);
127 bool CheckRadioItem(uint first, uint last, uint check, uint flags);
128 /// @}
129
130 /// \name MENUITEMINFO related API
131 /// @{
132 bool GetMenuItemInfo(uint posOrId, bool isPos, TMenuItemInfo& mi) const;
133 bool SetMenuItemInfo(uint posOrId, bool isPos, TMenuItemInfo& mi);
134 bool InsertMenuItem(uint posOrId, bool isPos, TMenuItemInfo& mi);
135 /// @}
136
137 static bool GetMenuCheckMarkDimensions(TSize& size);
138 static TSize GetMenuCheckMarkDimensions();
139
140 /// \name Virtual menu functions
141 /// @{
142 virtual void MeasureItem(MEASUREITEMSTRUCT & measureItem);
143 virtual void DrawItem(DRAWITEMSTRUCT & drawItem);
144 /// @}
145
146 protected:
147 static void DeepCopy(TMenu& dst, const TMenu& src, int srcOffset = 0, int itemCount = -1);
148 static void DeepCopy(TMenu& dst, int dstOffset, const TMenu& src, int srcOffset = 0, int itemCount = -1);
149
151 HMENU Handle; ///< Holds the handle to the menu.
152 bool ShouldDelete; ///< ShouldDelete is set to true if the Destructor needs to delete the handle to the menu.
153};
154
155//
156/// \class TXMenu
157// ~~~~~ ~~~~~~
158/// A nested class, TXMenu describes an exception that occurs when a menu item
159/// cannot be constructed.
160class _OWLCLASS TXMenu : public TXOwl {
161 public:
163
164 TXMenu* Clone();
165 void Throw();
166
167 static void Raise(uint resId = IDS_MENUFAILURE);
168};
169
170//
171/// \class TSystemMenu
172// ~~~~~ ~~~~~~~~~~~
173/// TSystemMenu creates a system menu object that then becomes the existing system
174/// menu.
176 public:
177 TSystemMenu(HWND wnd, bool revert= false);
178
179 private:
180 TSystemMenu();
181 TSystemMenu(const TSystemMenu&);
182};
183
184//
185/// \class TPopupMenu
186// ~~~~~ ~~~~~~~~~~
187/// TPopupMenu creates an empty pop-up menu to add to an existing window or pop-up
188/// menu.
189class _OWLCLASS TPopupMenu : public TMenu {
190 public:
194 int TrackPopupMenu(uint flags, int x, int y, int rsvd, HWND wnd, const TRect* rect=nullptr);
195 int TrackPopupMenu(uint flags, const TPoint& point, int rsvd, HWND wnd, const TRect* rect=nullptr);
196
197 private:
198 TPopupMenu(const TPopupMenu&);
199};
200
201//
202/// \class TMenuDescr
203// ~~~~~ ~~~~~~~~~~
204/// Menu with information used to allow merging
205//
206class _OWLCLASS TMenuDescr : public TMenu {
207 public:
208/// Used by TMenuDescr, the TGroup enum describes the following constants that
209/// define the index of the entry in the GroupCount array.
210 enum TGroup {
211 FileGroup, ///< Index of the File menu group count
212 EditGroup, ///< Index of the Edit menu group count
213 ContainerGroup, ///< Index of the Container menu group count
214 ObjectGroup, ///< Index of the Object group count
215 WindowGroup, ///< Index of the Window menu group count
216 HelpGroup, ///< Index of the Help menu group count
217 NumGroups ///< Total number of groups
218 };
219 TMenuDescr();
221 TMenuDescr(TResId id, int fg, int eg, int cg, int og, int wg, int hg,
222 TModule* module = &GetGlobalModule());
223 TMenuDescr(TResId id, TModule* module = &GetGlobalModule());
224 TMenuDescr(HMENU hMenu, int fg, int eg, int cg, int og, int wg, int hg,
225 TModule* module = &GetGlobalModule());
226 ~TMenuDescr();
227
229
230 HMENU GetHandle() const;
231 TModule* GetModule() const;
232 void SetModule(TModule* module);
233 TResId GetId() const;
234 int GetGroupCount(int group) const;
235
236 void ClearServerGroupCount(); ///< Not implemented?
237 void ClearContainerGroupCount(); ///< Not implemented?
238
239 bool Merge(const TMenuDescr& sourceMenuDescr);
240 bool Merge(const TMenuDescr& sourceMenuDescr, TMenu& destMenu);
241
242 protected:
243 bool ExtractGroups();
244
246/// Points to the TModule object that owns this TMenuDescr.
248
249/// The resource ID for the menu. The resource ID is passed in the constructors to
250/// identify the menu resource.
251 TResId Id;
252
253/// An array of values indicating the number of pop-up menus in each group on the
254/// menu bar.
255 int GroupCount[NumGroups];
256
259};
260
261/// @}
262
263#include <owl/posclass.h>
264
265//----------------------------------------------------------------------------
266// Inline implementations
267//
268
269//
270/// Gets the handle to the menu, possibly causing any deferred menu acquisition to
271/// occur.
273{
274 return TMenu::GetHandle();
275}
276
277//
278/// Returns a pointer to the module object.
280{
281 return Module;
282}
283
284//
285/// Sets the default module object for this menu descriptor.
286inline void TMenuDescr::SetModule(TModule* module)
287{
288 Module = module;
289}
290
291//
292/// Gets the menu resource ID used to construct the menu descriptor.
294{
295 return Id;
296}
297
298//
299/// Gets the number of menus in a specified group within the menu bar. There are a
300/// maximum of six functional groups as defined by the TGroup enum. These groups
301/// include FileGroup, EditGroup, ContainerGroup, ObjectGroup, WindowGroup, and
302/// HelpGroup.
303inline int TMenuDescr::GetGroupCount(int group) const
304{
305 return GroupCount[group];
306}
307
308//
309/// Returns the handle to the menu.
311{
312 return Handle;
313}
314
315//
316/// Returns the menu's handle. This function provides compatibility with functions
317/// that require a TMenuItem menu parameter.
318//
319inline TMenu::operator TMenuItem() const
320{
321 return reinterpret_cast<TMenuItem>(GetHandle());
322}
323
324//
325/// Returns the menu's handle.
326inline TMenu::operator HMENU() const
327{
328 return GetHandle();
329}
330
331//
332/// Returns true if the menu has a valid handle.
333inline bool TMenu::IsOK() const
334{
335 return GetHandle() != nullptr;
336}
337
338//
339/// Adds a text menu item to the end of the menu. See TMenu::GetMenuState for a
340/// description of the flag values that specify the attributes of the menu, for
341/// example, menu item is checked, menu item is a a bitmap, and so on.
343{
344 PRECONDITION(Handle);
345 return ::AppendMenu(Handle, flags, newItem, newStr);
346}
347
348//
349/// Adds a bitmap menu item at the end of the menu. See TMenu::GetMenuState for a
350/// description of the flag values that specify the attributes of the menu; for
351/// example, menu item is checked, menu item is disabled, and so on.
353{
354 PRECONDITION(Handle);
355 return ::AppendMenu(Handle, flags|MF_BITMAP, newItem,
356 reinterpret_cast<LPCTSTR>(newBmp.GetHandle()));
357}
358
359//
360/// Checks or unchecks the menu item. By combining flags with the bitwise OR
361/// operator (|) check specifies both the position of item (MF_BYCOMMAND,
362/// MF_BYPOSITION) and whether item is to be checked (MF_CHECKED) or unchecked
363/// (MF_UNCHECKED).
364inline bool TMenu::CheckMenuItem(uint item, uint check)
365{
366 PRECONDITION(Handle);
367 return ::CheckMenuItem(Handle, item, check);
368}
369
370//
371/// Removes the menu item (item) from the menu or deletes the menu item if it's a
372/// pop-up menu. flags is used to identify the position of the menu item by its
373/// relative position in the menu (MF_BYPOSITION) or by referencing the handle to
374/// the top-level menu (MF_BYCOMMAND).
375inline bool TMenu::DeleteMenu(uint item, uint flags)
376{
377 PRECONDITION(Handle);
378 return ::DeleteMenu(Handle, item, flags);
379}
380
381//
382/// Enables, disables, or grays the menu item specified in the item parameter. If a
383/// menu item is enabled (the default state), it can be selected and used as usual.
384/// If a menu item is grayed, it appears in grayed text and cannot be selected by
385/// the user. If a menu item is disabled, it is not displayed. Returns true if
386/// successful.
388{
389 PRECONDITION(Handle);
390 return ::EnableMenuItem(Handle, item, enable);
391}
392
393//
394/// Returns the number of items in a top-level or pop-up menu.
396{
397 PRECONDITION(Handle);
398 return ::GetMenuItemCount(Handle);
399}
400
401//
402/// Returns the menu flags for the menu item specified by item. flags specifies how
403/// the item is interpreted, and is one of the following values:
404/// - \c \b MF_BYCOMMAND Interpret item as a menu command ID. Default it neither
405/// - \c \b MF_BYCOMMAND nor MF_BYPOSITION is specified.
406/// - \c \b MF_BYPOSITION Interpret item as the zero-base relative postion of the menu item
407/// within the menu.
408///
409/// If item is found, and is a pop-up menu, the low-order byte of the return value
410/// contains the flags associated with item, and the high-order byte contains the
411/// number of items in the pop-up menu. If itemis not a pop-up menu, the return
412/// value specifies a combination of these flags:
413///
414/// - \c \b MF_BITMAP Menu item is a a bitmap.
415/// - \c \b MF_CHECKED Menu item is checked (pop-up menus only).
416/// - \c \b MF_DISABLED Menu item is disabled.
417/// - \c \b MF_ENABLED Menu item is enabled. \note this constant's value is 0.
418/// - \c \b MF_GRAYED Menu item is disabled and grayed.
419/// - \c \b MF_MENUBARBREAK Same as MF_MENUBREAK except pop-up menu columns are separated by
420/// a vertical dividing line.
421/// - \c \b MF_MENUBREAK Static menu items are placed on a new line, pop-up menu items are
422/// placed in a new column, without separating columns.
423/// - \c \b MF_SEPARATOR A horizontal dividing line is drawn, which cannot be enabled,
424/// checked, grayed, or highlighted. Both item and flags are ingonred.
425/// - \c \b MF_UNCHECKED Menu item check mark is removed (default). \note this constant
426/// value is 0.
427///
428/// Returns -1 if item doesn't exist.
429//
430inline uint TMenu::GetMenuState(uint item, uint flags) const
431{
432 PRECONDITION(Handle);
433 return ::GetMenuState(Handle, item, flags);
434}
435
436//
437/// Returns the label (str) of the menu item (item).
438inline int TMenu::GetMenuString(uint item, LPTSTR str, int count, uint flags) const
439{
440 PRECONDITION(Handle);
441 return ::GetMenuString(Handle, item, str, count, flags);
442}
443
444//
445/// Returns the handle of the menu specified by posItem.
447{
448 PRECONDITION(Handle);
449 return ::GetSubMenu(Handle, posItem);
450}
451
452//
453/// Inserts a new text menu item or pop-up menu into the menu after the menu item
454/// specified in item. The flagsparameter contains either the MF_BYCOMMAND or
455/// MF_BYPOSITION values that indicate how to interpret the item parameter. If
456/// MF_BYCOMMAND, item is a command ID; if MF_BYPOSITION, item holds a relative
457/// position within the menu.
459{
460 PRECONDITION(Handle);
461 return ::InsertMenu(Handle, item, flags|MF_STRING, newItem, newStr);
462}
463
464//
465/// Adds a bitmap menu item after the menu item specified in item. The flags
466/// parameter contains either the MF_BYCOMMAND or MF_BYPOSITION values that indicate
467/// how to interpret the item parameter. If MF_BYCOMMAND, item is a command ID; if
468/// MF_BYPOSITION, item holds a relative position within the menu.
469inline bool TMenu::InsertMenu(uint item, uint flags, TMenuItem newItem, const TBitmap& newBmp)
470{
471 return ::InsertMenu(Handle, item, flags|MF_BITMAP, newItem,
472 reinterpret_cast<LPCTSTR>(newBmp.GetHandle()));
473}
474
475//
476/// Changes an existing menu item from the item specified in item to newItem. The
477/// flags parameter contains either the MF_BYCOMMAND or MF_BYPOSITION values that
478/// indicate how to interpret the item parameter. If MF_BYCOMMAND, item is a command
479/// ID; if MF_BYPOSITION, item holds a relative position within the menu.
481{
482 PRECONDITION(Handle);
483 return ::ModifyMenu(Handle, item, flags|MF_STRING, newItem, newStr);
484}
485
486//
487/// Changes an existing menu item into a bitmap. The flags parameter contains either
488/// the MF_BYCOMMAND or MF_BYPOSITION values that indicate how to interpret the item
489/// parameter. If MF_BYCOMMAND, item is a command ID; if MF_BYPOSITION, item holds a
490/// relative position within the menu.
491inline bool TMenu::ModifyMenu(uint item, uint flags, TMenuItem newItem, const TBitmap& newBmp)
492{
493 PRECONDITION(Handle);
494 return ::ModifyMenu(Handle, item, flags|MF_BITMAP, newItem,
495 reinterpret_cast<LPCTSTR>(newBmp.GetHandle()));
496}
497
498//
499/// Removes the menu item from the menu but does not delete it if it is a submenu.
500inline bool TMenu::RemoveMenu(uint item, uint flags)
501{
502 PRECONDITION(Handle);
503 return ::RemoveMenu(Handle, item, flags);
504}
505
506//
507/// Specifies the bitmap to be displayed when the menu item is checked and
508/// unchecked. item indicates the menu item to be associated with the bitmap. flags
509/// indicates how the size parameter is interpreted (whether by MF_BYPOSITION or by
510/// MF_BYCOMMAND). GetMenuCheckMarkDimensions gets the size of the bitmap.
511inline bool TMenu::SetMenuItemBitmaps(uint item, uint flags,
512 const TBitmap* bmpUnchecked,
513 const TBitmap* bmpChecked)
514{
515 PRECONDITION(Handle);
516 return ::SetMenuItemBitmaps(Handle, item, flags,
517 bmpUnchecked ? HBITMAP(*bmpUnchecked) : nullptr,
518 bmpChecked ? HBITMAP(*bmpChecked) : nullptr);
519}
520
521//
522/// Gets the size of the bitmap used to display the default check mark on checked
523/// menu items.
524/// Always returns true. The size reference stores the dimensions of the checkmark
525/// bitmaps.
526//
528{
530 return true;
531}
532
533//
534/// Return the dimensions of the check mark bitmaps.
535//
540
541//
542/// Allows the application to create a pop-up menu at the specified location in the
543/// specified window. flags specifies a screen position and can be one of the
544/// TPM_xxxx values (TPM_CENTERALIGN, TPM_LEFTALIGN, TPM_RIGHTALIGN, TPM_LEFTBUTTON,
545/// or TPM_RIGHTBUTTON). wnd is the handle to the window that receives messages
546/// about the menu. x specifies the horizontal position in screen coordinates of the
547/// left side of the menu. y species the vertical position in screen coordinates of
548/// the top of the menu (for example, 0,0 specifies that a menu's left corner is in
549/// the top left corner of the screen). rect defines the area that the user can
550/// click without dismissing the menu.
551///
552/// If you specify TPM_RETURNCMD in the flags parameter, the return value is the
553/// menu-item identifier of the item that the user selected. If the user cancels
554/// the menu without making a selection, or if an error occurs, then the return
555/// value is zero.
556///
557/// If you do not specify TPM_RETURNCMD in the flags parameter, the return value
558/// is nonzero if the function succeeds and zero if it fails. To get extended
559/// error information, call GetLastError.
560//
561inline int TPopupMenu::TrackPopupMenu(uint flags, int x, int y, int rsvd,
562 HWND wnd, const TRect* rect)
563{
565 return ::TrackPopupMenu(GetHandle(), flags, x, y, rsvd, wnd, rect);
566}
567
568//
569/// TPoint-aware overload
570//
572 int rsvd, HWND wnd, const TRect* rect)
573{
575 return ::TrackPopupMenu(GetHandle(), flags, point.x, point.y, rsvd, wnd, rect);
576}
577
578} // OWL namespace
579
580
581#endif // OWL_MENU_H
#define PRECONDITION(condition)
Definition checks.h:227
TBitmap is the GDI bitmap class derived from TGdiObject.
Definition gdiobjec.h:510
Menu with information used to allow merging.
Definition menu.h:206
int GetGroupCount(int group) const
Gets the number of menus in a specified group within the menu bar.
Definition menu.h:303
HMENU GetHandle() const
Gets the handle to the menu, possibly causing any deferred menu acquisition to occur.
Definition menu.h:272
void ClearContainerGroupCount()
Not implemented?
TModule * GetModule() const
Returns a pointer to the module object.
Definition menu.h:279
void ClearServerGroupCount()
Not implemented?
TGroup
Used by TMenuDescr, the TGroup enum describes the following constants that define the index of the en...
Definition menu.h:210
@ FileGroup
Index of the File menu group count.
Definition menu.h:211
@ ContainerGroup
Index of the Container menu group count.
Definition menu.h:213
@ HelpGroup
Index of the Help menu group count.
Definition menu.h:216
@ ObjectGroup
Index of the Object group count.
Definition menu.h:214
@ EditGroup
Index of the Edit menu group count.
Definition menu.h:212
@ WindowGroup
Index of the Window menu group count.
Definition menu.h:215
TResId GetId() const
Gets the menu resource ID used to construct the menu descriptor.
Definition menu.h:293
void SetModule(TModule *module)
Sets the default module object for this menu descriptor.
Definition menu.h:286
The TMenu class encapsulates window menus.
Definition menu.h:77
uint GetMenuItemCount() const
Returns the number of items in a top-level or pop-up menu.
Definition menu.h:395
bool ModifyMenu(uint item, uint flags, TMenuItem newItem, const tstring &newStr)
Definition menu.h:115
bool ModifyMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr=nullptr)
Changes an existing menu item from the item specified in item to newItem.
Definition menu.h:480
bool InsertMenu(uint item, uint flags, TMenuItem newItem=-1, LPCTSTR newStr=nullptr)
Inserts a new text menu item or pop-up menu into the menu after the menu item specified in item.
Definition menu.h:458
bool InsertMenu(uint item, uint flags, TMenuItem newItem, const tstring &newStr)
Definition menu.h:112
bool RemoveMenu(uint item, uint flags)
Removes the menu item from the menu but does not delete it if it is a submenu.
Definition menu.h:500
bool AppendMenu(uint flags, TMenuItem newItem, const tstring &newStr)
Definition menu.h:100
bool SetMenuItemBitmaps(uint item, uint flags, const TBitmap *bmpUnchecked=nullptr, const TBitmap *bmpChecked=nullptr)
Specifies the bitmap to be displayed when the menu item is checked and unchecked.
Definition menu.h:511
bool DeleteMenu(uint item, uint flags)
Removes the menu item (item) from the menu or deletes the menu item if it's a pop-up menu.
Definition menu.h:375
uint GetMenuState(uint item, uint flags) const
Returns the menu flags for the menu item specified by item.
Definition menu.h:430
bool CheckMenuItem(uint item, uint check)
Checks or unchecks the menu item.
Definition menu.h:364
static TSize GetMenuCheckMarkDimensions()
Return the dimensions of the check mark bitmaps.
Definition menu.h:536
HMENU GetSubMenu(int posItem) const
Returns the handle of the menu specified by posItem.
Definition menu.h:446
int GetMenuString(uint item, TCHAR *str, int count, uint flags) const
Returns the label (str) of the menu item (item).
Definition menu.h:438
bool EnableMenuItem(uint item, uint enable)
Enables, disables, or grays the menu item specified in the item parameter.
Definition menu.h:387
bool IsOK() const
Returns true if the menu has a valid handle.
Definition menu.h:333
bool AppendMenu(uint flags, TMenuItem newItem=static_cast< unsigned int >(-1), LPCTSTR newStr=nullptr)
Adds a text menu item to the end of the menu.
Definition menu.h:342
virtual HMENU GetHandle() const
Returns the handle to the menu.
Definition menu.h:310
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition module.h:75
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
int TrackPopupMenu(uint flags, int x, int y, int rsvd, HWND wnd, const TRect *rect=nullptr)
Allows the application to create a pop-up menu at the specified location in the specified window.
Definition menu.h:561
TRect is a mathematical class derived from tagRect.
Definition geometry.h:308
The tagSIZE struct is defined as.
Definition geometry.h:234
TSystemMenu creates a system menu object that then becomes the existing system menu.
Definition menu.h:175
A nested class, TXMenu describes an exception that occurs when a menu item cannot be constructed.
Definition menu.h:160
TXOwl is root class of the ObjectWindows exception hierarchy.
Definition except.h:38
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition objstrm.h:391
Base class for writing streamable objects.
Definition objstrm.h:480
Definition of abstract GDI object class and derived classes.
TAutoDelete
Flag for Handle ctors to control Handle deletion in dtor.
Definition gdibase.h:70
@ AutoDelete
Definition gdibase.h:70
@ NoAutoDelete
Definition gdibase.h:70
#define MIIM_ALL
Definition menu.h:39
UINT_PTR TMenuItem
Represents an unsigned integer or handle which identifies a new menu item.
Definition menu.h:34
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
TModule * Module
Definition global.cpp:34
std::string tstring
Definition defs.h:79
unsigned int uint
Definition number.h:25
TModule & GetGlobalModule()
Definition global.cpp:48
#define protected_data
Definition defs.h:208
#define _OWLCFUNC(p)
Definition defs.h:342
#define _OWLCLASS
Definition defs.h:338
Classes for window system structure and type encapsulation.