MLGRID Initial Text Setup

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > UI (User Interface) > CONTROLS > Control Types > MLGrid Control > MLGrid Control Creation > CONTROL ADD MLGRID >

MLGRID Initial Text Setup

 

Caption field

 

The caption field of a MLGrid can be used for a "/" delimited flag string. It is a design feature of MLGrid to put many of the commonly used options in grid setup as switches.

Here is the meaning of the individual switches:

 

Name

Meaning

rx[,y]

x= the number of rows for the grid. Default is 5 rows.

y= (optional) specified number of dimensioned additional rows - the default is 100.

cx[,y]

x= the number of cols for the grid.

y= (optional) specified number of dimensioned additional cols - the default is 1.  Default is 5 columns.

 

A word is in order on how MLG addresses strings used in the grid.  It is simply a two dimension absolute string array referencing a block of memory created by MLG.  The array is usually dimensioned slightly larger than the grid to easily allow "room to grow".  The default is to dimension 100 additional rows and 1 additional column than actual grid size.  Since it is common to append records to a database, 100 rows may get used up quickly and the MLG will have to request more memory.  In most cases this will be done automatically for you.  Sometimes it is handy to place information about a record "to the right of the grid".  For instance, if a grid has 8 columns but is dimensioned for 9 then string data can be placed in the 9th column but hidden visually from the grid.  Note MLG defaults to dimensioning an additional 100 rows and 1 column if the memory has to be redimensioned automatically by inserting rows/columns or appending rows automatically.

 

Name

Meaning

fx

x=1 for Courier New, 2 for Times Roman, 3 for Arial (default)

sx

x=8 to 16.  Fontsizes for the font picked above.  Note:  additional user defined fonts can be made available by using the MLG API. Font size of 10 is the default.

ex

x=1 Return key moves the selection down after having dismissed the edit box in the cell.  If the selection moves past the bottom of the grid it will move up to the top.  The default is not to move to the top when move past the grid bottom.  x=2 is as x=1 but the selection will move over one column when it returns to the top after having moved past the bottom ot the grid.  x=3 is as x=1 but will add a new row to the bottom of the grid if data is in one of the cells of that row.  If additional dimensioning is required, MLG will handle it for you automatically.  Also a "*" will appear in the row header of the bottom row indicating that auto row expansion of the grid is active.  x=4 The edit box is dismissed but the selection will not move from the cell.

tx

x=1 Tab key moves the selection right after having dismissed the edit box in the cell.  If the the selections moves past the right of the grid then the selection will move the the first column of the same row.  The default action is not to move back to column 1.  x=2 is as x=1 but will move down one row when moving to the first column after having moved right of the grid.

hx

Default is showing both a row header and a column header.  x=1 no row header.  x=2 no column header.  x=3 no row or column header.

bx

Default is not to allow block selecting of rows are columns.  Block selection is accomplished by left clicking the mouse in a header and dragging down in the row header or across to the right in the column header.  Selections may be extended by SHIFT left clicking the mouse.  x=1 Allow row selections.  x=2 Allow columns selections.  x=3  Allow both row and columns selections with the added functionally of selecting the entire grid by left click the mouse on the upper left hand corner of the grid (intersection of the row header and column header).

xx

Comma delimited list of column width start with column (0) - (the width of the row header).  The default column width is 50 for the row header (column(0)) and 100 for the other columns.

For example x20,33,45,22 would set the columns width of the row header to 20 and columns 1 to 3 to 33,45,22 respectively.

yx

x= 1 to 6 Extra pixels added to row height in order for the grid to look more appealing.  The default is 2.  Some fonts need more room to look good.

ax

x=1 Will display a right pointing arrow in the selected row header.  x=2 will suppress auto row numbering so the programmer can put in custom text in the header.  The default action is to number the rows.  Note:  if rows are added or delected, it is up to the programmer to update the row headers.  If sequentially number is desired, the message %MAKEDEFHEADERS can be sent specifying only the row headers to be updated.

ix

x=1 Will draw a line in the left side of the row header if any text on a row (record) has changed indicating that a record update must be written.  Only one indicator options is available at this time.  The default action is NOT to indicate that a row is dirty.

dx

x=1  Hides the vertical scrollbar, x=2 Hides the horizontal scrollbar, x=3 Hides both scrollbars.

wx

x=1 Suppress the user's ability to control column width control with the mouse in the column header.

jx

x=1 Comma delimited list of column names starting with column 1.  For example, to place titles in the first 3 columns - j1CustID,Name,Position

mx

x=1 Inserts a right click menu into the grid from a comma delimited list. A "-" means a separator.   When right clicking a part of the grid which is not on the active edit box, will bring up the menu.  A notification will indicate which menu item is selected and on which cell the right click happened.  An example would be:  m1Insert Row Before,Insert Row After,-,Delete Row        .If x=2 then same as above but the right click menu is for the tabs in a multi-sheet workbook.