Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXMenuCascade.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * M e n u C a s c a d e W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXMenuCascade.h,v 1.24 2006/01/22 17:58:06 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXMENUCASCADE_H
25 #define FXMENUCASCADE_H
26 
27 #ifndef FXMENUCAPTION_H
28 #include "FXMenuCaption.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXPopup;
35 
36 
37 /**
38 * The cascade menu widget is used to bring up a sub menu from a
39 * pull down menu.
40 */
43 protected:
44  FXPopup *pane;
45 protected:
46  FXMenuCascade();
47  void drawTriangle(FXDCWindow& dc,FXint l,FXint t,FXint r,FXint b);
48 private:
50  FXMenuCascade &operator=(const FXMenuCascade&);
51 public:
52  long onPaint(FXObject*,FXSelector,void*);
53  long onEnter(FXObject*,FXSelector,void*);
54  long onLeave(FXObject*,FXSelector,void*);
55  long onButtonPress(FXObject*,FXSelector,void*);
56  long onButtonRelease(FXObject*,FXSelector,void*);
57  long onKeyPress(FXObject*,FXSelector,void*);
58  long onKeyRelease(FXObject*,FXSelector,void*);
59  long onHotKeyPress(FXObject*,FXSelector,void*);
60  long onHotKeyRelease(FXObject*,FXSelector,void*);
61  long onCmdPost(FXObject*,FXSelector,void*);
62  long onCmdUnpost(FXObject*,FXSelector,void*);
63 public:
64  enum {
65  ID_MENUTIMER=FXMenuCaption::ID_LAST,
66  ID_LAST
67  };
68 public:
69 
70  /// Construct a menu cascade responsible for the given popup menu
71  FXMenuCascade(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0);
72 
73  /// Create server-side resources
74  virtual void create();
75 
76  /// Detach server-side resources
77  virtual void detach();
78 
79  /// Destroy server-side resources
80  virtual void destroy();
81 
82  /// Yes it can receive the focus
83  virtual bool canFocus() const;
84 
85  /// Move the focus to this window
86  virtual void setFocus();
87 
88  /// Remove the focus from this window
89  virtual void killFocus();
90 
91  /// Set popup menu to pop up
92  void setMenu(FXPopup *pup){ pane = pup; }
93 
94  /// Return popup menu
95  FXPopup* getMenu() const { return pane; }
96 
97  /// True if this menu or is popup logically contains the mouse
98  virtual bool contains(FXint parentx,FXint parenty) const;
99 
100  /// Save menu to a stream
101  virtual void save(FXStream& store) const;
102 
103  /// Load menu from a stream
104  virtual void load(FXStream& store);
105 
106  /// Destructor
107  virtual ~FXMenuCascade();
108  };
109 
110 }
111 
112 #endif
Definition: FXWindow.h:241
unsigned int FXuint
Definition: fxdefs.h:396
Popup window.
Definition: FXPopup.h:52
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
The menu caption is a widget which can be used as a caption above a number of menu commands in a menu...
Definition: FXMenuCaption.h:56
int FXint
Definition: fxdefs.h:397
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:45
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Window Device Context.
Definition: FXDCWindow.h:52
The cascade menu widget is used to bring up a sub menu from a pull down menu.
Definition: FXMenuCascade.h:41
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp