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

FXMenuTitle.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * M e n u T i t l 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: FXMenuTitle.h,v 1.22 2006/01/22 17:58:06 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXMENUTITLE_H
25 #define FXMENUTITLE_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 * A menu title is a child of a menu bar which is responsible
39 * for popping up a pulldown menu.
40 */
43 protected:
44  FXPopup *pane; // Pane to pop up
45 protected:
46  FXMenuTitle(){}
47 private:
48  FXMenuTitle(const FXMenuTitle&);
49  FXMenuTitle &operator=(const FXMenuTitle&);
50 public:
51  long onPaint(FXObject*,FXSelector,void*);
52  long onEnter(FXObject*,FXSelector,void*);
53  long onLeave(FXObject*,FXSelector,void*);
54  long onLeftBtnPress(FXObject*,FXSelector,void*);
55  long onLeftBtnRelease(FXObject*,FXSelector,void*);
56  long onKeyPress(FXObject*,FXSelector,void*);
57  long onKeyRelease(FXObject*,FXSelector,void*);
58  long onHotKeyPress(FXObject*,FXSelector,void*);
59  long onHotKeyRelease(FXObject*,FXSelector,void*);
60  long onFocusUp(FXObject*,FXSelector,void*);
61  long onFocusDown(FXObject*,FXSelector,void*);
62  long onFocusIn(FXObject*,FXSelector,void*);
63  long onFocusOut(FXObject*,FXSelector,void*);
64  long onCmdPost(FXObject*,FXSelector,void*);
65  long onCmdUnpost(FXObject*,FXSelector,void*);
66 public:
67 
68  /// Constructor
69  FXMenuTitle(FXComposite* p,const FXString& text,FXIcon* ic=NULL,FXPopup* pup=NULL,FXuint opts=0);
70 
71  /// Create server-side resources
72  virtual void create();
73 
74  /// Detach server-side resources
75  virtual void detach();
76 
77  /// Return default width
78  virtual FXint getDefaultWidth();
79 
80  /// Return default height
81  virtual FXint getDefaultHeight();
82 
83  /// Yes it can receive the focus
84  virtual bool canFocus() const;
85 
86  /// Move the focus to this window
87  virtual void setFocus();
88 
89  /// Remove the focus from this window
90  virtual void killFocus();
91 
92  /// Set popup menu to pop up
93  void setMenu(FXPopup *menu);
94 
95  /// Return popup menu
96  FXPopup* getMenu() const { return pane; }
97 
98  /// True if this menu or is popup logically contains the mouse
99  virtual bool contains(FXint parentx,FXint parenty) const;
100 
101  /// Save menu to a stream
102  virtual void save(FXStream& store) const;
103 
104  /// Load menu from a stream
105  virtual void load(FXStream& store);
106 
107  /// Destructor
108  virtual ~FXMenuTitle();
109  };
110 
111 }
112 
113 #endif
unsigned int FXuint
Definition: fxdefs.h:389
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
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
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
A menu title is a child of a menu bar which is responsible for popping up a pulldown menu...
Definition: FXMenuTitle.h:41
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:390
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
#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