soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SMenuEx Class Reference

扩展菜单类 More...

#include <SMenuEx.h>

Inheritance diagram for SMenuEx:
SHostWnd SwndContainerImpl ISwndContainer ITimelineHandler

Public Member Functions

 SMenuEx (void)
 构造函数
 
virtual ~SMenuEx (void)
 析构函数
 
long AddRef () OVERRIDE
 添加引用
 
long Release () OVERRIDE
 释放引用
 
void OnFinalRelease () OVERRIDE
 释放对象
 
BOOL LoadMenu (LPCTSTR resId) OVERRIDE
 加载菜单资源
 
BOOL LoadMenuU8 (LPCSTR resId) OVERRIDE
 加载菜单资源(UTF-8)
 
BOOL LoadMenu2 (IXmlNode *xmlMenu) OVERRIDE
 加载菜单资源(XML)
 
BOOL InsertMenu (UINT uPosition, UINT uFlags, int nIDNewItem, LPCTSTR strText, int iIcon=-1) OVERRIDE
 插入菜单项
 
BOOL AppendMenu (UINT uFlags, int uIDNewItem, LPCTSTR lpNewItem, int iIcon=-1) OVERRIDE
 追加菜单项
 
BOOL CheckMenuRadioItem (UINT idFirst, UINT idLast, UINT idCheck, UINT uFlags) OVERRIDE
 检查菜单项(单选按钮)
 
BOOL CheckMenuItem (UINT uIdCheckItem, UINT uCheck) OVERRIDE
 检查菜单项
 
BOOL DeleteMenu (UINT uPosition, UINT uFlags) OVERRIDE
 删除菜单项
 
UINT TrackPopupMenu (UINT uFlags, int x, int y, HWND hWnd, int nScale=100) OVERRIDE
 跟踪弹出菜单
 
void DestroyMenu () OVERRIDE
 销毁菜单
 
BOOL ModifyMenuString (UINT uPosition, UINT uFlags, LPCTSTR lpItemString) OVERRIDE
 修改菜单项字符串
 
BOOL SetMenuUserData (UINT uPosition, UINT uFlags, ULONG_PTR ulUserData) OVERRIDE
 设置菜单项用户数据
 
ULONG_PTR GetMenuUserData (UINT uPosition, UINT uFlags) OVERRIDE
 获取菜单项用户数据
 
DWORD GetContextHelpId () SCONST OVERRIDE
 获取上下文帮助ID
 
void SetContextHelpId (DWORD dwId) OVERRIDE
 设置上下文帮助ID
 
IMenuEx * GetSubMenu (int nPos) OVERRIDE
 获取子菜单
 
BOOL GetMenuString (UINT uPosition, UINT uFlags, IStringT *lpItemString) OVERRIDE
 获取菜单项字符串
 
IHostWnd * GetHostWnd () OVERRIDE
 获取宿主窗口
 
SMenuExItemGetParentItem ()
 获取父菜单项
 
SMenuExGetSubMenu (int nID, BOOL byCmdId)
 获取子菜单
 
SMenuExItemGetMenuItem (int nID, BOOL byCmdId)
 获取菜单项
 

Static Public Member Functions

static void EndMenu (int nCmdId=0)
 结束菜单
 
static SMenuExGetEvtOwner ()
 获取事件所有者
 

Protected Member Functions

BOOL IniNullMenu (SMenuExRoot *ParentRoot)
 初始化一个空菜单(不应在外部调用)
 
int OnMouseActivate (HWND wndTopLevel, UINT nHitTest, UINT message)
 处理鼠标激活消息
 
void OnTimer (UINT_PTR timeID)
 处理定时器消息
 
void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 处理按键消息
 
virtual BOOL _HandleEvent (IEvtArgs *pEvt)
 处理事件
 
BOOL OnLoadLayoutFromResourceID (SXmlDoc &xmlDoc) override
 从资源ID加载布局
 
SRootWindowCreateRoot () override
 创建根窗口
 
LPCWSTR GetTranslatorContext () SCONST OVERRIDE
 获取翻译上下文
 
int GetScale () SCONST OVERRIDE
 获取缩放比例
 
SWindowFindItem (UINT uPos, UINT uFlag)
 查找菜单项
 
void ShowMenu (UINT uFlag, int x, int y)
 显示菜单
 
void HideMenu (BOOL bUncheckParentItem)
 隐藏菜单
 
void HideSubMenu ()
 隐藏子菜单
 
void RunMenu (HWND hOwner)
 运行菜单
 
void PopupSubMenu (SMenuExItem *pItem, BOOL bCheckFirstItem)
 弹出子菜单
 
void OnSubMenuHided (BOOL bUncheckItem)
 处理子菜单隐藏事件
 
 SMenuEx (SMenuExItem *pParent)
 构造函数(带父菜单项)
 
void SendInitPopupMenu2Owner (int idx)
 发送初始化弹出菜单事件给所有者
 
- Protected Member Functions inherited from SHostWnd
virtual void OnHostAnimationStarted (IAnimation *pAni)
 Called when the host window animation starts.
 
