stdscreens.eh

Useful builtin screens. More...

use "stdscreens.eh"

Types

type EditBox < Screen;
type ListBox < Screen;
type MsgBox < Screen;

Functions

def EditBox.get_caret(): Int;
def EditBox.get_maxsize(): Int;
def EditBox.get_size(): Int;
def EditBox.get_text(): String;
def EditBox.new(mode: Int = EDIT_ANY): EditBox;
def EditBox.set_maxsize(size: Int);
def EditBox.set_text(text: String);
def ListBox.add(str: String, img: Image = null);
def ListBox.clear();
def ListBox.delete(at: Int);
def ListBox.get_image(at: Int): Image;
def ListBox.get_index(): Int;
def ListBox.get_string(at: Int): String;
def ListBox.insert(at: Int, str: String, img: Image = null);
def ListBox.len(): Int;
def ListBox.new(strings: [String], images: [Image], select: Menu): ListBox;
def ListBox.set(at: Int, str: String, img: Image = null);
def ListBox.set_index(index: Int);
def MsgBox.get_image(): Image;
def MsgBox.get_text(): String;
def MsgBox.new(msg: String, icon: Image = null): MsgBox;
def MsgBox.set_image(img: Image);
def MsgBox.set_text(text: String);

Description

This header defines set of screens which may be used to build user interface.

Message box

MsgBox is a screen that displays static text and can optionally contain icon. This screen is convenient for making dialog windows.

Edit box

EditBox is a screen that allows user to enter and edit text.

List box

Screen that presents a list of strings from which user can pick one. Each string can optionally be accompanied by icon.

Type details

type MsgBox < Screen;
Screen which displays static text.

type EditBox < Screen;
Screen that allows user to enter and edit text.

type ListBox < Screen;
List of strings from which user can pick one.

Function details

def MsgBox.new(msg: String, icon: Image = null): MsgBox;
Creates new message box with given message and icon. If icon is null then message box contains no icon.

def MsgBox.get_text(): String;
Returns text contained in this message box.

def MsgBox.set_text(text: String);
Sets new text to this message box.

def MsgBox.get_image(): Image;
Returns image contained in this message box.

def MsgBox.set_image(img: Image);
Sets new image to this message box.

def EditBox.new(mode: Int = EDIT_ANY): EditBox;
Creates new editbox. Argument mode must be one of constants defined in ui_edit.eh.

def EditBox.get_text(): String;
Returns text currently contained in this editbox.

def EditBox.set_text(text: String);
Sets new text to this editbox.

def EditBox.get_maxsize(): Int;
Returns maximum length of text this editbox can store.

def EditBox.set_maxsize(size: Int);
Sets new maximum length of text this editbox can store. Note, that actual maximum length may be overriden by platform.

def EditBox.get_size(): Int;
Returns number of characters this editbox currently stores.

def EditBox.get_caret(): Int;
Returns current input position. On most devices this function simply returns cursor position. On some devices, however, it blocks and asks the user to set position.

def ListBox.new(strings: [String], images: [Image], select: Menu): ListBox;
Creates new listbox. Array strings is used as the initial contents of the list. If images is not null then it must have the same length as strings. The contents of images array is used as icons for list items. Some elements of images array may be null, the corresponding list item has no icon in this case. Menu given as select argument is added to the screen and returned in an event when user selects an item from the list.

def ListBox.get_index(): Int;
Returns index of the selected item in the listbox.

def ListBox.set_index(index: Int);
Sets selection to the item with the specified index in the listbox.

def ListBox.add(str: String, img: Image = null);
Adds new item to the end of the list. Argument img may be null.

def ListBox.insert(at: Int, str: String, img: Image = null);
Inserts new item at the specified position of the list. Argument img may be null.

def ListBox.set(at: Int, str: String, img: Image = null);
Replaces item at the specified position of the list with given one.

def ListBox.delete(at: Int);
Removes item at the specified position of the list.

def ListBox.get_string(at: Int): String;
Returns string part of the item at the specified position of the list.

def ListBox.get_image(at: Int): Image;
Returns image part of the item at the specified position of the list.

def ListBox.clear();
Removes all items from this list.

def ListBox.len(): Int;
Returns current number of items in this list.