SliderGump Class Reference

#include <SliderGump.h>

Inheritance diagram for SliderGump:

ModalGump Gump Object List of all members.

Public Member Functions

 ENABLE_RUNTIME_CLASSTYPE ()
 SliderGump ()
 SliderGump (int x, int y, sint16 min, sint16 max, sint16 value, sint16 delta=1)
virtual ~SliderGump (void)
virtual void InitGump (Gump *newparent, bool take_focus=true)
virtual void PaintThis (RenderSurface *surf, sint32 lerp_factor, bool scaled)
virtual void Close (bool no_del=false)
virtual void ChildNotify (Gump *child, uint32 message)
void setUsecodeNotify (UCProcess *ucp)
virtual bool StartDraggingChild (Gump *gump, int mx, int my)
virtual void DraggingChild (Gump *gump, int mx, int my)
virtual void StopDraggingChild (Gump *gump)
virtual bool OnKeyDown (int key, int mod)
bool loadData (IDataSource *ids, uint32 version)

Protected Member Functions

virtual void saveData (ODataSource *ods)
int getSliderPos ()
void setSliderPos ()
void setValueFromSlider (int sliderx)
void drawText (RenderSurface *surf)

Protected Attributes

sint16 min
sint16 max
sint16 delta
sint16 value
uint16 usecodeNotifyPID
sint16 renderedvalue
RenderedTextrenderedtext

Detailed Description

Definition at line 27 of file SliderGump.h.


Constructor & Destructor Documentation

SliderGump::SliderGump (  ) 

Definition at line 40 of file SliderGump.cpp.

References renderedtext.

SliderGump::SliderGump ( int  x,
int  y,
sint16  min,
sint16  max,
sint16  value,
sint16  delta = 1 
)

Definition at line 46 of file SliderGump.cpp.

References renderedtext, and usecodeNotifyPID.

SliderGump::~SliderGump ( void   )  [virtual]

Definition at line 54 of file SliderGump.cpp.


Member Function Documentation

void SliderGump::ChildNotify ( Gump child,
uint32  message 
) [virtual]

This function is used by our children to notifty us of 'something' Think of it as a generic call back function

Reimplemented from Gump.

Definition at line 174 of file SliderGump.cpp.

References ButtonWidget::BUTTON_CLICK, Close(), delta, Gump::GetIndex(), LEFT_INDEX, max, min, OK_INDEX, RIGHT_INDEX, setSliderPos(), and value.

void SliderGump::Close ( bool  no_del = false  )  [virtual]

Close the gump

Parameters:
no_del If true, do not delete after closing

Reimplemented from ModalGump.

Definition at line 196 of file SliderGump.cpp.

References ModalGump::Close(), Kernel::get_instance(), Kernel::getProcess(), Gump::process_result, usecodeNotifyPID, and value.

Referenced by ChildNotify(), and OnKeyDown().

void SliderGump::DraggingChild ( Gump gump,
int  mx,
int  my 
) [virtual]

Reimplemented from Gump.

Definition at line 221 of file SliderGump.cpp.

References GUIApp::get_instance(), GUIApp::getDraggingOffset(), Gump::GetIndex(), getSliderPos(), Gump::Move(), setValueFromSlider(), SLIDER_INDEX, and slidery.

void SliderGump::drawText ( RenderSurface surf  )  [protected]

Definition at line 106 of file SliderGump.cpp.

References RenderedText::draw(), font, FontManager::get_instance(), FontManager::getGameFont(), labelfont, labelx, labely, renderedtext, renderedvalue, and value.

Referenced by PaintThis().

SliderGump::ENABLE_RUNTIME_CLASSTYPE (  ) 

Reimplemented from ModalGump.

int SliderGump::getSliderPos (  )  [protected]

Definition at line 86 of file SliderGump.cpp.

References max, min, slidermaxx, sliderminx, and value.

Referenced by DraggingChild(), InitGump(), and setSliderPos().

void SliderGump::InitGump ( Gump newparent,
bool  take_focus = true 
) [virtual]

Init the gump and add it to parent; call after construction When newparent is 0, this will call GUIApp::addGump().

Parameters:
newparent The Gump's new parent or 0.
takefocus If true, set parent's focus_child to this

Reimplemented from ModalGump.

