DumontEXE 0.0.1
Public Slots | Public Member Functions | Private Attributes
cmcActiveViewInfo Class Reference

Active View Information. More...

#include <cmcActiveViewInfo.h>

Inheritance diagram for cmcActiveViewInfo:

List of all members.

Public Slots

QString categoryName ()
 Return the category Name component.
QString fieldName ()
 Return the Field Name component.
QString itemName ()
 Return the Item Name component.
void query ()
 Query the active view info.
QString string ()
 Return the entire ActiveViewInfo string.
QString viewName ()
 Return the View Name component.
QString viewType ()
 Return the View Type component.

Public Member Functions

 cmcActiveViewInfo (const cmcActiveViewInfo &copy)
 Copy Constructor.
 cmcActiveViewInfo (cmcApplication *application, cmcObject *parent=NULL)
 General Constructor.

Private Attributes

QStringList m_infoList
 ViewInfo stringlist cache.
QString m_viewInfo
 ViewInfo string cache.

Detailed Description

Active View Information.

This object contains the information from the [GetActiveViewInfo()] DDE call. The advantage to using this object is that all of the elements of the call are automatically broken up into their constituant parts for easy access.

Further, using this object is easy because it hides the errors that you'll get when making that call under various conditions. For instance, if you make this call during a time when a detail form was opened from a script or an agent call or something like that, it will often fail completely with a vbScript error message. Worse than that, the conditions under which the DDE request will succeed or fail is rather complicated. This object will shield you from those error conditions and simply return an empty object.

vbScript Example:
  dim dexe: set dexe = createObject("Dumont.EXE")
  dim dfrm: set dfrm = dexe.form(Form)
  dexe.debug "viewName     " & dfrm.avi.viewName
  dexe.debug "viewType     " & dfrm.avi.viewType
  dexe.debug "categoryName " & dfrm.avi.categoryName
  dexe.debug "itemName     " & dfrm.avi.itemName
  dexe.debug "fieldName    " & dfrm.avi.fieldName
Will yeild the following when called from a report:
Will yeild the following when called from a form connection field:

There are a couple of things to note about this very interesting DDE call into the Commence api.

So, none the less, this element of the Commence API is a strange animal. Hopefully this object will make working with it a little bit easier.

Definition at line 93 of file cmcActiveViewInfo.h.

Constructor & Destructor Documentation

Copy Constructor.

Definition at line 31 of file cmcActiveViewInfo.cpp.

cmcActiveViewInfo ( cmcApplication application,
cmcObject parent = NULL 

General Constructor.

Definition at line 38 of file cmcActiveViewInfo.cpp.

Member Function Documentation

QString categoryName ( void  ) [slot]

Return the category Name component.

This returns the active view Category name.

Definition at line 87 of file cmcActiveViewInfo.cpp.

QString fieldName ( void  ) [slot]

Return the Field Name component.

This returns the active view Field name. This value appears to only be valid when this call is made on a detail form that was opened from another detail form's connection control.

Definition at line 103 of file cmcActiveViewInfo.cpp.

QString itemName ( void  ) [slot]

Return the Item Name component.

This returns the active view Item Name.

Definition at line 95 of file cmcActiveViewInfo.cpp.

void query ( void  ) [slot]

Query the active view info.

Normally the active view info item is queried only once for the object that has requested it. For instance, when you open a form, that form object is instantiated one time at its onset, and all sub-objects (fields, connections, etc) are built as requested and then held in cache memory until the form is released. This is also true of the cmcActiveViewInfo object. This means that the active view info will also only be queried only once. This increases the efficiency of the application since only one DDE call is made to fetch all the fields of the active view info.

In some cases, when the active view info is called from the root cmcDatabase object, it may be necessary to force a requery of the active view info object. Calling query will do that:

vbScript Example:
 dlog.print dapp.db.avi.categoryName

Definition at line 50 of file cmcActiveViewInfo.cpp.

QString string ( void  ) [slot]

Return the entire ActiveViewInfo string.

This returns the entire ViewInfo of the getActiveViewInfo DDE call. This is the same as the raw-string return value provided by that DDE call. If the call fails then the value will be a single line of "Request Failed".

vbScript Example:
 dim avi: set avi = dfrm.DB.activeViewInfo
 msgbox avi.string

Definition at line 57 of file cmcActiveViewInfo.cpp.

QString viewName ( void  ) [slot]

Return the View Name component.

This returns the ViewName component of the call to getActiveViewInfo. This component appears to only be valid when the getActiveViewInfo is called from a view such as a report or a book or something like that.

Definition at line 71 of file cmcActiveViewInfo.cpp.

QString viewType ( void  ) [slot]

Return the View Type component.

This returns the ViewType component of the call to getActiveViewInfo. This component appears to only be valid when the getActiveViewInfo is called from a view such as a report or book or something like that. If this call is made on a detail form that was opened from another detail form's connection control, then this value appears to always be set to "Add Item", regardless if the originating form was in add mode or not.

Definition at line 79 of file cmcActiveViewInfo.cpp.

Member Data Documentation

QStringList m_infoList [private]

ViewInfo stringlist cache.

Definition at line 218 of file cmcActiveViewInfo.h.

QString m_viewInfo [private]

ViewInfo string cache.

Definition at line 212 of file cmcActiveViewInfo.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
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC