This reference page is linked to from the following overview topics: Viewport Button, Deferred Loading of Plug-ins.
A manager to control the usage of the viewport buttons.
A Manager that the developer uses to register viewport buttons.
It also contains helper function to provide global hittesting and
per button hittesting. The developer can use these from within the
OnAction callback. The manager is not responsible for deleting the
manager. The developer should Unregister and then delete the
button
To use IViewportButtonManager
simply use
static_cast<IViewportButtonManager*>(GetCOREInterface(IVIEWPORTBUTTONMANAGER_INTERFACE
))
#include <IViewportButton.h>
Public Member Functions |
|
virtual void | RegisterButton (IViewportButton *button)=0 |
Register a new button. |
|
virtual void | UnRegisterButton (IViewportButton *button)=0 |
Remove a previously registered button.
|
|
virtual bool | IsButtonRegistered (IViewportButton *button) const =0 |
A query to check if a button is registered.
|
|
virtual int | GetNumRegisteredButtons () const =0 |
The total number of buttons. |
|
virtual IViewportButton * | GetViewportButton (int index)=0 |
Access an indivdual button. |
|
virtual void | EnableButtons (bool val)=0 |
globally enable/disable the viewport buttons
|
|
virtual bool | GetButtonsEnabled () const =0 |
Globally acces whether the viewport buttons
are enabled. |
|
virtual bool | OnAction (HWND hwnd, GraphicsWindow *gw, IPoint2 hitLoc, IViewportButton::Action action)=0 |
Sends the OnAction command. |
|
virtual bool | OnUpdate (HWND hwnd, ViewExp *vpt)=0 |
Send the OnUpdate command. |
|
virtual bool | HitTest (HWND hwnd, GraphicsWindow *gw, IPoint2 stringStartLoc, IPoint2 hitLoc, MSTR &string)=0 |
Provides a single hittest of the text.
|
|
virtual bool | HitTest (HWND hwnd, GraphicsWindow *gw, IPoint2 hitLoc)=0 |
Global hittesting on all registered buttons.
|
|
virtual void | DrawButtons (ViewExp *vpt, Rect *rect=NULL)=0 |
Render the buttons. |
|
virtual void | RefreshButtonDisplay ()=0 |
Utility function for forcing a refresh of
the button display. |
virtual void RegisterButton | ( | IViewportButton * | button | ) | [pure virtual] |
Register a new button.
Register a new button with the manager. The system will check against buttons already registered
*button | The new button to register |
virtual void UnRegisterButton | ( | IViewportButton * | button | ) | [pure virtual] |
Remove a previously registered button.
Remove a button already registered with the system. The manager will not delete the button, simply removes it from the table
* | button The button to remove |
virtual bool IsButtonRegistered | ( | IViewportButton * | button | ) | const [pure virtual] |
A query to check if a button is registered.
Check to see if the button is registered. Developers can use this to check to see if a button is registered before trying to register it
*button | The button to test against |
virtual int GetNumRegisteredButtons | ( | ) | const [pure virtual] |
The total number of buttons.
The number of button registered with the manager
virtual IViewportButton* GetViewportButton | ( | int | index | ) | [pure virtual] |
Access an indivdual button.
Access to a specfiic button by index.
index | The index of the button to acess |
virtual void EnableButtons | ( | bool | val | ) | [pure virtual] |
globally enable/disable the viewport buttons
A global method for enabling the viewport button. If the buttons are disabled, nothing will be displayed or processed.
val | TRUE if the buttons are to be enabled |
virtual bool GetButtonsEnabled | ( | ) | const [pure virtual] |
Globally acces whether the viewport buttons are enabled.
A global method for querying viewport buttons enabled status. If the buttons are disabled, nothing will be displayed or processed.
virtual bool OnAction | ( | HWND | hwnd, |
GraphicsWindow * | gw, | ||
IPoint2 | hitLoc, | ||
IViewportButton::Action | action | ||
) | [pure virtual] |
Sends the OnAction command.
Send the OnAction command to all registered viewports
hwnd | The Window handle where the action we performed |
gw | A pointer to the GraphicsWindow |
hitLoc | The point where the action occured - this allow the button to perform a hittest. |
action | The type of action |
virtual bool OnUpdate | ( | HWND | hwnd, |
ViewExp * | vpt | ||
) | [pure virtual] |
Send the OnUpdate command.
Sends the OnUpate command to all registered viewports
hwnd | The Window handle issueing the update request |
*vpt | A pointer to current View |
virtual bool HitTest | ( | HWND | hwnd, |
GraphicsWindow * | gw, | ||
IPoint2 | stringStartLoc, | ||
IPoint2 | hitLoc, | ||
MSTR & | string | ||
) | [pure virtual] |
Provides a single hittest of the text.
Utility function to perform hittesting on the supplied string and the location provided The derived IViewportButton can use this for localised hit testing, for example in the OnAction method
hwnd | The window handle |
*gw | GraphicsWindow pointer from the active viewport |
stringStartLoc | The start location of the supplied string |
hitLoc | The mouse position |
string | The label to hittest against |
virtual bool HitTest | ( | HWND | hwnd, |
GraphicsWindow * | gw, | ||
IPoint2 | hitLoc | ||
) | [pure virtual] |
Global hittesting on all registered buttons.
Utility function to allow hittesting on all buttons registered. It will simply return TRUE on the first successful hit test on the button label
hwnd | The window handle |
*gw | The GraphicsWindow for the active viewport |
hitLoc | The mouse position |
Render the buttons.
Global function to draw each button registered in the system.
*vpt | The current active viewport |
*rect | If none NULL, the complete viewport Rect is stored here. |
virtual void RefreshButtonDisplay | ( | ) | [pure virtual] |
Utility function for forcing a refresh of the button display.