Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

NoteForm Class Reference

class contains code necessary to do note editing The data edited by the note field is copied on OK/Delete events to a temporary location which survives after the form closes. More...

#include <NoteForm.h>

Inheritance diagram for NoteForm:

Form Collaboration diagram for NoteForm:

Collaboration graph
[legend]
List of all members.

Public Methods

 NoteForm () FORM_SECTION2
 constructor; does nothing. More...

 ~NoteForm () FORM_SECTION2
 destructor; removes the currently allocated string. More...

Char * getNote () FORM_SECTION2
void initForm (Char *title_str, Char *note_str) FORM_SECTION2
 the starting string can be a pointer to a character strin or NULL, in which case new note is assumed; currently stored string is disposed of and re-allocated The last_caller field is set to 0. More...

bool updatedData (UInt16 form_id) FORM_SECTION2
 checks whether a given form id should update its data according to data stored by this form. More...


Static Public Methods

NoteForm * instance () FORM_SECTION2
 
Returns:
singleton reference to this object.
More...



Private Methods

void deleteNote () FORM_SECTION2
 deletes the _note attribute, only if necessary. More...

void updateScrollBar () FORM_SECTION2
 update the scroll bar with the values hinted by the note field. More...

void scroll (Int16 lines_to_scroll, Boolean update_scroll_bar) FORM_SECTION2
 scroll the note by a specified number of lines. More...

void pageScroll (WinDirectionType direction) FORM_SECTION2
 scroll the note a whole page up or down. More...

Boolean handleKeyDownEvent (WChar key_id, UInt16 modifiers) FORM_SECTION2
 called when key down event occurs. More...

Boolean handleOpenEvent () FORM_SECTION2
 called when form open event occurs. More...

Boolean handleCtlSelectEvent (UInt16 control_id) FORM_SECTION2
 called when ctl select event occurs. More...

Boolean handleFldChangedEvent () FORM_SECTION2
 handles events generated when field are changed. More...

Boolean handleSclRepeatEvent (UInt16 new_value, UInt16 value) FORM_SECTION2
 handles events generated by the scrollbar. More...


Private Attributes

UInt16 _last_caller
 contains the last valid form which called this form (i.e. to which we exited with ok/delete). More...

Char * _title
 current form title. More...

Char * _note
 data edited is stored here. More...


Static Private Attributes

NoteForm * _instance
 internal reference to this object. More...


Detailed Description

class contains code necessary to do note editing The data edited by the note field is copied on OK/Delete events to a temporary location which survives after the form closes.

This class is that it holds an internal buffer containing the edited note. The buffer is allocated dynamically and can be filled in before startup (so that a pre-written note is displayed). The contents of the buffer can be retrieved at any point, even after the form was closed. This is due to the fact that the actual form object for the entire life-time of the program.

Note:
this form generates update code 5, whenever the calling form needs to check for an update in the note field

Definition at line 37 of file NoteForm.h.


Constructor & Destructor Documentation

NoteForm::NoteForm  
 

constructor; does nothing.

NoteForm::~NoteForm  
 

destructor; removes the currently allocated string.


Member Function Documentation

void NoteForm::deleteNote   [private]
 

deletes the _note attribute, only if necessary.

Char* NoteForm::getNote  
 

Returns:
pointer to the stored note

Boolean NoteForm::handleCtlSelectEvent UInt16    control_id [private, virtual]
 

called when ctl select event occurs.

Parameters:
control_id  id of the control for which the event was generated

Reimplemented from Form.

Boolean NoteForm::handleFldChangedEvent   [private, virtual]
 

handles events generated when field are changed.

Reimplemented from Form.

Boolean NoteForm::handleKeyDownEvent WChar    key_id,
UInt16    modifiers
[private, virtual]
 

called when key down event occurs.

Reimplemented from Form.

Boolean NoteForm::handleOpenEvent   [private, virtual]
 

called when form open event occurs.

Reimplemented from Form.

Boolean NoteForm::handleSclRepeatEvent UInt16    new_value,
UInt16    value
[private, virtual]
 

handles events generated by the scrollbar.

Reimplemented from Form.

void NoteForm::initForm Char *    title_str,
Char *    note_str
 

the starting string can be a pointer to a character strin or NULL, in which case new note is assumed; currently stored string is disposed of and re-allocated The last_caller field is set to 0.

Parameters:
title_str  pointer to the string to be used as title. Note that this string should be allocated somewhere else and kept allocated until the form closes, as we simply mirror the address and not the location
note_str  pointer to starting string, if any

NoteForm* NoteForm::instance   [static]
 

Returns:
singleton reference to this object.

void NoteForm::pageScroll WinDirectionType    direction [private]
 

scroll the note a whole page up or down.

Parameters:
direction  direction to scrol in, can be winUp or winDown

void NoteForm::scroll Int16    lines_to_scroll,
Boolean    update_scroll_bar
[private]
 

scroll the note by a specified number of lines.

Parameters:
lines_to_scroll  number of lines to scroll (positive for down, negative for up
update_scroll_bar  if true, force a scrollbar update

bool NoteForm::updatedData UInt16    form_id
 

checks whether a given form id should update its data according to data stored by this form.

Parameters:
form_id  id of the form which is checking for updates
Returns:
true if data has been updated and the given form should fetch the new string

void NoteForm::updateScrollBar   [private]
 

update the scroll bar with the values hinted by the note field.


Member Data Documentation

NoteForm* NoteForm::_instance [static, private]
 

internal reference to this object.

Definition at line 66 of file NoteForm.h.

UInt16 NoteForm::_last_caller [private]
 

contains the last valid form which called this form (i.e. to which we exited with ok/delete).

Definition at line 68 of file NoteForm.h.

Char* NoteForm::_note [private]
 

data edited is stored here.

Definition at line 72 of file NoteForm.h.

Char* NoteForm::_title [private]
 

current form title.

Definition at line 70 of file NoteForm.h.


The documentation for this class was generated from the following file:
Generated on Thu Jan 16 23:11:15 2003 for FreeCoins by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002