ORACLE TAB CONTROL

This is tab control OCX with features like six different orientations, tooltips, bitmap and text, multiline/singleline and four different styles of tabs.

Properties

Methods

Events


Oracle Tab Control

This is tab control OCX with features like six different orientations, tooltips, bitmap and text, multiline/singleline and four different styles of tabs.

Properties

Methods

Events

Tab Item Object

You can also access each tab item object  as subobjects and invoke the properties, methods and events on each of them

TabItem Object


Properties of Tab Control

NAME                       TYPE        	 DEFAULT

BackColor                 OLE_COLOR 	   Ambient BackColor

The background color of the tab control.

ForeColor                  OLE_COLOR    	Ambient ForeColor

The foreground color of the tab control.

SelectColor                OLE_COLOR    	Ambient BackColor

 	The background color of the selected tab item.

TextColor                   OLE_COLOR    	Ambient TextColor

 	The text color for the tab control.

Enabled                     BOOL       	Ambient Enabled value

 Indicates whether the control is enabled or not. This stock property indicates whether the control 	can receive focus.

Font                                   	Ambient Font

 	The font used by the tab control.

FirstItemIndex           SHORT             	0

 By setting this property to a particular tab index we can scroll to make the tab to be the first one 	displayed.

Orientation                 SHORT	MMBX_OR_TOP

 	Indicates the orientation of the tab control along the client area.

 	Possible Values :MMBX_OR_TOP                 1

             MMBX_OR_LEFT               2

             MMBX_OR_BOTTOM        3

             MMBX_OR_RIGHT            4

             MMBX_OR_HOR_LEFT     5

             MMBX_OR_HOR_RIGHT  6

These values are defined in the MMBXPUB.h file

ItemCount                   SHORT	0

 	Indicates the number of items in the tab control.

Multiline                   BOOL   	FALSE

 Indicates whether the tab control is multiline. If this property is FALSE  then the tab control 	displays a single row of tabs.

SelectItem                  SHORT                       0

 Indicates the selected tab item in the tab control.

ItemStyle	      SHORT	MMBX_S_SQUARE

Possible Values:MMBX_S_SQUARE            1

                                         MMBX_S_ROUNDED        2

                                         MMBX_S_BEVELED         3

                                         MMBX_S_CHAMFERED   4

Indicates the various styles of drawing the tabs. All the four styles are available in the 32-bit 	control but the MMBX_S_ROUNDED is not available in the 16-bit control. These values are

               defined in the MMBXPUB.h file

ShowToolTips	    BOOL	 FALSE

This property enables and disables the Tooltips for the control. TooltipText can be added to each 	of tab items by accessing the ToolTipText property of  the tab item subobject.

ButtonStyle	   BOOL 	FALSE

When this property is set to TRUE, the tab items behave and look like buttons. Both multiline and 	single line and all different orientations are available with this style.


Methods of Tab Control

void   NewItem(  BSTR FAR *itemName, BSTR FAR *beforeWhich  );

           Adds a new tab item with the name itemName to the tab control

           before a tab item named beforeWhich. If beforeWhich is NULL,

           the tab item is added at the end.

void   DeleteItem(  BSTR FAR  *itemName  );

           Deletes the tab item specified by the itemName.

void   DeleteAllItems();

           Deletes all the tab items in the tab control.

short  GetItemIndex( BSTR  FAR *itemName );

           Gets the zero based tab index of the tab item with the given name.

BSTR   GetItemName( short tabIndex );

           Returns the name of the tab item specified by the tabIndex.

void   ChangeItemName(  BSTR  FAR *newItemName,  BSTR FAR *oldItemName );

           Changes the name of the tab item.

void   SetItemGray( BSTR FAR *itemName , BOOL  bGray );

           Grays out  a tab item. If bGray is set to TRUE then the tab item is

           greyed off and will not accept any input events.

short  GetRowCount( );

          Returns the row count of the tab control.

void   AdjustRect( BOOL bLarger,  LONG *left, LONG *top,

                  LONG *right, LONG *bottom);

           If  bLarger  is TRUE, the coordinates specify a display rectangle and

           receive the corresponding window rectangle. If this parameter is

           FALSE, the coordinates specify a window rectangle and receive the

           corresponding display rectangle.

void SetToolTipTextByIndex(short itemIndex, BSTR* ToolTipText);

          The ToolTipText specifies the text to be attached to the tab item at the itemIndex location. Make sure

           to set the ShowToolTips property of the tab control to TRUE so you can see the ToolTip.

