stdwindow.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <stdwindow.h>
00021
00022 namespace stdui {
00023
00024
00025 stdwindow::stdwindow():stdobject(){
00026 _mem_block = 0l;
00027 }
00028
00029 stdwindow::stdwindow(stdobject* __parentobj, const std::string& _nameid, stdflags __flags): stdobject(__parentobj, _nameid, __flags)
00030 {
00031 _mem_block = 0l;
00032 }
00033
00034
00035 stdwindow::stdwindow(stdwindow* _parentwin,const std::string& _nameid, stdflags __flags):stdobject(_parentwin, _nameid, __flags)
00036 {
00037 _mem_block = 0l;
00038 }
00039
00040
00041 stdwindow::~stdwindow()
00042 {
00043 if( _mem_block ) delete [] _mem_block;
00044 }
00045
00046
00047
00048
00049
00056 cell* stdwindow::cellat(int x, int y)
00057 {
00058 if ( ( x < 0 ) || ( y < 0 ) || ( x >= width() ) || ( y >= height() ) ) return 0l;
00059
00060
00061 return _mem_block + ( y*width() + x );
00062 }
00063
00064
00068 int stdwindow::write( const cxstring& cxs )
00069 {
00070 cell* pc;
00071 return write(_xy.x(), _xy.y(), cxs.data());
00072 }
00073
00074
00078 int stdwindow::write(const std::string& str)
00079 {
00080 return write(_xy.x(), _xy.y(), str);
00081 }
00082
00083
00087 int stdwindow::write(int xx, int yy, const std::string& str)
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 }
00097
00098
00102 int stdwindow::write(int,int, const cxstring& )
00103 {
00105 return 0;
00106 }
00107
00108
00112 bool stdwindow::gotoxy( const cxy& xy )
00113 {
00114 return gotoxy(xy.x(), xy.y());
00115 }
00116
00117
00121 bool stdwindow::gotoxy(int xx, int yy)
00122 {
00123 if(!cellat(xx,yy)) return false;
00124 _xy(xx,yy);
00125 }
00126
00127
00128
00129
00133 const cxy& stdwindow::xy()
00134 {
00135 return _xy;
00136 }
00137
00138
00142 cxy stdwindow::movewindowat(int, int )
00143 {
00144 cxy pxy = _topleft;
00145 return pxy;
00146 }
00147
00148
00152 cxy stdwindow::movewindow( const cxy& )
00153 {
00155 cxy pxy = _topleft;
00156 return pxy;
00157
00158 }
00159
00160
00164 cxy stdwindow::movewindow( int xx, int yy)
00165 {
00167 cxy pxy = _topleft;
00168
00169 return pxy;
00170
00171 }
00172
00173
00177 cxy stdwindow::movewindowat( const cxy& )
00178 {
00180 cxy pxy = _topleft;
00181 return pxy;
00182
00183 }
00184
00185
00186
00187
00191 int stdwindow::rx()
00192 {
00193 return _geometry.topleft().x();
00194 }
00195
00196
00200 int stdwindow::ry()
00201 {
00202 return _geometry.topleft().y();
00203 }
00204
00205
00209 int stdwindow::tx()
00210 {
00211 return _topleft.x();
00212 }
00213
00214
00218 int stdwindow::ty()
00219 {
00220 return _topleft.y();
00221 }
00222
00223 }
00224
API Documentation Generated by:
1.4.0
About the author |

Site started with trial version of DreamWeaver MX 2004 |
Finalizing with

|
Contact | ©2005, Serge Lussier ( Bretzel )