Laxkit  0.0.7.1
promptedit.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Copyright (C) 2004-2006 by Tom Lechner
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Library General Public
8 // License as published by the Free Software Foundation; either
9 // version 2 of the License, or (at your option) any later version.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Library General Public License for more details.
15 //
16 // You should have received a copy of the GNU Library General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 //
20 // Please consult http://laxkit.sourceforge.net about where to send any
21 // correspondence about this software.
22 //
23 #ifndef _LAX_PROMPTEDIT_H
24 #define _LAX_PROMPTEDIT_H
25 
26 #include <lax/multilineedit.h>
27 
28 
29 
30 namespace Laxkit {
31 
33 {
34  public:
37  HistoryNode *next,*prev;
38  HistoryNode() { next=prev=NULL; inputstart=outputstart=0; inputlen=outputlen=0; }
39  ~HistoryNode();
40 };
41 
42 class PromptEdit : public MultiLineEdit
43 {
44  protected:
45  char *promptstring;
46  long start;
47  HistoryNode *history;
48  int numhistory,maxhistory;
49  virtual char *process(const char *in);
50  public:
51  PromptEdit(anXWindow *prnt,const char *nname,const char *ntitle,unsigned long nstyle,
52  int xx,int yy,int ww,int hh,int brder,
53  anXWindow *prev,unsigned long nowner=None,const char *nsend=NULL,
54  unsigned int ntstyle=0,const char *newtext=NULL);
55  virtual ~PromptEdit();
56  virtual int readonly(long pos);
57  virtual int ProcessInput(const char *thisexpression=NULL);
58  virtual void SetPromptString(const char *nstr);
59  virtual const char *GetPromptString();
60  virtual int CharInput(unsigned int ch,const char *buffer,int len,unsigned int state,const LaxKeyboard *d);
61 };
62 
63 } // namespace Laxkit;
64 
65 #endif
66 

Mon Feb 17 2014 11:52:57, Laxkit