virtual void OnHostAnimationStoped (IAnimation *pAni)
 Called when the host window animation stops.
 
void _RedrawRegion (IRegionS *pRgn, CRect &rcInvalid)
 Redraws a specific region of the window.
 
void _Redraw ()
 Redraws the entire window.
 
void _RestoreClickState ()
 Restores the click state of the window.
 
void _Invalidate (LPCRECT prc)
 Invalidates a specific region of the window.
 
void _SetToolTipInfo (const SwndToolTipInfo *info, BOOL bNcTip)
 Sets tooltip information for the window.
 
void _Init ()
 Initializes the host window.
 
void _ExcludeVideoCanvasFromPaint (IRenderTarget *pRT)
 Excludes the video canvas from painting.
 
void _PaintVideoCanvasForeground (IRenderTarget *pRT)
 Paints the video canvas in the foreground.
 
void OnPrint (HDC dc, UINT uFlags=0)
 Handles the WM_PRINT message.
 
void OnPaint (HDC dc)
 Handles the WM_PAINT message.
 
BOOL OnEraseBkgnd (HDC dc)
 Handles the WM_ERASEBKGND message.
 
int OnCreate (LPCREATESTRUCT lpCreateStruct)
 Handles the WM_CREATE message.
 
void OnDestroy ()
 Handles the WM_DESTROY message.
 
void OnSize (UINT nType, CSize size)
 Handles the WM_SIZE message.
 
void OnMouseMove (UINT nFlags, CPoint point)
 Handles the WM_MOUSEMOVE message.
 
void OnMouseLeave ()
 Handles the WM_MOUSELEAVE message.
 
BOOL OnSetCursor (HWND hWnd, UINT nHitTest, UINT message)
 Handles the WM_SETCURSOR message.
 
void OnTimer (UINT_PTR idEvent)
 Handles the WM_TIMER message.
 
LRESULT OnMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse events.
 
LRESULT OnKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles key events.
 