void SetToolTipTextByName(BSTR* itemName, BSTR* ToolTipText);

          The ToolTipText specifies the text to be attached to the tab item with the itemName. Make sure to set

           the ShowToolTips property of the tab control to TRUE so you can see the ToolTip.

BSTR GetToolTipTextByName(BSTR* itemName);

           Call this function to get the tooltip text associated with the tab item with the given itemName.

BSTR GetToolTipTextByIndex(short itemIndex);

           Call this function to get the tooltip text associated with the tab item with the given itemIndex.

void SetPictureByIndex(short itemIndex, IPictureDisp* newValue);

           Sets the Picture of the tab item at the itemIndex location. The picture can be created from a bitmap,

           metafile or icon .

void SetPictureByName(BSTR* itemName, IPictureDisp* newValue);

           Set the Picture of the tab item with the name specified by itemName. The picture can be created from

           a bitmap, metafile or icon.

IPictureDisp* GetPictureByIndex(short itemIndex);

           Call this function to get the picture associated with the tab that is specified by itemIndex.

IPictureDisp* GetPictureByName(BSTR* itemName);

           Call this function to get the picture associated with the tab item specified by itemName.

METHODS FOR GETTING THE TAB ITEM OBJECT

IDispatch* GetItemObjectByIndex(short tabIndex);

IDispatch* GetItemObjectByName(BSTR* itemName);

These methods are provided to get the tab item object specified by the tabIndex

or the itemName. Once you have the tab item object you can directly call the

methods on the tab item for setting name, picture, ToolTipText and GrayOut

information. This alternative method is provided to simplified in the sense that

once you have the tab item object you can modify it's attributes directly rather

than having to pass the itemindex/itemName everytime to the Tab Control's methods.

The functions return the IDispatch to the Tab Item Object. Do not forget to call

Release() once you are done with the tab item's IDispatch.

Refer to the section below on TabItem Object Properties and Methods to find out

about the properties and methods of the tab item object.


Events of Tab Control

TabChangingByName(  BSTR FAR *ItemName, BOOL * cancelChange);

TabChangingByIndex( short ItemIndex, BOOL * cancelChange);

        This event is sent when the selection is about to change from one tab

        item to the other because of an input event. If the client does not

        wish to change selection, will set the cancelChange to FALSE in the

        event handler for this event.

TabChangedByName(  BSTR FAR *newItemName  );

TabChangedByIndex( short itemIndex );

        This event is sent to the client when the selection has changed from

        one tab item to the other.

OwnerDrawByIndex(short ItemIndex, boolean selected, long rectLeft, long

rectTop, long rectRight, long rectBottom);

OwnerDrawByName(BSTR* ItemName, boolean selected, long rectLeft, long

rectTop, long rectRight, long rectBottom);

To be implemented.

TabScroll(short amount);

Indicates the amount of the tab item the scroll has occurred. Negative

values indicate a left scroll and positive values indicate a positive

        scroll.

TabMouseMoveByIndex(short ItemIndex);

TabMouseMoveByName(BSTR* ItemName);

This event is sent to indicate that a mouse move has occurred

on the specified tab item.

TabLButtonDownByIndex(short ItemIndex);

TabLButtonDownByName(BSTR* ItemName);

This event is sent to indicate that a button down has occurred

on the specified tab item.

TabLButtonUpByIndex(short ItemIndex);

TabLButtonUpByName(BSTR* ItemName);

This event is sent to indicate that a button up has occurred

on the specified tab item.

TabKeyUp(long nChar, long nRepCount, long nFlags);

This event is sent to indicate that a key up has occurred

on the specified tab item.

TabKeyDown(long nChar, long nRepCount, long nFlags);

This event is sent to indicate that a key down has occurred

on the specified tab item.

TabGrayedByName(BSTR* ItemName, boolean isGrayed);

TabGrayedByIndex(short ItemIndex, boolean isGrayed);

This event is sent to indicate that the tab item has been

        grayed out.

TabDisplayRectSizeChange(long left, long top, long right, long bottom);

This event indicates that the display rectangle/client rectangle

        has changed. Handle this event to place the controls accordingly on

        the client area of the tab control.


Tab Item Object

PROPERTIES:

 ToolTipText	BSTR                Empty

Specify the ToolTipText property for the tab item.

 GrayOut	BOOLEAN             FALSE

Indicates whether the tab item is grayed out.

 Picture	IPictureDisp*	    Empty

Specify the picture associated with the tab item.

METHODS:

void SetName(BSTR* itemName);

Set the name of the tab item.

BSTR GetName();

Get the name of the tab item