Virtual U.org
Get Personal Training on VU Today
    
Top shadow
 
 register/help
User Name:

Password:

Box class Reference
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

Box Class Reference

#include <OBOX.H>

List of all members.

Public Methods

int ask (char *, char *=NULL, char *=NULL, int=-1, int=-1)
void msg (char *msgStr, int enableTimeOut=1, int x1=-1, int y1=-1)
void progress (int progressVal, int enableTimeOut=1, int x1=-1, int y1=-1)
void progress_update (int progressVal, int enableTimeOut=1, int x1=-1, int y1=-1)
void print (char *,...)
void tell (char *, int=-1, int=-1)
void open (int, int, int, int, int=1)
void open (int, int, int=1)
void paint (int)
void close ()
void calc_size (char *, int, int=-1, int=-1)
int ask_button (char *=NULL, char *=NULL, int=1)
void ask_button (Button &, Button &, char *=NULL, char *=NULL)
void ok_button (int=1)
void arrow_box (char *, char *=NULL, int=1)
void close_arrow_box ()
void calc_arrow_box (char *, int, int, int=0)
void calc_arrow_box (int, int, int, int)
void draw_arrow ()

Public Attributes

int box_x1
int box_y1
int box_x2
int box_y2
int arrow_x
int arrow_y
int save_scr_flag
int progress_val

Static Public Attributes

char opened_flag = 0


Detailed Description

UI class for message box classes, including message boxes, confirmation boxes, and progress bars.

Definition at line 29 of file OBOX.H.


Member Function Documentation

void Box::arrow_box char *   ,
char *    = NULL,
int    = 1
 

int Box::ask char *    msgStr,
char *    buttonDes1 = NULL,
char *    buttonDes2 = NULL,
int    x1 = -1,
int    y1 = -1
 

Popup a message box and ask user 'Ok' or 'Cancel'

Syntax :: ask( <char*> )

<char*> msgStr = pointer to the message, use '
' to seperate lines [char*] buttonDes1 = the description of button 1 (default : "Ok") [char*] buttonDes2 = the description of button 2 (default : "Cancel") [int] x1, y1 = the left corner of the box, if not given center the box on the screen

Return : 1 - if user select "Ok" button 0 - if user select "Cancel" button

Definition at line 273 of file Obox.cpp.

References BOX_BOTTOM_MARGIN, BOX_LINE_SPACE, BOX_TOP_MARGIN, and BOX_X_MARGIN.

void Box::ask_button Button   buttonOk,
Button   buttonCancel,
char *    strOk = NULL,
char *    strCancel = NULL
 

Display a Ok and Cancel button, and wait for player to click one of them

<Button&> buttonOk, buttonCancel = the defined buttons [char*] strOk, strCancel = the string of the button Ok & Cancel ( default : "Ok" & "Cancel" )

Definition at line 237 of file Obox.cpp.

References BOX_BUTTON_MARGIN.

int Box::ask_button char *    buttonDes1 = NULL,
char *    buttonDes2 = NULL,
int    rightClickClose = 1
 

Display two buttons, and wait for player to click one of them

[char*] buttonDes1 = the description of button 1 (default : "Ok") [char*] buttonDes2 = the description of button 2 (default : "Cancel") [int] rightClickClose = whether pressing the right button will close the window (default: 1)

Definition at line 181 of file Obox.cpp.

References BOX_BUTTON_MARGIN, CURSOR_NORMAL, KEY_ESC, and KEY_RETURN.

void Box::calc_arrow_box int   ,
int   ,
int   ,
int   
 

void Box::calc_arrow_box char *   ,
int   ,
int   ,
int    = 0
 

void Box::calc_size char *    msgStr,
int    minHeight,
int    x1 = -1,
int    y1 = -1
 

Given a string and then calculate the size of the box which can contain the string.

<char*> msgStr = the message string <int> minHeight = minimum height of the box [int] x1, y1 = the top left corner of the box

Definition at line 134 of file Obox.cpp.

References BOX_LINE_SPACE, BOX_X_MARGIN, MAX_BOX_WIDTH, VGA_HEIGHT, and VGA_WIDTH.

void Box::close  
 

Close the previously opened box

