Google
Web alhem.net
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

Static.cpp

Go to the documentation of this file.
00001 00006 /* 00007 Copyright (C) 2004 Anders Hedstrom 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either version 2 00012 of the License, or (at your option) any later version. 00013 00014 This program is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with this program; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00022 */ 00023 #include <SDL.h> 00024 #include "guitypedefs.h" 00025 #include "guicolors.h" 00026 #ifdef _WIN32 00027 #pragma warning(push) 00028 00029 #include <yvals.h> // warning numbers get enabled in yvals.h 00030 00031 #pragma warning(disable: 4251) 00032 #pragma warning(disable: 4786) // identifier was truncated to 'number' characters in the debug information 00033 00034 // BUG: C4786 Warning Is Not Disabled with #pragma Warning 00035 // STATUS: Microsoft has confirmed this to be a bug in the Microsoft product. This warning can be ignored. 00036 // This occured only in the <map> container. 00037 00038 #include <sge.h> 00039 00040 #pragma warning(pop) 00041 #else 00042 #include <sge.h> 00043 #endif 00044 //#include <iotm/Mutex.h> // iotm 00045 00046 #include "TTFont.h" 00047 //#include "TimerThread.h" 00048 #include "SDLControl.h" 00049 #include "Surface.h" 00050 #include "Static.h" 00051 00052 00053 namespace gui 00054 { 00055 00056 00057 Static::Static(Surface *s,coord_t x,coord_t y,coord_t w,coord_t h,SurfaceHelper *pclHelper) 00058 :Surface(s,x,y,w,h,pclHelper) 00059 { 00060 // SetBgColor(STATIC_DEFAULT_BG); 00061 SetFgColor(STATIC_DEFAULT_FG_R,STATIC_DEFAULT_FG_G,STATIC_DEFAULT_FG_B); 00062 SetFrameWidth(STATIC_DEFAULT_FW); 00063 } 00064 00065 00066 Static::~Static() 00067 { 00068 } 00069 00070 00071 void Static::Draw() 00072 { 00073 SDL_Rect *area = GetClientRectPtr(); 00074 Uint32 color; 00075 TTFont *font = GetTTFont(); 00076 SDL_Color fg; 00077 SDL_Color bg; 00078 // SDLControl *pcl = GetSDLControl(); 00079 // Uint32 tr = SDL_MapRGBA(pcl -> GetScreen() -> format, 255, 255, 255, 0); 00080 00081 color = GetFgColor(); 00082 memmove(&fg,&color,4); 00083 color = GetBgColor(); 00084 memmove(&bg,&color,4); 00085 00086 // color 0 - transparent 00087 SDL_FillRect(m_screen, area, color); 00088 00089 if (font && font -> GetFont()) 00090 { 00091 coord_t h = font -> GetH(); 00092 coord_t y = GetH() / 2 + h / 2; 00093 00094 sge_tt_textoutf(m_screen, font -> GetFont(), 00095 10,y, 00096 fg.r,fg.g,fg.b, 00097 bg.r,bg.g,bg.b, 00098 SDL_ALPHA_OPAQUE, 00099 "%s",GetText()); 00100 } 00101 } 00102 00103 00104 } // namespace

Generated for My SDL C++ Gui by doxygen 1.3.6

www.TV-friendship.com
The matchmaking service with an all new twist.

Quantum 'Teleportation'
Some thoughts
Page, code, and content Copyright (C) 2004 by Anders Hedström