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} }

 

nLabelWidth

A simple variable with fixed width size for items descriptions (as labels in InputWindow)

lLabelBold

A logical value when need be bold

aLabelFColor

Array for FontColor in labels

nAlign

Numeric value can it be:

0 = Left

1 = Right

2 = Center

 

 

xControlWidth

It can be by two different ways:

1. A simple variable with fixed width size for all control.

2. Or to be an array containing each width control size.

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:

  1. InputWindow will not replace any data in the grid.
    The main idea is to pass to edit all fields in the grids thru InputWindow and returning results in array to be handled by the programmer as be wished to entire responsability.

 

  1. InputWindow Implementation at grid I indicate to do it thru ON DBLCLICK grid event.

 

  1. InputWindow can be implemented at grid by these different ways:

    1. InputWindow() (without any parameter). It will detect by itself all grid properties.

 

    1. InputWindow(<cParentWindowName>,<cControlName>) (both parameters as regular character type variables).

 

    1. InputWindow(<cParentWindowName>,<cControlName>,<anWidths>) (two character variables and one numeric array). This array will contain the total of columns with its width's size of each.

 

    1. InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,<aHotKeys>) (two character variables, one numeric array and one composite array). This last array could contains the all parameters for Hot Key.
      For example:

 

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})

 

    1. InputWindow(<cParentWindowName>,<cControlName>,<anWidths>,<aHotKeys>, nRow, nCol, aBackColor, aToolTips, aHotKeys, aStyles, bCode ) 
      This is the complete parameter sequence. The aHotKeys and aStyles parameters will be overwritten for grids propose.

 

Relative notes:

    1. This parameter/instruction is valid for InputWindow to Grids only.
    2. All these parameters listed here for InputWindow to Grids, are optional, not mandatory.

 

  1. EDIT property at your grid should it be removed. In order to let InputWindow to take it placed.
  2. For replacement of contain of array in return from InputWindow. The suggestion is to make your own function. 
    Like this example: 
    ON DBLCLICK MyReplace(InputWindow2()). It would be more convenient to be created your own function to process all data obtained from InputWindow and be re-passed to the grid.

 


New features at ColumnControls was added and enhanced:

  1. DatePicker with two options: DROPDOWN or UPDOWN

 

  1. TimePicker with different options: _TIMELONG24H / _TIMESHORT24H / _TIMELONG12H / _TIMESHORT12H

 

  1. Spinner with:

 

Some interesting features:

  1. ColumnWhen make exceptions edtions. Preventing edition by enabling controls becoming in gray when attend the condition. This could be done by following ways:

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

 

 

  1. Implement a new composite field CheckBoxItem for selectable items. Which is not a separated field but count when be checked/filled. This is always the first field in edition. No label was applied, due of many languages for internalization.
     
  2. When is double-clicked at any column of grid (even for not CellNavigation), will be started at correlative field thru SetFocus. This is useful to go direct to the most interest field to be edited
     
  3. Allows fields for edition even for MultiSelect records in grid. Will be act in two different ways:

 

  1. Label were been optimized by it width size. Taking the maximum length of header's string.
     
  2. When anWidths parameter have not be informed at InputWindow calling, this will take the exact width of each column automatically.
     
  3. InputWindow will take the same sequence of columns at grid. Even if grid was with sorted order column, will take the corresponding column.
     
  4. When it have been width column resized at grid and then entered to InputWindow, this will also resize control correlative of that column. Useful for column with EditBox extending the width of column.

 


 

 

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

 

DATEPICKER

*

Array

 

Array {{headers},{Widths}}

 

GRID

 

 * New and optional features