TWindow Class Reference

#include <twwindow.h>

Inheritance diagram for TWindow:

Popup IconTV PopupList PopupListIcons FileBrowser TextButtonPopupList List of all members.

Public Member Functions

void enable ()
void disable ()
void hide ()
void show ()
 TWindow (char *identbase, bool vidwin=false)
void setscreen (BITMAP *scr)
BITMAP * bmp (char *bmpname, bool vidmem=false)
void center_abs (int xcenter, int ycenter)
void center (int xcenter, int ycenter)
void center ()
void locate (int xtopleftcorner, int ytopleftcorner)
void display (int idle_ms=0)
void load_music (const char *filename)
void load_sample (const char *filename)

Public Attributes

bool use_rle
int autoplace
TWindowprev
bool disabled
bool hidden
BITMAP * mouse_bmp
TwguiMusicBasewindow_music
TwguiSampleBasebutton_sample

Detailed Description

The window interface. This manages a list of buttons. The window itself can also be part of a list of windows (eg a main window and a couple of popup windows).

Special navigation controls:

Special settings for each window:


Constructor & Destructor Documentation

TWindow::TWindow char *  identbase,
bool  vidwin = false
 

vidwin: places the bitmaps used by the menu in video-memory, which is faster. Identbase: a string, which serves as the base for buttons that are assigned to the window. Also, identbase*backgr.bmp should exist, which defines the window layout.


Member Function Documentation

BITMAP * TWindow::bmp char *  bmpname,
bool  vidmem = false
 

return a bmp from the data file

void TWindow::center  ) 
 

centers the window on the middle of twscreen

void TWindow::center int  xcenter,
int  ycenter
 

centers the window on these pixel coordinates on the screen

void TWindow::center_abs int  xcenter,
int  ycenter
 

centers the window on this position, with additional correction for screen resolution

void TWindow::disable  ) 
 

changes the "disabled" flag

void TWindow::display int  idle_ms = 0  ) 
 

Calls the calculate and animate functions of the window, and then displays the menu on a vidscreen. Also uses an "idle" value (in milliseconds) after it's being displayed, for your convenience. This routine can be used in loops where you wait purely for user-input.

void TWindow::enable  ) 
 

changes the "disabled" flag

Reimplemented in Popup.

void TWindow::hide  ) 
 

changes the "hidden" flag

void TWindow::load_music const char *  filename  ) 
 

load music that will play when the window is active.

void TWindow::load_sample const char *  filename  ) 
 

load a sample that will sound when a button is pushed

void TWindow::locate int  xtopleftcorner,
int  ytopleftcorner
 

locate the topleftcorner of the window, with addition correction for screen resolution

void TWindow::setscreen BITMAP *  scr  ) 
 

set the screen to which the menu items are written

void TWindow::show  ) 
 

changes the "hidden" flag


Member Data Documentation

int TWindow::autoplace
 

The "autoplace" option in the info.txt file: true: then the auto-search is used to place a bitmap somewhere, and also there's always a check to see if this is needed; false: then the ini positions are used without further questions.

TwguiSampleBase* TWindow::button_sample
 

make a sound if you hit a button

bool TWindow::disabled
 

disables the window (for calculation)

bool TWindow::hidden
 

hide is "stronger" than disabled, since it also prevents drawing.

BITMAP* TWindow::mouse_bmp
 

mouse bitmap associated with this window

TWindow* TWindow::prev
 

keeping track of a list of (related) windows

bool TWindow::use_rle
 

(default=true): caches the background bitmap into an rle sprite, which is a compressed version of the bitmap. This can be very useful for simple backgrounds with large areas of the same color, but disadvantageous for complex bitmaps. If set to true, this creates a cached .rledat file next to the .bmp file, so you can check how much you save. Even if you don't save much, the rle operation is usually faster than the normal bitmap blitting. Set the "userle" option to "0" if you don't want to use it. You've to delete it manually if the .bmp is changed.

TwguiMusicBase* TWindow::window_music
 

play a piece of music, each time the window opens


The documentation for this class was generated from the following files:
Generated on Tue Feb 14 13:48:45 2006 for Twgui by  doxygen 1.4.6-NO