- Main Page
- Packages
- Classes
- Files
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# smjg.libs.sdwf.caret.Caret Class Reference

The smjg.libs.sdwf.caret.Caret class represents a window's caret (text cursor). More...

List of all members.

## Public Member Functions
| this (WindowBase w)
| Constructs a new Caret with unspecified size and position.
| this (WindowBase w, Point p)
| Constructs a new Caret at the given position.
| this (WindowBase w, RectDim d)
| Constructs a new Caret with the given dimensions.
| this (WindowBase w, Point p, RectDim d)
| Constructs a new Caret with the given position and dimensions.
| this (WindowBase w, Bitmap b)
| Constructs a new Caret from a bitmap.
| this (WindowBase w, Point p, Bitmap b)
| Constructs a new Caret with the given position and bitmap.
CARET_STYLE | style ()
| How the caret is displayed.
CARET_STYLE | style (CARET_STYLE s)
| How the caret is displayed.
RectDim | dim ()
| The dimensions of a rectangular (non-bitmap) caret.
RectDim | dim (RectDim d)
| The dimensions of a rectangular (non-bitmap) caret.
Bitmap | bitmap ()
| The bitmap used to display the caret.
Bitmap | bitmap (Bitmap b)
| The bitmap used to display the caret.
Point | position ()
| The current position of the caret within its window.
Point | position (Point p)
| The current position of the caret within its window.
void | show ()
| Displays the caret and starts it blinking.
void | hide ()
| Hides the caret.
uint | timesHidden ()
| The caret's hide count.

## Detailed Description

The smjg.libs.sdwf.caret.Caret class represents a window's caret (text cursor).

Unlike the Windows system caret, which is a single object that is passed between windows and controls that acquire keyboard focus, each Caret object belongs to a single window and persists for the window's lifetime.

Since:
  0.5

## Constructor & Destructor Documentation

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w | ) |

Constructs a new Caret with unspecified size and position.

Parameters:

  | w | window to which the caret will belong.

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w,
|  | Point | p |
| ) |  |  |

Constructs a new Caret at the given position.

Parameters:

  | w | window to which the caret will belong.
  | p | position of the caret, in the window's logical coordinates.

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w,
|  | RectDim | d |
| ) |  |  |

Constructs a new Caret with the given dimensions.

Parameters:

  | w | window to which the caret will belong.
  | d | size of the caret, in the window's logical coordinates.

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w,
|  | Point | p,
|  | RectDim | d |
| ) |  |  |

Constructs a new Caret with the given position and dimensions.

Parameters:

  | w | window to which the caret will belong.
  | p | position of the caret, in the window's logical coordinates.
  | d | size of the caret, in the window's logical coordinates.

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w,
|  | Bitmap | b |
| ) |  |  |

Constructs a new Caret from a bitmap.

Parameters:

  | w | window to which the caret will belong.
  | b | bitmap used to display the caret.

smjg.libs.sdwf.caret.Caret.this | ( | WindowBase | w,
|  | Point | p,
|  | Bitmap | b |
| ) |  |  |

Constructs a new Caret with the given position and bitmap.

Parameters:

  | w | window to which the caret will belong.
  | p | position of the caret, in the window's logical coordinates.
  | b | bitmap used to display the caret.

## Member Function Documentation

CARET_STYLE smjg.libs.sdwf.caret.Caret.style | ( |  | ) |

How the caret is displayed.

CARET_STYLE smjg.libs.sdwf.caret.Caret.style | ( | CARET_STYLE | s | ) |

How the caret is displayed.

Precondition:
  To set the CARET_STYLE.BITMAP style, a bitmap must have already been assigned to the caret.

Status:
  done

RectDim smjg.libs.sdwf.caret.Caret.dim | ( |  | ) |

The dimensions of a rectangular (non-bitmap) caret.

RectDim smjg.libs.sdwf.caret.Caret.dim | ( | RectDim | d | ) |

The dimensions of a rectangular (non-bitmap) caret.

Note:
  If the caret is currently a bitmap, setting this value will change it to a solid rectangular caret.

Status:
  test

Bitmap smjg.libs.sdwf.caret.Caret.bitmap | ( |  | ) |

The bitmap used to display the caret.

Bitmap smjg.libs.sdwf.caret.Caret.bitmap | ( | Bitmap | b | ) |

The bitmap used to display the caret.

Note:
  Setting this value automatically sets the caret's style to bitmap.

Status:
  done

Point smjg.libs.sdwf.caret.Caret.position | ( |  | ) |

The current position of the caret within its window.

Point smjg.libs.sdwf.caret.Caret.position | ( | Point | p | ) |

The current position of the caret within its window.

void smjg.libs.sdwf.caret.Caret.show | ( |  | ) |

Displays the caret and starts it blinking.

If the caret has been hidden two or more times in succession, this function must be called the same number of times to restore caret visibility.

void smjg.libs.sdwf.caret.Caret.hide | ( |  | ) |

Hides the caret.

Call this function before doing any drawing operations to the window containing the caret, to prevent display interference at the caret position. Call Caret.show to redisplay the caret afterwards.

Hiding is cumulative, so Caret.hide calls must be balanced by an equal number of Caret.show calls to restore visibility. This makes it possible to nest calls to functions that hide and redisplay the caret, and the caret will not reappear until all have finished.

uint smjg.libs.sdwf.caret.Caret.timesHidden | ( |  | ) |

The caret's hide count.

This is equal to the number of times Caret.show must be called to restore the caret's visibility.

This figure does not include instances in which an internal working of SDWF temporarily hides the caret.

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

- caret.d