Definition at line 131 of file SliderGump.cpp.

References Gump::dims, GameData::get_instance(), Shape::getFrame(), GameData::getGumps(), GameData::getShape(), ShapeArchive::getShape(), getSliderPos(), GameData::GUMPS, gumpshape, Pentagram::Rect::h, ShapeFrame::height, Gump::InitGump(), ModalGump::InitGump(), LEFT_INDEX, leftshape, OK_INDEX, okshape, RIGHT_INDEX, rightshape, Gump::SetIndex(), Gump::shape, SLIDER_INDEX, sliderframe, slidershape, slidery, Pentagram::Rect::w, and ShapeFrame::width.

Referenced by ContainerGump::DropItem().

bool SliderGump::loadData ( IDataSource ids,
uint32  version 
)

Reimplemented from ModalGump.

Definition at line 270 of file SliderGump.cpp.

bool SliderGump::OnKeyDown ( int  key,
int  mod 
) [virtual]

Reimplemented from Gump.

Definition at line 235 of file SliderGump.cpp.

References Close(), delta, max, min, setSliderPos(), and value.

void SliderGump::PaintThis ( RenderSurface surf,
sint32  lerp_factor,
bool  scaled 
) [virtual]

Overloadable method to Paint just this Gump (RenderSurface is relative to this).

Reimplemented from Gump.

Definition at line 123 of file SliderGump.cpp.

References drawText(), and Gump::PaintThis().

void SliderGump::saveData ( ODataSource ods  )  [protected, virtual]

save the actual Object data

Reimplemented from ModalGump.

Definition at line 265 of file SliderGump.cpp.

void SliderGump::setSliderPos (  )  [protected]

Definition at line 99 of file SliderGump.cpp.

References Gump::FindGump(), getSliderPos(), Gump::Move(), and slidery.

Referenced by ChildNotify(), and OnKeyDown().

void SliderGump::setUsecodeNotify ( UCProcess ucp  ) 

Definition at line 259 of file SliderGump.cpp.

References Process::getPid(), and usecodeNotifyPID.

void SliderGump::setValueFromSlider ( int  sliderx  )  [protected]

Definition at line 91 of file SliderGump.cpp.

References delta, max, min, slidermaxx, sliderminx, and value.

Referenced by DraggingChild().

bool SliderGump::StartDraggingChild ( Gump gump,
int  mx,
int  my 
) [virtual]

Called when a child gump starts to be dragged.

Returns:
false if the child isn't allowed to be dragged.

Reimplemented from Gump.

Definition at line 210 of file SliderGump.cpp.

References GUIApp::get_instance(), Gump::GetIndex(), Gump::ParentToGump(), GUIApp::setDraggingOffset(), and SLIDER_INDEX.

void SliderGump::StopDraggingChild ( Gump gump  )  [virtual]

Reimplemented from Gump.

Definition at line 231 of file SliderGump.cpp.


Member Data Documentation

sint16 SliderGump::delta [protected]

Definition at line 57 of file SliderGump.h.

Referenced by ChildNotify(), OnKeyDown(), and setValueFromSlider().

sint16 SliderGump::max [protected]

Definition at line 56 of file SliderGump.h.

Referenced by ChildNotify(), getSliderPos(), OnKeyDown(), and setValueFromSlider().

sint16 SliderGump::min [protected]

Definition at line 55 of file SliderGump.h.

Referenced by ChildNotify(), getSliderPos(), OnKeyDown(), and setValueFromSlider().

RenderedText* SliderGump::renderedtext [protected]

Definition at line 63 of file SliderGump.h.

Referenced by drawText(), and SliderGump().

sint16 SliderGump::renderedvalue [protected]

Definition at line 62 of file SliderGump.h.

Referenced by drawText().

uint16 SliderGump::usecodeNotifyPID [protected]

Definition at line 60 of file SliderGump.h.

Referenced by Close(), setUsecodeNotify(), and SliderGump().

sint16 SliderGump::value [protected]

Definition at line 58 of file SliderGump.h.

Referenced by ChildNotify(), Close(), drawText(), getSliderPos(), OnKeyDown(), and setValueFromSlider().


The documentation for this class was generated from the following files:
Generated on Fri Jul 27 22:29:56 2007 for pentagram by  doxygen 1.4.7