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

FXTriStateButton.h
1 /********************************************************************************
2 * *
3 * T r i - S t a t e B u t t o n W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2002,2024 by Charles Warren. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXTRISTATEBUTTON_H
22 #define FXTRISTATEBUTTON_H
23 
24 #ifndef FXTOGGLEBUTTON_H
25 #include "FXToggleButton.h"
26 #endif
27 
28 namespace FX {
29 
38 class FXAPI FXTriStateButton : public FXToggleButton {
39  FXDECLARE(FXTriStateButton)
40 protected:
41  FXString maybelabel;
42  FXIcon *maybeicon;
43  FXString maybetip;
44  FXString maybehelp;
45 protected:
47 private:
49  FXTriStateButton& operator=(const FXTriStateButton&);
50 public:
51  long onPaint(FXObject*,FXSelector,void*);
52  long onUnknown(FXObject*,FXSelector,void*);
53  long onQueryHelp(FXObject*,FXSelector,void*);
54  long onQueryTip(FXObject*,FXSelector,void*);
55 public:
56 
58  FXTriStateButton(FXComposite* p,const FXString& text1,const FXString& text2,const FXString& text3,FXIcon* icon1=nullptr,FXIcon* icon2=nullptr,FXIcon* icon3=nullptr,FXObject* tgt=nullptr,FXSelector sel=0,FXuint opts=TOGGLEBUTTON_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
59 
61  virtual void create();
62 
64  virtual void detach();
65 
67  virtual FXint getDefaultWidth();
68 
70  virtual FXint getDefaultHeight();
71 
73  void setMaybeText(const FXString& text);
74 
76  FXString getMaybeText() const { return maybelabel; }
77 
79  void setMaybeIcon(FXIcon* ic);
80 
82  FXIcon* getMaybeIcon() const { return maybeicon; }
83 
85  void setMaybeHelpText(const FXString& text);
86 
88  FXString getMaybeHelpText() const { return maybehelp; }
89 
91  void setMaybeTipText(const FXString& text);
92 
94  FXString getMaybeTipText() const { return maybetip; }
95 
97  virtual void save(FXStream& store) const;
98 
100  virtual void load(FXStream& store);
101 
103  virtual ~FXTriStateButton();
104  };
105 
106 }
107 
108 #endif
FXString getMaybeHelpText() const
Return maybe help text.
Definition: FXTriStateButton.h:88
FXString getMaybeTipText() const
Return maybe tip text.
Definition: FXTriStateButton.h:94
The tri-state button provides a three-state button, which toggles between the on and the off state ea...
Definition: FXTriStateButton.h:38
Base composite.
Definition: FXComposite.h:32
The toggle button provides a two-state button, which toggles between the on and the off state each ti...
Definition: FXToggleButton.h:48
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXString getMaybeText() const
Return maybe text.
Definition: FXTriStateButton.h:76
FXIcon * getMaybeIcon() const
Return maybe icon.
Definition: FXTriStateButton.h:82
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:138
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp