Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsDnDButton Class Reference

A Drag-and-Drop capable button widget with timer. More...

#include <pawsdndbutton.h>

List of all members.

Public Member Functions

void Clear ()
void ClearIcon ()
int ContainerID ()
virtual void Draw ()
 Draws the widget and all of it's children.
void DrawMask ()
 Draws the mask picture.
void EnableBackground (bool mode)
const char * GetAction ()
csArray< csString > * GetActionCallback ()
int GetButtonIndex ()
bool GetDnDLock ()
char const * GetFontName ()
 return the name of the font
const char * GetIcon ()
csArray< csString > * GetImageNameCallback ()
int GetIndexBase ()
iPawsImageGetMaskingImage ()
const char * GetName ()
 Get the name of this widget.
csArray< csString > * GetNameCallback ()
int GetTextOffsetX ()
int GetTextOffsetY ()
const char * GetTooltip ()
int IsDragDropInProgress ()
virtual void MouseOver (bool value)
 Sets hasMouseFocus.
virtual bool OnMouseDown (int button, int modifiers, int x, int y)
 Manage mouse down event to test for and apply window changes.
virtual bool OnMouseUp (int button, int modifiers, int x, int y)
 Manage mouse up event.
virtual void OnUpdateData (const char *, PAWSData &value)
 pawsDnDButton ()
bool PlaceItem (const char *imageName, const char *Name, const char *toolTip, const char *action)
bool SelfPopulate (iDocumentNode *node)
 This function allows a widget to fill in its own contents from an xml node supplied and calls the same function for all children.
void SetAction (const char *act)
void SetAction (csString *act)
void SetActionCallback (csArray< csString > *in)
void SetDangerLevel (float val, bool low)
void SetDangerMode (int)
void SetDnDLock (bool locked)
void SetDrag (int isDragDrop)
void SetDragDropInProgress (int val)
void SetFlashLevel (float val, bool low)
void SetFlashMode (int)
void SetIcon (const char *icon)
void SetImageNameCallback (csArray< csString > *in)
void SetIndexBase (int indexBase)
void SetMaskingImage (const char *image)
 Sets a masking image which will be drawn after the normal stuff.
void SetNameCallback (csArray< csString > *in)
virtual void SetRelativeFrame (int x, int y, int width, int height)
 Set the size of this widget and it's position relative to the parent.
void SetTextOffsetX (int offset)
void SetTextOffsetY (int offset)
void SetToolTip (const char *tooltip)
 Changes the text for a tool tip.
virtual bool Setup (iDocumentNode *node)
 Setup this widget.
void SetWarnLevel (float val, bool low)
void SetWarnMode (int)
void Start (csTicks startTicks, csTicks currentTicks, csTicks duration)
virtual ~pawsDnDButton ()

Protected Member Functions

virtual bool CheckKeyHandled (int keyCode)
 Allow pawsButton to simulate button pushes based on keypresses.

Protected Attributes

csString * action
csArray< csString > * ActionCallback
csString backgroundBackup
csString baseToolTip
pawsWidgetCallback
csTicks castingTime
int containerID
float dangerLevel
bool dangerLow
int dangerMode
bool DnDLock
int dragDrop
int dragDropInProgress
int editMode
float flashLevel
bool flashLow
int flashMode
csArray< csString > * ImageNameCallback
int indexBase
csTicks lastToolTipTime
psSlotManagermgr
csArray< csString > * NameCallback
pawsProgressBarspellProgress
csTicks startTime
float warnLevel
bool warnLow
int warnMode

Detailed Description

A Drag-and-Drop capable button widget with timer.

Definition at line 45 of file pawsdndbutton.h.


Constructor & Destructor Documentation

pawsDnDButton::pawsDnDButton ( )
virtual pawsDnDButton::~pawsDnDButton ( ) [virtual]

Member Function Documentation

virtual bool pawsDnDButton::CheckKeyHandled ( int  ) [protected, virtual]

Allow pawsButton to simulate button pushes based on keypresses.

Return true if key is handled.

Reimplemented from pawsButton.

void pawsDnDButton::Clear ( )
void pawsDnDButton::ClearIcon ( )
int pawsDnDButton::ContainerID ( ) [inline]

Definition at line 131 of file pawsdndbutton.h.

virtual void pawsDnDButton::Draw ( ) [virtual]

Draws the widget and all of it's children.

Remarks:
Uses clipping rect of it's parent to define drawing area. If the drawing area defined is empty it returns.

Reimplemented from pawsButton.

void pawsDnDButton::DrawMask ( ) [virtual]