LRESULT OnActivateApp (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles the WM_ACTIVATEAPP message.
 
BOOL OnMouseWheel (UINT nFlags, short zDelta, CPoint pt)
 Handles the WM_MOUSEWHEEL message.
 
void OnActivate (UINT nState, BOOL bMinimized, HWND wndOther)
 Handles the WM_ACTIVATE message.
 
void OnGetMinMaxInfo (LPMINMAXINFO lpMMI)
 Handles the WM_GETMINMAXINFO message.
 
void OnSetFocus (HWND wndOld)
 Handles the WM_SETFOCUS message.
 
void OnKillFocus (HWND wndFocus)
 Handles the WM_KILLFOCUS message.
 
void UpdatePresenter (HDC dc, IRenderTarget *pRT, LPCRECT rc, BYTE byAlpha=255, UINT uFlag=0)
 Updates the presenter.
 
void OnCaptureChanged (HWND wnd)
 Handles the WM_CAPTURECHANGED message.
 
LRESULT OnMenuExEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles custom menu events.
 
void OnWindowPosChanging (LPWINDOWPOS lpWndPos)
 Handles the WM_WINDOWPOSCHANGING message.
 
void OnWindowPosChanged (LPWINDOWPOS lpWndPos)
 Handles the WM_WINDOWPOSCHANGED message.
 
LRESULT OnGetObject (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles the WM_GETOBJECT message.
 
void OnSysCommand (UINT nID, CPoint lParam)
 Handles the WM_SYSCOMMAND message.
 
void OnCommand (UINT uNotifyCode, int nID, HWND wndCtl)
 Handles the WM_COMMAND message.
 
virtual IToolTipCreateTooltip () const
 Creates a tooltip for the container.
 
virtual void DestroyTooltip (IToolTip *pTooltip) const
 Destroys the specified tooltip.
 
virtual SXmlNode OnGetInitXmlNode (SXmlDoc &xmlDoc)
 Gets the initial XML node.
 
virtual void OnUserXmlNode (SXmlNode xmlUser)
 Handles user-defined XML node.
 
LRESULT OnSetLanguage (UINT uMsg, WPARAM wp, LPARAM lp)
 Handles the WM_SETLANGUAGE message.
 
LRESULT OnUpdateFont (UINT uMsg, WPARAM wp, LPARAM lp)
 Handles the WM_UPDATEFONT message.
 
LRESULT OnRunTasks (UINT uMsg, WPARAM wp, LPARAM lp)
 Handles the UM_RUN_TASKS message.
 
 SHostWnd (LPCWSTR pszResName=NULL)
 Constructs a SHostWnd object with an optional resource name.
 
 SHostWnd (LPCSTR pszResName)
 Constructs a SHostWnd object with an optional resource name (ANSI version).
 
virtual ~SHostWnd ()
 Destructor for SHostWnd.
 
BOOL InitFromXml (IXmlNode *pNode) OVERRIDE
 Initializes the host window from an XML node.
 
BOOL DestroyWindow () OVERRIDE
 Destroys the host window.
 
void SetLayoutId (LPCTSTR pszLayoutId) OVERRIDE
 Sets the layout ID for the host window.
 
IWindow * GetIRoot () OVERRIDE
 Gets the root window interface.
 
BOOL IsTranslucent () SCONST OVERRIDE
 Checks if the host window is translucent.
 
IHostPresenter * GetPresenter () OVERRIDE
 Gets the presenter interface for rendering.
 
void SetPresenter (IHostPresenter *pPresenter) OVERRIDE
 Sets the presenter for rendering.
 
IMessageLoopGetMsgLoop () OVERRIDE
 Gets the message loop interface.
 
IWindow * FindIChildByID (int nId) OVERRIDE
 Finds a child window by its ID.
 
IWindow * FindIChildByName (LPCWSTR pszName) OVERRIDE
 Finds a child window by its name (Unicode version).
 
IWindow * FindIChildByNameA (LPCSTR pszName) OVERRIDE
 Finds a child window by its name (ANSI version).
 
INcPainter * GetNcPainter () OVERRIDE
 Gets the non-client area painter for the host window.
 
BOOL ShowWindow (int nCmdShow) OVERRIDE
 Shows or hides the host window.
 
HWND CreateEx (HWND hWndParent, DWORD dwStyle, DWORD dwExStyle, int x, int y, int nWidth, int nHeight, IXmlNode *xmlInit=NULL) OVERRIDE
 Creates the host window with extended styles.
 
HWND Create (HWND hWndParent, int x=0, int y=0, int nWidth=0, int nHeight=0) OVERRIDE
 Creates the host window.
 
void SetEventHandler (FunCallback fun, void *ctx) OVERRIDE
 Sets the event handler for the host window.
 
EventHandlerInfo * GetEventHandler () OVERRIDE
 Gets the event handler information for the host window.
 
BOOL AnimateHostWindow (DWORD dwTime, DWORD dwFlags) OVERRIDE
 Animates the host window.
 
void EnableDragDrop () OVERRIDE
 Enables drag-and-drop functionality for the host window.
 
void ShowHostWnd (int uShowCmd, BOOL bWaitAniDone) OVERRIDE
 Shows the host window with optional animation.
 
void EnablePrivateUiDef (BOOL bEnable) OVERRIDE
 Enables or disables private UI definitions for the host window.
 
void SetScale (int nScale, LPCRECT pDestRect) OVERRIDE
 Sets the scale factor for the host window.
 
SWindowFindChildByName (LPCWSTR strName, int nDeep=-1)
 Finds a child window by its name (Unicode version).
 
SWindowFindChildByName (LPCSTR strName, int nDeep=-1)
 Finds a child window by its name (ANSI version).
 
template<class T>
T * FindChildByName2 (LPCWSTR pszName, int nDeep=-1)
 Finds a child window by its name (Unicode version) with template support.
 
template<class T>
T * FindChildByName2 (LPCSTR pszName, int nDeep=-1)
 Finds a child window by its name (ANSI version) with template support.
 
SWindowFindChildByID (int nID, int nDeep=-1)
 Finds a child window by its ID.
 
template<class T>
T * FindChildByID2 (int nID, int nDeep=-1)
 Finds a child window by its ID with template support.
 
template<class T>
T * FindChildByClass (int nDeep=-1) const
 Finds a child window by its class.
 
SWindowGetRoot () const
 Gets the root window.
 
SNativeWndGetNative ()
 Gets the native window interface.
 
CRect GetWindowRect () const
 Gets the window rectangle.
 
CRect GetClientRect () const
 Gets the client rectangle.
 
SHostWndAttrGetHostAttr ()
 Gets the host window attributes.
 
IToolTipGetToolTip () const
 Gets the tooltip interface.
 
bool StartHostAnimation (IAnimation *pAni)
 Starts an animation for the host window.
 
bool StopHostAnimation ()
 Stops the current animation for the host window.
 
void UpdateAutoSizeCount (bool bInc)
 Updates the auto-size count.
 
BOOL OnFireEvent (IEvtArgs *evt) OVERRIDE
 Fires an event in the container.
 
void GetContainerRect (RECT *ret) const OVERRIDE
 Gets the rectangle of the container.
 
HWND GetHostHwnd () OVERRIDE
 Gets the handle to the host window.
 
LPCWSTR GetTranslatorContext () const OVERRIDE
 Gets the translator context for the container.
 
void UpdateRegion (IRegionS *rgn) OVERRIDE
 Updates the specified region in the container.
 
void OnRedraw (LPCRECT rc, BOOL bClip) OVERRIDE
 Redraws the specified rectangle in the container.
 
BOOL OnReleaseSwndCapture () OVERRIDE
 Releases the capture from the container.
 
SWND OnSetSwndCapture (SWND swnd) OVERRIDE
 Sets the capture to the specified window.
 
BOOL IsSendWheel2Hover () const OVERRIDE
 Checks if wheel messages are sent to the hover window.
 
BOOL UpdateWindow (BOOL bForce=TRUE) OVERRIDE
 Updates the window.
 
void UpdateTooltip () OVERRIDE
 Updates the tooltip for the container.
 
void SetToolTip (LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) OVERRIDE
 Sets the tooltip for the container.
 
BOOL RegisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Registers a timeline handler.
 
BOOL UnregisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Unregisters a timeline handler.
 
void EnableHostPrivateUiDef (BOOL bEnable) OVERRIDE
 Enables or disables host private UI definitions.
 
IScriptModule * GetScriptModule () OVERRIDE
 Gets the script module for the container.
 
int GetScale () const OVERRIDE
 Gets the scale factor for the container.
 
void EnableIME (BOOL bEnable) OVERRIDE
 Enables or disables IME (Input Method Editor).
 
void OnUpdateCursor () OVERRIDE
 Updates the cursor for the container.
 
BOOL PostTask (IRunnable *runable, BOOL bAsync=TRUE) OVERRIDE
 Posts a task to the container.
 
int RemoveTasksForObject (void *pObj) OVERRIDE
 Removes tasks for the specified object.
 
virtual BOOL onRootResize (IEvtArgs *e)
 Handles the resize event of the root window.
 
- Protected Member Functions inherited from SwndContainerImpl
BOOL RegisterDragDrop (SWND swnd, IDropTarget *pDropTarget) OVERRIDE
 Registers a drop target for a window.
 
BOOL UnregisterDragDrop (SWND swnd) OVERRIDE
 Unregisters a drop target for a window.
 
BOOL OnReleaseSwndCapture () OVERRIDE
 Releases the window capture.
 
SWND OnSetSwndCapture (SWND swnd) OVERRIDE
 Sets the window capture.
 
void OnSetSwndFocus (SWND swnd) OVERRIDE
 Sets the window focus.
 
void FrameToHost (RECT *rc) SCONST OVERRIDE
 Transforms a rectangle from frame coordinates to host coordinates.
 
SWND OnGetSwndCapture () SCONST OVERRIDE
 Retrieves the window handle that has capture.
 
SWND GetFocus () SCONST OVERRIDE
 Retrieves the window handle that has focus.
 
SWND GetHover () SCONST OVERRIDE
 Retrieves the window handle that is hovered.
 
IAcceleratorMgrGetAcceleratorMgr ()
 Retrieves the accelerator manager.
 
BOOL RegisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Registers a timeline handler.
 
BOOL UnregisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Unregisters a timeline handler.
 
BOOL RegisterTrackMouseEvent (SWND swnd) OVERRIDE
 Registers a window for tracking mouse events.
 
BOOL UnregisterTrackMouseEvent (SWND swnd) OVERRIDE
 Unregisters a window for tracking mouse events.
 
void MarkWndTreeZorderDirty () OVERRIDE
 Marks the window tree's z-order as dirty.
 
void BuildWndTreeZorder () OVERRIDE
 Rebuilds the window tree's z-order.
 
BOOL RegisterVideoCanvas (SWND swnd) OVERRIDE
 Registers a window as a video canvas.
 
BOOL UnregisterVideoCanvas (SWND swnd) OVERRIDE
 Unregisters a window as a video canvas.
 
void OnFrameMouseMove (UINT uFlag, CPoint pt)
 Handles mouse move events within the frame.
 
void OnFrameMouseLeave ()
 Handles mouse leave events within the frame.
 
BOOL OnFrameSetCursor (const CPoint &pt)
 Sets the cursor based on the mouse position.
 
void OnFrameMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse events within the frame.
 
void OnFrameMouseWheel (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse wheel events within the frame.
 
LRESULT OnFrameKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles key events within the frame.
 
void OnFrameKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handles key down events within the frame.
 
void OnActivate (UINT nState)
 Handles window activation events.
 
void OnActivateApp (BOOL bActive, DWORD dwThreadID)
 Handles application activation events.
 
void _BuildWndTreeZorder (IWindow *pWnd, UINT &iOrder)
 Recursively builds the z-order of the window tree.
 
 SwndContainerImpl ()
 Constructor.
 
IDropTarget * GetDropTarget ()
 Retrieves the drop target.
 
SFocusManagerGetFocusManager ()
 Retrieves the focus manager.
 
void SetRoot (SWindow *pRoot)
 Sets the root window of the container.
 
virtual LRESULT DoFrameEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Processes frame events.
 
void OnNextFrame () OVERRIDE
 Called when the next frame is ready.
 
- Protected Member Functions inherited from ISwndContainer
BOOL RegisterTimelineHandler (ITimelineHandler *pHandler) PURE
 Registers an animation frame handler.
 
BOOL UnregisterTimelineHandler (ITimelineHandler *pHandler) PURE
 Unregisters an animation frame handler.
 
BOOL RegisterDragDrop (SWND swnd, IDropTarget *pDropTarget) PURE
 Registers an IDropTarget with a Swnd.
 
BOOL UnregisterDragDrop (SWND swnd) PURE
 Unregisters an IDropTarget from a Swnd.
 
BOOL OnFireEvent (IEvtArgs *evt) PURE
 Fires an event.
 
IMessageLoopGetMsgLoop () PURE
 Retrieves the current message loop.
 
IScriptModule * GetScriptModule () PURE
 Retrieves the script module.
 
HWND GetHostHwnd () PURE
 Retrieves the handle to the host window.
 
BOOL IsTranslucent () SCONST PURE
 Checks if the host window is translucent.
 
BOOL IsSendWheel2Hover () SCONST PURE
 Checks if mouseWheel messages are sent to the hover window.
 
int GetScale () SCONST PURE
 Retrieves the current DPI scale factor.
 
LPCWSTR GetTranslatorContext () SCONST PURE
 Retrieves the translation context.
 
void GetContainerRect (RECT *ret) SCONST PURE
 Retrieves the container's display rectangle.
 
void UpdateRegion (IRegionS *rgn) PURE
 Updates the specified region of the memory bitmap.
 
void OnRedraw (LPCRECT rc, BOOL bClip) PURE
 Requests a redraw of the specified area.
 
SWND OnGetSwndCapture () SCONST PURE
 Retrieves the Swnd object that has captured the mouse.
 
SWND OnSetSwndCapture (SWND swnd) PURE
 Sets the Swnd object to capture the mouse.
 
BOOL OnReleaseSwndCapture () PURE
 Releases the mouse capture from the Swnd object.
 
SWND GetHover () SCONST PURE
 Retrieves the Swnd object that is hovered over.
 
SWND GetFocus () SCONST PURE
 Retrieves the Swnd object that has focus.
 
void OnSetSwndFocus (SWND swnd) PURE
 Sets the focus to the specified Swnd object.
 
BOOL UpdateWindow (BOOL bForce=TRUE) PURE
 Requests an immediate update of the window.
 
void UpdateTooltip () PURE
 Requests an update of the tooltip.
 
void SetToolTip (LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) PURE
 Displays a tooltip at the specified position.
 
void FrameToHost (RECT *rc) SCONST PURE
 Converts the rectangle coordinates of the current frame to the final host coordinates.
 
IAcceleratorMgrGetAcceleratorMgr () PURE
 Retrieves the accelerator manager.
 
BOOL RegisterTrackMouseEvent (SWND swnd) PURE
 Registers a Swnd as a TrackMouseEvent window.
 
BOOL UnregisterTrackMouseEvent (SWND swnd) PURE
 Unregisters a Swnd as a TrackMouseEvent window.
 
void MarkWndTreeZorderDirty () PURE
 Marks the window tree's z-order as dirty.
 
void BuildWndTreeZorder () PURE
 Rebuilds the window tree's z-order.
 
void EnableIME (BOOL bEnable) PURE
 Enables or disables the input method editor (IME).
 
void OnUpdateCursor () PURE
 Updates the cursor.
 
BOOL RegisterVideoCanvas (SWND swnd) PURE
 Registers a VideoCanvas window.
 
BOOL UnregisterVideoCanvas (SWND swnd) PURE
 Unregisters a VideoCanvas window.
 
void EnableHostPrivateUiDef (BOOL bEnable) PURE
 Enables or disables the host's private UI definitions.
 
BOOL PostTask (IRunnable *runable, BOOL bAsync=TRUE) PURE
 Posts a task to the message queue.
 
int RemoveTasksForObject (void *pObj) PURE
 Removes all tasks associated with an object.
 
- Protected Member Functions inherited from ITimelineHandler
void OnNextFrame () PURE
 下一个动画帧处理接口
 

Protected Attributes

SMenuExItemm_pParent
 
SMenuExItemm_pHoverItem
 
SMenuExItemm_pCheckItem
 
BOOL m_bMenuInitialized
 
- Protected Attributes inherited from SHostWnd
SDummyWndm_dummyWnd
 
SHostWndAttr m_hostAttr
 
SStringT m_strXmlLayout
 
BOOL m_bTrackFlag
 
BOOL m_bNeedRepaint
 
BOOL m_bNeedAllRepaint
 
IToolTipm_pTipCtrl
 
SAutoRefPtr< IRegionSm_rgnInvalidate
 
SAutoRefPtr< IRenderTargetm_memRT
 
SAutoRefPtr< IUiDefInfom_privateUiDefInfo
 
int m_cEnableUiDefCount
 
SAutoRefPtr< IScriptModule > m_pScriptModule
 
SAutoRefPtr< SNcPainterm_pNcPainter
 
MSG m_msgMouse
 
CSize m_szAppSetted
 
CSize m_szPrev
 
int m_nAutoSizing
 
bool m_bResizing
 
SAutoRefPtr< IAnimation > m_hostAnimation
 
DWORD m_AniState
 
BOOL m_bFirstShow
 
tid_t m_dwThreadID
 
SRootWindowm_pRoot
 
EventHandlerInfo m_evtHandler
 
SAutoRefPtr< IHostPresenter > m_presenter
 
SCriticalSection m_cs
 
SList< IRunnable * > m_runnables
 
SCriticalSection m_csRunningQueue
 
SList< IRunnable * > m_runningQueue
 
IXmlNodem_xmlInit
 
SHostWnd::SHostAnimationHandler m_hostAnimationHandler
 
- Protected Attributes inherited from SwndContainerImpl
SWindowm_pRoot
 
SWND m_hCapture
 
SWND m_hHover
 
BOOL m_bNcHover
 
SFocusManager m_focusMgr
 
SDropTargetDispatcher m_dropTarget
 
BOOL m_bZorderDirty
 
SList< SWND > m_lstTrackMouseEvtWnd
 
SList< SWND > m_lstVideoCanvas
 
SAutoRefPtr< ICaret > m_caret
 
STimerlineHandlerMgr m_timelineHandlerMgr
 

Friends

class SMenuExItem
 
class SMenuExRunData
 
class SMenuExRoot
 

Additional Inherited Members

- Protected Types inherited from SHostWnd
enum  {
  kPulseTimer = 4321 , kPulseInterval = 10 , kNcCheckTimer = 4322 , kNcCheckInterval = 50 ,
  kTaskTimer = 4323 , kTaskInterval = 100
}
 
- Static Protected Member Functions inherited from SHostWnd
static void SetHideLocalUiDef (BOOL bHide)
 Sets whether to hide local UI definitions globally.
 
static void SetTaskQueueBufSize (int nBufSize)
 Sets the buffer size for asynchronous task queues.
 
- Static Protected Attributes inherited from SHostWnd
static BOOL s_HideLocalUiDef = TRUE
 
static int s_TaskQueueBufSize = 5
 

Detailed Description

扩展菜单类

Definition at line 136 of file SMenuEx.h.

Constructor & Destructor Documentation

◆ SMenuEx() [1/2]

SMenuEx::SMenuEx ( void )

构造函数

Definition at line 563 of file SMenuEx.cpp.

◆ ~SMenuEx()

SMenuEx::~SMenuEx ( void )
virtual

析构函数

Definition at line 580 of file SMenuEx.cpp.

◆ SMenuEx() [2/2]

SMenuEx::SMenuEx ( SMenuExItem * pParent)
protected

构造函数(带父菜单项)

Parameters
pParent父菜单项对象指针

Definition at line 572 of file SMenuEx.cpp.

Member Function Documentation

◆ _HandleEvent()

BOOL SMenuEx::_HandleEvent ( IEvtArgs * pEvt)
protectedvirtual

处理事件

Parameters
pEvt事件参数对象指针
Returns
成功返回TRUE,失败返回FALSE

Reimplemented from SHostWnd.

Definition at line 967 of file SMenuEx.cpp.

◆ AddRef()

long SMenuEx::AddRef ( )
inline

添加引用

Implements INativeWnd.

Definition at line 157 of file SMenuEx.h.

◆ AppendMenu()

BOOL SMenuEx::AppendMenu ( UINT uFlags,
int uIDNewItem,
LPCTSTR lpNewItem,
int iIcon = -1 )

追加菜单项

Parameters
uFlags标志
uIDNewItem新项ID
lpNewItem文本
iIcon图标索引(默认为-1)
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1248 of file SMenuEx.cpp.

◆ CheckMenuItem()

BOOL SMenuEx::CheckMenuItem ( UINT uIdCheckItem,
UINT uCheck )

检查菜单项

Parameters
uIdCheckItem要检查的菜单项ID
uCheck检查标志(例如,MF_CHECKED, MF_UNCHECKED)
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1285 of file SMenuEx.cpp.

◆ CheckMenuRadioItem()

BOOL SMenuEx::CheckMenuRadioItem ( UINT idFirst,
UINT idLast,
UINT idCheck,
UINT uFlags )

检查菜单项(单选按钮)

Parameters
idFirst第一个菜单项ID
idLast最后一个菜单项ID
idCheck要检查的菜单项ID
uFlags标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1304 of file SMenuEx.cpp.

◆ CreateRoot()

SRootWindow * SMenuEx::CreateRoot ( )
overrideprotectedvirtual

创建根窗口

Returns
根窗口对象指针

Reimplemented from SHostWnd.

Definition at line 585 of file SMenuEx.cpp.

◆ DeleteMenu()

BOOL SMenuEx::DeleteMenu ( UINT uPosition,
UINT uFlags )

删除菜单项

Parameters
uPosition菜单项位置
uFlags删除标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1274 of file SMenuEx.cpp.

◆ DestroyMenu()

void SMenuEx::DestroyMenu ( )

销毁菜单

Definition at line 1393 of file SMenuEx.cpp.

◆ EndMenu()

void SMenuEx::EndMenu ( int nCmdId = 0)
static

结束菜单

Parameters
nCmdId命令ID(默认为0)

Definition at line 1161 of file SMenuEx.cpp.

◆ FindItem()

SWindow * SMenuEx::FindItem ( UINT uPos,
UINT uFlag )
protected

查找菜单项

Parameters
uPos位置
uFlag标志
Returns
菜单项对象指针

Definition at line 1174 of file SMenuEx.cpp.

◆ GetContextHelpId()

DWORD SMenuEx::GetContextHelpId ( )

获取上下文帮助ID

Returns
上下文帮助ID

Definition at line 1379 of file SMenuEx.cpp.

◆ GetEvtOwner()

SMenuEx * SMenuEx::GetEvtOwner ( )
static

获取事件所有者

Returns
事件所有者对象指针

Definition at line 962 of file SMenuEx.cpp.

◆ GetHostWnd()

IHostWnd * SMenuEx::GetHostWnd ( )
inline

获取宿主窗口

Returns
宿主窗口对象指针

Definition at line 317 of file SMenuEx.h.

◆ GetMenuItem()

SMenuExItem * SMenuEx::GetMenuItem ( int nID,
BOOL byCmdId )

获取菜单项

Parameters
nID菜单项ID
byCmdId是否按命令ID查找
Returns
菜单项对象指针

Definition at line 635 of file SMenuEx.cpp.

◆ GetMenuString()

BOOL SMenuEx::GetMenuString ( UINT uPosition,
UINT uFlags,
IStringT * lpItemString )

获取菜单项字符串

Parameters
uPosition菜单项位置
uFlags标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
lpItemString接收菜单项字符串的对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1425 of file SMenuEx.cpp.

◆ GetMenuUserData()

ULONG_PTR SMenuEx::GetMenuUserData ( UINT uPosition,
UINT uFlags )

获取菜单项用户数据

Parameters
uPosition菜单项位置
uFlags标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
Returns
用户数据

Definition at line 1417 of file SMenuEx.cpp.

◆ GetParentItem()

SMenuExItem * SMenuEx::GetParentItem ( )
inline

获取父菜单项

Returns
父菜单项对象指针

Definition at line 339 of file SMenuEx.h.

◆ GetScale()

int SMenuEx::GetScale ( )
protected

获取缩放比例

Returns
缩放比例

Definition at line 1154 of file SMenuEx.cpp.

◆ GetSubMenu() [1/2]

SMenuEx * SMenuEx::GetSubMenu ( int nID,
BOOL byCmdId )

获取子菜单

Parameters
nID菜单项ID
byCmdId是否按命令ID查找
Returns
子菜单对象指针

Definition at line 653 of file SMenuEx.cpp.

◆ GetSubMenu() [2/2]

IMenuEx * SMenuEx::GetSubMenu ( int nPos)

获取子菜单

Parameters
nPos子菜单位置
Returns
子菜单对象指针

Definition at line 661 of file SMenuEx.cpp.

◆ GetTranslatorContext()

LPCWSTR SMenuEx::GetTranslatorContext ( )
protected

获取翻译上下文

Returns
翻译上下文字符串

Definition at line 1142 of file SMenuEx.cpp.

◆ HideMenu()

void SMenuEx::HideMenu ( BOOL bUncheckParentItem)
protected

隐藏菜单

Parameters
bUncheckParentItem是否取消选中父菜单项

Definition at line 809 of file SMenuEx.cpp.

◆ HideSubMenu()

void SMenuEx::HideSubMenu ( )
protected

隐藏子菜单

Definition at line 827 of file SMenuEx.cpp.

◆ IniNullMenu()

BOOL SMenuEx::IniNullMenu ( SMenuExRoot * ParentRoot)
protected

初始化一个空菜单(不应在外部调用)

Parameters
ParentRoot父菜单根对象指针
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1253 of file SMenuEx.cpp.

◆ InsertMenu()

BOOL SMenuEx::InsertMenu ( UINT uPosition,
UINT uFlags,
int nIDNewItem,
LPCTSTR strText,
int iIcon = -1 )

插入菜单项

Parameters
uPosition位置
uFlags标志
nIDNewItem新项ID
strText文本
iIcon图标索引(默认为-1)
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1201 of file SMenuEx.cpp.

◆ LoadMenu()

BOOL SMenuEx::LoadMenu ( LPCTSTR resId)

加载菜单资源

Parameters
resId资源ID
Returns
成功返回TRUE,失败返回FALSE

Definition at line 590 of file SMenuEx.cpp.

◆ LoadMenu2()

BOOL SMenuEx::LoadMenu2 ( IXmlNode * xmlMenu)

加载菜单资源(XML)

Parameters
xmlMenuXML节点
Returns
成功返回TRUE,失败返回FALSE

Definition at line 611 of file SMenuEx.cpp.

◆ LoadMenuU8()

BOOL SMenuEx::LoadMenuU8 ( LPCSTR resId)

加载菜单资源(UTF-8)

Parameters
resId资源ID
Returns
成功返回TRUE,失败返回FALSE

Definition at line 600 of file SMenuEx.cpp.

◆ ModifyMenuString()

BOOL SMenuEx::ModifyMenuString ( UINT uPosition,
UINT uFlags,
LPCTSTR lpItemString )

修改菜单项字符串

Parameters
uPosition菜单项位置
uFlags标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
lpItemString新的菜单项字符串
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1399 of file SMenuEx.cpp.

◆ OnFinalRelease()

void SMenuEx::OnFinalRelease ( )
inline

释放对象

Implements INativeWnd.

Definition at line 169 of file SMenuEx.h.

◆ OnKeyDown()

void SMenuEx::OnKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

处理按键消息

Parameters
nChar字符
nRepCnt重复次数
nFlags标志

Definition at line 1080 of file SMenuEx.cpp.

◆ OnLoadLayoutFromResourceID()

BOOL SMenuEx::OnLoadLayoutFromResourceID ( SXmlDoc & xmlDoc)
overrideprotectedvirtual

从资源ID加载布局

Parameters
xmlDocXML文档对象引用
Returns
成功返回TRUE,失败返回FALSE

Reimplemented from SHostWnd.

Definition at line 606 of file SMenuEx.cpp.

◆ OnMouseActivate()

int SMenuEx::OnMouseActivate ( HWND wndTopLevel,
UINT nHitTest,
UINT message )
protected

处理鼠标激活消息

Parameters
wndTopLevel顶级窗口句柄
nHitTest击中测试结果
message消息ID
Returns
激活状态

Definition at line 833 of file SMenuEx.cpp.

◆ OnSubMenuHided()

void SMenuEx::OnSubMenuHided ( BOOL bUncheckItem)
protected

处理子菜单隐藏事件

Parameters
bUncheckItem是否取消选中子菜单项

Definition at line 1030 of file SMenuEx.cpp.

◆ OnTimer()

void SMenuEx::OnTimer ( UINT_PTR timeID)
protected

处理定时器消息

Parameters
timeID定时器ID

Definition at line 1018 of file SMenuEx.cpp.

◆ PopupSubMenu()

void SMenuEx::PopupSubMenu ( SMenuExItem * pItem,
BOOL bCheckFirstItem )
protected

弹出子菜单

Parameters
pItem菜单项对象指针
bCheckFirstItem是否选中第一个子菜单项

Definition at line 1040 of file SMenuEx.cpp.

◆ Release()

long SMenuEx::Release ( )
inline

释放引用

Implements INativeWnd.

Definition at line 163 of file SMenuEx.h.

◆ RunMenu()

void SMenuEx::RunMenu ( HWND hOwner)
protected

运行菜单

Parameters
hOwner所有者窗口句柄

Definition at line 838 of file SMenuEx.cpp.

◆ SendInitPopupMenu2Owner()

void SMenuEx::SendInitPopupMenu2Owner ( int idx)
protected

发送初始化弹出菜单事件给所有者

Parameters
idx索引

Definition at line 1367 of file SMenuEx.cpp.

◆ SetContextHelpId()

void SMenuEx::SetContextHelpId ( DWORD dwId)

设置上下文帮助ID

Parameters
dwId上下文帮助ID

Definition at line 1386 of file SMenuEx.cpp.

◆ SetMenuUserData()

BOOL SMenuEx::SetMenuUserData ( UINT uPosition,
UINT uFlags,
ULONG_PTR ulUserData )

设置菜单项用户数据

Parameters
uPosition菜单项位置
uFlags标志(例如,MF_BYCOMMAND, MF_BYPOSITION)
ulUserData用户数据
Returns
成功返回TRUE,失败返回FALSE

Definition at line 1408 of file SMenuEx.cpp.

◆ ShowMenu()

void SMenuEx::ShowMenu ( UINT uFlag,
int x,
int y )
protected

显示菜单

Parameters
uFlag标志
xX坐标
yY坐标

Definition at line 714 of file SMenuEx.cpp.

◆ TrackPopupMenu()

UINT SMenuEx::TrackPopupMenu ( UINT uFlags,
int x,
int y,
HWND hWnd,
int nScale = 100 )

跟踪弹出菜单

Parameters
uFlags跟踪标志(例如,TPM_LEFTALIGN, TPM_RIGHTALIGN)
x菜单左上角的X坐标
y菜单左上角的Y坐标
hWnd父窗口句柄
nScale缩放比例(默认为100)
Returns
菜单项ID

Definition at line 666 of file SMenuEx.cpp.

Friends And Related Symbol Documentation

◆ SMenuExItem

friend class SMenuExItem
friend

Definition at line 139 of file SMenuEx.h.

◆ SMenuExRoot

friend class SMenuExRoot
friend

Definition at line 141 of file SMenuEx.h.

◆ SMenuExRunData

friend class SMenuExRunData
friend

Definition at line 140 of file SMenuEx.h.

Member Data Documentation

◆ m_bMenuInitialized

BOOL SMenuEx::m_bMenuInitialized
protected

Definition at line 493 of file SMenuEx.h.

◆ m_pCheckItem

SMenuExItem* SMenuEx::m_pCheckItem
protected

Definition at line 491 of file SMenuEx.h.

◆ m_pHoverItem

SMenuExItem* SMenuEx::m_pHoverItem
protected

Definition at line 490 of file SMenuEx.h.

◆ m_pParent

SMenuExItem* SMenuEx::m_pParent
protected

Definition at line 489 of file SMenuEx.h.


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