Changes

Jump to: navigation, search

Console UI Core Classes - OOP344 20113

1,449 bytes added, 06:31, 21 March 2012
CText Tester Crash
#:* void radio(bool isRadio);
#:* operator bool();
#:* operator char*();
#:* bool operator=(bool flag);
#:: (see [[#CCheckMark|CCheckMark]] description)
# Divide and assign tasks.
===The Text Helper Class===
[svn://zenit.senecac.on.ca/oop344/trunk/textClass Text class]
<!-- ===CText Tester Crash=== Incorrect, TD[0].data() allocates mem and copies the data into it using text::export string
<syntaxhighlight lang="cpp">
char* data = (char*)TD[0].data();
delete [] data;
</syntaxhighlight>
This fails because TD[0].data() refers to CField::data() and NOT CText::data() like it should.
Here are some possible fixes that I think Fardad meant to use:
<syntaxhighlight lang="cpp">
char* data = (char*)((CText&)(TD[0])).data();
OR
char* data = (char*)txt.data();
</syntaxhighlight>
Note, this does NOT crash on Matrix, only Windows and Visual Studio.
-->
==CCheckList==
===Methods===
<big><syntaxhighlight lang="cpp">
CCheckList& add(const char* Text, bool selected = false);
</syntaxhighlight></big>
* Only adds a new CCheckMark if '''_cnt''' does not exceed the maximum amount of '''_checkmarks''' (32)
* Creates a new CCheckMark with the row being '''_cnt'''+1, the height being 1 and the length being the length of '''Text'''+4
* Sets the newly created CCheckMarks' frame to '''this'''
* Automatically expands the width of the CCheckList if the width of the newly created CCheckMark is bigger than the current width of the CCheckList
* Sets the height of the CCheckList to '''_cnt'''+3
* Updates the bit pattern of '''_flags'''
* Increments '''_cnt'''
<big><syntaxhighlight lang="cpp">
CCheckList& operator<<(const char* Text);
</syntaxhighlight></big>
returns add(Text).
<big><syntaxhighlight lang="cpp">
void draw(int fn = C_FULL_FRAME);
int edit();
void set(const void* data);
int selectedIndex()const;
int selectedIndex(int index);
const char* selectedText();
</syntaxhighlight></big>
CButton holding the Title of this menu
====ConstrucotrConstructor/Destructor====
<big><syntaxhighlight lang = "cpp">
CMenu(const char* Title, const char* Format, int Row, int Col,
</syntaxhighlight></big>
Standard Linked list destructor
 
====Methods====
<big><syntaxhighlight lang = "cpp">
Sets the selected index to the integer pointed by data;
<big><syntaxhighlight lang = "cpp">
int selectedIndex()const;
</syntaxhighlight></big>
returns the selected index or -1 if nothing is selected

Navigation menu