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 "cscomp.h" 00032 00038 enum csDialogFrameStyle 00039 { 00041 csdfsNone, 00043 csdfsHorizontal, 00045 csdfsVertical, 00047 csdfsAround, 00049 csdfsBitmap 00050 }; 00051 00067 class csDialog : public csComponent 00068 { 00069 protected: 00071 csDialogFrameStyle FrameStyle; 00073 int GridX, GridY; 00075 bool SnapSizeToGrid; 00077 csComponent *first; 00079 int BorderWidth, BorderHeight; 00081 uint8 Alpha, OverlayAlpha; 00083 csPixmap *FrameBitmap, *OverlayBitmap; 00085 bool delFrameBitmap, delOverlayBitmap; 00086 00087 public: 00089 csDialog (csComponent *iParent, csDialogFrameStyle iFrameStyle = csdfsNone); 00090 00092 virtual ~csDialog(); 00093 00095 virtual bool HandleEvent (iEvent &Event); 00096 00103 void SetAutoGrid (int iDeltaX, int iDeltaY, bool iSnapSize) 00104 { GridX = iDeltaX; GridY = iDeltaY; SnapSizeToGrid = iSnapSize; } 00105 00107 virtual bool SetRect (int xmin, int ymin, int xmax, int ymax); 00108 00110 virtual void SuggestSize (int &w, int &h); 00111 00113 void GetBorderSize (int &w, int &h) 00114 { w = BorderWidth; h = BorderHeight; } 00116 void SetBorderSize (int w, int h); 00117 00119 virtual void FixSize (int &newW, int &newH); 00120 00122 inline csDialogFrameStyle GetFrameStyle () 00123 { return FrameStyle; } 00125 void SetFrameStyle (csDialogFrameStyle iFrameStyle); 00126 00128 virtual char *GetSkinName () 00129 { return "Dialog"; } 00130 00132 void SetAlpha (uint8 iAlpha); 00133 00135 void SetOverlayAlpha (uint8 iAlpha); 00136 00138 uint8 GetAlpha () 00139 { return GetState (CSS_TRANSPARENT) ? Alpha : 0; } 00140 00142 uint8 GetOverlayAlpha () 00143 { return GetState (CSS_TRANSPARENT) ? OverlayAlpha : 0; } 00144 00145 00147 void SetFrameBitmap(csPixmap *iFrameBitmap, bool iDelFrameBitmap); 00148 00150 void SetOverlayBitmap(csPixmap *iOverlayBitmap, bool iDelOverlayBitmap); 00151 00153 csPixmap *GetFrameBitmap() 00154 { return FrameBitmap; } 00155 00157 csPixmap *GetOverlayBitmap() 00158 { return OverlayBitmap; } 00159 00160 protected: 00162 void AdjustFocused (bool forward); 00164 static bool do_topleft (csComponent *comp, void *param); 00166 bool PlaceItems (); 00167 }; 00168 00171 #endif // __CS_CSDIALOG_H__
Generated for Crystal Space by doxygen 1.2.18