Software development libraries on www.maxdz.com

MDZSimpleGridAX reference

MDZSimpleGridAX ActiveX library contains MDZSimpleGrid object - data grid with resizeable and moveable columns with changeable title and data background and text colors. No MFC dependencies - the library is WTL/ATL/STL based, therefore small and quick.


MDZSimpleGridAX objects:

MDZSimpleGridAX.MDZSimpleGrid object
Method name Description
AddColumn Adds column to the grid
AddStringData Adds string data to the column
RecalculateLayout Recalculates grid columns/rows widths/heights, sets scrollings.
ChangeColors Opens ColorSchemaDialog allowing to modify grid color schema

Property name Description
ColorSchemaType type of grid color schema.
TitleBkColor title background color
TitleTextColor title text color
EvenBkColor even column/row background color
EvenTextColor even column/row text color
OddBkColor odd column/row background color
OddTextColor odd column/row text color


AddColumn Method

Adds column to the grid

[C++ dispinterface]
void object.AddColumnbstrTitle,  lWidth);

[C++ v-table]
HRESULT object.AddColumnbstrTitle,  lWidth);

[Visual Basic]
object.AddColumn bstrTitle As , lWidth As

Parameters
object - grid object
bstrTitle - Column title string
lWidth - Column width

C++ v-table return value
S_OK if the method succeeds or one of the next error codes:
MDZSG_MEMORYcouldn't allocate memory for column

Remarks
The method adds column with title bstrTitle to the grid. If lWidth is positive or column width changed later during resizing, column width stay fixed. Otherwise, column width will be recalculated depending on column content length.
Back to top..


AddStringData Method

Adds string data to the column

[C++ dispinterface]
void object.AddStringDatabstrTitle,  bstrData);

[C++ v-table]
HRESULT object.AddStringDatabstrTitle,  bstrData);

[Visual Basic]
object.AddStringData bstrTitle As , bstrData As

Parameters
object - grid object
bstrTitle - Title of column to add in
bstrData - String to add

C++ v-table return value
S_OK if the method succeeds or one of the next error codes:
MDZSG_INVALIDNAMEcolumn with bstrTitle title name is not found
MDZSG_MEMORYcouldn't allocate memory for data

Remarks
Adds string value bstrData to the column with bstrTitle title.
Back to top..


RecalculateLayout Method

Recalculates grid columns/rows widths/heights, sets scrollings.

[C++ dispinterface]
void object.RecalculateLayout ();

[C++ v-table]
HRESULT object.RecalculateLayout ();

[Visual Basic]
object.RecalculateLayout 

Parameters
object - grid object

C++ v-table return value
Always returns S_OK

Remarks
Recalculates grid columns/rows widths/heights, sets scrollings. Must be called after AddColumn,AddStringData methods, otherwise columns will not be correctly positioned.
Back to top..


ChangeColors Method

Opens ColorSchemaDialog allowing to modify grid color schema

[C++ dispinterface]
void object.ChangeColors ();

[C++ v-table]
HRESULT object.ChangeColors ();

[Visual Basic]
object.ChangeColors 

Parameters
object - grid object

C++ v-table return value
Always returns S_OK

Remarks
Opens ColorSchemaDialog allowing to modify grid color schema.
Back to top..


ColorSchemaType Property

Gets or sets type of grid color schema.

[C++ dispinterface]
ColorSchemaEnum object.GetColorSchemaType();
void object.SetColorSchemaType(ColorSchemaEnum newVal);

[C++ v-table]
HRESULT object.get_ColorSchemaType(ColorSchemaEnum* pVal);
HRESULT object.set_ColorSchemaType(ColorSchemaEnum newVal);

[Visual Basic]
object.ColorSchemaType [=ColorSchemaEnum]

Parameters
object - grid object
ColorSchemaEnum - type of grid color schema.

C++ v-table return value
Always return S_OK

Remarks
Gets or sets type of color schema. There are next types are possible:
CS_FLAT - all columns use the same background (EvenBkColor property) and text (EvenTextColor property) colors
CS_STRIPE_ROWS - even rows use even background and text colors (EvenBkColor and EvenTextColor properties), odd rows use odd background and text colors (OddBkColor and OddTextColor properties)
CS_STRIPE_COLUMNS - even columns use even background and text colors (EvenBkColor and EvenTextColor properties), odd columns use odd background and text colors (OddBkColor and OddTextColor properties)
Back to top..


TitleBkColor Property

Gets or sets title background color

[C++ dispinterface]
OLE_COLOR object.GetTitleBkColor();
void object.SetTitleBkColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_TitleBkColor(OLE_COLOR* pVal);
HRESULT object.set_TitleBkColor(OLE_COLOR newVal);

[Visual Basic]
object.TitleBkColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - title background color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets title background color.
Back to top..


TitleTextColor Property

Gets or sets title text color

[C++ dispinterface]
OLE_COLOR object.GetTitleTextColor();
void object.SetTitleTextColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_TitleTextColor(OLE_COLOR* pVal);
HRESULT object.set_TitleTextColor(OLE_COLOR newVal);

[Visual Basic]
object.TitleTextColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - title text color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets title text color.
Back to top..


EvenBkColor Property

Gets or sets even column/row background color

[C++ dispinterface]
OLE_COLOR object.GetEvenBkColor();
void object.SetEvenBkColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_EvenBkColor(OLE_COLOR* pVal);
HRESULT object.set_EvenBkColor(OLE_COLOR newVal);

[Visual Basic]
object.EvenBkColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - even column/row background color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets even column/row background color. For details on even/odd column/row colors see Remarks of ColorSchemaType
Back to top..


EvenTextColor Property

Gets or sets even column/row text color

[C++ dispinterface]
OLE_COLOR object.GetEvenTextColor();
void object.SetEvenTextColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_EvenTextColor(OLE_COLOR* pVal);
HRESULT object.set_EvenTextColor(OLE_COLOR newVal);

[Visual Basic]
object.EvenTextColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - even column/row text color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets even column/row text color. For details on even/odd column/row colors see Remarks of ColorSchemaType
Back to top..


OddBkColor Property

Gets or sets odd column/row background color

[C++ dispinterface]
OLE_COLOR object.GetOddBkColor();
void object.SetOddBkColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_OddBkColor(OLE_COLOR* pVal);
HRESULT object.set_OddBkColor(OLE_COLOR newVal);

[Visual Basic]
object.OddBkColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - odd column/row background color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets odd column/row background color. For details on even/odd column/row colors see Remarks of ColorSchemaType
Back to top..


OddTextColor Property

Gets or sets odd column/row text color

[C++ dispinterface]
OLE_COLOR object.GetOddTextColor();
void object.SetOddTextColor(OLE_COLOR newVal);

[C++ v-table]
HRESULT object.get_OddTextColor(OLE_COLOR* pVal);
HRESULT object.set_OddTextColor(OLE_COLOR newVal);

[Visual Basic]
object.OddTextColor [=OLE_COLOR]

Parameters
object - grid object
OLE_COLOR - odd column/row text color

C++ v-table return value
Always return S_OK

Remarks
Gets or sets odd column/row text color. For details on even/odd column/row colors see Remarks of ColorSchemaType
Back to top..


www.maxdz.com Send e-mail to the developer: Max Dzyubenko