Project stdui: "Simple Type Dialog User-Interface"

|
Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

stdui::stdwindow Class Reference

#include <stdwindow.h>

Inheritance diagram for stdui::stdwindow:

Inheritance graph
[legend]
Collaboration diagram for stdui::stdwindow:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< stdwindow * > list
typedef list::iterator iterator
typedef list::const_iterator const_iterator

Public Member Functions

 stdwindow (stdwindow *_parentwin, const std::string &nameid, stdflags __flags)
 stdwindow (stdobject *__parentobj, const std::string &nameid, stdflags __flags)
 stdwindow ()
 ~stdwindow ()
cellcellat (int, int)
 Provides the address of the pixel/cell contained into the private screen memry buffer data, at the givin position.
int height ()
 Gives the height of the widget's geometry.
int width ()
 Gives the width of the widget's geometry.
int write (const cxstring &)
int write (const std::string &str)
int write (int, int, const std::string &)
int write (int, int, const cxstring &)
bool gotoxy (const cxy &xy)
bool gotoxy (int, int)
const cxy & xy ()
cxy movewindowat (int, int)
cxy movewindow (const cxy &)
cxy movewindow (int, int)
cxy movewindowat (const cxy &)
int rx ()
int ry ()
int tx ()
int ty ()
const stdcolor & setcolor (stdcolor c)

Protected Attributes

crect _geometry
 The geometry of this window ( starting a 0,0 ).
cxy _topleft
 The absollute coords position of this window on the common screen buffer.
stdcolorgroup _colorgroup
cxy _xy
cxy _rxy
stdcolor _color

Private Attributes

cell_mem_block
 private screen contents memory buffer

Detailed Description

Author:
Serge Lussier,,,

Definition at line 33 of file stdwindow.h.


Member Typedef Documentation

typedef list::const_iterator stdui::stdwindow::const_iterator
 

Reimplemented from stdui::stdobject.

Definition at line 38 of file stdwindow.h.

typedef list::iterator stdui::stdwindow::iterator
 

Reimplemented from stdui::stdobject.

Definition at line 37 of file stdwindow.h.

typedef std::list<stdwindow*> stdui::stdwindow::list
 

Reimplemented from stdui::stdobject.

Definition at line 36 of file stdwindow.h.


Constructor & Destructor Documentation

stdui::stdwindow::stdwindow stdwindow _parentwin,
const std::string &  nameid,
stdflags  __flags
 

Definition at line 35 of file stdwindow.cpp.

References _mem_block.

00035                                                                                     :stdobject(_parentwin, _nameid, __flags)
00036 {
00037    _mem_block = 0l;
00038 }

stdui::stdwindow::stdwindow stdobject __parentobj,
const std::string &  nameid,
stdflags  __flags
 

Definition at line 29 of file stdwindow.cpp.

References _mem_block.

00029                                                                                       : stdobject(__parentobj, _nameid, __flags)
00030 {
00031    _mem_block = 0l;
00032 }

stdui::stdwindow::stdwindow  ) 
 

Definition at line 25 of file stdwindow.cpp.

References _mem_block.

00025                     :stdobject(){
00026    _mem_block = 0l;
00027 }

stdui::stdwindow::~stdwindow  ) 
 

Definition at line 41 of file stdwindow.cpp.

References _mem_block.

00042 {
00043    if( _mem_block ) delete [] _mem_block;
00044 }


Member Function Documentation

cell * stdui::stdwindow::cellat int  x,
int  y
 

Provides the address of the pixel/cell contained into the private screen memry buffer data, at the givin position.

Returns:
NULL if the position is out of the window's geometry bounds.
Note:
Have to decide to always return non-null, valid address to prevent memory leak.

Definition at line 56 of file stdwindow.cpp.

References _mem_block, height(), and width().

Referenced by gotoxy(), and write().

00057 {
00058    if ( ( x < 0 ) || ( y < 0 ) || ( x >= width() ) || ( y >= height() )  ) return 0l;
00059       // Prevent memory leak. return the beggining of the buffer.
00060       //return _mem_block;
00061    return _mem_block + ( y*width() + x );
00062 }

Here is the call graph for this function:

bool stdui::stdwindow::gotoxy int  xx,
int  yy
 

Definition at line 121 of file stdwindow.cpp.

References _xy, and cellat().

00122 {
00123     if(!cellat(xx,yy)) return false;
00124     _xy(xx,yy);
00125 }

Here is the call graph for this function:

bool stdui::stdwindow::gotoxy const cxy &  xy  ) 
 

Definition at line 112 of file stdwindow.cpp.

References xy().

00113 {
00114     return gotoxy(xy.x(), xy.y());
00115 }

Here is the call graph for this function:

stdui::stdwindow::height  )  [inline]
 

Gives the height of the widget's geometry.

Returns:
int the height value

Definition at line 53 of file stdwindow.h.

References _geometry.

Referenced by cellat().

00053 { return _geometry.height(); }

