Class UIFactory

GEOS-SC:  Library toolkit_lib: Class UIFactory


The UIFactory class allows the application programmer to instantiate visible components in the toolkit. The FlexUI library can use the optional lookHint parameter to determine which subclass of an object to create, or as a data instance that determines how a given UI object should be drawn. There is a global instance of UIFactory called theUIFactory that is used to instantiate visible components.

This is an abstract class and cannot be directly instantiated.

#include <toolkit/uifact.h>


Class Data and Methods

public:
FlexButton *CreateFlexButton (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexCheckbox *CreateFlexCheckbox (LookHint lookHint ) ; // pure virtual
FlexDialog *CreateFlexDialog (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexFrame *CreateFlexFrame (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexImage *CreateFlexImage(LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexInk *CreateFlexInk(LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexLabel *CreateFlexLabel (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexList *CreateFlexList (LookHint lookHint , uint16 numRows ) ;
FlexMenu *CreateFlexMenu (LookHint lookHint , const TCHAR *label ) ;
FlexMenuButton * CreateFlexMenuButton (LookHint lookHint , const TCHAR *label , MenuItemID id ) ;
FlexPanel *CreateFlexPanel (LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexHorizontalPanel * CreateFlexHorizontalPanel(LookHint lookHint , WinCoord gap , HorizontalFlowLayout::X_Justify xjustify , LayoutManagerInterface::Y_Align align , HorizontalFlowLayout::Y_Justify yjustify ) ;
FlexVerticalPanel * CreateFlexVerticalPanel(LookHint lookHint , WinCoord gap , VerticalFlowLayout::Y_Justify yjustify , LayoutManagerInterface::X_Align align , VerticalFlowLayout::X_Justify xjustify ) ;
FlexScrollbar *CreateFlexScrollbar (LookHint lookHint ) ; // pure virtual
FlexScrollPane *CreateFlexScrollPane (LookHint lookHint , FlexScrollPane::ScrollbarDisplayStateType displayState ) ;
FlexTable *CreateFlexTable (LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
FlexTextArea *CreateFlexTextArea (LookHint lookHint ) ; // pure virtual
FlexTextField *CreateFlexTextField(LookHint lookHint , const TCHAR *text , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;
uint8 MapKeyToNavigation(KeyEvent& event) ; // pure virtual
Colorant GetDefaultBackgroundColor() ; // pure virtual
Colorant GetDefaultForegroundColor() ; // pure virtual
protected:

Inherited Data and Methods:

This class does not inherit from any other class.

Back to the top of UIFactory


Ancestors

This class does not inherit from any other class.

Back to the top of UIFactory


Descendants

Class is not inherited by any others.

Back to the top of UIFactory


Descriptions of Class Data and Methods


FlexButton *CreateFlexButton (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexButton object. The type of FlexButton created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of button.
in *label
Text label for button.
in width
Width of button.
in height
Height of button.
in xPos
X position of button.
in yPosx
Y position of button.

Return value: A pointer to a FlexButton, or NULL if no memory is available.

Prototype:

    virtual FlexButton    *CreateFlexButton   (LookHint lookHint = 0, 
                           const TCHAR *label = NULL,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexCheckbox *CreateFlexCheckbox (LookHint lookHint ) ;

Creates a FlexCheckbox object. The type of FlexCheckbox created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of checkbox.

Return value: A pointer to a FlexCheckbox, or NULL if no memory is available.

Prototype:

    virtual FlexCheckbox  *CreateFlexCheckbox (LookHint lookHint = 0) = 0;

Back to the top of UIFactory


FlexDialog *CreateFlexDialog (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexDialog object. The type of FlexDialog created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of dialog.
in *label
Text label for dialog.
in width
Width of dialog.
in height
Height of dialog.
in xPos
X position of dialog.
in yPosx
Y position of dialog.

Return value: A pointer to a FlexDialog, or NULL if no memory is available.

Prototype:

    virtual FlexDialog    *CreateFlexDialog   (LookHint lookHint = 0, 
                           const TCHAR *label = NULL,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexFrame *CreateFlexFrame (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexFrame object. The type of FlexFrame created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of frame.
in *label
Text label for frame.
in width
Width of frame.
in height
Height of frame.
in xPos
X position of frame.
in yPosx
Y position of frame.

Return value: A pointer to a FlexFrame, or NULL if no memory is available.

Prototype:

    virtual FlexFrame     *CreateFlexFrame    (LookHint lookHint = 0, 
                           const TCHAR *label = NULL,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexImage *CreateFlexImage(LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexImage object. The type of FlexImage used can be determined by the lookHint.

Parameters:

in lookHint
Desired look of FlexImage.
in width
Width of FlexImage object.
in height
Height of FlexImage object.
in xPos
X position of FlexImage obeject.
in yPos
Y position of FlexImage object.

Return value: A pointer to a FlexImage, or NULL if no memory is available.

Prototype:

    virtual FlexImage     *CreateFlexImage(LookHint lookHint = 0,
                       WinCoord width = -1,
                       WinCoord height = -1,
                       WinCoord xPos = 0,
                       WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexInk *CreateFlexInk(LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexInk object. The type of FlexInk created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of FlexInk object.
in width
Width of FlexInk object.
in height
Height of FlexInk.
in xPos
X position of FlexInk.
in yPos
Y position of FlexInk.

Return value: A pointer to a FlexInk, or NULL if no memory is available.

Prototype:

    virtual FlexInk       *CreateFlexInk(LookHint lookHint = 0,
                     WinCoord width = -1,
                     WinCoord height = -1,
                     WinCoord xPos = 0,
                     WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexLabel *CreateFlexLabel (LookHint lookHint , const TCHAR *label , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexLabel object. The type of FlexLabel created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of label.
in *label
Text label for label.
in width
Width of label.
in height
Height of label.
in xPos
X position of label.
in yPosx
Y position of label.

Return value: A pointer to a FlexLabel, or NULL if no memory is available.

Prototype:

    virtual FlexLabel     *CreateFlexLabel    (LookHint lookHint = 0, 
                           const TCHAR *label = NULL,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexList *CreateFlexList (LookHint lookHint , uint16 numRows ) ;

Creates a FlexList object. The type of FlexList created is determined by the lookHint parameter.

A list cannot have 0 visible rows. When the user sets the number of rows to be 0, a default number of rows is used.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of list.
in numRows
Desired number of visible rows for list.

Return value: A pointer to a FlexList, or NULL if no memory is available.

Prototype:

    virtual FlexList  *CreateFlexList (LookHint lookHint = 0, 
                                       uint16 numRows = 0) = 0; 

Back to the top of UIFactory


FlexMenu *CreateFlexMenu (LookHint lookHint , const TCHAR *label ) ;

Creates a FlexMenu object.

Parameters:

in lookHint
Desired look of FlexMenu.

Return value: A pointer to a FlexMenu, or NULL if no memory is available.

Prototype:

    virtual FlexMenu *CreateFlexMenu (LookHint lookHint = 0, 
                      const TCHAR *label = NULL) = 0;

Back to the top of UIFactory


FlexMenuButton * CreateFlexMenuButton (LookHint lookHint , const TCHAR *label , MenuItemID id ) ;

Creates a FlexMenuButton object.

Parameters:

in lookHint
Desired look of FlexMenuItem.

Return value: A pointer to a FlexMenuItem, or NULL if no memory is available.

Prototype:

    virtual FlexMenuButton *
    CreateFlexMenuButton (LookHint lookHint = 0, 
                          const TCHAR *label = NULL,
                          MenuItemID id = MENU_ITEM_ID_NULL) = 0;

Back to the top of UIFactory


FlexPanel *CreateFlexPanel (LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexPanel object. The type of FlexPanel created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of panel.
in width
Width of panel.
in height
Height of panel.
in xPos
X position of panel.
in yPosx
Y position of panel.

Return value: A pointer to a FlexPanel, or NULL if no memory is available.

Prototype:

    virtual FlexPanel     *CreateFlexPanel    (LookHint lookHint = 0, 
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexHorizontalPanel * CreateFlexHorizontalPanel(LookHint lookHint , WinCoord gap , HorizontalFlowLayout::X_Justify xjustify , LayoutManagerInterface::Y_Align align , HorizontalFlowLayout::Y_Justify yjustify ) ;

Creates a FlexHorizontalPanel object. The type of FlexPanel created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of panel.
in gap
Space to put between components.
in xjustify
Horizontal justification of components.
in align
Vertical alignment of components.
in yjustify
Vertical justification of components.

Return value: A pointer to a FlexHorizontalPanel, or NULL if no memory is available.

Prototype:

    virtual FlexHorizontalPanel *
    CreateFlexHorizontalPanel(LookHint lookHint = 0,
                              WinCoord gap = 5,                              
                              HorizontalFlowLayout::X_Justify xjustify = 
                              HorizontalFlowLayout::X_JUSTIFY_CENTER,
                              LayoutManagerInterface::Y_Align align = 
                              LayoutManagerInterface::Y_ALIGN_CENTER,
                              HorizontalFlowLayout::Y_Justify yjustify = 
                              HorizontalFlowLayout::Y_JUSTIFY_CENTER) = 0;

Back to the top of UIFactory


FlexVerticalPanel * CreateFlexVerticalPanel(LookHint lookHint , WinCoord gap , VerticalFlowLayout::Y_Justify yjustify , LayoutManagerInterface::X_Align align , VerticalFlowLayout::X_Justify xjustify ) ;

Creates a FlexVerticalPanel object. The type of FlexPanel created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of panel.
in gap
Space to put between components.
in yjustify
Vertical justification of components.
in align
Horizontal alignment of components.
in xjustify
Horizontal justification of components.

Return value: A pointer to a FlexVerticalPanel, or NULL if no memory is available.

Prototype:

    virtual FlexVerticalPanel *
    CreateFlexVerticalPanel(LookHint lookHint = 0,
                            WinCoord  gap = 5,
                            VerticalFlowLayout::Y_Justify yjustify = 
                            VerticalFlowLayout::Y_JUSTIFY_CENTER,
                            LayoutManagerInterface::X_Align align = 
                            LayoutManagerInterface::X_ALIGN_CENTER,
                            VerticalFlowLayout::X_Justify xjustify = 
                            VerticalFlowLayout::X_JUSTIFY_CENTER) = 0;

Back to the top of UIFactory


FlexScrollbar *CreateFlexScrollbar (LookHint lookHint ) ;

Creates a FlexScrollbar object. The type of FlexScrollbar created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of scrollbar.

Return value: A pointer to a FlexScrollbar, or NULL if no memory is available.

Prototype:

    virtual FlexScrollbar  *CreateFlexScrollbar (LookHint lookHint = 0) = 0;

Back to the top of UIFactory


FlexScrollPane *CreateFlexScrollPane (LookHint lookHint , FlexScrollPane::ScrollbarDisplayStateType displayState ) ;

Creates a FlexScrollPane object. The type of FlexScrollPane created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of scrollpane.
in displayState
The desired display state for automatic scrollbars in the scrollpane. This is one of: SDST_NEVER, SDST_ALWAYS, OR SDST_AS_NEEDED.

Return value: A pointer to a FlexScrollPane, or NULL if no memory is available.

Prototype:

    virtual FlexScrollPane  *CreateFlexScrollPane (LookHint lookHint = 0,
            FlexScrollPane::ScrollbarDisplayStateType displayState = 
                                                  FlexScrollPane::SDST_NEVER) = 0;

Back to the top of UIFactory


FlexTable *CreateFlexTable (LookHint lookHint , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexTable object. The type of FlexTable created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of table.
in width
Width of table.
in height
Height of table.
in xPos
X position of table.
in yPosx
Y position of table.

Return value: Returns a pointer to a FlexTable or NULL if no memory is available.

Prototype:

    virtual FlexTable     *CreateFlexTable    (LookHint lookHint = 0,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


FlexTextArea *CreateFlexTextArea (LookHint lookHint ) ;

Creates a FlexTextArea object. The type of FlexTextArea created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of FlexTextArea.

Return value: A pointer to a FlexTextArea, or NULL if no memory is available.

Prototype:

    virtual FlexTextArea  *CreateFlexTextArea (LookHint lookHint = 0) = 0;

Back to the top of UIFactory


FlexTextField *CreateFlexTextField(LookHint lookHint , const TCHAR *text , WinCoord width , WinCoord height , WinCoord xPos , WinCoord yPos ) ;

Creates a FlexTextField object. The type of FlexTextField created is determined by the lookHint parameter.

The method returns NULL if no memory is available to create the object.

Parameters:

in lookHint
Desired look of FlexTextField.
in *text
Initial text for FlexTextField.
in width
Width of FlexTextField.
in height
Height of FlexTextField.
in xPos
X position of FlexTextField.
in yPosx
Y position of FlexTextField.

Return value: A pointer to a FlexTextField, or NULL if no memory is available.

Prototype:

    virtual FlexTextField *CreateFlexTextField(LookHint lookHint = 0,
                           const TCHAR *text = NULL,
                           WinCoord width = -1,
                           WinCoord height = -1,
                           WinCoord xPos = 0,
                           WinCoord yPos = 0) = 0;

Back to the top of UIFactory


uint8 MapKeyToNavigation(KeyEvent& event) ;

Maps keyboard characters into focus navigation events.

Parameters:

in event
Reference to a KeyEvent.

Return value: Focus navigation type associated with the key.

Prototype:

    virtual uint8 MapKeyToNavigation(KeyEvent& event) = 0;

Back to the top of UIFactory


Colorant GetDefaultBackgroundColor() ;

Returns the default background color for this user interface. FlexUI objects use this as their default background color if none is set specifically. A specific FlexUI look may override this default.

Return value: A Colorant representing the default background color.

Prototype:

    virtual Colorant GetDefaultBackgroundColor() = 0;

Back to the top of UIFactory


Colorant GetDefaultForegroundColor() ;

Returns the default foreground color for this user interface. FlexUI objects use this as their default foreground color if none is set specifically. A specific FlexUI look may override this default.

Return value: A Colorant representing the default foreground color.

Prototype:

    virtual Colorant GetDefaultForegroundColor() = 0;

Back to the top of UIFactory


Generated from source by Geoworks on Sat Dec 12 18:32:21 1998 .