/usr/include/paragui/pglineedit.h is in libparagui1.1-dev 1.1.8-3.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | /*
ParaGUI - crossplatform widgetset
Copyright (C) 2000,2001,2002 Alexander Pipelka
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Alexander Pipelka
pipelka@teleweb.at
Last Update: $Author: braindead $
Update Date: $Date: 2004/09/05 10:51:41 $
Source File: $Source: /cvsroot/paragui/paragui/include/pglineedit.h,v $
CVS/RCS Revision: $Revision: 1.3.6.1.2.8 $
Status: $State: Exp $
*/
#ifndef PG_LINEEDIT
#define PG_LINEEDIT
#include "pgthemewidget.h"
#include "pgsignals.h"
#include "pgstring.h"
/**
@author Alexander Pipelka
@short An editable text box.
This really should be renamed to PG_TextBox or something similar, because
PG_LineEdit really makes no sense :). Also the 'Edit' part implies that
it will always be modifiable, but having a modifyable attribute would
probably be better than creating a whole new widget for an unmodifiable
text box.
*/
class DECLSPEC PG_LineEdit : public PG_ThemeWidget {
public:
/**
Signal type declaration
**/
template<class datatype = PG_Pointer> class SignalEditBegin : public PG_Signal1<PG_LineEdit*, datatype> {};
template<class datatype = PG_Pointer> class SignalEditEnd : public PG_Signal1<PG_LineEdit*, datatype> {};
template<class datatype = PG_Pointer> class SignalEditReturn : public PG_Signal1<PG_LineEdit*, datatype> {};
/** */
PG_LineEdit(PG_Widget* parent, const PG_Rect& r = PG_Rect::null, const char* style="LineEdit", int maximumLength = 1000000);
/** */
~PG_LineEdit();
void LoadThemeStyle(const char* widgettype);
/** */
void LoadThemeStyle(const char* widgettype, const char* objectname);
/** start edit */
void EditBegin();
/** */
void EditEnd();
/** */
virtual void SetCursorPos(int p);
/** */
int GetCursorPos();
/**
Set the current text string
@param new_text pointer to text string
*/
virtual void SetText(const char* new_text);
/** */
bool IsCursorVisible();
/**
Send a char into the LineEdit widget
@param c the character to insert
*/
void SendChar(PG_Char c);
/**
Send a 'del' keystroke into the LineEdit widget
*/
void SendDel();
/**
Send a 'BKSPC' keystroke into the LineEdit widget
*/
void SendBackspace();
/**
Define a set of valid keys
@param keys a string which contains all valid chars
*/
void SetValidKeys(const char* keys);
/**
Set if the widget is editable by the user
@param edit true - widget is editable / false - widget is read only
*/
void SetEditable(bool edit);
/**
Check if the widget is editable by the user
@return true - widget is editable / false - widget is read only
*/
bool GetEditable();
/**
Set password character (witch will be displayed in place of letter)
@param passchar character (if = 0 do not any replacement)
*/
void SetPassHidden(char passchar);
/**
Return setted passchar
@return Returns character, witch is displayed in place on letters
*/
char GetPassHidden();
bool Action(KeyAction action);
SignalEditBegin<> sigEditBegin;
SignalEditEnd<> sigEditEnd;
SignalEditReturn<> sigEditReturn;
protected:
/** */
virtual void InsertChar(const PG_Char* c);
/** */
virtual void DeleteChar(Uint16 pos);
/** */
void CopyText(bool del = false);
/** */
void PasteText(Uint16 pos);
/** */
void StartMark(Uint16 pos);
/** */
void EndMark(Uint16 pos);
/** */
virtual bool eventFilterKey(const SDL_KeyboardEvent* key);
/** */
virtual void eventEditBegin(int id, PG_Widget* widget, unsigned long data, void *clientdata);
/** */
virtual void eventEditEnd(int id, PG_Widget* widget, unsigned long data, void *clientdata);
/** */
void eventBlit(SDL_Surface* surface, const PG_Rect& src, const PG_Rect& dst);
//void eventDraw(SDL_Surface* surface, const PG_Rect& rect);
/** */
bool eventKeyDown(const SDL_KeyboardEvent* key);
/** */
bool eventMouseButtonUp(const SDL_MouseButtonEvent* button);
/** */
void eventInputFocusLost(PG_MessageObject* newfocus);
void eventHide();
int my_cursorPosition;
SDL_Surface* my_srfTextCursor;
private:
PG_LineEdit(const PG_LineEdit&);
PG_LineEdit& operator=(PG_LineEdit&);
void DrawText(const PG_Rect& dst);
void DrawTextCursor();
Uint16 GetCursorXPos();
PG_String GetDrawText();
int GetCursorPosFromScreen(int x, int y);
bool IsValidKey(PG_Char c);
std::string my_buffer;
int my_startMark;
int my_endMark;
bool my_isCursorVisible;
int my_offsetX;
PG_String my_validkeys;
bool my_isEditable;
int my_maximumLength;
PG_Char my_passchar;
};
#endif // PG_LINEEDIT
|