menuitem.h

来自「这是VCF框架的代码」· C头文件 代码 · 共 310 行

H
310
字号
#ifndef _VCF_MENUITEM_H__#define _VCF_MENUITEM_H__//MenuItem.h/*Copyright 2000-2004 The VCF Project.Please see License.txt in the top level directorywhere you installed the VCF.*/#if _MSC_VER > 1000#   pragma once#endif/* Generated by Together */#ifndef _VCF_MENUITEMEVENT_H__	#include "vcf/ApplicationKit/MenuItemEvent.h"#endif //_VCF_MENUITEMEVENT_H__namespace VCF{class MenuItemPeer;class MenuItemListener;class Menu;class AcceleratorKey;#define MENUITEM_CLASSID		"1E8CBE22-2915-11d4-8E88-00207811CFAB"/**\class MenuItem MenuItem.h "vcf/ApplicationKit/MenuItem.h"*/class APPLICATIONKIT_API MenuItem : public Item {public:	enum MenuItemEvents {				miAdded = ITEM_EVENT_ADDED,		miRemoved = ITEM_EVENT_DELETED,		miCaptionChanged = ITEM_EVENT_TEXT_CHANGED,		miStateChanged = ITEM_EVENT_CHANGED,		miImageIndexChanged = 400431,		miStateImageIndexChanged,		miIndexChanged,		miAcceleratorChanged,		miSelected,		miSeparatorStateChanged,		miCheckStateChanged,		miRadioStateChanged,		miVisibleStateChanged,		miEnabledStateChanged,		miItemClicked = MENU_ITEM_EVENT_CLICKED,		miItemUpdate = MENU_ITEM_EVENT_UPDATED	};	enum MenuItemDisplayState{		mdsChecked = Item::idsChecked,		mdsUnChecked = Item::idsUnChecked,		mdsRadioUnpressed = Item::idsRadioUnpressed,		mdsRadioPressed = Item::idsRadioPressed,		mdsVisible = 0x0100,		mdsSelected = 0x0200,		mdsEnabled = 0x0400,		mdsRadioItem = 0x0800,		mdsSeparator = 0x1000,		/**		This state value indicates that the menu item		has been bound/associated with a real menu item 		peer		*/		mdsBoundToMenuPeer = 0x01000000	};	enum {		InvalidMenuIndex = (uint32)-1	};	MenuItem(){	};	virtual ~MenuItem(){};		DELEGATE(MenuItemClicked);	DELEGATE(MenuItemUpdate);	virtual Enumerator<MenuItem*>* getChildren() = 0;	virtual void addChild( MenuItem* child ) = 0;	virtual void insertChild( const unsigned long& index, MenuItem* child ) = 0;	virtual void deleteChild( MenuItem* child ) = 0;	virtual void deleteChild( const unsigned long& index ) = 0;	virtual void clearChildren() = 0;	virtual bool isChecked() = 0;	virtual void setChecked( const bool& checked ) = 0;	virtual bool hasParent() = 0;	virtual bool hasChildren() = 0;	virtual unsigned long getChildCount() = 0;	/**	Searches all the children of this menu item for the first child menu item	whose name \em exactly matches the name parameter. This search is 	case sensitive.	@return MenuItem the found menu item. If no item is found, return is NULL.	*/	virtual MenuItem* findChildNamed( const String& name ) = 0;	/**	Searches all the children of this menu item for the first child menu item	whose name roughly matches that of the named parameter. The search	is case insensitive. For example, if you were to pass in "foo" and a menu item	had a name of "FooBar" a match would occur.	@return MenuItem the found menu item. If no item is found, return is NULL.	*/	virtual MenuItem* findChildNamedSimilarTo( const String& name ) = 0;	/**	*returns the owner of the menu item. This generally	is either a MenuBar or a PopupMenu	*/	virtual Menu* getMenuOwner() = 0;	/**	*sets the Owner for the MenuItem and for all it's children as	*well	*/	virtual void setMenuOwner( Menu* menuOwner ) = 0;	virtual MenuItem* getParent() = 0;	virtual void setParent( MenuItem* parent ) = 0;	virtual MenuItem* getChildAt( const unsigned long& index ) = 0;	virtual bool isEnabled() = 0;	virtual void setEnabled( const bool& enabled ) = 0;	virtual bool isVisible() = 0;	virtual void setVisible( const bool& visible ) = 0;	virtual bool getRadioItem() = 0;	virtual void setRadioItem( const bool& value ) = 0;	virtual void setCaption( const String& caption ) = 0;	virtual String getCaption() = 0;	virtual MenuItemPeer* getPeer() = 0;	virtual bool isSeparator() = 0;	virtual void setSeparator( const bool& separator ) = 0;	virtual void click() = 0;	virtual void update() = 0;	/**	\p	This sets the accelerator key object for the menu item. If one already exists	it is removed for this menu item. The accelerator is assigned the 	key code and modifier mask passed in, and is given a default event handler,	determined by the implementor.	\p	A menu item may have only one accelerator associated with it at any given time.	*/	virtual void setAcceleratorKey( const VirtualKeyCode& keyCode, const ulong32& modifierMask ) = 0;	/**	Sets the acclerator object for this menu item. If one already exists then it is removed.	*/	virtual void setAcceleratorKey( AcceleratorKey* accelerator ) = 0;	/**	Returns the accelerator for the menu item.	*/	virtual AcceleratorKey* getAccelerator() = 0;	virtual uint32 getChildIndex( MenuItem* child ) = 0;};};/***CVS Log info*$Log$*Revision 1.5  2006/04/07 02:35:24  ddiego*initial checkin of merge from 0.6.9 dev branch.**Revision 1.4.2.1  2006/03/14 02:25:47  ddiego*large amounts of source docs updated.**Revision 1.4  2005/07/09 23:14:53  ddiego*merging in changes from devmain-0-6-7 branch.**Revision 1.3.2.2  2005/06/06 02:34:06  ddiego*menu changes to better support win32 and osx.**Revision 1.3.2.1  2005/03/14 04:17:24  ddiego*adds a fix plus better handling of accelerator keys, ands auto menu title for the accelerator key data.**Revision 1.3  2004/12/01 04:31:21  ddiego*merged over devmain-0-6-6 code. Marcello did a kick ass job*of fixing a nasty bug (1074768VCF application slows down modal dialogs.)*that he found. Many, many thanks for this Marcello.**Revision 1.2.2.1  2004/11/18 06:45:44  ddiego*updated toolbar btn bug, and added text edit sample.**Revision 1.2  2004/08/07 02:49:08  ddiego*merged in the devmain-0-6-5 branch to stable**Revision 1.1.2.3  2004/06/06 07:05:30  marcelloptr*changed macros, text reformatting, copyright sections**Revision 1.1.2.2  2004/04/29 03:43:14  marcelloptr*reformatting of source files: macros and csvlog and copyright sections**Revision 1.1.2.1  2004/04/28 00:28:18  ddiego*migration towards new directory structure**Revision 1.13.4.1  2004/04/26 21:58:20  marcelloptr*changes for dir reorganization: _VCF_MACRO_H__**Revision 1.13  2003/12/18 05:15:57  ddiego*merge from devmain-0-6-2 branch into the stable branch**Revision 1.12.4.3  2003/10/17 21:22:54  ddiego*added menu item child count function*fixed a selection glitch in tree list control**Revision 1.12.4.2  2003/09/21 04:15:34  ddiego*moved the cvs info data to teh bottom of the header instead of the*top so it is easier to get to the actual header class declarations*instead of having to wade through all the cvs info stuff.**Revision 1.12.4.1  2003/09/12 00:09:32  ddiego*added better tabbing behaviour - fixed an earlier bug.*Code is easier to understand and it simplified the implementation*a bit as well*Moved around the RTTI definitions for various Appkit classes to a*single inline and stripped them from the various class headers**Revision 1.12  2003/05/17 20:37:03  ddiego*this is the checkin for the 0.6.1 release - represents the merge over from*the devmain-0-6-0 branch plus a few minor bug fixes**Revision 1.11.2.1  2003/03/23 03:23:45  marcelloptr*3 empty lines at the end of the files**Revision 1.11  2003/02/26 04:30:38  ddiego*merge of code in the devmain-0-5-9 branch into the current tree.*most additions are in the area of the current linux port, but the major*addition to this release is the addition of a Condition class (currently*still under development) and the change over to using the Delegate class*exclusively from the older event handler macros.**Revision 1.10.2.2  2002/12/27 23:04:32  marcelloptr*Improved macros for automatic import/export of libraries. - Warning fixes. - Other Minor Changes.**Revision 1.10.2.1  2002/12/02 00:38:34  ddiego*more fixes to get the ApplicationKit to compile under mingw. Everything now*compiles OK at this point.**Revision 1.10  2002/11/18 00:46:07  ddiego*this is the merge over of all the bug fixes and features (mostly*VCF Builder stuff) from the devmain-0-5-8 branch**Revision 1.9.16.1  2002/09/27 23:38:35  ddiego*added support for geting various layout information*added support for drawing various graphics UI primitives like scroll buttons*tabs, tab pages, etc, partially to have this support in place for use*in MacOSX.*Also added scrolling buttons to TabbedPages, this fixes task 56652 in the*ApplicationKit list**Revision 1.9  2002/01/24 01:46:47  ddiego*added a cvs "log" comment to the top of all files in vcf/src and vcf/include*to facilitate change tracking**/#endif // _VCF_MENUITEM_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?