Main Page   Class Hierarchy   Compound List   File List   Compound Members  

KrListBox Class Reference

A very simple listbox. More...

#include <listbox.h>

Inheritance diagram for KrListBox::

KrWidget KrImNode IKrWidgetListener List of all members.

Public Methods

 KrListBox (int width, int height, const KrScheme &scheme, bool drawBorder)
 Constructs a list box. More...

int NumItems ()
 Return the number of items in the list box.

int SelectedItem ()
 Return the index of the selected item.

int AddTextChar (const std::string &text)
 Add an item. Returns the index of the item.

void GetTextChar (int index, std::string *text)
 Query an item and write it to the "text" string.

void MoveSelection (int delta)
 Move the selection, positive or negative, scrolling if necessary.

virtual bool HandleWidgetEvent (KrWidget *source, U32 event, U32 data, const SDL_Event *sdlEvent, const char *command, const char *arg)
 Handle SDL events, return true if handled, false if not ours.


Detailed Description

A very simple listbox.

Items can be added, but not removed. It can be scrolled, but through the method MoveSelection. Normally, you set up button to accomplish this. (The guitest demonstrates this.)

Events Sent


Constructor & Destructor Documentation

KrListBox::KrListBox int    width,
int    height,
const KrScheme   scheme,
bool    drawBorder
 

Constructs a list box.

Parameters:
width  Width in pixels of the list box.
height  Height in pixels of the list box.
scheme  The color palette and font to use to render the list box.
drawBorder  Whether or not a bevel should be drawn around the list box.


The documentation for this class was generated from the following file:
Generated on Mon Sep 15 12:01:11 2003 for Kyra by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001