tbx
0.7.6
|
#include <caret.h>
Public Member Functions | |
Caret (bool get_current=false) | |
Create an uninitialised caret. More... | |
Caret (const Caret &other) | |
Construct from an existing caret. | |
Caret (WindowHandle window, IconHandle icon, int x, int y, int height_and_flags, int index) | |
Assigning using the raw fields. More... | |
Caret (tbx::Window window) | |
Construct an invisible caret for the given toolbox window. More... | |
Caret (tbx::Window window, int x, int y) | |
Construct an invisible caret for the given toolbox window. More... | |
Caret (tbx::Window window, int x, int y, int height, bool vdu=false) | |
Construct a visible caret of the given height using the standard wimp colours. More... | |
Caret (tbx::Window window, int x, int y, int height, int colour, bool untranslated=false, bool vdu=false) | |
Construct a visible caret of the given height using the given colours. More... | |
Caret & | operator= (const Caret &other) |
Assignment operator. | |
void | get () |
Update this object with the current location and state of the WIMP caret. | |
void | set () |
Update the WIMP caret location and appearance to the settings in this class. | |
void | move (int x, int y) |
Move the caret class and the WIMP caret to a new location. More... | |
tbx::Window | window () const |
Get toolbox window for Caret (if possible) More... | |
WindowHandle | window_handle () const |
Get Wimp window handle for the caret. More... | |
IconHandle | icon_handle () const |
Get the Wimp icon that contains the caret. More... | |
int | x_offset () const |
Get the current x offset of the caret relative to the window work area origin. | |
int | y_offset () const |
Get the current y offset of the caret relative to the window work area origin. | |
int | height () const |
Get the height of the caret. | |
int | colour () const |
Get caret colour - if colour set. | |
bool | vdu () const |
Is it a vdu caret. More... | |
bool | invisible () const |
Invisible caret. | |
bool | uses_colour () const |
caret_color is used for the colour otherwise caret is Wimp colour 11 | |
bool | colour_untranslated () const |
Colour is untranslated, otherwise they are a Wimp colour. | |
int | index () const |
The index of the caret into the writeable field or -1 if not in a writeable field. | |
Static Public Member Functions | |
static void | turn_off () |
Turn off and disown the caret. | |
Class to read and control the WimpCaret. Writable gadgets and gadgets that contain writable fields will manage the caret themselves. Use this class to control the caret within a window manually. This class stores the values needed for the caret.
Call the set() update the system WIMP caret
tbx::Caret::Caret | ( | bool | get_current = false | ) |
Create an uninitialised caret.
Do not call set until get is called or the fields are set.
@params get_current true to read in the current caret data, false to leave uninitialised (default false).
tbx::Caret::Caret | ( | WindowHandle | window, |
IconHandle | icon, | ||
int | x, | ||
int | y, | ||
int | height_and_flags, | ||
int | index | ||
) |
Assigning using the raw fields.
This is provided to allow everything to be set. Use one of the other constructors for a simpler interfaces.
Call the set() method to update the WIMP caret.
window | WIMP window handle (or -1 to disown the caret) |
icon | WIMP icon handle (or -1 for focus to the window not an icon) |
x | x work area offset of the caret. |
y | y work area offset of the caret. |
height_and_flags | The bottom 16 bits are the height (see the Programmers Reference Manual for the flags). |
index | index into the string on a writable field (or -1 if not on a writable field) |
tbx::Caret::Caret | ( | tbx::Window | window | ) |
tbx::Caret::Caret | ( | tbx::Window | window, |
int | x, | ||
int | y | ||
) |
tbx::Caret::Caret | ( | tbx::Window | window, |
int | x, | ||
int | y, | ||
int | height, | ||
bool | vdu = false |
||
) |
Construct a visible caret of the given height using the standard wimp colours.
Call the set() method to update the WIMP caret.
window | Window the caret will be shown in |
x | x work area offset of the caret. |
y | y work area offset of the caret. |
height | height of the caret in OS units |
vdu | true to use a VDU 5 style caret, false (the default) to use the standard anti-aliased caret. |
tbx::Caret::Caret | ( | tbx::Window | window, |
int | x, | ||
int | y, | ||
int | height, | ||
int | colour, | ||
bool | untranslated = false , |
||
bool | vdu = false |
||
) |
Construct a visible caret of the given height using the given colours.
Call the set() method to update the WIMP caret.
window | Window the caret will be shown in |
x | x work area offset of the caret. |
y | y work area offset of the caret. |
height | height of the caret in OS units. |
colour | the colour for the cursor. |
untranslated | true to use the colour number directly, false (the default) to use the equivalent WIMP colour. |
vdu | true to use a VDU 5 style caret, false (the default) to use the standard anti-aliased caret. |
|
inline |
Get the Wimp icon that contains the caret.
void tbx::Caret::move | ( | int | x, |
int | y | ||
) |
Move the caret class and the WIMP caret to a new location.
x | new work area x-offset |
y | new work area y-offset |
|
inline |
Is it a vdu caret.
tbx::Window tbx::Caret::window | ( | ) | const |
Get toolbox window for Caret (if possible)
|
inline |
Get Wimp window handle for the caret.