Changes

Jump to: navigation, search

Console UI Core Classes - OOP344 20111

973 bytes added, 22:58, 23 March 2011
CFrame
==CFrame==
The code for this class is provided. You must understand and use it to develop your core classes.
 
CFrame class is responsible to create a frame or structure in which all user interface classes contain themselves in. It can draw a border around it self or be border-less.
CFrame also, before displaying itself on the screen, will save the area it is about to cover, so it can redisplay them to hide itself.
 
CFrame is base of all objects in our user interface system.
 
<big><syntaxhighlight lang="cpp">
#pragma once
class CFrame{
int _row; // relative row of left top corner to the container frame or the screen if _frame is null int _col; // relative col of left top corner to the container frame or the screen if _frame is null int _height;
int _width;
char _border[9]; // border characters bool _visible; // is bordered or not CFrame* _frame; // pointer to the container of the frame (the frame, surrounding this frame) char* _covered; // pointer to the characters of the screen which are covered by this frame, when displayed void capture(); // captures and saves the characters in the area covered by this frame when displayed and sets // _covered to point to it
protected:
int absRow()const; int absCol()const;
public:
CFrame(int Row=-1, int Col=-1, int Width=-1,int Height=-1,
====Protected Methods====
*int absRow()const; returns calculates the absolute row (relative to the left top corner of the frame based on the screen's left/top ) and returns it.*:it returns the sum of '''row()''' of this border plus all the '''row()'''s of the '''_containter_frame'''s*int absCol()const; returns calculates the absolute column (relative to the left top corner of the frame based on the screen's left/top ) and returns it.*:it returns the sum of '''col()''' of this border plus all the '''col()'''s of the '''_containter_frame'''s
====Public Methods====

Navigation menu