Skip to main content

Class JtvHistoryWindow

public class JtvHistoryWindow
extends JtvWindow

The popup window that hosts a JtvHistoryViewer.

JtvHistoryWindow is a borderless, number-less window created automatically by JtvHistory.initHistoryWindow(JtvRect) when the user requests the history pick-list. It contains a JtvHistoryViewer with horizontal and vertical scroll bars.

Clicking outside the window's bounds dismisses it with cmCancel. This class is managed automatically by JtvHistory and does not normally need to be used directly.

Colour palette

The seven-entry palette cpHistoryWindow maps to:

  1. Passive frame colour.
  2. Active frame / title colour.
  3. Frame icon colour.
  4. Scroll bar page area colour.
  5. Scroll bar arrow colour.
  6. History list normal item colour.
  7. History list focused item colour.

org.viktor44.jtvision.dialogs.JtvHistoryWindow

Summary​

Constructors​

VisibilitySignature
publicJtvHistoryWindow(JtvRect bounds, int historyId)

Fields​

ModifiersField nameType
private static finalcpHistoryWindoworg.viktor44.jtvision.core.JtvPalette
privateviewerorg.viktor44.jtvision.dialogs.JtvHistoryViewer

Methods​

ModifiersMethod signatureReturn type
protectedinitViewer(JtvRect r, int historyId)org.viktor44.jtvision.dialogs.JtvHistoryViewer
publicgetPalette()org.viktor44.jtvision.core.JtvPalette
publicgetSelection()String
publichandleEvent(JtvEvent event)void

Constructors​

JtvHistoryWindow(JtvRect bounds, int historyId)​

Creates a history window with the given bounds and history ID. Constructs and inserts a JtvHistoryViewer with keyboard-enabled scroll bars.

Parameters

  • bounds - the bounding rectangle for the popup window
  • historyId - the ID of the history list to display

Fields​

org.viktor44.jtvision.core.JtvPalette cpHistoryWindow​

Seven-entry colour palette:

  1. 0x13 — passive frame colour.
  2. 0x13 — active frame / title colour.
  3. 0x15 — frame icon colour.
  4. 0x18 — scroll bar page area colour.
  5. 0x17 — scroll bar arrow colour.
  6. 0x13 — history list normal item colour.
  7. 0x14 — history list focused item colour.

org.viktor44.jtvision.dialogs.JtvHistoryViewer viewer​

The list-viewer component that displays the history entries.

Methods​

initViewer(JtvRect r, int historyId)​

Creates the JtvHistoryViewer inside this window, with standard horizontal and vertical scroll bars. Override to customise the viewer.

Parameters

  • r - the window's client rectangle (will be shrunk by 1 on each side)
  • historyId - the history ID to pass to the viewer

Returns

a new JtvHistoryViewer

getPalette()​

Overrides:

getPalette() in org.viktor44.jtvision.views.JtvWindow

Returns the default color palette cpHistoryWindow.

Returns

the history window's color palette

getSelection()​

Returns the text of the entry currently selected in the viewer.

Returns

the selected history entry text, or an empty string if no viewer exists

handleEvent(JtvEvent event)​

Overrides:

handleEvent(JtvEvent event) in org.viktor44.jtvision.views.JtvWindow

Extends the inherited event handler to dismiss the window (cmCancel) when the user clicks outside its bounds.

Parameters

  • event - the incoming event