UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QfButton.H
1 /* QfButton.H */
2 /* $Id: QfButton.H,v 1.3 2001/11/21 17:18:05 vlad Exp $ */
3 #ifndef __QfButton_H
4 #define __QfButton_H
5 
6 #include <zm/Zm.h>
7 #include <zm/qvfcdefs.h>
8 #include <zm/QfBrick.H>
9 
10 
11 /***********************************************************************
12  * Action button object. Provides way to execute some action on push
13  * the button.
14  */
15 class QfButton: public QfBrick
16 {
17 protected:
18 
19  /* XmSTRING or XmPIXMAP */
20  int labelType;
21 
22  /* Temporal slot to store label between construction and create_self() */
23  XmString xmsLabel;
24 
25  /* Temporal slot to store icon between construction and create_self() */
26  ZmBitmapSource icon;
27 
28  /* XmPushButton */
29  virtual void create_self (Widget wParent);
30 
31  /* Pointer at action procedure or NULL. */
32  QfActionProc pActionProc;
33 
34  /* Pointer at user data to pass in action procedure. */
35  void *pActionUserData;
36 
37  /* Button-press event. */
38  static void activate_cb (Widget w, XtPointer pUserData,
39  XtPointer pCallData);
40 
41 public:
42 
43  /* Button with text label. */
44  QfButton (char* szLabel,
45  QfActionProc pProc = NULL,
46  void* pUserData = NULL);
47 
48  /* Button with icon. */
49  QfButton (char* pIconData, int nIconWidth, int nIconHeight,
50  QfActionProc pProc = NULL,
51  void* pUserData = NULL);
52  /* You can use it like with:
53  #include <zm/zoom_in.xbm>
54  ...
55  << new QfButton(ZmInlineXBM(zoom_in), ZoomInCB);
56  */
57 
58  /*
59  * Adjustable features.
60  */
61 
62  /* Execute this procedure on button press. Calls for pActionProc
63  if pActionProc!=NULL */
64  virtual void action ();
65 
66 };
67 
68 
69 #endif /* QfButton.H */
Definition: Zm.h:102
Definition: QfBrick.H:54
Definition: QfButton.H:15
virtual void create_self(Widget wParent)