Draws the mask picture.

Remarks:
Uses focus status to apply appropriate fading.

Reimplemented from pawsWidget.

void pawsDnDButton::EnableBackground ( bool  mode)
const char* pawsDnDButton::GetAction ( ) [inline]

Definition at line 157 of file pawsdndbutton.h.

csArray<csString>* pawsDnDButton::GetActionCallback ( ) [inline]

Definition at line 111 of file pawsdndbutton.h.

int pawsDnDButton::GetButtonIndex ( ) [inline]

Definition at line 203 of file pawsdndbutton.h.

bool pawsDnDButton::GetDnDLock ( ) [inline]

Definition at line 190 of file pawsdndbutton.h.

char const* pawsDnDButton::GetFontName ( ) [inline]

return the name of the font

Definition at line 216 of file pawsdndbutton.h.

const char* pawsDnDButton::GetIcon ( )
csArray<csString>* pawsDnDButton::GetImageNameCallback ( ) [inline]

Definition at line 87 of file pawsdndbutton.h.

int pawsDnDButton::GetIndexBase ( ) [inline]

Definition at line 124 of file pawsdndbutton.h.

iPawsImage* pawsDnDButton::GetMaskingImage ( )
const char* pawsDnDButton::GetName ( ) [inline]

Get the name of this widget.

Reimplemented from pawsWidget.

Definition at line 104 of file pawsdndbutton.h.

csArray<csString>* pawsDnDButton::GetNameCallback ( ) [inline]

Definition at line 96 of file pawsdndbutton.h.

int pawsDnDButton::GetTextOffsetX ( ) [inline]

Definition at line 77 of file pawsdndbutton.h.

int pawsDnDButton::GetTextOffsetY ( ) [inline]

Definition at line 68 of file pawsdndbutton.h.

const char* pawsDnDButton::GetTooltip ( ) [inline]

Definition at line 169 of file pawsdndbutton.h.

int pawsDnDButton::IsDragDropInProgress ( )
virtual void pawsDnDButton::MouseOver ( bool  value) [virtual]

Sets hasMouseFocus.

Parameters:
valueTRUE causes widget to react to mouse focus.
Remarks:
hasMouseFocus is used by DrawBackground() to fade the background in. Disabled by default.

Reimplemented from pawsWidget.

virtual bool pawsDnDButton::OnMouseDown ( int  button,
int  modifiers,
int  x,
int  y 
) [virtual]

Manage mouse down event to test for and apply window changes.

Parameters:
buttonType of button: 1 resizable or movable, 2 context menu or config window.
modifiersUsed with PAWS_CONSTRUCTION.
xUsed to test for resize.
yUsed to test for resize.
Returns:
bool TRUE if movable or resizable.
Remarks:
calls OnMouseDown on it's parent.

Reimplemented from pawsButton.

virtual bool pawsDnDButton::OnMouseUp ( int  button,
int  modifiers,
int  x,
int  y 
) [virtual]

Manage mouse up event.

Returns:
bool Parent's result or FALSE if no parent.
Remarks:
Acts recursively on it's parents.

Reimplemented from pawsButton.

virtual void pawsDnDButton::OnUpdateData ( const char *  ,
PAWSData value 
) [virtual]

Reimplemented from pawsWidget.

bool pawsDnDButton::PlaceItem ( const char *  imageName,
const char *  Name,
const char *  toolTip,
const char *  action 
)
bool pawsDnDButton::SelfPopulate ( iDocumentNode *  node) [virtual]

This function allows a widget to fill in its own contents from an xml node supplied and calls the same function for all children.

Parameters:
nodeThe xml data for the widget.
Returns:
bool TRUE if no children, FALSE if there are problems with a node.
Remarks:
User should overload this function to populate different types of widgets. Call this base class function to populate children. This is NOT the same as Setup(), which is defining height, width, styles, etc. This is data.

Reimplemented from pawsButton.

void pawsDnDButton::SetAction ( csString *  act) [inline]

Definition at line 148 of file pawsdndbutton.h.

void pawsDnDButton::SetAction ( const char *  act) [inline]

Definition at line 136 of file pawsdndbutton.h.

void pawsDnDButton::SetActionCallback ( csArray< csString > *  in) [inline]

Definition at line 115 of file pawsdndbutton.h.

void pawsDnDButton::SetDangerLevel ( float  val,
bool  low 
)
void pawsDnDButton::SetDangerMode ( int  )
void pawsDnDButton::SetDnDLock ( bool  locked) [inline]

Definition at line 185 of file pawsdndbutton.h.

