DumontEXE 0.0.1
Public Slots | Signals | Public Member Functions | Protected Member Functions | Private Attributes
cmcFormField Class Reference

Form Field. More...

#include <cmcFormField.h>

Inheritance diagram for cmcFormField:

List of all members.

Public Slots

virtual QString label ()
 Field Text Label (passthru)
.
virtual bool onChange ()
 Execute the onChange code
.
virtual bool onEnter ()
 Execute on-enter functions
.
virtual bool onLeave ()
 Execute on-leave functions
.
virtual void value (bool value)
 Set a Boolean
.
virtual QString value ()
 Get Field Text Value (passthru)
.
virtual void value (QString value)
 Set Field Text Value
.

Signals

void change (QString fieldName, QString fieldValue)
 Field Change Signal
.
void enter (QString fieldName, QString fieldValue)
 Field Enter Signal
.
void leave (QString fieldName, QString fieldValue)
 Field Leave Signal
.

Public Member Functions

 cmcFormField (const QString &fieldName, IDispatch *dispatch, cmcApplication *application, cmcForm *parentForm)
 Normal Constructor.

Protected Member Functions

cmcFormform ()
 Return the parent Form object
.

Private Attributes

cmcApim_api
 API pointer
.
QString m_enterValue
 Field Enter Value
.

Detailed Description

Form Field.

Definition at line 44 of file cmcFormField.h.


Constructor & Destructor Documentation

cmcFormField ( const QString &  fieldName,
IDispatch *  dispatch,
cmcApplication application,
cmcForm parentForm 
)

Normal Constructor.

Parameters:
fieldNamestring ~ the name of the field

dispatchdispatch ~ pointer to the Commence field interface

applicationapplication ~ pointer to the hosting application

parentFormform ~ pointer to the parent form

Definition at line 44 of file cmcFormField.cpp.


Member Function Documentation

void change ( QString  fieldName,
QString  fieldValue 
) [signal]

Field Change Signal
.

This signal gets sent from this field whenever the value() changes between the onEnter() and onLeave() events. This is an internal Qt signal() that is designed to be hooked into by an upper-level object. For instance, the QCommenceForm object hooks in to this signal so that the hosting form can be informed when any field is changed.

This is an internal function and is not meant to be called from vbScript.

void enter ( QString  fieldName,
QString  fieldValue 
) [signal]

Field Enter Signal
.

This signal get sent from this field whenever the onEnter() event is called. This is an internal Qt signal() that is designed to be hooked into by an upper-level object. For instance, the QCommenceForm object hooks in to this signal so that the hosting form can be informed when any field is entered into.

This is an internal function and is not meant to be called from vbScript.

cmcForm * form ( ) [protected]

Return the parent Form object
.

This function returns a pointer to this field's parent Form. It is private because nothing on this field should be being called except through the form anyway, so providing a pointer to that said form is problemmatic and probably a pointer crash issue. It's only used internally, and is provided so that this field can access the database and conversation API. This method should *not* be called from vbScript.

Reimplemented from cmcField.

Definition at line 120 of file cmcFormField.cpp.

QString label ( ) [virtual, slot]

Field Text Label (passthru)
.

This returns the 'Label' of the Form field. This is a passthrough function that transfers control directly to the Commence Form.Field object and therefore returns the same data as the standard Form.Field("Name").Label call.

vbScript example:
 msgbox dfrm.Field("calendarKey").Label
Note:
This value is cached so that repeated lookups do not make repeated calls into the Commence API.

Implements cmcField.

Definition at line 70 of file cmcFormField.cpp.

void leave ( QString  fieldName,
QString  fieldValue 
) [signal]

Field Leave Signal
.

This signal gets sent from this field whenever the onLeave() event is called. This is an internal Qt signal() that is designed to be hooked into by an upper-level object. For instance, the QCommenceForm object hooks in to this signal so that the hosting form can be informed when any field is left from.

This is an internal function and is not meant to be called from vbScript.

bool onChange ( ) [virtual, slot]

Execute the onChange code
.

This routine does whatever on-change things need to be done to this field item. There may be nothing. A signal does get fired indicating that this field has a change event. This is an internal function that gets called when the user calls the onLeave() function and there is a data-delta in the before and after values - indicating that a change has been made.

This function fires a signal change().

Definition at line 144 of file cmcFormField.cpp.

bool onEnter ( ) [virtual, slot]

Execute on-enter functions
.

This function is intended to be called by the parent form to indicate that the field has become active in the user interface and may possibly be edited.

This function fires a signal enter().

Definition at line 125 of file cmcFormField.cpp.

bool onLeave ( ) [virtual, slot]

Execute on-leave functions
.

This function is intended to be called by the parent form to indicate that the field has become inactive in the user interface and is no longer being edited.

This function fires a signal leave().

Definition at line 132 of file cmcFormField.cpp.

void value ( QString  value) [virtual, slot]

Set Field Text Value
.

This sets the 'Value' of the Form field. This is a passthrough function that transfers control directly to the Commence Form.Field object and therefore sets the same data as the standard Form.Field("FieldName").Value = "xyz" call.

Note:
This function also tests the new value against the current value, and if there is no change then no updates will be performed on the database. This can help reduce the number of updates the database has to sync around the workgroup in the event no real data is changing on the field. This is particularily useful when scripted-updates are occuring on various text-type-memo fields that the user doesn't update, but the script updates automatically. The script can just update the field value blindly and if there is an actual data field change, then, and only then will that change be written to the commence field, thus reducing the amount of data that has to get synced around the workgroup.
vbScript example:
 dfrm.Field("calendarKey").Value = "new value"

Implements cmcField.

Definition at line 99 of file cmcFormField.cpp.

void value ( bool  value) [virtual, slot]

Set a Boolean
.

This sets the Form.Field boolean value to "1" or "0" depending on value.

vbScript Example ~ Setting a boolean field value
   dfrm.Field("Active").value = True
Parameters:
valueboolean ~ True/False of field value

Implements cmcField.

Definition at line 114 of file cmcFormField.cpp.

QString value ( ) [virtual, slot]

Get Field Text Value (passthru)
.

This returns the 'Value' of the Form field. This is a passthrough function that transfers control directly to the Commence Form.Field object and therefore returns the same data as the standard Form.Field("Name").Value call.

vbScript example:
 msgbox dfrm.Field("calendarKey").Value

Implements cmcField.

Definition at line 77 of file cmcFormField.cpp.


Member Data Documentation

cmcApi* m_api [private]

API pointer
.

Definition at line 268 of file cmcFormField.h.

QString m_enterValue [private]

Field Enter Value
.

This is a cache of the field value when the onEnter() function gets called It is used in the onLeave() function to examine the field value to determine if it has changed.

See also:
onEnter, onLeave, onChange

Definition at line 279 of file cmcFormField.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com