cxy stdui::stdwindow::movewindow int  xx,
int  yy
 

Todo:
implement me

Definition at line 164 of file stdwindow.cpp.

References _topleft.

00165 {
00167    cxy pxy = _topleft;
00168    
00169    return pxy;
00170     
00171 }

cxy stdui::stdwindow::movewindow const cxy &   ) 
 

Todo:
implement me

Definition at line 152 of file stdwindow.cpp.

References _topleft.

00153 {
00155    cxy pxy = _topleft;
00156    return pxy;
00157     
00158 }

cxy stdui::stdwindow::movewindowat const cxy &   ) 
 

Todo:
implement me

Definition at line 177 of file stdwindow.cpp.

References _topleft.

00178 {
00180    cxy pxy = _topleft;
00181    return pxy;
00182     
00183 }

cxy stdui::stdwindow::movewindowat int  ,
int 
 

Definition at line 142 of file stdwindow.cpp.

References _topleft.

00143 {
00144    cxy pxy = _topleft;
00145    return pxy;
00146 }

int stdui::stdwindow::rx  ) 
 

Definition at line 191 of file stdwindow.cpp.

References _geometry.

00192 {
00193    return _geometry.topleft().x();
00194 }

int stdui::stdwindow::ry  ) 
 

Definition at line 200 of file stdwindow.cpp.

References _geometry.

00201 {
00202     return _geometry.topleft().y();
00203 }

stdui::stdwindow::setcolor stdcolor  c  )  [inline]
 

Definition at line 79 of file stdwindow.h.

References _color.

00079 { stdcolor C = _color; _color = c; return C; }

int stdui::stdwindow::tx  ) 
 

Definition at line 209 of file stdwindow.cpp.

References _topleft.

00210 {
00211     return _topleft.x();
00212 }

int stdui::stdwindow::ty  ) 
 

Definition at line 218 of file stdwindow.cpp.

References _topleft.

00219 {
00220     return _topleft.y();
00221 }

stdui::stdwindow::width  )  [inline]
 

Gives the width of the widget's geometry.

Definition at line 59 of file stdwindow.h.

References _geometry.

Referenced by cellat().

00059 { return _geometry.width(); }

int stdui::stdwindow::write int  ,
int  ,
const cxstring & 
 

Todo:
implement me

Definition at line 102 of file stdwindow.cpp.

00103 {
00105     return 0;
00106 }

int stdui::stdwindow::write int  xx,
int  yy,
const std::string &  str
 

Definition at line 87 of file stdwindow.cpp.

References _color, and cellat().

00088 {
00089     int n = 0;
00090     cell* p = cellat( xx,yy);
00091     const char* c = str.c_str();
00092     while(*c){
00093       *p++ = _color.code()|*c++;
00094     }
00095     return c-str.c_str();
00096 }

Here is the call graph for this function:

int stdui::stdwindow::write const std::string &  str  ) 
 

Definition at line 78 of file stdwindow.cpp.

References _xy, and write().

00079 {
00080     return write(_xy.x(), _xy.y(), str);
00081 }

Here is the call graph for this function:

int stdui::stdwindow::write const cxstring &  cxs  ) 
 

Definition at line 68 of file stdwindow.cpp.

References _xy.

Referenced by write().

00069 {
00070    cell* pc;
00071    return write(_xy.x(), _xy.y(), cxs.data());
00072 }

const cxy & stdui::stdwindow::xy  ) 
 

Definition at line 133 of file stdwindow.cpp.

References _xy.

Referenced by gotoxy().

00134 {
00135     return _xy;
00136 }


Member Data Documentation

stdcolor stdui::stdwindow::_color [protected]
 

Definition at line 92 of file stdwindow.h.

Referenced by setcolor(), and write().

stdcolorgroup stdui::stdwindow::_colorgroup [protected]
 

Definition at line 89 of file stdwindow.h.

crect stdui::stdwindow::_geometry [protected]
 

The geometry of this window ( starting a 0,0 ).

Definition at line 86 of file stdwindow.h.

Referenced by height(), rx(), ry(), and width().

cell* stdui::stdwindow::_mem_block [private]
 

private screen contents memory buffer

Definition at line 83 of file stdwindow.h.

Referenced by cellat(), stdwindow(), and ~stdwindow().

cxy stdui::stdwindow::_rxy [protected]
 

Definition at line 91 of file stdwindow.h.

cxy stdui::stdwindow::_topleft [protected]
 

The absollute coords position of this window on the common screen buffer.

Definition at line 88 of file stdwindow.h.

Referenced by movewindow(), movewindowat(), tx(), and ty().

cxy stdui::stdwindow::_xy [protected]
 

Definition at line 90 of file stdwindow.h.

Referenced by gotoxy(), write(), and xy().


The documentation for this class was generated from the following files:
API Documentation Generated by:  doxygen 1.4.0
About the author | Site started with trial version of DreamWeaver MX 2004 | Finalizing with  | Contact | ©2005, Serge Lussier ( Bretzel )