2009-08-17 10:41:51 +00:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
gtextbox.h
|
|
|
|
|
2011-03-21 00:04:10 +00:00
|
|
|
(c) 2000-2011 Benoît Minisini <gambas@users.sourceforge.net>
|
2009-08-17 10:41:51 +00:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program 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 General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2011-06-03 00:51:09 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
|
|
|
MA 02110-1301, USA.
|
2009-08-17 10:41:51 +00:00
|
|
|
|
|
|
|
***************************************************************************/
|
2007-12-30 16:41:49 +00:00
|
|
|
#ifndef __GTEXTBOX_H
|
|
|
|
#define __GTEXTBOX_H
|
|
|
|
|
|
|
|
class gTextBox : public gControl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
gTextBox(gContainer *parent, bool combo = false);
|
|
|
|
|
|
|
|
//"Properties"
|
|
|
|
int alignment();
|
|
|
|
bool hasBorder();
|
|
|
|
virtual int length();
|
|
|
|
int maxLength();
|
|
|
|
bool password();
|
|
|
|
int position();
|
|
|
|
virtual char *text();
|
|
|
|
virtual bool isReadOnly();
|
|
|
|
int selLength();
|
|
|
|
int selStart();
|
|
|
|
char* selText();
|
|
|
|
bool isSelected();
|
|
|
|
|
|
|
|
void setAlignment(int vl);
|
|
|
|
void setBorder(bool vl);
|
|
|
|
void setMaxLength(int len);
|
|
|
|
void setPassword(bool vl);
|
|
|
|
void setPosition(int pos);
|
|
|
|
virtual void setReadOnly(bool vl);
|
|
|
|
virtual void setText(const char *vl);
|
|
|
|
void setSelText(char *txt, int len);
|
|
|
|
|
|
|
|
//"Methods"
|
|
|
|
virtual void clear();
|
|
|
|
void insert(char* txt,int len);
|
|
|
|
void selClear();
|
|
|
|
void select(int start,int len);
|
|
|
|
void selectAll();
|
|
|
|
|
|
|
|
//"Signals"
|
|
|
|
void (*onChange)(gTextBox *sender);
|
|
|
|
void (*onActivate)(gTextBox *sender);
|
|
|
|
|
|
|
|
//"Private"
|
|
|
|
void updateCursor(GdkCursor *cursor);
|
|
|
|
void initEntry();
|
|
|
|
GtkWidget *entry;
|
|
|
|
virtual int minimumHeight();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|