Definition at line 112 of file Obox.cpp.

void Box::close_arrow_box  
 

void Box::draw_arrow  
 

void Box::msg char *    msgStr,
int    enableTimeOut = 1,
int    x1 = -1,
int    y1 = -1
 

Popup a message box and ask user to press the 'Ok' button

Syntax :: msg( <char*> )

<char*> msgStr = pointer to the message, use '
' to seperate lines. [int] enableTimeOut = enable time out or not (default: 1) [int] x1, y1 = the left corner of the box, if not given center the box on the screen.

Definition at line 309 of file Obox.cpp.

References BOX_BOTTOM_MARGIN, BOX_LINE_SPACE, BOX_TOP_MARGIN, and BOX_X_MARGIN.

void Box::ok_button int    timeOut = 1
 

[int] timeOut - 1=enable inactive timeout 0=disable inactive timeout (default : 1 )

Definition at line 159 of file Obox.cpp.

References BOX_BUTTON_MARGIN.

void Box::open int    boxWidth,
int    boxHeight,
int    downCentre = 1
 

Given the width & height of the box, and open the box

<int> boxWidth, boxHeight - width & height of the box

[int] downCentre - whether paint down the center of the box (default : 1)

Definition at line 76 of file Obox.cpp.

References VGA_HEIGHT, and VGA_WIDTH.

void Box::open int    inX1,
int    inY1,
int    inX2,
int    inY2,
int    downCentre = 1
 

Open the box with the given coordinations

<int> x1, y1, x2, y2 - coordination of the box (default : use current settings)

[int] downCentre - whether paint down the center of the box (default : 1)

Definition at line 56 of file Obox.cpp.

void Box::paint int   
 

Definition at line 90 of file Obox.cpp.

References box_x1, box_x2, box_y1, box_y2, err_when, and opened_flag.

void Box::print char *    formatStr,
...   
 

Popup a message box and ask user to press the 'Ok' button

<char*> formatStr - formated message with % argument <....> the argument list

Definition at line 420 of file Obox.cpp.

void Box::progress int    progressVal,
int    enableTimeOut = 1,
int    x1 = -1,
int    y1 = -1
 

Popup a progress indicator

Syntax :: progress( <char*> )

<char*> msgStr = pointer to the message, use '
' to seperate lines. [int] enableTimeOut = enable time out or not (default: 1) [int] x1, y1 = the left corner of the box, if not given center the box on the screen.

Definition at line 345 of file Obox.cpp.

void Box::progress_update int    progressVal,
int    enableTimeOut = 1,
int    x1 = -1,
int    y1 = -1
 

Definition at line 383 of file Obox.cpp.

References progress_val, and String::str_buf.

void Box::tell char *    tellStr,
int    x1 = -1,
int    y1 = -1
 

Popup a box and display a message. Call Box::close() to close the box.

Syntax :: tell( <char*> )

<char*> tellStr = pointer to the message, use '
' to seperate lines [int] x1, y1 = the left corner of the box, if not given center the box on the screen

Definition at line 453 of file Obox.cpp.

References BOX_BOTTOM_MARGIN, BOX_LINE_SPACE, BOX_TOP_MARGIN, and BOX_X_MARGIN.


Member Data Documentation

int Box::arrow_x
 

Definition at line 32 of file OBOX.H.

int Box::arrow_y
 

Definition at line 32 of file OBOX.H.

int Box::box_x1
 

Definition at line 31 of file OBOX.H.

Referenced by paint().

int Box::box_x2
 

Definition at line 31 of file OBOX.H.

Referenced by paint().

int Box::box_y1
 

Definition at line 31 of file OBOX.H.

Referenced by paint().

int Box::box_y2
 

Definition at line 31 of file OBOX.H.

Referenced by paint().

char Box::opened_flag = 0 [static]
 

Definition at line 44 of file Obox.cpp.

Referenced by paint().

int Box::progress_val
 

Definition at line 34 of file OBOX.H.

Referenced by progress_update().

int Box::save_scr_flag
 

Definition at line 33 of file OBOX.H.


The documentation for this class was generated from the following files:
Generated on Fri Aug 23 01:39:01 2002 for VirtualU by doxygen1.2.17