00001 /* 00002 ----------------------------------------------------------------------------- 00003 00004 File: BitmapMenuItem.h 00005 00006 Description: A menu item with a bitmap on the left. 00007 00008 Copyright 2003, 2004, yellowTAB GmbH, All rights reserved. 00009 00010 Developer: Owen Smith and others. 00011 00012 ----------------------------------------------------------------------------- 00013 */ 00014 00015 #ifndef BITMAPMENUITEM_H 00016 #define BITMAPMENUITEM_H 00017 00018 #include <interface/MenuItem.h> 00019 00020 class BBitmap; 00021 class BMessage; 00022 class BMenu; 00023 00024 namespace Z { 00025 namespace Interface { 00026 00027 class BBitmapMenuItem : public BMenuItem 00028 { 00029 public: 00030 BBitmapMenuItem( const char* _label, BBitmap* _bitmap, BMessage* _message = NULL); 00031 BBitmapMenuItem( BMenu* _submenu, BBitmap* _bitmap, BMessage* _message = NULL); 00032 virtual ~BBitmapMenuItem(); 00033 00034 virtual void GetContentSize( float* _width, float* _height ); 00035 virtual void DrawContent(); 00036 00037 virtual void TruncateLabel( float _maxWidth, char* _newLabel ); 00038 00039 void SetBitmapAutoDestruct( bool _state ); 00040 bool BitmapAutoDestruct() const; 00041 00042 protected: 00043 BBitmap* fBitmap; 00044 float fBitmapDeslX; 00045 float fBitmapDeslY; 00046 00047 private: 00048 void Init(); 00049 00050 private: 00051 bool fBitmapAutoDestruct; 00052 float fTitleAscent; 00053 float fTitleDescent; 00054 }; 00055 00056 } 00057 } 00058 00059 #ifndef _ZETA_EXPLICIT_NAMESPACE_ 00060 using Z::Interface::BBitmapMenuItem; 00061 #endif 00062 00063 00064 #endif