OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TDrawMenuItemProxy Class Reference

Derived from TDrawItemProxy, TDrawMenuItemProxy is a proxy parent for TDrawMenuItem. More...

#include <owl/drawitem.h>

Inheritance diagram for owl::TDrawMenuItemProxy:
owl::TDrawItemProxy

Public Types

typedef TTypedArray< uint, uint, TStandardAllocator > TUIntAray
 Container of TDrawItem's.
Public Types inherited from owl::TDrawItemProxy
typedef TIPtrArray< TDrawItem * > TDrawItemArray

Public Member Functions

 TDrawMenuItemProxy (TResId resId, TModule *module=&GetGlobalModule())
 Constructs a TDrawMenuItemProxy object using the specified resource.
virtual ~TDrawMenuItemProxy ()
 Destroys the instance.
TDrawItem * FindItem (uint cmdId)
 Returns the TDrawItem with id cmdId, or 0 if it doesn't exist.
void RemapMenu (HMENU hMenu)
 Walks through the menu tree hMenu adding seperators.
bool EvMenuChar (uint uChar, uint, HMENU hMenu, TParam2 &param)
 Returns true if a shortcut was pressed that fits into the menu and false if not.
Public Member Functions inherited from owl::TDrawItemProxy
 TDrawItemProxy (TFont *font=0)
 Constructs a TDrawItemProxy object using the specified font.
virtual ~TDrawItemProxy ()
 Deletes Font. If DeleteCel is true, delets CelArray.
void SetFont (TFont *font)
 Deletes Font and sets it to font.
virtual TFont * GetFont ()
void SetCelArray (TCelArray *celarray, TAutoDelete del=AutoDelete)
 If DeleteCel is true, deletes CelArray.
void SetCelArray (TResId resId, uint count, TModule *module=&GetGlobalModule())
 Loads a TDib with resource id resId from module.
virtual TCelArray * GetCelArray ()
void RegisterItem (TDrawItem *item)
 For automatic deletion of items.
TDrawItemArray & GetItems ()
 Returns ItemArray.

Protected Member Functions

int GetIndex (int cmdId)
 Returns the array index of the item with id cmdId.
virtual TDrawItem * CreateItem (uint itemId, const tstring &text)
 Returns the item with id cmdId if it exists; otherwise creates a new item and returns it.

Static Protected Member Functions

static TFont * CreateProxyMenuFont ()
 Creates a font for use in menu bars.

Protected Attributes

TUIntAray * Array
 Array of id's.

Detailed Description

Derived from TDrawItemProxy, TDrawMenuItemProxy is a proxy parent for TDrawMenuItem.

Definition at line 229 of file drawitem.h.

Member Typedef Documentation

◆ TUIntAray

Container of TDrawItem's.

Definition at line 232 of file drawitem.h.

Constructor & Destructor Documentation

◆ TDrawMenuItemProxy()

◆ ~TDrawMenuItemProxy()

owl::TDrawMenuItemProxy::~TDrawMenuItemProxy ( )
virtual

Destroys the instance.

Definition at line 1372 of file drawitem.cpp.

References Array.

Member Function Documentation

◆ CreateItem()

TDrawItem * owl::TDrawMenuItemProxy::CreateItem ( uint itemId,
const tstring & text )
protectedvirtual

◆ CreateProxyMenuFont()

TFont * owl::TDrawMenuItemProxy::CreateProxyMenuFont ( )
staticprotected

Creates a font for use in menu bars.

Definition at line 1335 of file drawitem.cpp.

References owl::TFont::TFont().

◆ EvMenuChar()

bool owl::TDrawMenuItemProxy::EvMenuChar ( uint uChar,
uint ,
HMENU hMenu,
TParam2 & param )

Returns true if a shortcut was pressed that fits into the menu and false if not.

Definition at line 1449 of file drawitem.cpp.

References _T, _tcschr, _totupper, owl::TButtonTextDrawItem::GetText(), owl::MkUint32(), PRECONDITION, and TYPESAFE_DOWNCAST.

◆ FindItem()

TDrawItem * owl::TDrawMenuItemProxy::FindItem ( uint cmdId)

Returns the TDrawItem with id cmdId, or 0 if it doesn't exist.

Definition at line 1489 of file drawitem.cpp.

References GetIndex(), owl::TDrawItemProxy::GetItems(), owl::TArrayBase::NPOS, and owl::TArrayBase::Size().

◆ GetIndex()

int owl::TDrawMenuItemProxy::GetIndex ( int cmdId)
protected

Returns the array index of the item with id cmdId.

Definition at line 1508 of file drawitem.cpp.

References Array, and owl::TTypedArray< T, R, A >::Find().

◆ RemapMenu()

void owl::TDrawMenuItemProxy::RemapMenu ( HMENU hMenu)

Walks through the menu tree hMenu adding seperators.

Definition at line 1405 of file drawitem.cpp.

References CreateItem(), MAX_PATH, RemapMenu(), and owl::TButtonTextDrawItem::sepNoBitmap.

Member Data Documentation

◆ Array

TUIntAray* owl::TDrawMenuItemProxy::Array
protected

Array of id's.

Definition at line 249 of file drawitem.h.


The documentation for this class was generated from the following files: