|
csdialog.h00001 /* 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 __CSDIALOG_H__ 00021 #define __CSDIALOG_H__ 00022 00023 #include "cscomp.h" 00024 00030 enum csDialogFrameStyle 00031 { 00033 csdfsNone, 00035 csdfsHorizontal, 00037 csdfsVertical, 00039 csdfsAround, 00041 csdfsBitmap 00042 }; 00043 00059 class csDialog : public csComponent 00060 { 00061 protected: 00063 csDialogFrameStyle FrameStyle; 00065 int GridX, GridY; 00067 bool SnapSizeToGrid; 00069 csComponent *first; 00071 int BorderWidth, BorderHeight; 00073 uint8 Alpha, OverlayAlpha; 00075 csPixmap *FrameBitmap, *OverlayBitmap; 00077 bool delFrameBitmap, delOverlayBitmap; 00078 00079 public: 00081 csDialog (csComponent *iParent, csDialogFrameStyle iFrameStyle = csdfsNone); 00082 00084 virtual ~csDialog(); 00085 00087 virtual bool HandleEvent (iEvent &Event); 00088 00095 void SetAutoGrid (int iDeltaX, int iDeltaY, bool iSnapSize) 00096 { GridX = iDeltaX; GridY = iDeltaY; SnapSizeToGrid = iSnapSize; } 00097 00099 virtual bool SetRect (int xmin, int ymin, int xmax, int ymax); 00100 00102 virtual void SuggestSize (int &w, int &h); 00103 00105 void GetBorderSize (int &w, int &h) 00106 { w = BorderWidth; h = BorderHeight; } 00108 void SetBorderSize (int w, int h); 00109 00111 virtual void FixSize (int &newW, int &newH); 00112 00114 inline csDialogFrameStyle GetFrameStyle () 00115 { return FrameStyle; } 00117 void SetFrameStyle (csDialogFrameStyle iFrameStyle); 00118 00120 virtual char *GetSkinName () 00121 { return "Dialog"; } 00122 00124 void SetAlpha (uint8 iAlpha); 00125 00127 void SetOverlayAlpha (uint8 iAlpha); 00128 00130 uint8 GetAlpha () 00131 { return GetState (CSS_TRANSPARENT) ? Alpha : 0; } 00132 00134 uint8 GetOverlayAlpha () 00135 { return GetState (CSS_TRANSPARENT) ? OverlayAlpha : 0; } 00136 00137 00139 void SetFrameBitmap(csPixmap *iFrameBitmap, bool iDelFrameBitmap); 00140 00142 void SetOverlayBitmap(csPixmap *iOverlayBitmap, bool iDelOverlayBitmap); 00143 00145 csPixmap *GetFrameBitmap() 00146 { return FrameBitmap; } 00147 00149 csPixmap *GetOverlayBitmap() 00150 { return OverlayBitmap; } 00151 00152 protected: 00154 void AdjustFocused (bool forward); 00156 static bool do_topleft (csComponent *comp, void *param); 00158 bool PlaceItems (); 00159 }; 00160 00161 #endif // __CSDIALOG_H__ Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000 |