void pawsDnDButton::SetDrag ( int  isDragDrop) [inline]

Definition at line 81 of file pawsdndbutton.h.

void pawsDnDButton::SetDragDropInProgress ( int  val)
void pawsDnDButton::SetFlashLevel ( float  val,
bool  low 
)
void pawsDnDButton::SetFlashMode ( int  )
void pawsDnDButton::SetIcon ( const char *  icon)
void pawsDnDButton::SetImageNameCallback ( csArray< csString > *  in) [inline]

Definition at line 91 of file pawsdndbutton.h.

void pawsDnDButton::SetIndexBase ( int  indexBase) [inline]

Definition at line 120 of file pawsdndbutton.h.

void pawsDnDButton::SetMaskingImage ( const char *  image)

Sets a masking image which will be drawn after the normal stuff.

Parameters:
imageThe image resource name.

Reimplemented from pawsWidget.

void pawsDnDButton::SetNameCallback ( csArray< csString > *  in) [inline]

Definition at line 100 of file pawsdndbutton.h.

virtual void pawsDnDButton::SetRelativeFrame ( int  x,
int  y,
int  width,
int  height 
) [virtual]

Set the size of this widget and it's position relative to the parent.

Parameters:
xThe offset from the parent's minimum x value.
yThe offset from the parent's minimum y value.
widthValue to be used for default width.
heightValue to be used for default height.

Reimplemented from pawsWidget.

void pawsDnDButton::SetTextOffsetX ( int  offset) [inline]

Definition at line 72 of file pawsdndbutton.h.

void pawsDnDButton::SetTextOffsetY ( int  offset) [inline]

Definition at line 63 of file pawsdndbutton.h.

void pawsDnDButton::SetToolTip ( const char *  text)

Changes the text for a tool tip.

Parameters:
textThe new text.

Reimplemented from pawsWidget.

virtual bool pawsDnDButton::Setup ( iDocumentNode *  ) [virtual]

Setup this widget.

Reimplemented from pawsButton.

void pawsDnDButton::SetWarnLevel ( float  val,
bool  low 
)
void pawsDnDButton::SetWarnMode ( int  )
void pawsDnDButton::Start ( csTicks  startTicks,
csTicks  currentTicks,
csTicks  duration 
)

Member Data Documentation

csString* pawsDnDButton::action [protected]

Definition at line 240 of file pawsdndbutton.h.

csArray<csString>* pawsDnDButton::ActionCallback [protected]

Definition at line 247 of file pawsdndbutton.h.

csString pawsDnDButton::backgroundBackup [protected]

Definition at line 248 of file pawsdndbutton.h.

csString pawsDnDButton::baseToolTip [protected]

Definition at line 249 of file pawsdndbutton.h.

Definition at line 244 of file pawsdndbutton.h.

csTicks pawsDnDButton::castingTime [protected]

Definition at line 267 of file pawsdndbutton.h.

Definition at line 241 of file pawsdndbutton.h.

Definition at line 255 of file pawsdndbutton.h.

bool pawsDnDButton::dangerLow [protected]

Definition at line 256 of file pawsdndbutton.h.

Definition at line 257 of file pawsdndbutton.h.

bool pawsDnDButton::DnDLock [protected]

Definition at line 265 of file pawsdndbutton.h.

Definition at line 238 of file pawsdndbutton.h.

Definition at line 239 of file pawsdndbutton.h.

Definition at line 243 of file pawsdndbutton.h.

Definition at line 259 of file pawsdndbutton.h.

bool pawsDnDButton::flashLow [protected]

Definition at line 260 of file pawsdndbutton.h.

Definition at line 261 of file pawsdndbutton.h.

csArray<csString>* pawsDnDButton::ImageNameCallback [protected]

Definition at line 245 of file pawsdndbutton.h.

Definition at line 242 of file pawsdndbutton.h.

csTicks pawsDnDButton::lastToolTipTime [protected]

Definition at line 267 of file pawsdndbutton.h.

Definition at line 237 of file pawsdndbutton.h.

csArray<csString>* pawsDnDButton::NameCallback [protected]

Definition at line 246 of file pawsdndbutton.h.

Definition at line 266 of file pawsdndbutton.h.

csTicks pawsDnDButton::startTime [protected]

Definition at line 267 of file pawsdndbutton.h.

Definition at line 251 of file pawsdndbutton.h.

bool pawsDnDButton::warnLow [protected]

Definition at line 252 of file pawsdndbutton.h.

Definition at line 253 of file pawsdndbutton.h.


The documentation for this class was generated from the following file: