MGUI::CTRL_TOOLTIP Class Reference

#include <mgui/tooltip.h>

List of all members.

Classes

struct  STYLE
 ToolTip style. More...

Public Member Functions

 CTRL_TOOLTIP ()
virtual ~CTRL_TOOLTIP ()
void AppendImage (SPATMOD::IMAGE::STAGE &image)
void AppendImage (const MGD::DEVICE &device, bool bTakeOwnership=false)
void AppendText (const MISTRING &text, const SPATMOD::IMAGE::STAGE_ARRAY *Images)
void AppendText (const MISTRING &text)
void Attach (Widget widget, bool DeleteOnCtrlDestroy=false)
void Attach (MGUI::CTRL &ctrl, bool DeleteOnCtrlDestroy=false)
bool CheckMotion (const XEvent &event, bool AutoHide=true)
bool CheckMotion (int x, int y, bool AutoHide=true)
void Clear ()
void Detach ()
void Disable ()
void Enable ()
INT32 GetDelay ()
ERRVALUE GetImages (SPATMOD::IMAGE::STAGE_ARRAY &Images, bool bTransferOwnership)
int GetPixelDelta () const
int GetPriority () const
const STYLEGetStyle () const
const MISTRINGGetText () const
void Hide ()
bool IsDisabled () const
bool IsVisible () const
void SetAlpha (int alpha)
void SetDelay (INT32 delay)
void SetDelegateOnShowRequest (DELEGATE_ONTOOLTIPREQUEST delegate)
void SetImage (const MGD::DEVICE &imgdev, const MGD::DEVICE_BINARY *maskdev=0, const LPOINT2D *pos=0)
void SetPixelDelta (int PixelDelta)
void SetPriority (int priority)
void SetStyle (const STYLE &style)
void SetText (const MISTRING &text, const SPATMOD::IMAGE::STAGE_ARRAY *Images)
void SetText (const MISTRING &text)
void Show ()

Static Public Member Functions

static CTRL_TOOLTIPFindAttached (Widget widget)
static void HideAll ()

Private Member Functions

virtual bool v_HasDatatip ()
virtual void v_OnHide ()
virtual void v_OnShow ()
virtual bool v_OnShowRequest (int x, int y)

Constructor & Destructor Documentation

MGUI::CTRL_TOOLTIP::CTRL_TOOLTIP (  ) 

Constructor.

virtual MGUI::CTRL_TOOLTIP::~CTRL_TOOLTIP (  )  [virtual]

Destructor.


Member Function Documentation

void MGUI::CTRL_TOOLTIP::AppendImage ( SPATMOD::IMAGE::STAGE image  ) 

Append an image to the tooltip.

void MGUI::CTRL_TOOLTIP::AppendImage ( const MGD::DEVICE device,
bool  bTakeOwnership = false 
)

Append an image to the tooltip.

void MGUI::CTRL_TOOLTIP::AppendText ( const MISTRING text,
const SPATMOD::IMAGE::STAGE_ARRAY Images 
)

Set text to show next time ToolTip is displayed.

Does not cause ToolTip to appear.

The Images array is used if the text contains {~IMG #}, where the # is a 0-based index into the Images array. Note, even if the Tool tip already has images embeded in it, the the {~IMG #} tags specified in the text parameter should be numbered starting at 0 relative to the Images array passed in. They will be adjusted if necessary.

Parameters:
text Text to show
Images Images inserted into text.
void MGUI::CTRL_TOOLTIP::AppendText ( const MISTRING text  ) 

Append text to the tooltip.

void MGUI::CTRL_TOOLTIP::Attach ( Widget  widget,
bool  DeleteOnCtrlDestroy = false 
)

Attach instance to Widget (X only).

Parameters:
widget Widget to attach to
DeleteOnCtrlDestroy Delete ToolTip instance when associated control is destroyed
void MGUI::CTRL_TOOLTIP::Attach ( MGUI::CTRL ctrl,
bool  DeleteOnCtrlDestroy = false 
)

Attach instance to CTRL.

Parameters:
ctrl Control to attach, must have already been created
DeleteOnCtrlDestroy Delete ToolTip instance when associated control is destroyed
bool MGUI::CTRL_TOOLTIP::CheckMotion ( const XEvent &  event,
bool  AutoHide = true 
)
bool MGUI::CTRL_TOOLTIP::CheckMotion ( int  x,
int  y,
bool  AutoHide = true 
)
void MGUI::CTRL_TOOLTIP::Clear (  ) 

Clear the current contents.

Useful if you intend to Append to the tip.

void MGUI::CTRL_TOOLTIP::Detach (  ) 

Detach instance from control.

void MGUI::CTRL_TOOLTIP::Disable (  ) 

Disable automatic ToolTip display mechanism.

ToolTip may still be shown by calling Show(). Does not hide ToolTip if presently showing. Each use of Disable() much be matched by call to Enable() to actually re-enable ToolTip

void MGUI::CTRL_TOOLTIP::Enable (  ) 

Enable automatic ToolTip display mechanism.

static CTRL_TOOLTIP* MGUI::CTRL_TOOLTIP::FindAttached ( Widget  widget  )  [static]

Find CTRL_TOOLTIP instance attached to Widget (X only).

Returns:
NULL if none attached.
INT32 MGUI::CTRL_TOOLTIP::GetDelay (  ) 

Get delay for automatic ToolTip display.

Returns:
Delay in milliseconds.
ERRVALUE MGUI::CTRL_TOOLTIP::GetImages ( SPATMOD::IMAGE::STAGE_ARRAY Images,
bool  bTransferOwnership 
)

Get the images (if any) from the tooltip.

The Images array is not cleared by this process. The CTRL_TOOLTIP's images will be appended to the Images array. If bTransferOwnership is true, then the images will be removed from the CTRL_TOOLTIP and the Images array will "own" them. If it's false, then it has to copy the images.

int MGUI::CTRL_TOOLTIP::GetPixelDelta (  )  const

Get amount of movement for automatically hiding ToolTip.

Returns:
Movement amount in pixels.
int MGUI::CTRL_TOOLTIP::GetPriority (  )  const

Get Priority for selecting amoung multiple ToolTips attached to same control.

const STYLE& MGUI::CTRL_TOOLTIP::GetStyle (  )  const

Get current style settings.

const MISTRING& MGUI::CTRL_TOOLTIP::GetText (  )  const

Get text to be displayed.

Returns:
Text string, will be blank if using label from attached control.
void MGUI::CTRL_TOOLTIP::Hide (  ) 

Hide ToolTip if visible.

This is usually done automatically unless disabled.

static void MGUI::CTRL_TOOLTIP::HideAll (  )  [static]

Hide all currently visible tooltips.

bool MGUI::CTRL_TOOLTIP::IsDisabled (  )  const

Determine if automatic display mechanism is disabled.

Manual display via Show/Hide is always allowed.

bool MGUI::CTRL_TOOLTIP::IsVisible (  )  const

Determine if ToolTip is presently visible.

void MGUI::CTRL_TOOLTIP::SetAlpha ( int  alpha  ) 

Set the Alpha (opacity) of the tooltip window.

Note, this will only work under Windows, as it uses a feature unique to the MicroImages X Server. Alpha must be set before the tool tip is shown.

Parameters:
alpha 0 = transparent, 255 = opaque
void MGUI::CTRL_TOOLTIP::SetDelay ( INT32  delay  ) 

Set delay for automatic ToolTip display.

Parameters:
delay ToolTip popup delay in milliseconds
void MGUI::CTRL_TOOLTIP::SetDelegateOnShowRequest ( DELEGATE_ONTOOLTIPREQUEST  delegate  ) 

Set delegate to call when requesting tooltip be shown.

Delegate is only called if v_OnShowRequest is not overridden.

Parameters:
delegate Delegate
void MGUI::CTRL_TOOLTIP::SetImage ( const MGD::DEVICE imgdev,
const MGD::DEVICE_BINARY maskdev = 0,
const LPOINT2D pos = 0 
)

Set image, optional mask and position for graphical ToolTip.

This does not actually display the ToolTip.

Parameters:
imgdev Device containing associated image
maskdev Optional device containing mask
pos Optional position relative to cursor
void MGUI::CTRL_TOOLTIP::SetPixelDelta ( int  PixelDelta  ) 

Set distance cursor must move to hide tooltip.

Note that if cursor moves outside attached control the tooltip will be hidden regardless of distance.

Parameters:
PixelDelta Movement distance in screen pixels
void MGUI::CTRL_TOOLTIP::SetPriority ( int  priority  ) 

Set priority if multiple CTRL_TOOLTIP instances are attached to the same control.

If multiple instances attached the one with the highest priority will be shown.

Parameters:
priority Priority to set
void MGUI::CTRL_TOOLTIP::SetStyle ( const STYLE style  ) 

Set style to use next time ToolTip text is shown.

void MGUI::CTRL_TOOLTIP::SetText ( const MISTRING text,
const SPATMOD::IMAGE::STAGE_ARRAY Images 
)

Set text to show next time ToolTip is displayed.

Does not cause ToolTip to appear.

The Images array is used if the text contains {~IMG #}, where the # is a 0-based index into the Images array.

Parameters:
text Text to show
Images Images inserted into text.
void MGUI::CTRL_TOOLTIP::SetText ( const MISTRING text  ) 

Set text to show next time ToolTip is displayed.

Does not cause ToolTip to appear.

Parameters:
text Text to show
void MGUI::CTRL_TOOLTIP::Show (  ) 

Show the ToolTip.

This is usually done automatically unless disabled.

virtual bool MGUI::CTRL_TOOLTIP::v_HasDatatip (  )  [private, virtual]

Override to set when datatip becomes available Used for making request in separate thread Default implementation returns 'true' unless no text or image is available.

virtual void MGUI::CTRL_TOOLTIP::v_OnHide (  )  [private, virtual]

Called after ToolTip is hidden.

Generally used to send notifications about action. Default implementation does nothing.

virtual void MGUI::CTRL_TOOLTIP::v_OnShow (  )  [private, virtual]

Called after ToolTip is shown.

Generally used to send notifications about action. Default implementation does nothing.

virtual bool MGUI::CTRL_TOOLTIP::v_OnShowRequest ( int  x,
int  y 
) [private, virtual]

Override to perform custom ToolTip creating.

When overriding, use SetText or SetImage to control what will be displayed.

Returns:
true to show ToolTip, false to not. Default implementation calls delegate if available otherwise returns 'true' unless no text or image is available.

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

Generated on Sun Oct 7 21:35:39 2012 for TNTsdk 2012 by  doxygen 1.6.1