Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _SV_MENU_HXX
21 : #define _SV_MENU_HXX
22 :
23 : #include <tools/solar.h>
24 : #include <vcl/dllapi.h>
25 : #include <tools/rc.hxx>
26 : #include <tools/resid.hxx>
27 : #include <vcl/bitmapex.hxx>
28 : #include <tools/color.hxx>
29 : #include <vcl/vclevent.hxx>
30 : #include <com/sun/star/uno/Reference.hxx>
31 :
32 : struct MenuItemData;
33 : class Point;
34 : class Size;
35 : class Rectangle;
36 : class Menu;
37 : class MenuItemList;
38 : class HelpEvent;
39 : class Image;
40 : class PopupMenu;
41 : class KeyCode;
42 : class KeyEvent;
43 : class MenuFloatingWindow;
44 : class Window;
45 : class SalMenu;
46 : struct SystemMenuData;
47 :
48 : namespace com {
49 : namespace sun {
50 : namespace star {
51 : namespace accessibility {
52 : class XAccessible;
53 : }}}}
54 :
55 : namespace vcl { struct MenuLayoutData; }
56 :
57 : // --------------
58 : // - Menu-Types -
59 : // --------------
60 :
61 : #define MENU_APPEND ((sal_uInt16)0xFFFF)
62 : #define MENU_ITEM_NOTFOUND ((sal_uInt16)0xFFFF)
63 :
64 : #define POPUPMENU_EXECUTE_DOWN ((sal_uInt16)0x0001)
65 : #define POPUPMENU_EXECUTE_UP ((sal_uInt16)0x0002)
66 : #define POPUPMENU_EXECUTE_LEFT ((sal_uInt16)0x0004)
67 : #define POPUPMENU_EXECUTE_RIGHT ((sal_uInt16)0x0008)
68 :
69 : #define POPUPMENU_NOMOUSEUPCLOSE ((sal_uInt16)0x0010)
70 :
71 : // By changes you must also change: rsc/vclrsc.hxx
72 : enum MenuItemType { MENUITEM_DONTKNOW, MENUITEM_STRING, MENUITEM_IMAGE,
73 : MENUITEM_STRINGIMAGE, MENUITEM_SEPARATOR };
74 :
75 : // By changes you must also change: rsc/vclrsc.hxx
76 : typedef sal_uInt16 MenuItemBits;
77 : #define MIB_CHECKABLE ((MenuItemBits)0x0001)
78 : #define MIB_RADIOCHECK ((MenuItemBits)0x0002)
79 : #define MIB_AUTOCHECK ((MenuItemBits)0x0004)
80 : #define MIB_ABOUT ((MenuItemBits)0x0008)
81 : #define MIB_HELP ((MenuItemBits)0x0010)
82 : #define MIB_POPUPSELECT ((MenuItemBits)0x0020)
83 : // not in rsc/vclsrc.hxx because only a prelimitary solution
84 : #define MIB_NOSELECT ((MenuItemBits)0x0040)
85 : #define MIB_ICON ((MenuItemBits)0x0080)
86 : #define MIB_TEXT ((MenuItemBits)0x0100)
87 :
88 : #define MENU_FLAG_NOAUTOMNEMONICS 0x0001
89 : #define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002
90 :
91 : // overrides default hiding of disabled entries in popup menus
92 : #define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004
93 :
94 : struct ImplMenuDelData
95 : {
96 : ImplMenuDelData* mpNext;
97 : const Menu* mpMenu;
98 :
99 : ImplMenuDelData( const Menu* pMenu );
100 : ~ImplMenuDelData();
101 :
102 2844 : bool isDeleted() const { return mpMenu == 0; }
103 : };
104 :
105 : // --------
106 : // - Menu -
107 : // --------
108 :
109 0 : struct MenuLogo
110 : {
111 : BitmapEx aBitmap;
112 : Color aStartColor;
113 : Color aEndColor;
114 : };
115 :
116 : class VCL_DLLPUBLIC Menu : public Resource
117 : {
118 : friend class MenuBar;
119 : friend class MenuBarWindow;
120 : friend class MenuButton;
121 : friend class MenuFloatingWindow;
122 : friend class PopupMenu;
123 : friend class SystemWindow;
124 : friend struct ImplMenuDelData;
125 : private:
126 : ImplMenuDelData* mpFirstDel;
127 : MenuItemList* pItemList; // Liste mit den MenuItems
128 : MenuLogo* pLogo;
129 : Menu* pStartedFrom;
130 : Window* pWindow;
131 :
132 : Link aActivateHdl; // Active-Handler
133 : Link aDeactivateHdl; // Deactivate-Handler
134 : Link aHighlightHdl; // Highlight-Handler
135 : Link aSelectHdl; // Highlight-Handler
136 :
137 : VclEventListeners maEventListeners;
138 : VclEventListeners maChildEventListeners;
139 :
140 : XubString aTitleText; // PopupMenu text
141 :
142 : sal_uLong nEventId;
143 : sal_uInt16 mnHighlightedItemPos; // for native menus: keeps track of the highlighted item
144 : sal_uInt16 nMenuFlags;
145 : sal_uInt16 nDefaultItem; // Id of default item
146 : sal_uInt16 nSelectedId;
147 :
148 : // for output:
149 : sal_uInt16 nImgOrChkPos;
150 : sal_uInt16 nTextPos;
151 :
152 : sal_Bool bIsMenuBar : 1, // Is this a menubar?
153 : bCanceled : 1, // Terminated during a callback
154 : bInCallback : 1, // In Activate/Deactivate
155 : bKilled : 1; // Killed...
156 :
157 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
158 : mutable vcl::MenuLayoutData* mpLayoutData;
159 : SalMenu* mpSalMenu;
160 :
161 : protected:
162 : SAL_DLLPRIVATE void ImplInit();
163 : SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
164 : SAL_DLLPRIVATE Menu* ImplGetStartMenu();
165 : SAL_DLLPRIVATE Menu* ImplFindSelectMenu();
166 : SAL_DLLPRIVATE Menu* ImplFindMenu( sal_uInt16 nId );
167 : SAL_DLLPRIVATE Size ImplCalcSize( Window* pWin );
168 : SAL_DLLPRIVATE sal_Bool ImplIsVisible( sal_uInt16 nPos ) const;
169 : SAL_DLLPRIVATE sal_Bool ImplIsSelectable( sal_uInt16 nPos ) const;
170 : SAL_DLLPRIVATE sal_uInt16 ImplGetVisibleItemCount() const;
171 : SAL_DLLPRIVATE sal_uInt16 ImplGetFirstVisible() const;
172 : SAL_DLLPRIVATE sal_uInt16 ImplGetPrevVisible( sal_uInt16 nPos ) const;
173 : SAL_DLLPRIVATE sal_uInt16 ImplGetNextVisible( sal_uInt16 nPos ) const;
174 : SAL_DLLPRIVATE void ImplPaint( Window* pWin, sal_uInt16 nBorder, long nOffY = 0, MenuItemData* pThisDataOnly = 0, sal_Bool bHighlighted = sal_False, bool bLayout = false ) const;
175 : SAL_DLLPRIVATE void ImplSelect();
176 : SAL_DLLPRIVATE void ImplCallHighlight( sal_uInt16 nHighlightItem );
177 : SAL_DLLPRIVATE void ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos );
178 : DECL_DLLPRIVATE_LINK( ImplCallSelect, void* );
179 :
180 : SAL_DLLPRIVATE void ImplFillLayoutData() const;
181 711 : SAL_DLLPRIVATE SalMenu* ImplGetSalMenu() { return mpSalMenu; }
182 : SAL_DLLPRIVATE void ImplSetSalMenu( SalMenu *pMenu );
183 : SAL_DLLPRIVATE const XubString& ImplGetHelpText( sal_uInt16 nItemId ) const;
184 :
185 : // returns native check and option menu symbol height in rCheckHeight and rRadioHeight
186 : // return value is maximum width and height of checkboxes and radiobuttons
187 : SAL_DLLPRIVATE Size ImplGetNativeCheckAndRadioSize( Window*, long& rCheckHeight, long& rRadioHeight ) const;
188 :
189 : // returns native submenu arrow size and spacing from right border
190 : // return value is whether it's supported natively
191 : SAL_DLLPRIVATE sal_Bool ImplGetNativeSubmenuArrowSize( Window* pWin, Size& rArrowSize, long& rArrowSpacing ) const;
192 :
193 : SAL_DLLPRIVATE void ImplAddDel( ImplMenuDelData &rDel );
194 : SAL_DLLPRIVATE void ImplRemoveDel( ImplMenuDelData &rDel );
195 : public:
196 : SAL_DLLPRIVATE void ImplKillLayoutData() const;
197 : SAL_DLLPRIVATE Menu* ImplGetStartedFrom() const { return pStartedFrom; }
198 :
199 : Menu();
200 : Menu( sal_Bool bMenuBar );
201 295 : SAL_DLLPRIVATE Window* ImplGetWindow() const { return pWindow; }
202 : void ImplSelectWithStart( Menu* pStartMenu = NULL );
203 :
204 : public:
205 : virtual ~Menu();
206 :
207 : virtual void Activate();
208 : virtual void Deactivate();
209 : virtual void Highlight();
210 : virtual void Select();
211 : virtual void RequestHelp( const HelpEvent& rHEvt );
212 :
213 : void InsertItem( sal_uInt16 nItemId, const XubString& rStr,
214 : MenuItemBits nItemBits = 0,
215 : sal_uInt16 nPos = MENU_APPEND );
216 : void InsertItem( sal_uInt16 nItemId, const Image& rImage,
217 : MenuItemBits nItemBits = 0,
218 : sal_uInt16 nPos = MENU_APPEND );
219 : void InsertItem( sal_uInt16 nItemId,
220 : const XubString& rString, const Image& rImage,
221 : MenuItemBits nItemBits = 0,
222 : sal_uInt16 nPos = MENU_APPEND );
223 : void InsertItem( const ResId& rResId, sal_uInt16 nPos = MENU_APPEND );
224 : void InsertSeparator( sal_uInt16 nPos = MENU_APPEND );
225 : void RemoveItem( sal_uInt16 nPos );
226 : void CopyItem( const Menu& rMenu, sal_uInt16 nPos,
227 : sal_uInt16 nNewPos = MENU_APPEND );
228 : void Clear();
229 :
230 : void CreateAutoMnemonics();
231 :
232 0 : void SetMenuFlags( sal_uInt16 nFlags ) { nMenuFlags = nFlags; }
233 0 : sal_uInt16 GetMenuFlags() const { return nMenuFlags; }
234 :
235 : sal_uInt16 GetItemCount() const;
236 : sal_uInt16 GetItemId( sal_uInt16 nPos ) const;
237 : sal_uInt16 GetItemPos( sal_uInt16 nItemId ) const;
238 : MenuItemType GetItemType( sal_uInt16 nPos ) const;
239 : sal_uInt16 GetCurItemId() const;
240 :
241 0 : void SetDefaultItem( sal_uInt16 nItemId ) { nDefaultItem = nItemId; }
242 0 : sal_uInt16 GetDefaultItem() const { return nDefaultItem; }
243 :
244 : void SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits );
245 : MenuItemBits GetItemBits( sal_uInt16 nItemId ) const;
246 :
247 : void SetUserValue( sal_uInt16 nItemId, sal_uLong nValue );
248 : sal_uLong GetUserValue( sal_uInt16 nItemId ) const;
249 :
250 : void SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu );
251 : PopupMenu* GetPopupMenu( sal_uInt16 nItemId ) const;
252 :
253 : void SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode );
254 : KeyCode GetAccelKey( sal_uInt16 nItemId ) const;
255 :
256 : void CheckItem( sal_uInt16 nItemId, sal_Bool bCheck = sal_True );
257 : sal_Bool IsItemChecked( sal_uInt16 nItemId ) const;
258 :
259 : void SelectItem( sal_uInt16 nItemId );
260 : void DeSelect() { SelectItem( 0xFFFF ); } // MENUITEMPOS_INVALID
261 :
262 : void EnableItem( sal_uInt16 nItemId, sal_Bool bEnable = sal_True );
263 : sal_Bool IsItemEnabled( sal_uInt16 nItemId ) const;
264 :
265 : void ShowItem( sal_uInt16 nItemId, sal_Bool bVisible = sal_True );
266 0 : void HideItem( sal_uInt16 nItemId ) { ShowItem( nItemId, sal_False ); }
267 :
268 : sal_Bool IsItemPosVisible( sal_uInt16 nItemPos ) const;
269 : sal_Bool IsMenuVisible() const;
270 771 : sal_Bool IsMenuBar() const { return bIsMenuBar; }
271 :
272 : void RemoveDisabledEntries( sal_Bool bCheckPopups = sal_True, sal_Bool bRemoveEmptyPopups = sal_False );
273 : sal_Bool HasValidEntries( sal_Bool bCheckPopups = sal_True );
274 :
275 : void SetItemText( sal_uInt16 nItemId, const XubString& rStr );
276 : XubString GetItemText( sal_uInt16 nItemId ) const;
277 :
278 : void SetItemImage( sal_uInt16 nItemId, const Image& rImage );
279 : Image GetItemImage( sal_uInt16 nItemId ) const;
280 : void SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 );
281 : long GetItemImageAngle( sal_uInt16 nItemId ) const;
282 : void SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror );
283 : sal_Bool GetItemImageMirrorMode( sal_uInt16 ) const;
284 :
285 : void SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand );
286 : const XubString& GetItemCommand( sal_uInt16 nItemId ) const;
287 :
288 : void SetHelpText( sal_uInt16 nItemId, const XubString& rString );
289 : const XubString& GetHelpText( sal_uInt16 nItemId ) const;
290 :
291 : void SetTipHelpText( sal_uInt16 nItemId, const XubString& rString );
292 : const XubString& GetTipHelpText( sal_uInt16 nItemId ) const;
293 :
294 : void SetHelpCommand( sal_uInt16 nItemId, const XubString& rString );
295 : const XubString& GetHelpCommand( sal_uInt16 nItemId ) const;
296 :
297 : void SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId );
298 : rtl::OString GetHelpId( sal_uInt16 nItemId ) const;
299 :
300 236 : void SetActivateHdl( const Link& rLink ) { aActivateHdl = rLink; }
301 : const Link& GetActivateHdl() const { return aActivateHdl; }
302 :
303 980 : void SetDeactivateHdl( const Link& rLink ) { aDeactivateHdl = rLink; }
304 : const Link& GetDeactivateHdl() const { return aDeactivateHdl; }
305 :
306 236 : void SetHighlightHdl( const Link& rLink ) { aHighlightHdl = rLink; }
307 : const Link& GetHighlightHdl() const { return aHighlightHdl; }
308 :
309 967 : void SetSelectHdl( const Link& rLink ) { aSelectHdl = rLink; }
310 : const Link& GetSelectHdl() const { return aSelectHdl; }
311 :
312 : void SetLogo( const MenuLogo& rLogo );
313 : void SetLogo();
314 0 : sal_Bool HasLogo() const { return pLogo ? sal_True : sal_False; }
315 : MenuLogo GetLogo() const;
316 :
317 : void AddEventListener( const Link& rEventListener );
318 : void RemoveEventListener( const Link& rEventListener );
319 : void AddChildEventListener( const Link& rEventListener );
320 : void RemoveChildEventListener( const Link& rEventListener );
321 :
322 : Menu& operator =( const Menu& rMenu );
323 :
324 : // Fuer Menu-'Funktionen'
325 0 : MenuItemList* GetItemList() const { return pItemList; }
326 :
327 : // returns the system's menu handle if native menus are supported
328 : // pData must point to a SystemMenuData structure
329 : sal_Bool GetSystemMenuData( SystemMenuData* pData ) const;
330 :
331 : // accessibility helpers
332 :
333 : // returns the bounding box for the character at index nIndex
334 : // where nIndex is relative to the starting index of the item
335 : // with id nItemId (in coordinates of the displaying window)
336 : Rectangle GetCharacterBounds( sal_uInt16 nItemId, long nIndex ) const;
337 : // -1 is returned if no character is at that point
338 : // if an index is found the corresponding item id is filled in (else 0)
339 : long GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const;
340 : // returns the bounding rectangle for an item at pos nItemPos
341 : Rectangle GetBoundingRectangle( sal_uInt16 nItemPos ) const;
342 :
343 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible();
344 : void SetAccessible( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
345 :
346 : // gets the activation key of the specified item
347 : KeyEvent GetActivationKey( sal_uInt16 nItemId ) const;
348 :
349 0 : Window* GetWindow() const { return pWindow; }
350 :
351 : void SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr );
352 : XubString GetAccessibleName( sal_uInt16 nItemId ) const;
353 :
354 : // returns whether the item a position nItemPos is highlighted or not.
355 : bool IsHighlighted( sal_uInt16 nItemPos ) const;
356 :
357 : void HighlightItem( sal_uInt16 nItemPos );
358 0 : void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
359 : };
360 :
361 : // -----------
362 : // - MenuBar -
363 : // -----------
364 :
365 : class VCL_DLLPUBLIC MenuBar : public Menu
366 : {
367 : Link maCloserHdl;
368 : Link maFloatHdl;
369 : Link maHideHdl;
370 : sal_Bool mbCloserVisible;
371 : sal_Bool mbFloatBtnVisible;
372 : sal_Bool mbHideBtnVisible;
373 : sal_Bool mbDisplayable;
374 :
375 : friend class Application;
376 : friend class Menu;
377 : friend class MenuBarWindow;
378 : friend class MenuFloatingWindow;
379 : friend class SystemWindow;
380 :
381 : SAL_DLLPRIVATE static Window* ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu );
382 : SAL_DLLPRIVATE static void ImplDestroy( MenuBar* pMenu, sal_Bool bDelete );
383 : SAL_DLLPRIVATE sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True );
384 :
385 : public:
386 : MenuBar();
387 : MenuBar( const MenuBar& rMenu );
388 : ~MenuBar();
389 :
390 : MenuBar& operator =( const MenuBar& rMenu );
391 :
392 : void ShowCloser( sal_Bool bShow = sal_True );
393 472 : sal_Bool HasCloser() const { return mbCloserVisible; }
394 236 : sal_Bool HasFloatButton() const { return mbFloatBtnVisible; }
395 236 : sal_Bool HasHideButton() const { return mbHideBtnVisible; }
396 : void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide );
397 :
398 : void SelectEntry( sal_uInt16 nId );
399 : sal_Bool HandleMenuActivateEvent( Menu *pMenu ) const;
400 : sal_Bool HandleMenuDeActivateEvent( Menu *pMenu ) const;
401 : sal_Bool HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
402 : sal_Bool HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
403 : sal_Bool HandleMenuButtonEvent( Menu *pMenu, sal_uInt16 nEventId ) const;
404 :
405 253 : void SetCloserHdl( const Link& rLink ) { maCloserHdl = rLink; }
406 0 : const Link& GetCloserHdl() const { return maCloserHdl; }
407 : void SetFloatButtonClickHdl( const Link& rLink ) { maFloatHdl = rLink; }
408 0 : const Link& GetFloatButtonClickHdl() const { return maFloatHdl; }
409 : void SetHideButtonClickHdl( const Link& rLink ) { maHideHdl = rLink; }
410 0 : const Link& GetHideButtonClickHdl() const { return maHideHdl; }
411 :
412 : // - by default a menubar is displayable
413 : // - if a menubar is not displayable, its MenuBarWindow will never be shown
414 : // and it will be hidden if it was visible before
415 : // - note: if a menubar is diplayable, this does not necessarily mean that it is currently visible
416 : void SetDisplayable( sal_Bool bDisplayable );
417 594 : sal_Bool IsDisplayable() const { return mbDisplayable; }
418 :
419 : struct MenuBarButtonCallbackArg
420 : {
421 : sal_uInt16 nId; // Id of the button
422 : bool bHighlight; // highlight on/off
423 : MenuBar* pMenuBar; // menubar the button belongs to
424 : };
425 : // add an arbitrary button to the menubar (will appear next to closer)
426 : // passed link will be call with a MenuBarButtonCallbackArg on press
427 : // passed string will be set as tooltip
428 : sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos = 0 );
429 : // set the highlight link for additional button with ID nId
430 : // highlight link will be called with a MenuBarButtonHighlightArg
431 : // the bHighlight member of that struct shall contain the new state
432 : void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& );
433 : // returns the rectangle occupied by the additional button named nId
434 : // coordinates are relative to the systemwindiow the menubar is attached to
435 : // if the menubar is unattached an empty rectangle is returned
436 : Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId );
437 : void RemoveMenuBarButton( sal_uInt16 nId );
438 : };
439 :
440 0 : inline MenuBar& MenuBar::operator =( const MenuBar& rMenu )
441 : {
442 0 : Menu::operator =( rMenu );
443 0 : return *this;
444 : }
445 :
446 :
447 : // -------------
448 : // - PopupMenu -
449 : // -------------
450 :
451 : class VCL_DLLPUBLIC PopupMenu : public Menu
452 : {
453 : friend class Menu;
454 : friend class MenuFloatingWindow;
455 : friend class MenuBarWindow;
456 : friend struct MenuItemData;
457 :
458 : private:
459 : Menu** pRefAutoSubMenu; // keeps track if a pointer to this Menu is stored in the MenuItemData
460 :
461 0 : SAL_DLLPRIVATE MenuFloatingWindow* ImplGetFloatingWindow() const { return (MenuFloatingWindow*)Menu::ImplGetWindow(); }
462 :
463 : protected:
464 : SAL_DLLPRIVATE sal_uInt16 ImplExecute( Window* pWindow, const Rectangle& rRect, sal_uLong nPopupFlags, Menu* pStaredFrom, sal_Bool bPreSelectFirst );
465 : SAL_DLLPRIVATE long ImplCalcHeight( sal_uInt16 nEntries ) const;
466 : SAL_DLLPRIVATE sal_uInt16 ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry = 0, sal_uInt16* pLastVisible = NULL ) const;
467 :
468 : public:
469 : PopupMenu();
470 : PopupMenu( const PopupMenu& rMenu );
471 : PopupMenu( const ResId& rResId );
472 : ~PopupMenu();
473 :
474 : void SetText( const XubString& rTitle ) { aTitleText = rTitle; }
475 : const XubString& GetText() const { return aTitleText; }
476 :
477 : sal_uInt16 Execute( Window* pWindow, const Point& rPopupPos );
478 : sal_uInt16 Execute( Window* pWindow, const Rectangle& rRect, sal_uInt16 nFlags = 0 );
479 :
480 : // Fuer das TestTool
481 : void EndExecute( sal_uInt16 nSelect = 0 );
482 : void SelectEntry( sal_uInt16 nId );
483 : void SetSelectedEntry( sal_uInt16 nId ); // for use by native submenu only
484 :
485 : static sal_Bool IsInExecute();
486 : static PopupMenu* GetActivePopupMenu();
487 :
488 : PopupMenu& operator =( const PopupMenu& rMenu );
489 : };
490 :
491 0 : inline PopupMenu& PopupMenu::operator =( const PopupMenu& rMenu )
492 : {
493 0 : Menu::operator =( rMenu );
494 0 : return *this;
495 : }
496 :
497 : #endif // _SV_MENU_HXX
498 :
499 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|