21
edits
Changes
→Properties
: _border[7], left side
bool _visible; Indicates if the border surrounding the entity is to be drawn or not. <br />
FWBorder* _container; holds the container (another FWBorder) which has opened this one (owner or container of the current FWBorder). '''_container''' will be NULL if this FWBorder does not have a container, in which case, it will be full screen and no matter what the values of row, col, width and height are, FWBorder will be '''Full Screen''' (no border will be drawn)=====Methods===========Protected====== *int absRow()const;*:it returns the sum of '''row()''' of this border plus all the '''row()'''s of the '''_containter'''s*int absCol()const;*:it returns the sum of '''col()''' of this border plus all the '''col()'''s of the '''_containter'''s These two methods return the absolute coordinates of the FWBorder instance. (the row an column with respect to left top corner of the screen). These tow functions are used to '''draw''' the border on the screen. ======public======<big><pre> FWBorder(int Row=0, int Col=0, int Width=0,int Height=0, bool Visible = false, const char* Border=FW_BORDER_CHARS, FWBorder* Container = (FWBorder*)0);</pre></big>Sets the corresponding attributes to the incoming values in the argument list. <big><pre> void visible(bool val); bool visible()const; void container(FWBorder* theContainer); FWBorder* container(); void row(int val); int row()const; void col(int val); int col()const; void size(int height, int width); int height()const; int width()const;</pre></big> These Methods, set and get the corresponding attributes of the class <big><pre> bool fullscreen()const;</pre></big>Returns true if _container is null or else, it returns false; <big><pre> virtual ~FWBorder();</pre></big>An empty virtual destructor. <big><pre> virtual void draw(int refresh = FW_NO_REFRESH)const;</pre></big> If _container is null then it just clears the screen and exits. <br />Otherwise:<br />*If '''Refresh''' flag is set to FW_REFRESH, it will call the _container's draw, passing the same value as argument*If the _visible flag is true, it will draw a box at _row and _col, with size of _width and _height using the _border characters and fills it with spaces. Otherwise it will just draw a box using spaces at the same location and same size.
====Border Tester====