Laxkit  0.0.7.1
button.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (C) 2004-2010 by Tom Lechner
22 //
23 #ifndef _LAX_BUTTON_H
24 #define _LAX_BUTTON_H
25 
26 
27 #include <lax/buttonbase.h>
28 #include <lax/laximages.h>
29 
30 namespace Laxkit {
31 
32 #define IBUT_ICON_ONLY (1<<18)
33 #define IBUT_TEXT_ONLY (1<<19)
34 #define IBUT_TEXT_ICON (1<<20)
35 #define IBUT_ICON_TEXT (1<<21)
36 
37 class Button : public ButtonBase
38 {
39  protected:
40  LaxImage *image,*bwimage;
41  int thing,thingw,thingh;
42  char *label;
43  public:
44  int pad,gap,labelstyle;
45 
46  Button(anXWindow *parnt,const char *nname,const char *ntitle,unsigned long nstyle,
47  int xx,int yy,int ww,int hh,int brder,
48  anXWindow *prev,unsigned long nowner,const char *nsendmes,
49  int nid=-1,
50  const char *nlabel=NULL,
51  const char *filename=NULL,LaxImage *img=NULL,
52  int npad=-1,int ngap=-1);
53  virtual ~Button();
54  virtual const char *whattype() { return "Button"; }
55  virtual int SetGraphic(int newthing, int newwidth, int newheight);
56  virtual int SetIcon(const char *filename,int makebw=0);
57  virtual int SetIcon(LaxImage *img,int makebw=0);
58  virtual const char *Label(unsigned int which);
59  virtual const char *Label(const char *nlabel);
60  virtual const char *Label() { return label; }
61  virtual void draw();
62  virtual void WrapToExtent(int which);
63 
64  //serializing aids
65  virtual LaxFiles::Attribute *dump_out_atts(LaxFiles::Attribute *att,int what,anObject *context);
66  virtual void dump_in_atts(LaxFiles::Attribute *att,int flag,anObject *context);
67 };
68 
69 } // namespace Laxkit
70 
71 #endif
72 

Mon Feb 17 2014 11:52:56, Laxkit