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

gui::Progress Class Reference

#include <Progress.h>

Inheritance diagram for gui::Progress:

Inheritance graph
[legend]
Collaboration diagram for gui::Progress:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Progress (Surface *, coord_t, coord_t, coord_t, coord_t, SurfaceHelper *=NULL)
 ~Progress ()
void Draw ()
void SetMax (long)
void SetPos (long)
void SetMax ()

Private Attributes

long m_max
long m_pos

Constructor & Destructor Documentation

gui::Progress::Progress Surface ,
coord_t  ,
coord_t  ,
coord_t  ,
coord_t  ,
SurfaceHelper = NULL
 

Definition at line 56 of file Progress.cpp.

References gui::coord_t.

00057 :Surface(s,x,y,w,h,sh) 00058 ,m_max(100) 00059 ,m_pos(0) 00060 { 00061 SetFrameColor(0,0,0); 00062 SetFrameWidth(1); 00063 }

gui::Progress::~Progress  ) 
 

Definition at line 66 of file Progress.cpp.

00067 { 00068 }


Member Function Documentation

void gui::Progress::Draw  )  [virtual]
 

Reimplemented from gui::Surface.

Definition at line 84 of file Progress.cpp.

References gui::Surface::GetBgColor(), gui::Surface::GetClientRect(), gui::Surface::GetFgColor(), gui::Surface::GetW(), m_max, and m_pos.

00085 { 00086 SDL_Rect r = GetClientRect(); 00087 SDL_Rect a = r; 00088 long w = (m_pos * (long)GetW()) / m_max; 00089 00090 SDL_FillRect(m_screen, &r, GetBgColor()); 00091 00092 a.w = w; 00093 if (a.w) 00094 { 00095 // copy bmp? 00096 SDL_FillRect(m_screen, &a, GetFgColor()); 00097 } 00098 a.x = r.x + w; // ClientRect.x kan vara > 0 (FrameWidth) 00099 a.w = r.w - w; 00100 if (a.w) 00101 { 00102 SDL_FillRect(m_screen, &a, GetBgColor()); 00103 } 00104 }

void gui::Progress::SetMax  ) 
 

Definition at line 107 of file Progress.cpp.

References m_max, and m_pos.

00108 { 00109 m_pos = m_max; 00110 SetDirty(true); 00111 }

void gui::Progress::SetMax long   ) 
 

Definition at line 71 of file Progress.cpp.

References m_max.

00072 { 00073 m_max = x; 00074 }

void gui::Progress::SetPos long   ) 
 

Definition at line 77 of file Progress.cpp.

References m_pos.

00078 { 00079 m_pos = x; 00080 SetDirty(true); 00081 }


Member Data Documentation

long gui::Progress::m_max [private]
 

Definition at line 42 of file Progress.h.

Referenced by Draw(), and SetMax().

long gui::Progress::m_pos [private]
 

Definition at line 43 of file Progress.h.

Referenced by Draw(), SetMax(), and SetPos().


The documentation for this class was generated from the following files:
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