home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cset21v1.zip
/
IBMCPP
/
IBMCLASS
/
ICNRCTL.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-22
|
91KB
|
1,644 lines
#ifndef _ICNRCTL_
#define _ICNRCTL_
/*******************************************************************************
* FILE NAME: icnrctl.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IContainerControl - Base container control class *
* IContainerControl::ObjectCursor - Cursor objects in a container *
* IContainerControl::TextCursor - Cursor objects text in a container *
* IContainerControl::ColumnCursor - Cursor columns in a container *
* IContainerControl::FilterFn - Filter objects in a container *
* IContainerControl::CompareFn - Sort objects in a container *
* IContainerControl::Iterator - Iterate objects in a container *
* *
* COPYRIGHT: *
* (C) Copyright IBM Corporation 1992 *
* All Rights Reserved *
* Licensed Materials * Property of IBM *
* *
* HISTORY: *
*******************************************************************************/
#ifndef _ICONTROL_
#include <icontrol.hpp>
#endif
#ifndef _ICNROBJ_
#include <icnrobj.hpp>
#endif
#ifndef _IRECT_
#include <irect.hpp>
#endif
/*----------------------------------------------------------------------------*/
/* Align classes on four byte boundary. */
/*----------------------------------------------------------------------------*/
#pragma pack(4)
/*----------------------------------------------------------------------------*/
/* Turn off warning for compiler generated copy/assignment */
/*----------------------------------------------------------------------------*/
#pragma info(nocpy)
// Forward Declarations
class IContainerControl;
class IContainerColumn;
class IContainerObject;
class IResourceId;
class IPrivateResource;
class IMultiLineEdit;
struct ICnrInfo;
class IColor;
class ICnrControlList;
class ICnrObjectSet;
class IContainerControl : public IControl
{
typedef IControl
Inherited;
/*******************************************************************************
* The IContainerControl class is used to display a container of objects in any *
* of the supported views (icon, name, tree, details, and text). *
* *
* Like other controls in the library, this control can be constructed in one *
* of the following ways: *
* - On a window *
* - Loaded in a dialog template *
* - As a pre-existing control. * *
* *
* EXAMPLE: *
* // Frame Window Constructor *
* CustomerList :: CustomerList(const IRectangle& rect, *
* Boolean fLoadObjectsIn) *
* : IFrameWindow(CNR_MAINWINDOW) *
* // Create a Container Control *
* pCustContainer = new IContainerControl(CNR_RESID, this, this); *
* // Make the container the client *
* setClient(pCustContainer); *
* // Now construct columns and objects *
*******************************************************************************/
public:
/*-------------------------- Related Types -------------------------------------
| The following enumerations are defined: |
| EnumerationOrder - Order in which icons are enumerated: |
| |
| itemOrder - Container records are enumerated in item |
| order, lowest to highest. Item order is |
| similar to the order in which the |
| records were added to the container, |
| except records can be explicitly |
| inserted into the item order. |
| zOrder - Container records are enumerated by |
| z-order, first to last. zOrder is the |
| order in which the icons are painted on |
| the display in the icon view. |
| |
| TitleAlignment - Title alignment types: |
| |
| left - Container titles are left-aligned. |
| right - Container titles are right-aligned. |
| centered - Container titles are centered. |
------------------------------------------------------------------------------*/
enum EnumerationOrder { itemOrder, zOrder};
enum TitleAlignment { left, right, centered};
/*-------------------------------- Style ----------------------------------
The following functions provide a means to set and query container styles:
Style - Nested class that provides static members that define the set of
valid container styles. These styles can be used in conjunction
with the styles defined by the nested classes IWindow::Style and
IControl::Style. For example, you could define an instance of
the IContainerControl::Style class and initialize it like:
IContainerControl::Style
style = IContainerControl::readOnly | IWindow::visible;
An object of this type is provided when the container is created.
A customizable default is used if no styles are specified. Once
the object is constructed, IContainerControl, IWindow, and
IControl member functions can be used to set or query the
object's style.
The declaration of the IContainerControl::Style nested class is
generated by the INESTEDBITFLAGCLASSDEF2 macro.
The valid container styles are:
classDefaultStyle - Original default style for this class, which is
singleSelection | IWindow::visible.
readOnly - Specifies that the text in the container is not
editable.
autoPosition - Objects added to the container are positioned in the
icon view automatically.
extendedSelection - Specifies that the container use extended selection.
This style overrides multipleSelection, but is
overridden by singleSelection, if combined with
either or both.
singleSelection - Specifies that the container use single selection.
This style is the default. It overrides both
extendedSelection and multipleSelection if combined
with either or both.
multipleSelection - Specifies that the container use multiple selection.
This style is overridden by both singleSelection and
extendedSelection if combined with either or both.
verifyPointers - Validates that container objects exist.
The following functions provide a means of getting and setting the default
style for this class:
defaultStyle - Returns the current default style. This is the same as
classDefaultStyle unless setDefaultStyle has been
called.
setDefaultStyle - Sets the default style for all subsequent containers.
-------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF2( Style, IContainerControl, IWindow, IControl);
static const Style
classDefaultStyle,
readOnly,
autoPosition,
extendedSelection,
singleSelection, /* default */
multipleSelection,
verifyPointers;
static Style
defaultStyle ( );
static void
setDefaultStyle ( Style style);
/*-------------------------------- Attribute ------------------------------
The following functions provide a means to set and query container
attributes:
Attribute - This nested class provides static members that define the
set of valid container attributes. For example, you could
define an instance of the IContainerControl::Attribute class
and initialize it like:
IContainerControl::Attribute
attribute = IContainerControl::detailsView |
IContainerControl::alignTitleCentered |
IContainerControl::handleDrawItem;
An object of this type is provided when the container is
created. A customizable default is used if no attributes
are specified. Once the object is constructed,
IContainerControl member functions can be used to set or
query the object's attributes.
The declaration of the IContainerControl::Attribute nested
class is generated by the INESTEDBITFLAGCLASSDEF0 macro.
The valid container attributes are:
classDefaultAttribute - Original default attribute for this class, which
is orderedTargetEmphasis | detailsViewTitles |
visibleTreeLine | readOnlyTitle | iconView.
textView - Shows the text view of the container.
iconView - Shows the icon view of the container.
nameView - Shows the name view of the container.
detailsView - Shows the details view of the container.
treeView - Shows the tree view of the container.
flowedView - Shows the flowed view of the container.
readOnlyTitle - Disables editing of the container title.
titleSeparator - Adds a separator line after the title.
detailsViewTitles - Shows the details view titles.
visibleTitle - Shows the container title.
alignTitleCentered - Centers the container title.
alignTitleLeft - Left-justifies the container title.
alignTitleRight - Right-justifies the container title.
handleDrawItem - Causes draw item messages to be dispatched.
handleDrawBackground - Causes draw background messages to be dispatched.
orderedTargetEmphasis - Sets ordered target emphasis.
mixedTargetEmphasis - Sets mixed target emphasis.
visibleTreeLine - Shows the tree line in the tree view.
The following functions provide means of getting and setting the default
attribute for this class:
defaultAttribute - Returns the current default attribute. This is the
same as classDefaultAttribute unless
setDefaultAttribute has been called.
setDefaultAttribute - Sets the default attribute for all subsequent
containers.
-------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF0( Attribute, IContainerControl);
static const Attribute
textView,
iconView, /* default */
nameView,
detailsView,
treeView,
flowedView,
readOnlyTitle, /* default */
titleSeparator,
detailsViewTitles, /* default */
visibleTitle,
alignTitleCentered,
alignTitleLeft,
alignTitleRight,
handleDrawItem,
handleDrawBackground,
orderedTargetEmphasis,
mixedTargetEmphasis,
visibleTreeLine, /* default */
classDefaultAttribute;
static Attribute
defaultAttribute ( );
static void
setDefaultAttribute ( Attribute attribute);
/*------------------------ Constructors ----------------------------------------
| You can construct an instance of this class in the following ways: |
| - On a window by specifying the parent and owner. |
| - From a container control on a loaded dialog template. |
| - From an existing container control's window handle. |
------------------------------------------------------------------------------*/
/* Construct a control from scratch */
IContainerControl ( unsigned long id,
IWindow* parent,
IWindow* owner,
const IRectangle& location = IRectangle(),
const Style& style = defaultStyle(),
const Attribute& attribute = defaultAttribute());
/* Construct from a control on a Dialog */
IContainerControl ( unsigned long id,
IWindow* parentDialog);
/* Construct from an existing control */
IContainerControl ( const IWindowHandle& handle);
virtual
~IContainerControl ( );
/*------------------------ Comparison ------------------------------------------
| The following function is used to compare two IContainerControls: |
| operator == - Returns true if two containers are the same. |
------------------------------------------------------------------------------*/
Boolean
operator==( const IContainerControl& that);
/*------------------------ Initialization --------------------------------------
| initialize - Sets up the container environment. Called automatically if the |
| first container component created is an IContainerControl, but |
| must be called explicitly if IContainerObjects are created |
| before the container is constructed. |
------------------------------------------------------------------------------*/
static void
initialize ( );
class FilterFn : public IVBase
{
/***************************************************************************
* The IContainerControl::FilterFn class is used by the container to show *
* a subset of the existing objects by filtering out some of the objects. *
* When filtering is requested in the container, a FilterFn object is *
* passed on input. The FilterFn::isMemberOf function will be called for *
* each object in the container. *
* *
* EXAMPLE: *
* *
* class BlueFilter : public IContainerControl::FilterFn *
* { *
* virtual Boolean *
* isMemberOf( IContainerObject* object, *
* IContainerControl* container) const *
* { *
* if (((ColorObject*)object)->isBlue()) *
* return true; *
* return false; *
* } *
* }; *
* *
* BlueFilter blueFilter; *
* container().filter(blueFilter); *
*
***************************************************************************/
typedef IVBase
Inherited;
public:
/*------------------------ Constructors -------------------------------------
| The only way to construct an instance of this class is to use the default |
| constructor with no arguments. |
---------------------------------------------------------------------------*/
FilterFn ( );
~FilterFn ( );
/*------------------------ Object Filtering ---------------------------------
| The following function is used to filter objects from the container: |
| isMemberOf - Returns true if the object is to remain in the container |
| and false if it is to be removed. |
---------------------------------------------------------------------------*/
virtual Boolean
isMemberOf ( IContainerObject* object,
IContainerControl* container) const = 0;
}; /* end FilterFn */
class CompareFn : public IVBase
{
/***************************************************************************
* The IContainerControl::CompareFn class is used by the container to sort *
* the objects in the container. When sorting is requested in the *
* container, a CompareFn object is passed on input. The *
* CompareFn::isEqual function will be called as needed by the container *
* to sort the objects. *
* *
* EXAMPLE: *
* *
* class AgeSort : public IContainerControl::CompareFn *
* { *
* virtual int *
* isEqual( IContainerObject* object1, *
* IContainerObject* object2, *
* IContainerControl* container) const *
* { *
* if (((Customer*)object1)->age() < ((Customer*)object2)->age()) *
* return -1; *
* else if (((Customer*)object1)->age() > ((Customer*)object2)->age()) *
* return 1; *
* else; *
* return 0; *
* } *
* }; *
* *
* AgeSort ageSort; *
* container().sort(ageSort); *
* *
***************************************************************************/
typedef IVBase Inherited;
public:
/*------------------------ Constructors -------------------------------------
| The only way to construct an instance of this class is to use the default |
| constructor with no arguments. |
---------------------------------------------------------------------------*/
CompareFn ( );
~CompareFn ( );
/*------------------------ Object Sorting -----------------------------------
| The following function is used to compare objects in the container: |
| isEqual - If the isEqual function returns a value: |
| Less than 0 - The first object is less than the second object. |
| 0 - The first object is equal to the second object. |
| Greater than 0 - The first object is greater than the second object.|
---------------------------------------------------------------------------*/
virtual int
isEqual ( IContainerObject* object1,
IContainerObject* object2,
IContainerControl* container) const = 0;
}; /* end CompareFn */
class ObjectCursor : public IVBase
{
typedef IVBase
Inherited;
/***************************************************************************
* The IContainerControl::ObjectCursor class is used to iterate the *
* container by finding objects based on the selection criteria *
* established during construction of the cursor. The cursor is only *
* valid until objects are added to or removed from the container. *
* *
* EXAMPLE: *
* // smack all the objects in a container *
* IContainerControl::ObjectCursor cursor(*pCustContainer) *
* for (cursor.setToFirst(); *
* cursor.isValid(); *
* cursor.setToNext() ) *
* { *
* object.objectAt(cursor).smack(); *
* } *
* *
***************************************************************************/
public:
/*------------------------ Constructors -------------------------------------
| You can construct an instance of this class in the following ways: |
| - A cursor to iterate all records in the container or records meeting |
| the emphasis selection criteria. Records can be found in item order |
| (the default) or z-order. |
| - A cursor to find all objects that have the passed object as a parent. |
---------------------------------------------------------------------------*/
ObjectCursor ( const IContainerControl& container,
IContainerObject::Emphasis emphasis = IContainerObject::none,
EnumerationOrder enumeration = itemOrder);
/* Construct an iterator for Child (or All Descendents) Iteration */
ObjectCursor ( const IContainerControl& container,
const IContainerObject* parentObject,
const Boolean allDescendents = false);
~ObjectCursor ( );
/*------------------------ Cursor Movement ----------------------------------
| The following functions are used to position the ObjectCursor based on |
| the type of objects indicated in the construction of the cursor: |
| setToFirst - Points to the first object in the container. |
| setToNext - Points to the next or first object in the container. |
| setToLast - Points to the last object in the container. |
| setToPrevious - Points to the previous or last object in the container. |
---------------------------------------------------------------------------*/
virtual Boolean
setToFirst ( ),
setToNext ( ),
setToLast ( ),
setToPrevious ( );
/*------------------------ Object Retrieval ---------------------------------
| The following functions are used to retrieve objects: |
| first - Points to and returns the first object in the container. |
| next - Points to and returns the next or first object in the |
| container. |
| last - Points to and returns the last object in the container. |
| previous - Points to and returns the previous or last object in the |
| container. |
| current - Returns the current object of this cursor. |
| setCurrent - Sets the cursor to point to a particular object. |
---------------------------------------------------------------------------*/
virtual IContainerObject
*first ( ),
*next ( ),
*previous ( ),
*last ( ),
*current ( ) const;
ObjectCursor
&setCurrent ( const IContainerObject* currentObject);
/*------------------------ Cursor Validation --------------------------------
| The following functions are used in cursor validation: |
| isValid - Queries whether the cursor is pointing to a valid object. |
| invalidate - Flags the cursor as invalid. |
---------------------------------------------------------------------------*/
virtual Boolean
isValid ( ) const;
virtual ObjectCursor
&invalidate ( );
private:
IContainerObject
*object ( const IContainerObject* objectAfter,
unsigned long command),
*selectedObject ( const IContainerObject* objectAfter,
unsigned long emphasis),
*lastObject ( const IContainerObject* objectAfter = 0),
*previousObject ( const IContainerObject* objectBefore),
*nextObject ( const IContainerObject* objectAfter),
*nextBranchObject( const IContainerObject* objectAfter);
enum State { all=1, child=2, emphasis=4, allSubTree=8 };
IContainerObject
*pcnrobjClCurrent,
*pcnrobjClParent;
unsigned long
ulClChanges;
IContainerControl
*pcnrctlClOwner;
unsigned long
flClEmphasis;
unsigned long
flClEnumeration;
unsigned long
flClState;
}; /* end ObjectCursor */
class TextCursor : public IVBase
{
typedef IVBase
Inherited;
/***************************************************************************
* The IContainerControl::TextCursor class is used to iterate the *
* container and find objects that contain the text string indicated *
* during construction of the cursor. *
* *
* EXAMPLE: *
* // Find all objects with "Sev 1" *
* IContainerControl::ObjectCursor cursor(*pCustContainer, "Sev 1") *
* for (cursor.setToFirst(); *
* cursor.isValid(); *
* cursor.setToNext() ) *
* { *
* object.objectAt(cursor).notifyIBM(); *
* } *
* *
***************************************************************************/
public:
/*------------------------ Constructors -------------------------------------
| An instance of this class can be constructed by providing a text string |
| to be used for searching the container. In addition, the search can be |
| specified to: |
| - Return a case sensitive match only. |
| - Return a match only when the text is the first in the record. |
| - Return an exact match of the text string only. |
| |
| When a TextCursor is constructed, it is valid only for the objects shown |
| in the view that the container is currently displaying. For example, if |
| the container is displaying the icon view when the TextCursor is |
| constructed, and you want the application to iterate a text cursor for |
| children in a tree view, you must switch the container to the tree view |
| and create a new TextCursor. |
| |
| If you create a details view TextCursor, all text columns are searched |
| for the given string. |
---------------------------------------------------------------------------*/
/* Construct an iterator for text occurances */
TextCursor ( const IContainerControl& container,
const char* text,
Boolean isCaseSensitive = true,
Boolean isFirstInRecord = false,
Boolean isExactMatch = false );
~TextCursor ( );
/*------------------------ Cursor Movement ----------------------------------
| The following functions are used to position the TextCursor: |
| setToFirst - Points to the first object in the container with the |
| matching text. |
| setToNext - Points to the next or first object in the container with |
| the matching text. | |
| setToLast - Points to the last object in the container with the |
| matching text. |
| setToPrevious - Points to the previous or last object in the container |
| with the matching text. |
---------------------------------------------------------------------------*/
virtual Boolean
setToFirst ( ),
setToNext ( ),
setToLast ( ),
setToPrevious ( );
/*------------------------ Object Retrieval ---------------------------------
| The following functions are used to retrieve objects using a TextCursor: |
| first - Points to and returns the first object in the container |
| with the matching text. |
| next - Points to and returns the next or first object in the |
| container with the matching text. |
| last - Points to and returns the last object in the container with |
| the matching text. |
| previous - Points to and returns the previous or last object in the |
| container with the matching text. |
| current - Returns the current object of this cursor. |
| setCurrent - Sets the cursor to point to a particular object. |
---------------------------------------------------------------------------*/
virtual IContainerObject
*first ( ),
*next ( ),
*previous ( ),
*last ( ),
*current ( ) const;
TextCursor
&setCurrent ( const IContainerObject* currentObject);
/*------------------------ Cursor Validation --------------------------------
| The following functions are used in cursor validation: |
| isValid - Queries whether the cursor is pointing to a valid object. |
| invalidate - Flags the cursor as invalid. |
---------------------------------------------------------------------------*/
virtual Boolean
isValid ( ) const;
virtual TextCursor
&invalidate ( );
private:
IContainerObject
*find( unsigned long ulView,
IContainerObject* objectAfter,
const char* pszText,
Boolean fIsCaseSensitive,
Boolean fIsFirstInRecord);
IContainerObject
*pcnrobjClCurrent,
*pcnrobjClParent;
unsigned long
ulClView;
unsigned long
ulClChanges;
IContainerControl
*pcnrctlClOwner;
IString
strClSearchString;
Boolean
fClIsCaseSensitive,
fClIsFirstInRecord,
fClIsExactMatch;
}; /* end TextCursor */
class ColumnCursor : public IVBase
{
typedef IVBase
Inherited;
/***************************************************************************
* The IContainerControl::ColumnCursor class is used to iterate the *
* container's details view columns. *
* *
* EXAMPLE: *
* ** smack all the columns in a container ** *
* IContainerControl::ColumnCursor cursor(*pCustContainer); *
* for (cursor.setToFirst(); *
* cursor.isValid(); *
* cursor.setToNext() ) *
* { *
* object.columnAt(cursor).smack(); *
* } *
* *
****************************************************************************/
public:
/*------------------------ Constructors -------------------------------------
| Objects of this class are constructed by passing in: |
| - The container over which the iteration is to occur, and |
| - An optional value that indicates whether all columns, or only visible |
| columns, will be iterated. |
---------------------------------------------------------------------------*/
ColumnCursor ( const IContainerControl& container,
Boolean visibleOnly=false);
~ColumnCursor ( );
/*------------------------ Cursor Movement ----------------------------------
| The following functions are used to move the cursor and retrieve columns: |
| setToFirst - Points to the first column in the container. |
| setToNext - Points to the next or first column in the container. |
| setToLast - Points to the last column in the container. |
| setToPrevious - Points to the previous or last column in the container. |
---------------------------------------------------------------------------*/
virtual Boolean
setToFirst ( ),
setToNext ( ),
setToLast ( ),
setToPrevious ( );
/*------------------------ Column Retrieval ---------------------------------
| The following functions are used to move the cursor and retrieve columns: |
| first - Points to and returns the first column in the container. |
| next - Points to and returns the next or first column in the |
| container. |
| last - Points to and returns the last column in the container. |
| previous - Points to and returns the previous or last column in the |
| container. |
| current - Returns the current column of this cursor. |
| setCurrent - Sets the cursor to point to a particular column. This |
| function does not check for visibility. |
---------------------------------------------------------------------------*/
virtual IContainerColumn
*first ( ),
*next ( ),
*previous ( ),
*last ( ),
*current ( ) const;
ColumnCursor
&setCurrent ( const IContainerColumn* currentColumn);
/*------------------------ Cursor Validation --------------------------------
| The following functions are used in cursor validation: |
| isValid - Queries whether the cursor is pointing to a valid column. |
| invalidate - Flags the cursor as invalid. |
---------------------------------------------------------------------------*/
virtual Boolean
isValid ( ) const;
virtual ColumnCursor
&invalidate ( );
private:
IContainerColumn
*pcnrcolClCurrent;
unsigned long
ulClChanges;
IContainerControl
*pcnrctlClOwner;
Boolean
fClVisible;
}; /* end ColumnCursor */
class Iterator : public IVBase
{
/***************************************************************************
* The IContainerControl::Iterator class is used by the container to apply *
* a function to the objects in the container. To perform a function on *
* the elements of the container, subclass Iterator and provide the *
* behavior for the applyTo function. Then, call *
* IContainerControl::allObjectsDo with an instance of this class. The *
* allObjectsDo function will call the applyTo function for all objects in *
* the container or until a false is returned. *
* *
* EXAMPLE: *
* *
* class Recalculate : public IContainerControl::Iterator *
* { *
* virtual Boolean *
* applyTo( IContainerObject* object) *
* { *
* // Update the state of the object *
* return true; *
* } *
* }; *
* *
* Recalculate calculator; *
* container().allObjectsDo(calculator); *
* *
***************************************************************************/
typedef IVBase
Inherited;
public:
/*------------------------ Constructors -------------------------------------
| The only way to construct an instance of this class is to use the default |
| constructor with no arguments. |
---------------------------------------------------------------------------*/
Iterator ( );
~Iterator ( );
/*------------------------ Filter Behavior ----------------------------------
| The following function is used to apply a behavior to all objects in a |
| container: |
| applyTo - Returns true if the iteration is to continue or false |
| if it is to stop. |
---------------------------------------------------------------------------*/
virtual Boolean
applyTo ( IContainerObject* object) = 0;
}; /* end Iterator */
/*-------------------------------- Accessors -----------------------------------
| The following functions provide means of getting and setting the accessible |
| attributes of instances of this class: |
| setTitle - Sets the container title using text or a |
| resource ID. |
| setTitleAlignment - Sets the alignment attributes for the title. |
| showTitle - Shows the container title. |
| hideTitle - Removes the container title from the container. |
| enableTitleUpdate - Allows the container title to be edited. |
| disableTitleUpdate - Prevents the container title from being edited. |
| showTitleSeparator - Displays a horizontal separator between the |
| title and the work area. |
| hideTitleSeparator - Removes the title separator from the container |
| window. |
| showDetailsViewTitles - Displays column headings in details view. |
| hideDetailsViewTitles - Removes column headings from details view. |
| setLineSpacing - Sets the vertical distance between records. |
| setIconSize - Sets the icon or bit-map size for all objects. |
| setSingleSelection - Sets the selection mode to single selection. |
| setMultipleSelection - Sets the selection mode to multiple selection. |
| setExtendedSelection - Sets the selection mode to extended selection. |
| setNormalTargetEmphasis - Sets the drag mode to normal target emphasis. |
| setOrderedTargetEmphasis - Sets the drag mode to ordered target emphasis. |
| setMixedTargetEmphasis - Sets the drag mode to mixed target emphasis. |
| title - Returns the title of the container. |
| isTitleVisible - Queries whether the container title is |
| currently displayed. |
| lineSpacing - Returns the space between lines, in pixels. |
| iconSize - Returns the icon or bit-map size of all |
| objects. |
------------------------------------------------------------------------------*/
IContainerControl
&setTitle ( const char* title),
&setTitle ( const IResourceId& resourceId),
&setTitleAlignment ( TitleAlignment alignment = centered),
&showTitle ( Boolean show = true),
&hideTitle ( ),
&enableTitleUpdate ( Boolean enable = true),
&disableTitleUpdate ( ),
&showTitleSeparator ( Boolean show = true),
&hideTitleSeparator ( ),
&showDetailsViewTitles ( Boolean show = true),
&hideDetailsViewTitles ( ),
&setLineSpacing ( long lineSpacing),
&setIconSize ( const ISize& iconSize),
&setSingleSelection ( ),
&setMultipleSelection ( ),
&setExtendedSelection ( ),
&setNormalTargetEmphasis ( ),
&setOrderedTargetEmphasis ( ),
&setMixedTargetEmphasis ( );
IString
title ( ) const;
Boolean
isTitleVisible ( ) const;
long
lineSpacing ( ) const;
ISize
iconSize ( ) const;
/*-------------------------- Automatic Deletion Behavior ----------------------
| The following functions are used to describe behavior that should occur |
| automatically when a container is deleted: |
| setDeleteObjectsOnClose - Deletes all objects in the container when the |
| container is deleted. Since objects can be in |
| multiple containers, the container's default |
| behavior only removes objects but does not |
| delete them when the container is deleted. |
| setDeleteColumnsOnClose - Deletes all columns in the container when the |
| container is deleted. Only columns allocated |
| using operator new should be set for automatic |
| deletion. Since columns can be in multiple |
| containers, the container's default behavior |
| only removes columns but does not delete them |
| when the container is deleted. |
| willDeleteObjectsOnClose - Returns true if container objects will be |
| deleted when the container is deleted. |
| willDeleteColumnsOnClose - Returns true if the columns will be deleted |
| when the container is deleted. |
------------------------------------------------------------------------------*/
IContainerControl
&setDeleteObjectsOnClose ( Boolean destroy = true),
&setDeleteColumnsOnClose ( Boolean destroy = true);
Boolean
willDeleteObjectsOnClose ( ) const,
willDeleteColumnsOnClose ( ) const;
/*----------------------------- Color ------------------------------------------
| The following functions are used to change or query colors in the container: |
| setColor - Changes the color of a particular ColorArea. |
| color - Returns the color of a particular ColorArea. |
| ColorArea - The areas of the container whose color can be set or |
| determined. They are: |
| |
| background - The background of the container window. |
| foreground - The foreground or unselected text in |
| the container. |
| border - The border of the container window. |
| highlightBackground - The color of selection emphasis, the |
| color of the cursor of an unselected |
| item in the details view, and the color |
| of the cursor in all other views. |
| highlightForeground - The color of the text of a selected item |
| in all views and the color of the cursor |
| of a selected item in the details view. |
------------------------------------------------------------------------------*/
enum ColorArea {
background=1,
foreground,
border,
highlightBackground,
highlightForeground
};
virtual IContainerControl
&setColor ( ColorArea value, const IColor& color);
IColor
color ( ColorArea value) const;
/*-------------------- Changing Views ------------------------------------------
| The following functions are used to change the view: |
| showTextView - Sets the current view to the non-flowed text view. |
| showFlowedTextView - Sets the current view to the flowed text view. |
| showNameView - Sets the current view to the non-flowed name view. |
| showFlowedNameView - Sets the current view to the flowed name view. |
| showDetailsView - Sets the current view to the details view. |
| showTreeIconView - Sets the current view to the tree icon view. |
| showTreeTextView - Sets the current view to the tree text view. |
| showTreeNameView - Sets the current view to the tree name view. |
| showIconView - Sets the current view to the icon view. |
| arrangeIconView - Arranges the icon view. |
------------------------------------------------------------------------------*/
IContainerControl
&showTextView ( ),
&showFlowedTextView ( ),
&showNameView ( ),
&showFlowedNameView ( ),
&showDetailsView ( ),
&showTreeIconView ( ),
&showTreeTextView ( ),
&showTreeNameView ( ),
&showIconView ( ),
&arrangeIconView ( );
/*-------------- Determining the View ------------------------------------------
| The following functions are used to query the view: |
| isTextView - Queries whether the container is currently in the text |
| view. |
| isNameView - Queries whether the container is currently in the name |
| view. |
| isDetailsView - Queries whether the container is currently in the details |
| view. |
| isTreeView - Queries whether the container is currently in the tree |
| view. |
| isIconView - Queries whether the container is currently in the icon |
| view. |
| isFlowed - Queries whether the current container view is flowed. |
| This function applies to the name and text views only. |
------------------------------------------------------------------------------*/
Boolean
isTextView ( ) const,
isNameView ( ) const,
isDetailsView ( ) const,
isTreeView ( ) const,
isIconView ( ) const,
isFlowed ( ) const;
/*-------------------- Container Refresh ---------------------------------------
| The following functions are used to refresh the container: |
| setRefreshOn - Enables refreshing the container after changes. |
| setRefreshOff - Disables refreshing the container after changes. |
| refresh - Refreshes all objects in the container. |
| refreshAllContainers - Refreshes all containers. |
| isRefreshOn - Queries the refresh state of the container. |
------------------------------------------------------------------------------*/
IContainerControl
&setRefreshOn ( Boolean on = true),
&setRefreshOff ( ),
&refresh ( );
static void
refreshAllContainers ( );
Boolean
isRefreshOn ( );
/*-------------- Querying the Container Viewport Rectangle ---------------------
| The following functions are used to determine the work area relative to |
| either the workspace or the window: |
| viewPortOnWorkspace - Retrieves the current work area in workspace |
| coordinates. |
| viewPortOnWindow - Retrieves the current work area in window |
| coordinates. |
| detailsViewPortOnWorkspace - Retrieves either the right or left work |
| area of a split details view, in workspace |
| coordinates. |
| detailsViewPortOnWindow - Retrieves either the right or left work |
| area of a split details view, in windows |
| coordinates. |
------------------------------------------------------------------------------*/
IRectangle
viewPortOnWorkspace ( ) const,
viewPortOnWindow ( ) const,
detailsViewPortOnWorkspace ( Boolean rightSide = false) const,
detailsViewPortOnWindow ( Boolean rightSide = false) const;
/*------------------- Container Scrolling --------------------------------------
| The following functions are used in scrolling the container: |
| scrollVertically - Scrolls the container vertically. |
| scrollHorizontally - Scrolls the container horizontally. If |
| rightSide is true and the container currently |
| is displaying a split details view, the right |
| pane will be scrolled. |
| scroll - Scrolls the container both horizontally and |
| vertically. If horizontalPixels is non-zero |
| and the container is currently displaying a |
| split details view, rightSide determines which |
| pane is scrolled horizontally. |
| scrollDetailsHorizontally - Scrolls either the right or left side of a |
| split details view horizontally. If |
| rightSide is true, the right pane will be |
| scrolled. If rightSide is false, the left |
| pane will be scrolled. |
| scrollToObject - Scrolls a particular object and column into |
| the work area. If a column is specified, it |
| will also be scrolled into the work area. If |
| leftJustify is false, the column will be |
| scrolled into the work area at the closest |
| border. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&scrollVertically ( long pixels),
&scrollHorizontally ( long pixels,
Boolean rightSide = false),
&scroll ( long vericalPixels,
long horizontalPixels,
Boolean rightSide = false),
&scrollDetailsHorizontally ( long horizontalPixels,
Boolean rightSide = false),
&scrollToObject ( const IContainerObject* object),
&scrollToObject ( const IContainerObject* object,
const IContainerColumn* column,
Boolean leftJustify = true );
/*------------------- Tree View Functions --------------------------------------
| The following functions are used in the tree view: |
| showTreeLine - Shows the lines connecting parents to children's |
| records. |
| hideTreeLine - Does not show lines connecting parents to |
| children's records. |
| setTreeExpandIconSize - Changes the size of the expanded and collapsed bit |
| maps. |
| setTreeViewIndent - Sets the distance that children will be offset |
| horizontally from their parent. |
| setTreeItemIcons - Sets the icons to be used for a tree view. |
| collapseTree - Collapses all nodes of a tree view. This |
| function does not work in OS/2 Version 2.0. |
| expandTree - Expands all nodes of a tree view. This function |
| does not work in OS/2 Version 2.0. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&showTreeLine ( long treeLinePixelWidth = -1),
&hideTreeLine ( ),
&setTreeExpandIconSize ( const ISize& sizeIcon),
&setTreeViewIndent ( long indentPixels = -1),
&setTreeItemIcons ( const IPointerHandle& expanded,
const IPointerHandle& collapsed),
&setTreeItemIcons ( const IResourceId& expanded,
const IResourceId& collapsed),
&collapseTree ( ),
&expandTree ( );
/*------------------- Details View Functions -----------------------------------
| The following functions are used in the details view: |
| showSplitBar - Adds the split bar to the details view work area. |
| hideSplitBar - Removes the split bar from the details view work |
| area. |
| splitBarOffset - Returns the offset of the split bar, in pixels, from |
| the left side of the container window. |
| setDetailsViewSplit - Splits the details view by specifying the last |
| column to be viewed in the left window. |
| isColumnRight - Returns true if the given column is to the right |
| of the split bar. |
| addColumn - Adds a column to the container following the given |
| column. |
| removeColumn - Removes the given column from the container. |
| removeColumnAt - Removes the column at a given cursor. |
| columnAt - Retrieves the column at a given 0-based index or |
| cursor. |
| detailsViewSplit - Returns the last column before the split bar. |
| columnCount - Returns the number of columns in the container. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&showSplitBar ( Boolean Show=true),
&hideSplitBar ( ),
&setDetailsViewSplit ( const IContainerColumn* lastColumnBeforeSplit,
unsigned long pixelsFromLeft=50);
/* note: the 1st parameter is the last column */
/* which will ever be scrolled in the left */
/* frame. The 2nd parameter is the location */
/* of the split bar in Pixels */
Boolean
isColumnRight ( const IContainerColumn* column) const;
virtual IContainerControl
&addColumn ( const IContainerColumn* column,
const IContainerColumn* afterColumn=0),
&removeColumn ( const IContainerColumn* column),
&removeColumnAt ( IContainerControl::ColumnCursor& cursor);
IContainerColumn
*columnAt ( unsigned long index) const,
*columnAt ( const ColumnCursor& cursor) const,
*detailsViewSplit ( ) const;
unsigned long
columnCount ( ) const,
splitBarOffset ( ) const;
/*------------------- Adding and Removing Objects ------------------------------
| The following functions are used to add and remove objects: |
| addObject - Adds an object to the container. In the tree view, |
| the parent defines the object's location. When |
| the parent is provided, the object is added as its |
| last immediate descendent. |
| addObjectAfter - Adds an object to be placed after a given object. |
| If you specify 0 for the afterObject argument, |
| the object will be added as the first object in |
| the container. |
| removeObject - Removes an object from this container or all |
| containers. |
| removeObjectAt - Removes the object at the cursor location. |
| removeSelectedObjects - Removes all selected objects from the container. |
| removeAllObjects - Removes all objects from the container. |
| deleteSelectedObjects - Deletes the selected objects in this container. If |
| an object exists in other containers, it is |
| removed from them as well before being deleted. |
| deleteAllObjects - Deletes all objects in this container. If an |
| object exists in other containers, it is removed |
| from them as well before being deleted. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&addObject ( const IContainerObject* newObject,
IContainerObject* parentObject = 0),
&addObjectAfter ( const IContainerObject* newObject,
const IContainerObject* afterObject,
IContainerObject* parentObject = 0),
/* remove does not delete the object */
&removeObject ( IContainerObject* object,
Boolean fAllContainers = false),
&removeObjectAt ( IContainerControl::ObjectCursor& cursor),
&removeObjectAt ( IContainerControl::TextCursor& cursor),
&removeSelectedObjects ( ),
&removeAllObjects ( ),
&deleteSelectedObjects ( ),
&deleteAllObjects ( );
/*----------------- Moving/Copying Subtrees ------------------------------------
| The following functions are used to move and copy objects and descendents: |
| isMoveValid - Checks if an object and its descendents can be moved to a |
| new location. This function checks the validity of a move |
| to be performed by moveObjectTo(). This function will |
| return false for the following reasons. |
| 1) If moveObject = 0. |
| 2) If the source container doesn't contain moveObject. |
| 3) If afterObject is an invalid location. If the target |
| container doesn't contain a non-zero afterObject. |
| 4) If newParentObject is invalid. If the target container|
| doesn't contain a non-zero newParentObject. |
| 5) If both afterObject and newParentObject are specified, |
| and newParentObject is not the parent of afterObject |
| in the target container. |
| 6) If the source and target containers are the same and |
| moveObject is to be moved as a child of one of its |
| descendents. |
| 7) If the source and target containers are different and |
| moveObject or any of its descendents exist in the |
| target container. |
| moveObjectTo - Moves an object and its descendents to a new location in |
| the tree view. An object and its descendents can be moved |
| to a new container if the object and its descendents do not |
| exist there already. |
| copyObjectTo - Copies an object and its descendents to a new location in |
| the tree view. The object must overload the objectCopy |
| function. The copy of the object is returned. |
------------------------------------------------------------------------------*/
virtual Boolean
isMoveValid ( IContainerObject* moveObject,
IContainerObject* newParentObject = 0,
IContainerControl* newContainer = 0,
IContainerObject* afterObject = 0);
virtual Boolean
moveObjectTo ( IContainerObject* moveObject,
IContainerObject* newParentObject = 0,
IContainerControl* newContainer = 0,
IContainerObject* afterObject = 0,
const IPoint& iconViewLocation = IPoint(0,0));
IContainerObject
*copyObjectTo ( IContainerObject* copyObject,
IContainerObject* parentObject = 0,
IContainerControl* newContainer = 0,
IContainerObject* afterObject =0,
const IPoint& iconViewLocation = IPoint(0,0));
/*-------------------- Retrieving Objects --------------------------------------
| The following functions are used to retrieve objects in the container: |
| objectAt - Returns an object at an index or cursor position |
| in the container. |
| parentObject - Returns the parent object in the tree view. |
| descendentsOf - Returns the set of all descendents of an object |
| in the tree view. |
| immediateDescendentsOf - Returns the set of immediate descendents only of |
| an object in the tree view. |
| objectList - Returns the set of all objects in the container. |
| objectCount - Returns the number of objects in the container. |
| containsObject - Returns true if the passed object is in the |
| container. |
| cursoredObject - Returns the object on which the cursor is |
| located. |
------------------------------------------------------------------------------*/
virtual IContainerObject
*objectAt ( unsigned long index) const,
*objectAt ( const IContainerControl::ObjectCursor& cursor) const,
*objectAt ( const IContainerControl::TextCursor& cursor) const,
*parentObject ( const IContainerObject* childObject) const;
/* Return a list of descendents of the passed object */
ICnrObjectSet
descendentsOf ( IContainerObject* parentObject) const,
immediateDescendentsOf ( IContainerObject* parentObject) const,
objectList ( ) const;
unsigned long
objectCount ( ) const;
Boolean
containsObject( const IContainerObject* object) const;
IContainerObject
*cursoredObject ( ) const;
/*------------------ Setting Object Attributes ---------------------------------
| The following functions are used to set and remove the attributes of |
| objects: |
| setSelected - Gives an object selection emphasis. |
| removeSelected - Removes selection emphasis from an object. |
| setInUse - Gives an object in-use emphasis. |
| removeInUse - Removes in-use emphasis from an object. |
| showSourceEmphasis - Draws source emphasis. If an object is specified, |
| the emphasis is drawn around the object. When this |
| function is applied to an entire container, it turns |
| source emphasis on the first time it is called, and |
| turns source emphasis off the second time it is
| called. When this function is applied to individual
| records, it only turns source emphasis on. |
| NOTE: On OS/2 Version 2.0, you cannot use this |
| function to show source emphasis for an object |
| if the container has the orderedTargetEmphasis |
| attribute set. |
| hideSourceEmphasis - Removes source emphasis. If an object is specified, |
| the emphasis is removed from the object. |
| setCursor - Gives an object cursored emphasis. |
| enableDataUpdate - Enables direct editing of the text of an object. |
| disableDataUpdate - Disables direct editing of the text of an object. |
| expand - Expands the tree view to show the descendents of the |
| parent object. |
| collapse - Collapses the descendents of an object in the tree |
| view. |
| Note: The parent is not actually being collapsed or |
| expanded. |
| refresh - Refreshes all objects in the container. |
| enableDrop - Enables an object to be the target of a drag |
| operation. |
| disableDrop - Prevents an object from receiving a drop; no target |
| emphasis is drawn. |
| showObject - Shows an object that is currently invisible or |
| filtered from the container. |
| hideObject - Makes an object invisible by filtering it out of the |
| container. |
------------------------------------------------------------------------------*/
IContainerControl
&setSelected ( IContainerObject* object,
Boolean select = true),
&removeSelected ( IContainerObject* object),
&showSourceEmphasis ( Boolean source = true),
&showSourceEmphasis ( IContainerObject* object,
Boolean source = true),
&hideSourceEmphasis ( ),
&hideSourceEmphasis ( IContainerObject* object),
&setInUse ( IContainerObject* object,
Boolean inUse = true),
&removeInUse ( IContainerObject* object),
&setCursor ( IContainerObject* object),
&enableDataUpdate ( IContainerObject* object,
Boolean enable=true),
&disableDataUpdate ( IContainerObject* object),
&expand ( IContainerObject* object),
&collapse ( IContainerObject* object),
&refresh ( IContainerObject* object),
&enableDrop ( IContainerObject* object,
Boolean enable=true),
&showObject ( IContainerObject* object,
Boolean visible=true),
&hideObject ( IContainerObject* object),
&disableDrop ( IContainerObject* object);
/*------------------ Querying Object Attributes --------------------------------
| The following functions are used to query the attributes of an object: |
| isTarget - Queries whether the object is a target of direct |
| manipulation. |
| isSelected - Queries whether the object has selection emphasis. |
| isSource - Queries whether the object has source emphasis. |
| isInUse - Queries whether the object has in-use emphasis. |
| isCursored - Queries whether the object has cursored emphasis. |
| isVisible - Queries whether the object is currently visible. |
| isExpanded - Queries whether the tree view node object is currently |
| expanded. |
| isCollapsed - Queries whether the tree view node object is currently |
| collapsed. |
| isReadOnly - Queries whether the object is read-only. |
| isDropOnAble - Queries whether the object is set to receive a direct |
| manipulation drop. |
------------------------------------------------------------------------------*/
Boolean
isTarget ( const IContainerObject* object) const,
isSource ( const IContainerObject* object) const,
isSelected ( const IContainerObject* object) const,
isInUse ( const IContainerObject* object) const,
isCursored ( const IContainerObject* object) const,
isVisible ( const IContainerObject* object) const,
isExpanded ( const IContainerObject* object) const,
isCollapsed ( const IContainerObject* object) const,
isReadOnly ( const IContainerObject* object) const,
isDropOnAble ( const IContainerObject* object) const;
/*------------------ Object Position -------------------------------------------
| The following functions are used to manipulate and query object position: |
| moveIconTo - Moves the object to the specified workspace |
| location. |
| iconRectangle - Returns the icon rectangle and, optionally, |
| includes text. This rectangle is in container |
| window coordinates. |
| detailObjectRectangle - Returns the details view rectangle. If the column |
| is specified, provides the cell in the details |
| view. This rectangle is in container window |
| coordinates. |
| textRectangle - Returns the text rectangle in window coordinates. |
| objectUnderPoint - Retrieves the object under the point in window |
| coordinates. |
| columnUnderPoint - Retrieves the column under the point in window |
| coordinates. |
| convertToWorkspace - Converts a rectangle from container window |
| coordinates to workspace coordinates. This is |
| valid only for the current view. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&moveIconTo ( IContainerObject* object,
const IPoint& point);
IRectangle
iconRectangle ( const IContainerObject* object,
Boolean includeText = false) const,
detailObjectRectangle ( const IContainerObject* object,
Boolean rightWindow = false ) const,
detailObjectRectangle ( const IContainerObject* object,
const IContainerColumn* column) const,
textRectangle ( const IContainerObject* object) const,
convertToWorkspace ( const IRectangle& windowRectangle,
Boolean rightWindow = false) const;
IContainerObject
*objectUnderPoint ( const IPoint& point) const;
IContainerColumn
*columnUnderPoint ( const IPoint& point) const;
/*------------------------ Sorting Objects -------------------------------------
| The following functions are used to provide sorting in the container: |
| sortByIconText - Sorts the container by the icon's text. |
| sort - Sorts the container by a user-defined sort function |
| (CompareFn). |
| nlsCompare - Compares two strings consisting of a national character |
| set. This function is useful for implementing National |
| Language Support. |
------------------------------------------------------------------------------*/
IContainerControl
&sortByIconText ( Boolean ascending = true),
&sort ( const IContainerControl::CompareFn& sortObject);
static long
nlsCompare ( const char* text1,
const char* text2) ;
/*------------------------ Filtering Objects -----------------------------------
| The following function is used to sort the container: |
| filter - Filters the container by calling the passed FilterFn's |
| isMemberOf function. If a FilterFn is not passed, |
| objects currently filtered from the container are |
| restored to the container. |
------------------------------------------------------------------------------*/
IContainerControl
&filter ( ),
&filter ( const IContainerControl::FilterFn& filterObject);
/*------------------------ Iterating Objects -----------------------------------
| The following function is used to apply behavior to the objects in the |
| container: |
| allObjectsDo - Calls the applyTo function on the passed iterator for |
| all objects in the container. If includeDescendents |
| is true, the tree view descendent objects will be |
| called as well. The iteration will be stopped when |
| applyTo returns true or all the objects in the |
| container have been processed. |
------------------------------------------------------------------------------*/
IContainerControl
&allObjectsDo ( IContainerControl::Iterator& iteratorObject,
Boolean includeDescendents = false);
/*------------------------ Direct Editing --------------------------------------
| The following functions are used in direct editing in the container: |
| editContainerTitle - Opens an edit field on the container title. |
| editColumnTitle - Opens an edit field on a column heading. |
| editObject - Opens an edit field on an object. |
| closeEdit - Closes an open edit field. |
| setEditMLE - Stores a multiple-line entry (MLE) field being used |
| for editing. |
| setEditColumn - Stores the column over which editing is occurring. |
| setEditObject - Stores the object over which editing is occurring. |
| currentEditMLE - Retrieves the multiple-line entry (MLE) field being |
| used for editing. |
| currentEditColumn - Retrieves the column being edited. |
| currentEditObject - Retrieves the object being edited. |
------------------------------------------------------------------------------*/
virtual IContainerControl
&editContainerTitle ( ),
&editColumnTitle ( IContainerColumn* column),
&editObject ( IContainerObject* object,
IContainerColumn* column=0),
&closeEdit ( ),
&setEditMLE ( IMultiLineEdit* editField),
&setEditColumn ( IContainerColumn* column),
&setEditObject ( IContainerObject* object);
IMultiLineEdit
*currentEditMLE ( );
IContainerColumn
*currentEditColumn ( );
IContainerObject
*currentEditObject ( );
/*------------------------ Miscellaneous ---------------------------------------
| enableCaching - If an ICnrHandler has been created and added to the |
| container, this function causes the dispatch of an |
| ICnrQueryDeltaEvent to the handler when the |
| container scrolls past the pre-defined delta value. |
| disableCaching - Stops the dispatch of ICnrQueryDeltaEvents to an |
| ICnrHandler. |
| enableDrawItem - If an ICnrDrawHandler has been created and added to |
| the container, this function causes the dispatch of |
| an ICnrDrawItemEvent to the handler. |
| disableDrawItem - Stops the dispatch of ICnrDrawItemEvents to an |
| ICnrHandler. |
| enableDrawBackground - If an ICnrDrawHandler has been created and added to |
| the container, this function causes the dispatch of |
| an ICnrDrawBackgroundEvent to the handler. |
| disableDrawBackground - Stops the dispatch of ICnrDrawBackgroundEvents to |
| an ICnrHandler. |
| containerFromHandle - Retrieves a container from the list using the handle.|
| numberOfObjectChanges - Retrieves the containers count of object additions |
| and removals. This function is used by cursors to |
| ensure invalidation occurs when the container is |
| changed. |
| numberOfColumnChanges - Retrieves the containers count of column additions |
| and removals. This function is used by cursors to |
| ensure invalidation occurs when the container is |
| changed. |
------------------------------------------------------------------------------*/
IContainerControl
&enableCaching ( unsigned long ulDeltaValue = 30),
&disableCaching ( ),
&enableDrawItem ( Boolean Enable=true),
&disableDrawItem ( ),
&enableDrawBackground ( Boolean Enable=true),
&disableDrawBackground ( );
static IContainerControl
*containerFromHandle ( const IWindowHandle& handle);
unsigned long
numberOfObjectChanges ( ) const,
numberOfColumnChanges ( ) const;
/*-------------------------------- Overrides -----------------------------------
| This class overrides the following inherited functions: |
| isVisible - Overridden because of the addition of |
| isVisible(IContainerObject). |
| refresh - Overridden because of the addition of refresh(). |
------------------------------------------------------------------------------*/
IContainerControl
&refresh ( Boolean refreshChildren),
&refresh ( const IRectangle& invalidRectangle);
Boolean
isVisible ( ) const;
protected:
/*----------------------------- Implementation ---------------------------------
| The following functions are used in the implementation of the class: |
| setContainerAttributes - Sets the attributes into the container control. |
| containerInfo - Refreshes your copy of the container's state |
| data. |
| setEmphasis - Sets an object to an emphasis attribute. |
| setAttributes - Updates the attributes of an object. |
| setDefaultContainer - Initializes a container to the default styles. |
| containerAttributes - Returns the current container attribute mask. |
| attributes - Returns an attribute mask for an object. |
| column - Returns a column matching the command criteria. |
| calcMinimumSize - Returns a minimum size for the container. |
| hwndAllocation - Returns the container used for object allocation. |
| containerList - Returns the list of containers in this |
| application. |
| containerKey - Returns the key used to control access when |
| updating the container. Acts as a semaphore to |
| the container updates. |
| baseRecordSize - Returns the size of the RECORDCORE portion of the |
| objects stored in a container. |
------------------------------------------------------------------------------*/
virtual void
setContainerAttributes ( unsigned long attributeToTurnOff,
unsigned long attributeToTurnOn),
containerInfo ( ) const,
setEmphasis ( IContainerObject* object,
unsigned long emphasisAttribute,
Boolean setOn=true),
setAttributes ( IContainerObject* object,
unsigned long attributeToTurnOn,
unsigned long attributeToTurnOff),
setDefaultContainer ( const Attribute& attribute);
unsigned long
containerAttributes ( ) const,
attributes ( const IContainerObject* object) const;
IContainerColumn
*column ( IContainerColumn* column,
unsigned long command,
Boolean visible);
virtual unsigned long
baseRecordSize ( );
static IWindowHandle
hwndAllocation ( );
static ICnrControlList
&containerList ( );
static IPrivateResource
&containerKey ( );
virtual ISize
calcMinimumSize ( ) const;
IContainerControl ( );
private:
/*--------------------------------- PRIVATE ----------------------------------*/
enum State { ok=1, noRefresh=2, invalid=4, autoDeleteObjects=8, autoDeleteColumns=16,
needsRefresh=32};
friend class IContainerColumn;
friend class IContainerControl::ColumnCursor;
friend class IContainerControl::ObjectCursor;
friend class IContainerObject;
friend class ICnrEditHandler;
friend class ICnrDestroyHandler;
void
addContainer ( ),
showView ( unsigned long viewFlags),
collectDescendents ( ICnrObjectSet& containerSet,
IContainerObject* object) const,
addDefaultHandler ( ),
removeDefaultHandler( );
IContainerObject
*findFirst ( unsigned long usView,
const char* text,
Boolean isCaseSensitive = false,
Boolean isFirstInRecord = false) const,
*selectedObject ( const IContainerObject* objectAfter,
unsigned long ulEmphasis) const,
*object ( const IContainerObject* objectAfter,
unsigned long command) const;
IRectangle
viewport ( unsigned long ulCoordinateSpace,
Boolean rightSplitWindow) const;
static ICnrDestroyHandler
&destroyHandler ( );
static void
setAllocationContainer ( unsigned long handle);
void
cleanUp();
ICnrInfo
*pcnrinfoCl;
IContainerColumn
*pcnrcolClSplitbar;
/* MLE Edit data */
IContainerColumn
*pcnrcolClEdit;
IContainerObject
*pcnrobjClEdit;
IMultiLineEdit
*pmleClEdit;
Boolean
fClInvalidate;
int
lClSplitbar,
flClState;
unsigned long
ulClDragEvent;
IBitmapHandle
hbmClIconViewBackground;
ISize
sizIconViewBitmap;
unsigned long
ulClObjectChanges;
unsigned long
ulClColumnChanges;
static const Attribute
miniView;
static Attribute
currentDefaultAttribute;
static Style
currentDefaultStyle;
}; /* end IContainerControl */
INESTEDBITFLAGCLASSFUNCS(Style, IContainerControl);
/*----------------------------------------------------------------------------*/
/* Resume compiler default packing and warning messages. */
/*----------------------------------------------------------------------------*/
#pragma pack()
#pragma info(restore)
/*--------------------------------- INLINES ----------------------------------*/
#ifndef I_NO_INLINES
#include <icnrctl.inl>
#endif
#endif /* _ICNRCTL_ */