Planeshift
Classes | Public Member Functions

psMainWidget Class Reference

The main or desktop widget. More...

#include <psmainwidget.h>

List of all members.

Classes

struct  mesgOption
 Used to store an option about on screen options. More...

Public Member Functions

void ClearFadingText ()
void DeleteChild (pawsWidget *txtBox)
 Removes the fading text box from the array and the memory.
void Draw ()
 Draw method.
void DrawChildren ()
 Draws all children marked visible.
GEMClientObjectFindMouseOverObject (int mouseX, int mouseY)
 Find what entity the mouse is over.
psEntityTypesGetEntityTypes ()
const char * HandleCommand (const char *)
 Handles commands (unused for now)
void HandleMessage (MsgEntry *message)
 Handles server messages.
bool IsPlayerLocked ()
void LockPlayer ()
bool OnDoubleClick (int button, int modifiers, int x, int y)
 Manage mouse double click event.
bool OnKeyDown (utf32_char keyCode, utf32_char key, int modifiers)
 Process keydown messages.
bool OnMouseDown (int button, int modifiers, int x, int y)
 Manage mouse down event to test for and apply window changes.
bool OnMouseUp (int button, int modifiers, int x, int y)
 Manage mouse up event.
void PrintOnScreen (const char *text, int color, float ymod=0.50f)
 Print a message on screen.
 psMainWidget ()
bool SetupMain ()
void UnlockPlayer ()
virtual ~psMainWidget ()
Functions to handle on-screen messages options
bool GetMesgOption (int mesgType)
 Gets an on-screen message option.
void SetMesgOption (int mesgType, bool value)
 Sets a on screen message option.
bool LoadConfigFromFile ()
 Loads the configuration of this widget.
bool SaveConfigToFile ()
 Saves the configuration of this widget.
csHash< mesgOption, int >
::GlobalIterator 
GetMesgOptionsIterator ()
 Returns an iterator to iterate the options about on-screen messages.

Detailed Description

The main or desktop widget.

Definition at line 79 of file psmainwidget.h.


Constructor & Destructor Documentation

psMainWidget::psMainWidget ( )
virtual psMainWidget::~psMainWidget ( ) [virtual]

Member Function Documentation

void psMainWidget::ClearFadingText ( )
void psMainWidget::DeleteChild ( pawsWidget txtBox) [virtual]

Removes the fading text box from the array and the memory.

Reimplemented from pawsWidget.

void psMainWidget::Draw ( ) [inline, virtual]

Draw method.

As the main widget is not a real widget which should show things, but only it's children are drawn by calling drawchildren directly, the draw function does nothing.

Reimplemented from pawsWidget.

Definition at line 132 of file psmainwidget.h.

void psMainWidget::DrawChildren ( ) [virtual]

Draws all children marked visible.

Reimplemented from pawsWidget.

GEMClientObject* psMainWidget::FindMouseOverObject ( int  mouseX,
int  mouseY 
)

Find what entity the mouse is over.

Parameters:
mouseXThe screen X position of the mouse.
mouseYThe screen Y position of the mouse.
Returns:
A pointer to the GEMObject found or NULL if no entity.
psEntityTypes* psMainWidget::GetEntityTypes ( ) [inline]

Definition at line 102 of file psmainwidget.h.

bool psMainWidget::GetMesgOption ( int  mesgType)

Gets an on-screen message option.

Parameters:
mesgTypeThe id of the message.
See also:
messages.h for a list of them.
Returns:
The status set for this message (true is show, false is hide)
csHash<mesgOption, int>::GlobalIterator psMainWidget::GetMesgOptionsIterator ( ) [inline]

Returns an iterator to iterate the options about on-screen messages.

Returns:
a GlobalIterator instance to the message options

Definition at line 170 of file psmainwidget.h.

const char* psMainWidget::HandleCommand ( const char *  ) [inline, virtual]

Handles commands (unused for now)

Implements psCmdBase.

Definition at line 108 of file psmainwidget.h.

void psMainWidget::HandleMessage ( MsgEntry message) [virtual]

Handles server messages.

Implements psCmdBase.

bool psMainWidget::IsPlayerLocked ( ) [inline]

Definition at line 92 of file psmainwidget.h.

bool psMainWidget::LoadConfigFromFile ( )

Loads the configuration of this widget.

For now it loads just the options about the on-screen messages to show/hide.

Returns:
The result of the operation
void psMainWidget::LockPlayer ( ) [inline]

Definition at line 91 of file psmainwidget.h.

bool psMainWidget::OnDoubleClick ( int  button,
int  modifiers,
int  x,
int  y 
) [virtual]

Manage mouse double click event.

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

Reimplemented from pawsMainWidget.

bool psMainWidget::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
) [virtual]

Process keydown messages.

Parameters:
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns:
bool TRUE for success FALSE if no action.
Remarks:
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsMainWidget.

bool psMainWidget::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 pawsMainWidget.

bool psMainWidget::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 pawsMainWidget.

void psMainWidget::PrintOnScreen ( const char *  text,
int  color,
float  ymod = 0.50f 
)

Print a message on screen.

This function is called when a system message is received. To print a message on screen fire a system message of type MSG_ERROR(Red), MSG_OK(Green), MSG_RESULT(Yellow) or MSG_ACK(Blue)

Parameters:
textThe text to be printed on screen. Have to be at lest 2 chars or it will be ignored.
colorThe color to be used on the text.
ymodWhere on screen should the message be displayed. Default in center.
bool psMainWidget::SaveConfigToFile ( )

Saves the configuration of this widget.

For now it saves just the options about the on-screen messages to show/hide.

Returns:
The result of the operation
void psMainWidget::SetMesgOption ( int  mesgType,
bool  value 
)

Sets a on screen message option.

Parameters:
mesgTypeThe id of the message.
See also:
messages.h for a list of them.
Parameters:
valueThe status to set for this message (true is show, false is hide)
bool psMainWidget::SetupMain ( )
void psMainWidget::UnlockPlayer ( ) [inline]

Definition at line 93 of file psmainwidget.h.


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