rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliTableComboBox Class Reference

Field gadget class. More...

#include <ilviews/dataccess/gadgets/tblcombo.h>

Inheritance diagram for IliTableComboBox:
IliAbstractComboBox IliEntryField IlvTextField IliFieldItf IlvGadget IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IliTableComboBox (IlvDisplay *display, const IlvRect &rect, const IliMapEntry *map, IlBoolean owner, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Initializes a table combo box, where the foreign table is an IliMapTable.
 IliTableComboBox (IlvDisplay *display, const IlvRect &rect, IliTable *table, IlBoolean owner, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Initializes a table combo box, where the foreign table to be used is specified.
 IliTableComboBox (IlvDisplay *display, const IlvRect &rect, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Initializes a table combo box.
virtual void close ()
 Hides the pull-down menu or dialog box.
virtual IlBoolean f_complete ()
 Updates the internal value of the field, according to its current external representation and its foreign table, provided completion is enabled for the field.
virtual IlBoolean f_externalToInternal ()
 Updates the internal value of a field according to its current external representation.
virtual IlBoolean f_isAutoFitPullDown () const
 Returns IlTrue if the width of the pull-down menu is automatically computed so that its contents fit.
virtual IlBoolean f_isConsistent () const
 Returns IlTrue if the internal value of the field corresponds to its current external representation.
virtual void f_setAutoFitPullDown (IlBoolean flag)
 Enables/disables the automatic width computing of the pull-down menu.
virtual void f_setForeignDisplayColumnName (const char *)
 Sets the name of the column of the foreign table that will serve as a result, when the table is used as a map to convert internal values into external representations.
virtual void f_setForeignTable (IliTable *, IlBoolean owner=IlFalse)
 Sets the foreign table of the field.
virtual void f_setForeignValueColumnName (const char *)
 Sets the name of the column of the foreign table that will serve as a key, when the table is used as a map to convert internal values into external representations.
virtual IlBoolean f_setValue (const IliValue &, IlBoolean internalP=IlFalse)
 Sets the value of the field.
IliAbstractTablePopupViewgetComboBoxWindow () const
 Returns the default dialog (a pull-down menu) of the combo box.
IliAbstractTablePopupViewgetComboBoxWindow ()
 Returns the default dialog (a pull-down menu) of the combo box.
IlInt getDisplayColumns (IlInt *) const
 Returns the index of each column displayed by the pull-down menu.
IlInt getDisplayColumnsCount () const
 Returns the number of columns displayed by the pull-down menu.
IlInt getPullDownWidth () const
 Returns the width of the pull-down menu.
const char * getTableColumns () const
 Returns the list of column names displayed by the pull-down menu.
IliAbstractTablePopupViewgetUserComboBoxWindow ()
 Returns the dialog displayed when the user clicks to display the pull-down menu.
IliAbstractTablePopupViewgetUserComboBoxWindow () const
 The dialog displayed when the user clicks to display the pull-down menu.
IlBoolean isAutoFitting () const
 IlTrue if the table combo box is in auto-fitting mode.
IlBoolean isMultiColumnsMode () const
 Returns IlTrue if the pull-down menu displays several columns.
virtual IlBoolean isOpen () const
 Returns IlTrue if the pull-down menu or the dialog box is currently displayed.
IlBoolean selectNextRow ()
 Changes the value of the combo box to the value, contained in the value column, of the next row in the foreign table.
IlBoolean selectPreviousRow ()
 Changes the value of the combo box to the value, contained in the value column, of the previous row in the foreign table.
IlBoolean selectRow (IlInt rowno)
 Changes the value of the combo box to the value contained in the value column, in the foreign table.
void setAutoFitting (IlBoolean flag)
 Turns on or off the table combo box in auto-fitting mode.
void setPullDownWidth (IlInt width)
 Sets the width of the pull-down menu.
void setTableColumns (const char *list)
 Sets the list of column names displayed by the pull-down menu.
void setUserComboBoxWindow (IliAbstractTablePopupView *dlg)
 Defines the dialog displayed when the user clicks to display the pull-down menu.

Protected Member Functions

virtual void valueToLabel (const IliValue &value)
 Sets the value to the label of the entry field.

Detailed Description

Field gadget class.

Library: dbgadget

The IliTableComboBox class defines a combo box gadget that opens a pull-down menu when the user clicks on the combo button. The pull-down menu displays a column of the foreign table of the field. A IliTableComboBox gadget inherits the following properties from the IliFieldItf class:

When a table combo box receives a new value, it looks in the foreign table for a row that has this value in what is referred to as its value column. If such a row is found, the table combo box displays the value contained in what is referred to as the display column of this row. Therefore, a table combo box does not display the new value, but a value which is derived from the initial value through the foreign table. The foreign table serves as a value converter. In addition, if the user edits the value displayed in the table combo box, the edited value is converted back in a reversed version of the procedure described above. A row that contains the newly edited value in its display column is searched for in the foreign table. If such a row is found, the value of the combo box changes to the value contained in the value column of the row. Moreover, the pull-down menu can display several columns of the foreign table. See the function setTablesColumns. However, if you display another dialog, use the IliAbstractTablePopupView class to define your dialog class and replace the pull-down menu by this class. Note: This gadget does not support XP look&feel. If you need a support of the XP look&feel see IliScrolledComboBox class.

See also:
IliMapTable, IliTable, IliScrolledComboBox.

Constructor & Destructor Documentation

IliTableComboBox::IliTableComboBox ( IlvDisplay display,
const IlvRect rect,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Initializes a table combo box.

Parameters:
display The display.
rect The location.
thickness The border thickness.
palette The palette.
IliTableComboBox::IliTableComboBox ( IlvDisplay display,
const IlvRect rect,
IliTable table,
IlBoolean  owner,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Initializes a table combo box, where the foreign table to be used is specified.

Parameters:
display The display.
rect The location.
table The foreign table.
owner The table owner, if IlTrue, the combo box becomes the owner of the foreign table.
thickness The border thickness.
palette The palette.
IliTableComboBox::IliTableComboBox ( IlvDisplay display,
const IlvRect rect,
const IliMapEntry map,
IlBoolean  owner,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Initializes a table combo box, where the foreign table is an IliMapTable.

Parameters:
display The display.
rect The location.
map The rows of the foreign table.
owner The table owner, if IlTrue, the combo box becomes the owner of the rows of the foreign table.
thickness The border thickness.
palette The palette.

Member Function Documentation

virtual void IliTableComboBox::close (  )  [virtual]

Hides the pull-down menu or dialog box.

The type of object that is hidden depends on the subclass of IliAbstractComboBox being used.

Reimplemented from IliAbstractComboBox.

virtual IlBoolean IliTableComboBox::f_complete (  )  [virtual]

Updates the internal value of the field, according to its current external representation and its foreign table, provided completion is enabled for the field.

For more information on completion, see the f_iscompletionEnabled member function.

Returns:
IlTrue if successful.

Reimplemented from IliFieldItf.

virtual IlBoolean IliTableComboBox::f_externalToInternal (  )  [virtual]

Updates the internal value of a field according to its current external representation.

Returns:
IlTrue if successful and IlFalse otherwise. Note that this may fail due to the fact that not all external representations can be converted to a value object. For example, this is especially true for text fields that are used to edit numeric or date values.

Reimplemented from IliEntryField.

virtual IlBoolean IliTableComboBox::f_isAutoFitPullDown (  )  const [virtual]

Returns IlTrue if the width of the pull-down menu is automatically computed so that its contents fit.

Returns:
IlTrue if the width of the pull-down menu is automatically computed so that its contents fit. The value returned by this virtual member function is currently meaningful only when the field gadget is one of the following: For a table gadget, this property applies to all table combo boxes contained in the table gadget.

Reimplemented from IliFieldItf.

virtual IlBoolean IliTableComboBox::f_isConsistent (  )  const [virtual]

Returns IlTrue if the internal value of the field corresponds to its current external representation.

A return value of IlFalse means that the external representation of the field has been edited by the end-user since the last time one of the member functions, f_setValue, f_externalToInternal, f_internalToExternal or f_complete was successfully called.

Returns:
IlTrue if the internal value of the field corresponds to its current external representation.

Reimplemented from IliEntryField.

virtual void IliTableComboBox::f_setAutoFitPullDown ( IlBoolean  flag  )  [virtual]

Enables/disables the automatic width computing of the pull-down menu.

Parameters:
flag If IlTrue, the width of the pull-down menu is automatically computed so that its contents fit. See the description of f_isAutoFitPullDown for more information on this property.

Reimplemented from IliFieldItf.

virtual void IliTableComboBox::f_setForeignDisplayColumnName ( const char *  name  )  [virtual]

Sets the name of the column of the foreign table that will serve as a result, when the table is used as a map to convert internal values into external representations.

Parameters:
name The column name.

Reimplemented from IliFieldItf.

virtual void IliTableComboBox::f_setForeignTable ( IliTable tbl,
IlBoolean  owner = IlFalse 
) [virtual]

Sets the foreign table of the field.

Parameters:
tbl The table.
owner Determines whether the field will own the table.

Reimplemented from IliFieldItf.

virtual void IliTableComboBox::f_setForeignValueColumnName ( const char *  name  )  [virtual]

Sets the name of the column of the foreign table that will serve as a key, when the table is used as a map to convert internal values into external representations.

Parameters:
name The column name.

Reimplemented from IliFieldItf.

virtual IlBoolean IliTableComboBox::f_setValue ( const IliValue val,
IlBoolean  internal = IlFalse 
) [virtual]

Sets the value of the field.

Parameters:
val The value.
internal If IlFalse, then the external representation and the display of the field are automatically updated.
Returns:
IlTrue if successful, and IlFalse otherwise.

Reimplemented from IliEntryField.

IliAbstractTablePopupView* IliTableComboBox::getComboBoxWindow (  )  const

Returns the default dialog (a pull-down menu) of the combo box.

Returns:
The dialog.
IliAbstractTablePopupView* IliTableComboBox::getComboBoxWindow (  ) 

Returns the default dialog (a pull-down menu) of the combo box.

Returns:
The dialog.
IlInt IliTableComboBox::getDisplayColumns ( IlInt  )  const

Returns the index of each column displayed by the pull-down menu.

Returns:
The index of each column displayed by the pull-down menu. It also returns the number of columns displayed by the pull-down menu.
IlInt IliTableComboBox::getDisplayColumnsCount (  )  const

Returns the number of columns displayed by the pull-down menu.

Returns:
The count.
IlInt IliTableComboBox::getPullDownWidth (  )  const

Returns the width of the pull-down menu.

Returns:
The width of the pull-down menu. It is either -1, the default, or a positive integer. See the setPullDownWidth member function for more information.
const char* IliTableComboBox::getTableColumns (  )  const

Returns the list of column names displayed by the pull-down menu.

These columns are from the foreign data source. The column names are separated by a `;' .

Returns:
The columns list.
IliAbstractTablePopupView* IliTableComboBox::getUserComboBoxWindow (  ) 

Returns the dialog displayed when the user clicks to display the pull-down menu.

Returns:
The dialog.
IliAbstractTablePopupView* IliTableComboBox::getUserComboBoxWindow (  )  const

The dialog displayed when the user clicks to display the pull-down menu.

Returns:
The dialog.
IlBoolean IliTableComboBox::isAutoFitting (  )  const

IlTrue if the table combo box is in auto-fitting mode.

In auto-fitting mode, the width of the pull-down menu is automatically adjusted to the contents of the data it contains. Initially, this property is IlFalse.

Returns:
IlTrue if the table combo box is in auto-fitting mode.
IlBoolean IliTableComboBox::isMultiColumnsMode (  )  const

Returns IlTrue if the pull-down menu displays several columns.

Returns:
IlTrue if the pull-down menu displays several columns.
virtual IlBoolean IliTableComboBox::isOpen (  )  const [virtual]

Returns IlTrue if the pull-down menu or the dialog box is currently displayed.

Returns:
The pull-down menu (or dialog box) visibility.

Reimplemented from IliAbstractComboBox.

IlBoolean IliTableComboBox::selectNextRow (  ) 

Changes the value of the combo box to the value, contained in the value column, of the next row in the foreign table.

Returns:
IlTrue if successful.
IlBoolean IliTableComboBox::selectPreviousRow (  ) 

Changes the value of the combo box to the value, contained in the value column, of the previous row in the foreign table.

Returns:
IlTrue if successful.
IlBoolean IliTableComboBox::selectRow ( IlInt  rowno  ) 

Changes the value of the combo box to the value contained in the value column, in the foreign table.

Parameters:
rowno The row position.
Returns:
IlTrue if successful.
void IliTableComboBox::setAutoFitting ( IlBoolean  flag  ) 

Turns on or off the table combo box in auto-fitting mode.

Parameters:
flag If IlTrue, the auto-fitting mode is on.
void IliTableComboBox::setPullDownWidth ( IlInt  width  ) 

Sets the width of the pull-down menu.

Parameters:
width The width, which must be either -1 or a positive integer. When the pull-down menu is opened, it will have a width equal to the maximum of the given value and the width of the gadget itself. This property can be used to specify that the actual width of the pull-down menu is not less than the given value.
void IliTableComboBox::setTableColumns ( const char *  list  ) 

Sets the list of column names displayed by the pull-down menu.

These columns are from the foreign data source. The column names are separated by a `;' .

Parameters:
list The columns list.
void IliTableComboBox::setUserComboBoxWindow ( IliAbstractTablePopupView dlg  ) 

Defines the dialog displayed when the user clicks to display the pull-down menu.

Parameters:
dlg The dialog.
virtual void IliTableComboBox::valueToLabel ( const IliValue value  )  [protected, virtual]

Sets the value to the label of the entry field.

However if a format is defined the function formatValue is called to format the value. If there is no format but there is a mask, the value is formatted with the mask.

At the end the function setLabelSilently is called to set the value to the label and to launch the drawing of the label.

Parameters:
value The value.

Reimplemented from IliEntryField.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.