csws/csdialog.h
Go to the documentation of this file.00001 /* 00002 Crystal Space Windowing System: dialog window class 00003 Copyright (C) 1998,1999 by Andrew Zabolotny <bit@eltech.ru> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public 00016 License along with this library; if not, write to the Free 00017 Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00018 */ 00019 00020 #ifndef __CS_CSDIALOG_H__ 00021 #define __CS_CSDIALOG_H__ 00022 00031 #include "csextern.h" 00032 00033 #include "cscomp.h" 00034 00040 enum csDialogFrameStyle 00041 { 00043 csdfsNone, 00045 csdfsHorizontal, 00047 csdfsVertical, 00049 csdfsAround, 00051 csdfsBitmap 00052 }; 00053 00069 class CS_CSWS_EXPORT csDialog : public csComponent 00070 { 00071 protected: 00073 csDialogFrameStyle FrameStyle; 00075 int GridX, GridY; 00077 bool SnapSizeToGrid; 00079 csComponent *first; 00081 int BorderWidth, BorderHeight; 00083 uint8 Alpha, OverlayAlpha; 00085 csPixmap *FrameBitmap, *OverlayBitmap; 00087 bool delFrameBitmap, delOverlayBitmap; 00088 00089 public: 00091 csDialog (csComponent *iParent, csDialogFrameStyle iFrameStyle = csdfsNone); 00092 00094 virtual ~csDialog(); 00095 00097 virtual bool HandleEvent (iEvent &Event); 00098 00105 void SetAutoGrid (int iDeltaX, int iDeltaY, bool iSnapSize) 00106 { GridX = iDeltaX; GridY = iDeltaY; SnapSizeToGrid = iSnapSize; } 00107 00109 virtual bool SetRect (int xmin, int ymin, int xmax, int ymax); 00110 00112 virtual void SuggestSize (int &w, int &h); 00113 00115 void GetBorderSize (int &w, int &h) 00116 { w = BorderWidth; h = BorderHeight; } 00118 void SetBorderSize (int w, int h); 00119 00121 virtual void FixSize (int &newW, int &newH); 00122 00124 inline csDialogFrameStyle GetFrameStyle () 00125 { return FrameStyle; } 00127 void SetFrameStyle (csDialogFrameStyle iFrameStyle); 00128 00130 virtual char *GetSkinName () 00131 { return "Dialog"; } 00132 00134 void SetAlpha (uint8 iAlpha); 00135 00137 void SetOverlayAlpha (uint8 iAlpha); 00138 00140 uint8 GetAlpha () 00141 { return GetState (CSS_TRANSPARENT) ? Alpha : 0; } 00142 00144 uint8 GetOverlayAlpha () 00145 { return GetState (CSS_TRANSPARENT) ? OverlayAlpha : 0; } 00146 00147 00149 void SetFrameBitmap(csPixmap *iFrameBitmap, bool iDelFrameBitmap); 00150 00152 void SetOverlayBitmap(csPixmap *iOverlayBitmap, bool iDelOverlayBitmap); 00153 00155 csPixmap *GetFrameBitmap() 00156 { return FrameBitmap; } 00157 00159 csPixmap *GetOverlayBitmap() 00160 { return OverlayBitmap; } 00161 00162 protected: 00164 void AdjustFocused (bool forward); 00166 static bool do_topleft (csComponent *comp, void *param); 00168 bool PlaceItems (); 00169 }; 00170 00173 #endif // __CS_CSDIALOG_H__
Generated for Crystal Space by doxygen 1.2.18