Scol standard library package
0.3.1
Common and usefull functions for all Scol applications
|
Classes | |
struct | Grid |
Opaque internal structure. You should not call it directly, use API instead ! More... | |
Functions | |
_CRgridCreate (chn, iLines, iCols, iWidthCell, iHeightCell, iSpacing) | |
Create an empty Grid object. More... | |
_EXCHANGEgridCell (grid, iLineSrc, iColSrc, iLineDest, iColDest, iKeepCurSize) | |
Exchange two cells. More... | |
_GETgridCell (grid, iLine, iCol) | |
Get the window object cell. More... | |
_GETgridCellInitPos (grid, iLine, iCol) | |
Return the initial positions of a cell. More... | |
_GETgridCellPos (grid, iLine, iCol) | |
Return the current positions of a cell. More... | |
_MOVEgrid (grid, iPosX, iPosY) | |
Move the grid. More... | |
_MOVEgridCell (grid, iLine, iCol, iPosX, iPosY) | |
Move a cell in a grid. More... | |
_REMOVEgridCell (grid, iLine, iCol) | |
Remove a cell from a grid. More... | |
_RESETgridCell (grid, iLine, iCol) | |
Reset the position and the size of a cell. More... | |
_SETgridCellDragDrop (grid, iLine, iCol, iState, iMouse) | |
Activate or Deacticate the drag & drop in a given cell. More... | |
_SETgridCellFlag (grid, iLine, iCol, iFlags) | |
Set the flags for a cell. More... | |
_SETgridCellFlagForce (grid, iLine, iCol, iFlags) | |
Force the flags for a cell. More... | |
_SETgridFlag (grid, iFlags) | |
Set the flags of cell when they created. More... | |
_SETgridParent (grid, oParent) | |
Set the current parent window. More... | |
_SIZEgrid (grid, iWidthCell, iHeightCell) | |
Resize a grid. More... | |
_SIZEgridCell (grid, iLine, iCol, iWidth, iHeight) | |
Resize a window cell in a grid. More... | |
A Grid is a table of window objects which can be freely set
Package to load : lib/2dos/grid.pkg
_CRgridCreate | ( | chn | , |
iLines | , | ||
iCols | , | ||
iWidthCell | , | ||
iHeightCell | , | ||
iSpacing | |||
) |
Create an empty Grid object.
It allows to create a grid of window object (ObjWin) with a customized settings. In fact, each cell can provide a window or keep empty. All cells have the same size.
By default, no parent window is set. If needed, use _SETgridParent.
You can change the parent window as you want : thus, on a same grid, you put the cells on several levels and keep an homogeneous interface.
By default, the grid is at the position (0,0). Use _MOVEgrid to set it.
Prototype : fun [Chn I I I I I] Grid
Chn | : the channel where the Grid is created |
I | : the number of lines (> 0) |
I | : the number of columns (> 0) |
I | : the cell width (>0) |
I | : the cell height (>0) |
I | : the spacing (the space between each cell, >= 0) |
_SETgridParent | ( | grid | , |
oParent | |||
) |
_GETgridCell | ( | grid | , |
iLine | , | ||
iCol | |||
) |
Get the window object cell.
Any 2d object can be added in this window object, as any window object.
If no window is defined for this cell yet, it will be automatically created when this function is called.
Prototype : fun [Grid I I] ObjWin
_MOVEgrid | ( | grid | , |
iPosX | , | ||
iPosY | |||
) |
_MOVEgridCell | ( | grid | , |
iLine | , | ||
iCol | , | ||
iPosX | , | ||
iPosY | |||
) |
Move a cell in a grid.
Even if the window object comes in another line or column, it keeps linked to its cell.
Thus, you can do as you want but i don't recommend to move beyond the original cell.
Prototype : fun [Grid I I I I] Grid
Grid | : a Grid object |
I | : a line (the first line is 0) |
I | : a column (the first column is 0) |
I | : the new x coordinate |
I | : the new y coordinate |
_SIZEgridCell | ( | grid | , |
iLine | , | ||
iCol | , | ||
iWidth | , | ||
iHeight | |||
) |
Resize a window cell in a grid.
Even if the window object comes in another line or column, it keeps linked to its cell.
It is recommended to perform a resize by this function than directly with _'SIZEwindow'.
Prototype : fun [Grid I I I I] Grid
Grid | : a Grid object |
I | : a line (the first line is 0) |
I | : a column (the first column is 0) |
I | : the new width |
I | : the new height |
_SETgridFlag | ( | grid | , |
iFlags | |||
) |
Set the flags of cell when they created.
They are the same flags than for the window : http://www.scolring.org/files/doc_html/_crwindow.html
All created cell after this call will have these flags. By default, WN_NORMAL is used.
This function can be called as often as needed.
_SETgridCellFlag | ( | grid | , |
iLine | , | ||
iCol | , | ||
iFlags | |||
) |
Set the flags for a cell.
They are the same flags than for the window : http://www.scolring.org/files/doc_html/_crwindow.html
If no window defined in this cell, this function returns also nil.
_SETgridCellFlagForce | ( | grid | , |
iLine | , | ||
iCol | , | ||
iFlags | |||
) |
Force the flags for a cell.
They are the same flags than for the window : http://www.scolring.org/files/doc_html/_crwindow.html
_REMOVEgridCell | ( | grid | , |
iLine | , | ||
iCol | |||
) |
Remove a cell from a grid.
_SIZEgrid | ( | grid | , |
iWidthCell | , | ||
iHeightCell | |||
) |
_SETgridCellDragDrop | ( | grid | , |
iLine | , | ||
iCol | , | ||
iState | , | ||
iMouse | |||
) |
Activate or Deacticate the drag & drop in a given cell.
A such drag & drop allows to move a cell to another cell, like _EXCHANGEgridCell.
Prototype : fun [Grid I I I I] Grid
Grid | : a Grid object |
I | : a line (the first line is 0) |
I | : a column (the first column is 0) |
I | : the state : GRID_DRAGDROP to activate it, GRID_NODRAGDROP (default) to deactivate it. Another value is incorrect. |
I | : the mouse button : it is one of these following values :
|
_EXCHANGEgridCell | ( | grid | , |
iLineSrc | , | ||
iColSrc | , | ||
iLineDest | , | ||
iColDest | , | ||
iKeepCurSize | |||
) |
Exchange two cells.
Exactly, only the two windows are exchanged.
Prototype : fun [Grid I I I I I] Grid
Grid | : a Grid object |
I | : the number line of the first cell (the first line is 0) |
I | : the number column of the first cell (the first column is 0) |
I | : the number line of the second cell (the first line is 0) |
I | : the number column of the second cell (the first column is 0) |
I | : 1 to keep the current size (by default) else 0 |
_RESETgridCell | ( | grid | , |
iLine | , | ||
iCol | |||
) |
Reset the position and the size of a cell.
Position and size are those defined at the beginning (when the cell has been created).
_GETgridCellInitPos | ( | grid | , |
iLine | , | ||
iCol | |||
) |
Return the initial positions of a cell.
Prototype : fun [Grid I I] [I I I I]
Grid | : a Grid object |
I | : the number line of the cell (the first line is 0) |
I | : the number column of the cell (the first column is 0) |
_GETgridCellPos | ( | grid | , |
iLine | , | ||
iCol | |||
) |
Return the current positions of a cell.
These positions are also those of the window object only if the motion or the resize has been invoked by this API. Else, they are the last known positions by this API.
Prototype : fun [Grid I I] [I I I I]
Grid | : a Grid object |
I | : the number line of the cell (the first line is 0) |
I | : the number column of the cell (the first column is 0) |