InputWindow()
Creates an Editing Window Automatically
Based Upon Given Values
InputWindow can be used as
fast edition of any kind of fields when you do not wish to create any form.
You can also use it for an
alternative to in-place-edit feature in Grids, using InputWindow with a minimum
implementation efforts for users and without any degradation or slowness on the
Grid.
1.Common syntax:
InputWindow( [cTitle], acLabels, aValues, aFormats [, nRow] [, nCol] [, aBackColor]
[, aToolTips] [, aHotKeys] [, aStyles] [, bCode] ) --> aResult
|
Argument |
Meaning |
||||||||||||
|
|
|
||||||||||||
|
cTitle |
Optional Window Title. Default: ThisWindow.Name |
||||||||||||
|
acLabels |
Character array containing labels with item
descriptions. |
||||||||||||
|
aValues |
Array containing initial values to edit. |
||||||||||||
|
aFormats |
Array containing format information for editing. |
||||||||||||
|
nRow |
Optional for Initial row position. |
||||||||||||
|
nCol |
Optional for Initial column position. |
||||||||||||
|
aBackColor |
Optional for Window and labels BackColor |
||||||||||||
|
aToolTips |
Optional for ToolTip for each control |
||||||||||||
|
aHotKeys |
Optional CodeBlock array containing each key
definition. Ex.: { { 0, VK_ESCAPE, {|| ThisWindow.Release() } } |
||||||||||||
|
aStyles |
Optional with bidimensional array as follows: { {nLabelWidth, lLabelBold,
aLabelFColor, nAlign},; {xControlWidth, lControlBold}
}
|
||||||||||||
|
bCode |
Optional CodeBlock array containing an UDF (user€™s
function) name for initialization and changing properties of controls. |
2.Alternative for in-place-edit in Grids syntax:
Some considerations:
abEscape:={ 0, VK_ESCAPE, {|| ThisWindow.Release() }
abF1:={ 0, VK_F1, {|| My_Help() }
ON DBLCLICK
InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,{abEscape,abF1})
or like this:
ON DBLCLICK InputWindow(,,,{abEscape,
abF1})
Relative notes:
New features at ColumnControls was added and enhanced:
Some interesting features:
Example:
{ This.CellValue == .T., This.CellValue
> CToD("01/01/2000") }
Example:
{ .T.,.T.,.F.,.T. }
Example:
{
CheckValid(This.CellValue),CheckAge(This.CellValue) }
Anyway is good to test all the logical compose. Try first with EDIT at grid to
check results before.
2. Hidden fields (not displayed and not editable) can be
happen by:
Please check for the right usage:
Image( lTransparent )
ImageIndex( nRow , nCol )
ImageList
HeaderImageIndex
Feature Summary:
|
|
Value Type |
|
Format Type |
|
Control to be Created |
|
|
(aValues) |
|
(aFormats) |
|
(aResult) |
|
|
|
|
|
|
|
|
* |
Character |
|
Nil |
|
LABEL |
|
|
Character |
|
Numeric (< 32) |
|
TEXTBOX |
|
|
Character |
|
Numeric (>= 32) |
|
EDITBOX |
|
* |
Character |
|
Character "PASSWORD" |
|
TEXTBOX PASSWORD |
|
|
Numeric |
|
Character (InputMask) |
|
TEXTBOX NUMERIC |
|
* |
Numeric |
|
Numeric |
|
TEXTBOX NUMERIC INTEGER |
|
|
Numeric |
|
Character Array |
|
COMBOBOX |
|
*
|
Character
|
|
{_TIMELONG24H} or {_TIMESHORT24H} or {_TIMELONG12H} or {_TIMESHORT12H}
|
|
TIMEPICKER
|
|
*
|
Array
|
|
Numeric Array It must be with two elements (nRangeMin and nRangeMax) Also could be an optional third element for (nIncrement)
|
|
SPINNER
|
|
|
Logical |
|
Nil |
|
CHECKBOX |
|
|
Date |
|
Nil / <cDateFormat> * |
|
DATEPICKER |
|
* |
Array |
|
Array {{headers},{Widths}} |
|
GRID |
* New and optional features
Newest feature:
· ScrollBars was added automatically when number of items or width sizes
exceeds the maximum size according desktop resolution.
· GetColumnHeaderSize(<cForm>,<cControl>,<” COLUMNHEADERWIDTH”|” COLUMNHEADERHEIGHT”>,<cText>)
function can be used to get size of header’s Grids in width or height.
· GetDateFormat() function is used to get
right lpszFormat for DatePickers.
· SetMethodCode(cForm, cControlType,
cMethod, bCode) is part of InputWindow core now.
This
function is usefull when we want to add bCodes at events of most controls as
follows:
|
Control type |
Event Method |
|
|
|
|
COMBO |
DISPLAYCHANGE, LISTDISPLAY, LOSTFOCUS, GOTFOCUS, CHANGE and ENTER |
|
TEXT, NUMTEXT and MASKEDTEXT |
LOSTFOCUS, GOTFOCUS, CHANGE and ENTER |
|
EDIT |
LOSTFOCUS, GOTFOCUS and CHANGE |
|
DATEPICK |
LOSTFOCUS, GOTFOCUS, CHANGE and ENTER |
|
CHECKBOX |
LOSTFOCUS, GOTFOCUS, CHANGE and ENTER |
|
GRID |
LOSTFOCUS, GOTFOCUS, CHANGE and ENTER |