Planeshift
pawsstringpromptwindow.h
Go to the documentation of this file.
1 /*
2  * pawsstringpromptwindow.h - Author: Ondrej Hurt
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef PAWS_STRING_PROMPT_WINDOW_HEADER
21 #define PAWS_STRING_PROMPT_WINDOW_HEADER
22 
23 #include <csutil/list.h>
24 #include <iutil/document.h>
25 #include "pawspromptwindow.h"
26 
27 class pawsButton;
28 
38 {
39 public:
46  virtual void OnStringEntered(const char* name, int param,const char* value) = 0;
47 
50 };
51 
56 {
57 public:
69  bool OnButtonReleased(int mouseButton, int keyModifier, pawsWidget* widget);
70 
79  virtual bool OnKeyDown(utf32_char keyCode, utf32_char keyChar, int modifiers);
80 
87  virtual bool OnChange(pawsWidget* widget);
88 
104  static pawsStringPromptWindow* Create(
105  const csString &label,
106  const csString &string, bool multiline, int width, int height,
107  iOnStringEnteredAction* action,const char* name,int param = 0,
108  bool modal = false, int maxlen = 0);
109 
110 protected:
123  void Initialize(const csString &label, const csString &string, bool multiline, int width,
124  int height, iOnStringEnteredAction* action, const char* name, int param = 0, int maxlen = 0);
125 
131  void CloseWindow(const csString &text);
132 
136  void CloseWindow();
137 
141  bool multiLine;
149  csString name;
153  int param;
154 };
155 
157 
160 #endif
161 
bool multiLine
Whether the prompt is multi-line or single.
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
iOnStringEnteredAction * action
The action to call when this window is successfully destroyed.
CREATE_PAWS_FACTORY(pawsStringPromptWindow)
int param
The optional parameter for the window; is sent to the action when OK is pressed.
virtual ~iOnStringEnteredAction()
Basic deconstructor.
virtual void OnStringEntered(const char *name, int param, const char *value)=0
When the pawsStringPromptWindow is created, a ptr to a class which implements this function is provid...
void void Initialize(iObjectRegistry *object_reg)
pawsPromptWindow is the common base for windows that let the user enter one piece of information...
A simple button widget.
Definition: pawsbutton.h:43
pawsStringPromptWindow is a window that lets the user enter a string
This interface defines the callback used by pawsStringPromptWindow to notify another window of a supp...
csString name
The name of the window; is sent to the action when OK is pressed.