|
OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Derived from TButtonTextDrawItem, the TDrawMenuItem class is used for owner drawn menus. More...
#include <owl/drawitem.h>
Public Types | |
| typedef void(TDrawMenuItem::* | TCheckPainter) (TDC &dc, TRect &rect) |
| Prototype for a function used to paint the check image of a menu item. | |
Public Types inherited from owl::TButtonTextDrawItem | |
| enum | TAlign { aLeft , aCenter , aRight } |
| TAlign contains values that defines how text will be layed out. More... | |
| enum | TStyle { sNone =0 , sBitmap =0x001 , sText =0x002 , sBitmapText =0x003 } |
| TStyle contains values that defines how the button will be displayed. More... | |
| enum | TLayoutStyle { lTextLeft , lTextTop , lTextRight , lTextBottom } |
| TLayoutStyle contains values that defines how a bitmap and text will be layed out. More... | |
| enum | TSeparator { sepNoBitmap =-2 , sepUseBitmap =-1 } |
Public Types inherited from owl::TDrawItem | |
| typedef const char * | Type_id |
Public Types inherited from owl::TDrawItemBase | |
| enum | TDrawItemId { drawId = 0x69777264 } |
Public Member Functions | |
| TDrawMenuItem (TDrawItemProxy *proxy, int cmdId, int index, LPCTSTR title=0) | |
| Called with the proxy parent, the command it, the index in the menu and the text to display. | |
| TDrawMenuItem (TDrawItemProxy *proxy, int cmdId, int index, const tstring &title) | |
| String-aware overload. | |
| virtual void | PaintBitmap (TDC &dc, TRect &rect) |
| Paint the bitmap on the menu entry. | |
| virtual void | PaintText (TDC &rc, TRect &rect) |
| virtual void | GetTextSize (TSize &size) |
| virtual void | GetButtonSize (TSize &btnSize) |
| Get the size of the bitmap button. | |
| virtual TColor | GetBkColor () |
| If the menu item is selected returns TColor::SysActiveCaption; otherwise returns TColor::SysMenu. | |
| virtual TColor | GetTextColor () |
| Returns the text color. | |
| virtual void | PaintCheckFace (TDC &dc, TRect &rect) |
| If checked, clears the area in preparation for painting the check mark. | |
| int | GetCmdId () |
| Returns CmdId. | |
| void | SetCheckPainter (TCheckPainter painter) |
| Set the routine to be used to paint the check mark. | |
| void | PaintCheck_None (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_3Angle (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_Arrow (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_Box (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_Diamond (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_Dot (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_Plus (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_V (TDC &dc, TRect &rect) |
| Draw this: | |
| void | PaintCheck_X (TDC &dc, TRect &rect) |
| Draw this: | |
Public Member Functions inherited from owl::TButtonTextDrawItem | |
| TButtonTextDrawItem (TDrawItemProxy *proxy=0) | |
| Constructs a TButtonTextDrawItem with proxy as it's parent. | |
| ~TButtonTextDrawItem () | |
| Destroys a TButtonTextDrawItem object. If DeleteCel is true, deletes CelArray. | |
| LPCTSTR | GetText () const |
| Returns Text, the text do display on the button. | |
| void | SetText (LPCTSTR text) |
| Deletes Text and clears the text style. | |
| void | SetText (const tstring &text) |
| int | GetIndex () const |
| Returns Index, the index of Bitmap in the Proxy CellArray or -1. | |
| void | SetIndex (int index) |
| Index is set to index and the sBitmap style is cleared from Style. | |
| TStyle | GetStyle () const |
| Returns Style: Bitmap only, Text only, or Bitmap and Text. | |
| void | SetStyle (const TStyle style) |
| Sets Style to style. | |
| TAlign | GetAlign () const |
| Returns Align. | |
| void | SetAlign (const TAlign align) |
| Sets Align to align. | |
| TLayoutStyle | GetLayoutStyle () const |
| Returns LayoutStyle. | |
| void | SetLayoutStyle (const TLayoutStyle style) |
| Sets LayoutStyle to style. | |
| void | SetFont (TFont *font) |
| Deletes Font and then assigns font to Font. | |
| virtual TFont * | GetFont () |
| void | SetCelArray (TCelArray *celarray, TAutoDelete del=AutoDelete) |
| If DeleteCel is true, CelArray is deleted. | |
| void | SetCelArray (TResId resId, uint count, TModule *module=&GetGlobalModule()) |
| A bitmap with resource id resId is loaded from module and used to create a TCelArray with count cells. | |
| virtual TCelArray * | GetCelArray () |
| virtual void | Draw (DRAWITEMSTRUCT &drawItem) |
| Extracts information from drawItem and calls Paint. | |
| virtual void | Measure (MEASUREITEMSTRUCT &drawItem) |
| Calculates the area required to display the button and text. | |
| virtual int | Compare (COMPAREITEMSTRUCT &drawItem) |
| Does an lstrcmp on Text from the instances contained in drawItem. | |
| virtual void | Paint (TDC &rc, TRect &rect) |
| Paint function. | |
| virtual void | Layout (const TRect &src, TRect &textRect, TRect &bmpRect) |
| Layout Text and Bitmap. | |
| virtual void | PaintBorder (TDC &rc, TRect &rect) |
| Paint the border of the gadget based on the BorderStyle member. | |
| bool | IsEnabled () |
| Returns true if (Flags & ODS_DISABLED)==0; false otherwise. | |
| bool | IsSelected () |
| Returns true if (Flags & ODS_SELECTED)==0; false otherwise. | |
| bool | IsFocused () |
| Returns true if (Flags & ODS_FOCUS)==0; false otherwise. | |
| bool | IsGrayed () |
| Returns true if (Flags & ODS_GRAYED)==0; false otherwise. | |
| bool | IsChecked () |
| Returns true if (Flags & ODS_CHECKED)==0; false otherwise. | |
Public Member Functions inherited from owl::TDrawItemBase | |
| TDrawItemBase () | |
| virtual | ~TDrawItemBase () |
Public Attributes | |
| DECLARE_CASTABLE | |
Public Attributes inherited from owl::TDrawItem | |
| DECLARE_CASTABLE | |
Public Attributes inherited from owl::TDrawItemBase | |
| DECLARE_CASTABLE | |
| uint32 | __itemId |
Derived from TButtonTextDrawItem, the TDrawMenuItem class is used for owner drawn menus.
Definition at line 184 of file drawitem.h.
Prototype for a function used to paint the check image of a menu item.
Definition at line 187 of file drawitem.h.
| owl::TDrawMenuItem::TDrawMenuItem | ( | TDrawItemProxy * | proxy, |
| int | cmdId, | ||
| int | index, | ||
| LPCTSTR | title = 0 ) |
Called with the proxy parent, the command it, the index in the menu and the text to display.
Definition at line 447 of file drawitem.cpp.
References owl::TButtonTextDrawItem::SetIndex(), and owl::TButtonTextDrawItem::SetText().
| owl::TDrawMenuItem::TDrawMenuItem | ( | TDrawItemProxy * | proxy, |
| int | cmdId, | ||
| int | index, | ||
| const tstring & | title ) |
String-aware overload.
Definition at line 458 of file drawitem.cpp.
References owl::TButtonTextDrawItem::SetIndex(), and owl::TButtonTextDrawItem::SetText().
|
virtual |
If the menu item is selected returns TColor::SysActiveCaption; otherwise returns TColor::SysMenu.
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 498 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsSelected(), owl::TColor::SysActiveCaption, and owl::TColor::SysMenu.
Get the size of the bitmap button.
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 481 of file drawitem.cpp.
References owl::TButtonTextDrawItem::sepNoBitmap.
|
inline |
Returns CmdId.
Definition at line 340 of file drawitem.h.
|
virtual |
Returns the text color.
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 506 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), owl::TButtonTextDrawItem::IsSelected(), owl::TColor::Sys3dHilight, and owl::TColor::SysMenuText.
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 469 of file drawitem.cpp.
References owl::TButtonTextDrawItem::GetStyle(), owl::TButtonTextDrawItem::GetTextSize(), owl::TButtonTextDrawItem::sBitmap, and owl::TextSpaceE.
Paint the bitmap on the menu entry.
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 517 of file drawitem.cpp.
References owl::TUIFace::Disabled, owl::TUIFace::Indeterm, owl::TButtonTextDrawItem::IsChecked(), owl::TButtonTextDrawItem::IsEnabled(), owl::TButtonTextDrawItem::IsGrayed(), owl::TButtonTextDrawItem::IsSelected(), owl::TUIFace::Normal, owl::TUIBorder::Paint(), PaintCheck_None(), owl::TUIBorder::RaisedInner, owl::TButtonTextDrawItem::sBitmap, owl::TDC::SetBkColor(), owl::TUIBorder::SunkenInner, owl::TColor::SysMenu, and owl::TDC::TextRect().
Draw this:
Definition at line 708 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), PaintCheckFace(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 780 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), PaintCheckFace(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 856 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), owl::TDC::LineTo(), owl::TDC::MoveTo(), PaintCheckFace(), owl::TDC::RestorePen(), owl::TDC::SelectObject(), owl::TColor::Sys3dHilight, and owl::TDC::TextRect().
Draw this:
Definition at line 918 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), PaintCheckFace(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 1002 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), owl::TDC::LineTo(), owl::TDC::MoveTo(), PaintCheckFace(), owl::TDC::RestorePen(), owl::TDC::SelectObject(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 1076 of file drawitem.cpp.
References PaintCheckFace().
Draw this:
Definition at line 1111 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), owl::TDC::LineTo(), owl::TDC::MoveTo(), PaintCheckFace(), owl::TDC::RestorePen(), owl::TDC::SelectObject(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 1183 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), PaintCheckFace(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
Draw this:
Definition at line 1263 of file drawitem.cpp.
References owl::TButtonTextDrawItem::IsEnabled(), PaintCheckFace(), owl::TDC::SetPixel(), and owl::TColor::Sys3dHilight.
If checked, clears the area in preparation for painting the check mark.
Definition at line 673 of file drawitem.cpp.
References owl::TDC::FillRect(), owl::TUIFace::GetDitherBrush(), owl::TButtonTextDrawItem::IsChecked(), owl::TButtonTextDrawItem::IsEnabled(), owl::TButtonTextDrawItem::IsSelected(), owl::TUIBorder::Paint(), owl::TUIBorder::Recessed, owl::TDC::SetBkColor(), owl::TColor::SysMenu, and owl::TDC::TextRect().
Reimplemented from owl::TButtonTextDrawItem.
Definition at line 579 of file drawitem.cpp.
References _T, owl::TButtonTextDrawItem::aCenter, owl::TButtonTextDrawItem::aLeft, owl::TButtonTextDrawItem::aRight, owl::TUIFace::Disabled, GetBkColor(), GetTextColor(), owl::TButtonTextDrawItem::IsEnabled(), owl::TButtonTextDrawItem::IsGrayed(), owl::TButtonTextDrawItem::IsSelected(), owl::TButtonTextDrawItem::lTextBottom, owl::TButtonTextDrawItem::lTextLeft, owl::TButtonTextDrawItem::lTextRight, owl::TButtonTextDrawItem::lTextTop, owl::TUIFace::Normal, owl::TDC::RestoreFont(), owl::TDC::SelectObject(), owl::TDC::SetTextColor(), owl::TButtonTextDrawItem::sText, and owl::TextSpaceE.
|
inline |
Set the routine to be used to paint the check mark.
Definition at line 332 of file drawitem.h.
| owl::TDrawMenuItem::DECLARE_CASTABLE |
Definition at line 193 of file drawitem.h.