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

FXChoiceBox.h
1 /********************************************************************************
2 * *
3 * C h o i c e B o x *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2004,2022 by Jeroen van der Zijp. 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 FXCHOICEBOX_H
22 #define FXCHOICEBOX_H
23 
24 #ifndef FXDIALOGBOX_H
25 #include "FXDialogBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXList;
32 
33 
40 class FXAPI FXChoiceBox : public FXDialogBox {
41  FXDECLARE(FXChoiceBox)
42 protected:
43  FXList *list;
44 protected:
45  FXChoiceBox(){}
46 private:
47  FXChoiceBox(const FXChoiceBox&);
48  FXChoiceBox &operator=(const FXChoiceBox&);
49  void initialize(const FXString& text,FXIcon* icon);
50 public:
51  long onCmdClicked(FXObject*,FXSelector,void*);
52  long onCmdCancel(FXObject*,FXSelector,void*);
53 public:
54  enum{
55  ID_CLICKED=FXDialogBox::ID_LAST,
56  ID_LAST
57  };
58 public:
59 
61  FXChoiceBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
62 
64  FXChoiceBox(FXWindow* owner,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
65 
67  FXChoiceBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
68 
70  FXChoiceBox(FXApp* app,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
71 
73  virtual FXuint execute(FXuint placement=PLACEMENT_CURSOR);
74 
81  static FXint ask(FXWindow* owner,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices);
82 
89  static FXint ask(FXWindow* owner,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices);
90 
97  static FXint ask(FXApp* app,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXchar** choices);
98 
105  static FXint ask(FXApp* app,FXuint opts,const FXString& caption,const FXString& text,FXIcon* icon,const FXString& choices);
106 
107 
109  virtual void save(FXStream& store) const;
110 
112  virtual void load(FXStream& store);
113 
115  virtual ~FXChoiceBox();
116  };
117 
118 }
119 
120 #endif
DialogBox window.
Definition: FXDialogBox.h:37
Window is the base class for all widgets in FOX.
Definition: FXWindow.h:130
The Application object is the central point of a FOX user-interface.
Definition: FXApp.h:134
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
A List Widget displays a list of items, each with a text and optional icon.
Definition: FXList.h:169
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
The Choice Box provides a dialog panel to select one item out of a list of choices.
Definition: FXChoiceBox.h:40
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
Closes the dialog, accept the entry.
Definition: FXDialogBox.h:51
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp