tbx  0.7.6
Public Member Functions | Static Public Member Functions | List of all members
tbx::Caret Class Reference

#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...
 
Caretoperator= (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.
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Caret() [1/6]

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).

◆ Caret() [2/6]

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.

Parameters
windowWIMP window handle (or -1 to disown the caret)
iconWIMP icon handle (or -1 for focus to the window not an icon)
xx work area offset of the caret.
yy work area offset of the caret.
height_and_flagsThe bottom 16 bits are the height (see the Programmers Reference Manual for the flags).
indexindex into the string on a writable field (or -1 if not on a writable field)

◆ Caret() [3/6]

tbx::Caret::Caret ( tbx::Window  window)

Construct an invisible caret for the given toolbox window.

Call the set() method to update the WIMP caret.

Parameters
windowWindow the caret will be shown in

◆ Caret() [4/6]

tbx::Caret::Caret ( tbx::Window  window,
int  x,
int  y 
)

Construct an invisible caret for the given toolbox window.

Call the set() method to update the WIMP caret.

Parameters
windowWindow the caret will be shown in
xx work area offset of the caret.
yy work area offset of the caret.

◆ Caret() [5/6]

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.

Parameters
windowWindow the caret will be shown in
xx work area offset of the caret.
yy work area offset of the caret.
heightheight of the caret in OS units
vdutrue to use a VDU 5 style caret, false (the default) to use the standard anti-aliased caret.

◆ Caret() [6/6]

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.

Parameters
windowWindow the caret will be shown in
xx work area offset of the caret.
yy work area offset of the caret.
heightheight of the caret in OS units.
colourthe colour for the cursor.
untranslatedtrue to use the colour number directly, false (the default) to use the equivalent WIMP colour.
vdutrue to use a VDU 5 style caret, false (the default) to use the standard anti-aliased caret.

Member Function Documentation

◆ icon_handle()

IconHandle tbx::Caret::icon_handle ( ) const
inline

Get the Wimp icon that contains the caret.

Returns
The IconHandle or -1 if none.

◆ move()

void tbx::Caret::move ( int  x,
int  y 
)

Move the caret class and the WIMP caret to a new location.

Parameters
xnew work area x-offset
ynew work area y-offset

◆ vdu()

bool tbx::Caret::vdu ( ) const
inline

Is it a vdu caret.

Returns
true for vdu caret, false for antialiased caret

◆ window()

tbx::Window tbx::Caret::window ( ) const

Get toolbox window for Caret (if possible)

Returns
toolbox window or null window if it can't be determined

◆ window_handle()

WindowHandle tbx::Caret::window_handle ( ) const
inline

Get Wimp window handle for the caret.

Returns
window handle or -1 if no window has the caret

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