Main Page   Class Hierarchy   Compound List   File List   Compound Members  

awscmdbt.h

00001  #ifndef __AWS_COMMAND_BUTTON_H__
00002  #define __AWS_COMMAND_BUTTON_H__
00003 /**************************************************************************
00004     Copyright (C) 2000-2001 by Christopher Nelson 
00005     
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010   
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015   
00016     You should have received a copy of the GNU Library General Public
00017     License along with this library; if not, write to the Free
00018     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 *****************************************************************************/
00020 #include "aws/awscomp.h"
00021 
00022 
00023 class awsCmdButton : public awsComponent
00024 {
00026    bool is_down;
00027 
00029    bool mouse_is_over;
00030 
00034    iTextureHandle *tex[3];
00035 
00037    int frame_style;
00038 
00040    int alpha_level;
00041 
00043    iString *caption;
00044    
00045 public:
00046     awsCmdButton();
00047     virtual ~awsCmdButton();
00048 
00049    /******* Frame Styles **********************/
00050     
00052    static const int fsNormal;
00053 
00055    static const int fsToolbar;
00056 
00058    static const int fsBitmap;
00059 
00060    /******* Signals **********************/
00061 
00063    static const int signalClicked;
00064         
00065     
00066 public:
00068     virtual bool Setup(iAws *wmgr, awsComponentNode *settings);
00069 
00071     bool GetProperty(char *name, void **parm);
00072 
00074     bool SetProperty(char *name, void *parm);
00075 
00077     virtual char *Type();
00078 
00079 public:
00080     SCF_DECLARE_IBASE;
00081 
00083     virtual void OnDraw(csRect clip);
00084 
00086     virtual bool OnMouseDown(int button, int x, int y);
00087     
00089     virtual bool OnMouseUp(int button, int x, int y);
00090     
00092     virtual bool OnMouseMove(int button, int x, int y);
00093 
00095     virtual bool OnMouseClick(int button, int x, int y);
00096 
00098     virtual bool OnMouseDoubleClick(int button, int x, int y);
00099 
00101     virtual bool OnMouseExit();
00102 
00104     virtual bool OnMouseEnter();
00105 
00107     virtual bool OnKeypress(int key, int modifiers);
00108     
00110     virtual bool OnLostFocus();
00111 
00113     virtual bool OnGainFocus();
00114 
00115 };
00116 
00117 class awsCmdButtonFactory : public awsComponentFactory
00118 {
00119 public:
00120     SCF_DECLARE_IBASE;
00121 
00123     awsCmdButtonFactory(iAws *wmgr);
00124 
00126     virtual ~awsCmdButtonFactory();
00127 
00129     virtual iAwsComponent *Create();
00130 };
00131 
00132 #endif
00133 

Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000