Changes

Jump to: navigation, search

The CUI Framework - OOP344 20132

1,627 bytes removed, 23:53, 10 August 2013
Issues, Releases and Due Dates
==Objective==
Your objective at this stage is to create series of core classes designed to interact with the user. These '''Core Classes''' then can be used in development of any interactive application.
* like any other implementation, these implementations could be buggy
==Tips==
* [[GIT for OOP344 Projects| Guide for using Github]]
Start by creating mock-up classes (class declaration and definition with empty methods that only compiles and don't do anything).
* '''Avoid "just in case" includes.'''
==CUI General Header file (cuigh.h)==
The general header file holds the common setting and definition between all the Core Classes. Review this header file at each stage of the project for changes.
<big><syntaxhighlight lang="cpp">
</syntaxhighlight></big>
==File Names==
Use the following rules to create filenames for your class.
*Each class MUST have its own header file and cpp file for implementation
*:For example '''CFrame''' class should have '''cframe.h''' and '''cframe.cpp''' files for its implementation.
==Hierarchy==
<big><pre>
CFrame
</pre></big>
==Issues, Releases and Due Dates==
*Issue Name Format
*:Issue and branch name format:<br />'''V.V_Name ''' <br />*:example; issue: Add Text Class to the project (issue 2.9.1) issue and branch name on gitubgithub: '''2.9.1_AddTextClass'''<br />=== : * A2 Milestone 0.2 Milestone ===- Due Friday July 12th# Add Console Class to the repo *: Split up work within group and test document it with cio_test.cpp and Test1Frame.cpp.in the team pages# Create Mock-up classes## CLabel Mock-up Class *: Add skeletons for each class (issue 2empty function definitions in .2cpp files)## CDialog Mock-up Class (issue 2.3)*:## CLineEdit Mock-up Class (issue 2* A2 Milestone 0.4)## CButton Mock-up Class (issue 2.5)Due Friday July 19th====Details====*: Implement CLabel[[OOP344 0.2 Milestone 20131|0.2 milestone details]]*: Implement CButton====Due Date====*: Implement CLineEditThursday Feb, 14th, 23*:59=== * A2 Milestone 0.3 Milestone ===# Apply changes to CDialog, cuigh.h and update and test your related mock5 -ups. (issue 3.1)Due Friday July 26th# CLabel Implementation (issue 3.2)# *: Implement CDialog Implementation (issue 3.3)# CLineEdit Implementation (issue 3.4)*: Implement CValEdit# CButton Implementation (issue 3.5)====Details========Due Date====*: Implement CMenuItemWednesday March, 6th, 23*:59=== * A2 Milestone 0.5 Milestone ===# All mock7 -ups (issue 5.1)Due Friday August 2nd# CValEdit Implementation (issue 5.2)# *: Implement CCheckMark Implementation (issue 5.3)# CMenuItem Implementation (issue 5.4)*: Implement CText====Details====*: Implement CCheckList====Due Date====Thursday March, 28th, 23*:59 === 0.8 and * A2 Milestone 0.9(optional) Milestone ===- Due Friday August 9th# CText Implementation (issue 8.1)# CCheckList Implementation (issue 8.2)# *: Implement CMenu Implementation (issue 9.1)====Details====*: Merge all projects and verify CUI framework is fully functional and bugless====Due Date====Saturday April, 6th, 23*:59=== * A2 Milestone 1.0 Milestone ===- Due Friday August 15th# *: The applicationApplication====Details====*:====Due Date====Saturday AprilPlease note these are latest recommendations and you should intend to have these completed BEFORE the due dates. The final dead-line for this project is August 15h, 13th, 23:59no projects will be accepted past this point.
=Classes=
==CFrame==
The code for this class is provided in your repository. You must understand and use it to develop your core classes in your repository.
void draw(int fn=C_NO_FRAME) ;
</syntaxhighlight></big>
makes a direct call to console.displaystrdsp(), passing '''_data''' for the string to be printed and absRow() and absCol() for row and col and _length width() for len.
this function ignores the argument fn.
<big><syntaxhighlight lang="cpp">
if width() is greater than zero, it will copy the string pointed by str into the string pointed by _data upto width characters.
if width() is zero,<br /> It will delete the memory pointed by _data and reallocates enough memory for str and copies the string pointed by str into the newly allocated memory pointed by _data.
 
===CLabel Student Resources===
====CLabel Help/Questions Blogs====
#include "cuigh.h"
#include "cframe.h"
namespace ciocui{
class CField;
class CDialog: public CFrame{
int Row = -1, int Col = -1,
int Width = -1, int Height = -1,
bool Borderd Bordered = false,
const char* Border=C_BORDER_CHARS);
virtual ~CDialog();
unsigned int _fldSize;
</syntaxhighlight></big>
Holds the current length of '''''_fld''''' and '''''_dyn'''''. <br />When adding a field to dialog if '''_fum_fnum''' reaches '''_fldSize''', then the size of '''_fld''' and '''_dyn''' is expanded by '''''C_DIALOG_EXPANSION_SIZE''''', defined in '''cuigh.h'''
===Constructors/Destructors===
===CDialog Student Resources===
====CDialog Help/Questions Blogs====
does anyone know the meaning of the following sentence?if you know,feedback as soon as possible
 
int add(CField* field, bool dynamic = true);
Make sure that add() sets the container of the added CField to this CDialog object, using the container() method of CField(vivek patel)
====CDialog Blog Posts====
<big><syntaxhighlight lang="cpp">
#include "cfield.h"
namespace ciocui{
class CLineEdit: public CField{
bool _dyn;
int edit();
</syntaxhighlight></big>
Makes a direct call to, and returns '''console.editstredit()'''.
For the coordinates and width arguments follow the same rules as the draw function.
For the rest of the arguments of console.edit(), use the attributes of '''CLineEdit'''.
</syntaxhighlight></big>
Copies the characters pointed by '''Str''' into the memory pointed by Field's '''_data''' up to '''_maxdatalen''' characters.
 
===CLineEdit Student Resources===
====CLineEdit Help/Questions Blogs====
*Does anyone know that what value I have to assign to _offset and _curpos for CLineEdit attribute since there is no value passed by the constructor? Chun Chen
* [http://ksidhucode.blogspot.ca/2013/07/should-they-be--> _offset and _curpos are set to 0friends. html Kevin S -Koghulan NamasivayamNeed help with draw()]
====CLineEdit Blog Posts====
#pragma once
#include "cfield.h"
namespace ciocui{
class CButton: public CField{
[http://pankajsama01.blogspot.ca/2013/03/cbuttonhit-key.html C_BUTTON_HIT Key] is not defined(Pankaj Sama)
** It is defined in the new cuigh.h file. It is defined #define C_BUTTON_HIT 1. Gary Chen
 
 
'''HELP: Brackets around buttons' labels'''
: [http://namniak.blogspot.ca/2013/07/help-cbutton-brackets.html link] Vadim Namniak
====CButton Blog Posts====
#include "clineedit.h"
namespace ciocui{
class CValEdit: public CLineEdit{
void (*_help)(MessageStatus, CDialog&);
===CValedit Student Resources===
====CValEdit Help/Questions Blogs====
====CValedit Blog Posts====
 
{| class="wikitable" border="1"
| [http://divya522.blogspot.ca/2013/03/errors-in-cvaledit.html Cdirection Error]||[mailto:dsharma37@myseneca.ca?subject=oop344 Divya Sharma]||
|}
 
====CValedit Blog Posts====
==CCheckMark==
Creates a single CheckMark on the screen and allows the user to:<br />
#include "cfield.h"
#include "clabel.h"
namespace ciocui{
class CCheckMark : public CField{
bool _flag;
-S.E.
 
I think you may try to change to console.setPos(row, ++col).
-Ivy
====CCheckMark Blog Posts====
#include "clabel.h"
#include "cfield.h"
namespace ciocui{
class CMenuItem:public CField{
bool _selected;
===CMenuItem Student Resources===
====CMenuItem Help/Questions Blogs====
 
{| class="wikitable" border="1"
|-
| Question || Comment
|-
| [http://pankajsama01.blogspot.ca/2013/03/getting-cdirection-error.html Getting Cdirection Error](Pankaj Sama)||
 
|-
|[http://lhmcintosh.blogspot.ca/2013/03/05-cdialog-issue.html 0.5 CDialog Error] (Lucas McIntosh)|| just put return *_fld[_curidx]; - Glaser
|}
====CMenuItem Blog Posts====
#include "text.h"
using namespace ciocui;
===The Text Helper Class===
[https://github.com/Seneca-OOP344/20131-notes20132notes/tree/master/TextClass textClass Text class]
===CText Student Resources===
====CText Help/Questions Blogs====
====CText Blog Posts====
 
 
 
{| class="wikitable" border="1"
 
|-
 
| Question || Comment
 
|-
 
|[http://bleulynn.wordpress.com/2013/04/15/ctext/] curpos (Ran)||
 
|}
==CCheckList==
#include "cfield.h"
#include "ccheckmark.h"
namespace ciocui{
class CCheckList : public CField{
===CCheckList Student Resources===
====CCheckList Help/Questions Blogs====
 
* If you copied the header (''cchecklist.h'') from the ''20132notes'' repository, make sure to remove the const keyword after the ''void* data()'' function, since it is not.
* The same thing is for ''<u>void selectedIndex(int index)</u>'' and ''<u>int selectedIndex()const</u>'' — it is how they should look like.
 
====CCheckList Blog Posts====
{| class="wikitable" border="1"
|-
| Question || Comment
|-
|Anybody knows how to update the bit pattern of _flags in CCheckList add() method? (Xinggui Deng)||
|-
|You can do: _flags = _flags (bit operator or) (1 << _cnt) ---Gary Chen ||
|-
|[http://kelan-meta.blogspot.ca/2013/04/cchecklist-constructors.html CCheckList constructor question]||
|-
|Also, Brian found out we should use the console.getkey() instead of CCheckMarks::edit() to get the key in edit() function--Gary Chen ||
|-
|[http://kelan-meta.blogspot.ca/2013/04/checked.html Can anyone give me a hint as to why there are garbage symbols after checked option?]|| Thank you for pointing out in your blog that bio::strncpy() does not copy the null byte! I was able to fix my group's clabel.cpp with your help -- Brian Wong (yhwong)
|}
==CMenu and MNode (optional)==
<big><syntaxhighlight lang="cpp">
#ifndef __CIO__CMENU_H____CUI__CMENU_H__#define __CIO__CMENU_H____CUI__CMENU_H__
#include "cuigh.h"
#include "cfield.h"
#include "cmenuitem.h"
#include "cbutton.h"
namespace ciocui{
class Cmenu;
</syntaxhighlight></big>
===MNode===
MNode holds to main information about an Item in the menutmenu:
# The CMenuItem object
# The index of this Item
</syntaxhighlight></big>
deletes the '''_item'''
 
===CMenu===
const char* selectedText();
</syntaxhighlight></big>
returns the text of the selected menu, if . If nothing is selected, and empty string is returned.
<big><syntaxhighlight lang = "cpp">
bool editable()const;
</syntaxhighlight></big>
returns true if '''_cnt''' is greater than zero
 
===CMenu Student Resources===
====CMenu Help/Questions Blogs====
====CMenu Blog Posts====

Navigation menu