Difference between revisions of "Console UI Core Classes - OOP344 20111"

From CDOT Wiki
Jump to: navigation, search
(File Names)
Line 35: Line 35:
 
*Use the class name for the name of the file but make sure it is all lowercase.
 
*Use the class name for the name of the file but make sure it is all lowercase.
 
*:For example '''CFrame''' class should have '''cframe.h''' and '''cframe.cpp''' files for its implementation.
 
*:For example '''CFrame''' class should have '''cframe.h''' and '''cframe.cpp''' files for its implementation.
 +
=Hierarchy=
 +
<big><pre>
 +
CFrame
 +
|
 +
|---CDialog
 +
|
 +
|
 +
|---CField
 +
      |
 +
      |-------- CLabel
 +
      |        |
 +
      |        |-------CCheck
 +
      |        |-------CMenuItem
 +
      |
 +
      |-------- CButton
 +
      |
 +
      |
 +
      |-------- CLineEdit
 +
      |        |
 +
      |        |-------CValEdit
 +
      |
 +
      |-------- CText
 +
      |
 +
      |-------- CCheckList
 +
      |-------- CMenu
 +
</pre></big>
 +
 
=Basic (BIO) Encapsulating Classes=
 
=Basic (BIO) Encapsulating Classes=

Revision as of 12:14, 7 February 2011

Under Construction!

Your objective at this stage is to create series core of classes designed to interact with the user. These Core Classes then can be used in development of any interactive application.

Please note that the class definitions here are minimum requirement for the Core Classes and you are free to add any enhancements or features you find useful. However make sure that you discuss these enhancements with your professor to make sure they are feasible before implementation.

It is highly recommended to develop the classes in the order they are stated here. You must create your won tester programs fore each class (if possible); However, close to due date of each release, a tester program is provided to help you verify the functionality of your classes. Executables of the test programs are available on matrix to show you how it is supposed to run.

Start by creating mock-up classes (class declaration and definition with empty methods that only compiles and don't do anything). Each class MUST have its own header file to hold its declaration and "cpp" file to hold its implementation. To make sure you do not do circular includes follow these simple guidelines:

  • Add recompilation safeguards to all your header files.
  • Always use forward declaration if possible instead of including a class header-file.
  • Use includes only in files in which the actual header file code is used.
  • Avoid "just in case" includes.

General Internal Header file (ccgh.h R0.1)

The general header file holds the common setting and definition between all the Core Classes.

#ifndef ___CCGH_H__
#define ___CCGH_H__

 #ifndef _CRT_SECURE_NO_DEPRECATE
 #define _CRT_SECURE_NO_DEPRECATE
 #endif
 #ifndef _CRT_SECURE_NO_WARNINGS
 #define _CRT_SECURE_NO_WARNINGS
 #endif

#define CC_BORDER_CHARS  "/-\\|/-\\|"

#endif

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
  • Use the class name for the name of the file but make sure it is all lowercase.
    For example CFrame class should have cframe.h and cframe.cpp files for its implementation.

Hierarchy

CFrame
 |
 |---CDialog
 |
 |
 |---CField
       |
       |-------- CLabel
       |         |
       |         |-------CCheck
       |         |-------CMenuItem
       |
       |-------- CButton
       |
       |
       |-------- CLineEdit
       |         |
       |         |-------CValEdit
       |
       |-------- CText
       |
       |-------- CCheckList
       |-------- CMenu 

Basic (BIO) Encapsulating Classes