Valid Property

Codeblock array (one element per column) that is evaluated after field editing for Browse control

Syntax:

Valid <abValues>

Sample:

@ 10,10 BROWSE Browse_1 ;
   WIDTH 610 ;
   HEIGHT 390 ;
   HEADERS { 'Code' , 'First Name' , 'Last Name' } ;
   WIDTHS { 150 , 150 , 150 } ;
   WORKAREA Test ;
   FIELDS { 'Test->Code' , 'Test->First' , 'Test->Last' } ;
   VALUE 1 ;
   EDIT ;
   VALID { { || MemVar.Test.Code <= 1000 } , { || !Empty(MemVar.Test.First) } , { || !Empty(MemVar.Test.Last) } } ;
   VALIDMESSAGES { 'Code Range: 0-1000', 'First Name Cannot Be Empty', Nil }

ValidMessages Property

Character array (one element per column) with messages to show when valid procedure returns .F.

Syntax:

ValidMessages <lValue>

Sample:

See above Valid Property Sample.


Value Property

Sets \/ Gets gui object's value

Syntax:

Value <xValue> (Control Definition)
<WindowName>.<ControlName>.Value := <Value>
<WindowName>.<ControlName>.Value -> <Value>

<Value> type depends upon the control type:

TIMEPICKER : Character.

DATEPICKER : Date.

MONTHCALENDAR: Date

TEXTBOX : Character.

TEXTBOX (Numeric) : Numeric.

TEXTBOX (Password) : Character.

RADIOGROUP : Numeric (Option Selected).

CHECKBOX : Logical.

COMBOBOX : Numeric (Row Selected).

LISTBOX : Numeric (Row Selected).

LISTBOX (Multiselect): Numeric Array (Rows Selected).

GRID (Standard): Numeric (Row Selected).

GRID (Multiselect): Numeric Array (Rows Selected).

GRID (CellNavigation): Numeric Array (Row and col selected).

EDITBOX : Character.

TAB : Numeric (Active Page).

SPINNER : Numeric.

SLIDER : Numeric.

BROWSE: Numeric (Selected Record Number (RecNo()))

TIMER : Numeric (Write Only)

PROGRESSBAR : Numeric (Write Only)

TOOLBAR BUTTON: Logical. .T. when button is selected (Check style) .

IPADDRESS: Numeric array (four elements).

TREE: Selected item ID.

LABEL: Character.


ValueSource Property

Setting VALUESOURCE property to a fieldname, its containt is returned instead the physical record number for ComboBox control

Syntax:

ValueSource <xcValue>

This property is used by ComboBox control linked to a table field via ‘ItemSource’ property.

Sample:

Function Main()
   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 365 ;
      HEIGHT 120 ;
      TITLE "Exemplos ComboBox New" ;
      MAIN ;
      ON INIT OpenTables() ;
      ON RELEASE CloseTables()
      DEFINE MAIN MENU
         DEFINE POPUP '&Test'
            MENUITEM 'Get Value' ACTION MsgInfo( Form_1.Combo_1.Value )
            MENUITEM 'Set Value' ACTION Form_1.Combo_1.Value := 2
            MENUITEM 'Refresh' ACTION Form_1.Combo_1.Refresh
         END POPUP
      END MENU
      @010,010 COMBOBOX Combo_1 ;
         ITEMSOURCE CIDADES->DESCRICAO ;
         VALUESOURCE CIDADES->DESCRICAO ;
         WIDTH 200 ;
         FONT "Arial" SIZE 9 ;
         TOOLTIP "Combo Cidades"
   END WINDOW
   CENTER WINDOW Form_1
   ACTIVATE WINDOW Form_1
Return

Procedure Opentables()
   Use Cidades Alias Cidades New
   Index On Descricao To Cidades1
Return

Procedure CloseTables()
  Use 
Return

Vertical Property

Specifies vertical orientation for ProgressBar, Slider and Tab controls

Syntax:

Vertical <lValue>


Virtual Property

Specifies whether a Grid control allow virtual rows

Syntax:

Virtual <lValue>

This allows handling of millons rows without performance penalty.

When using virtual Grids you must avoid to use Item property and additem method. It can generate unexpected results.

Sample:

#include "hmg.ch"
Function Main
   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 450 ;
      HEIGHT 400 ;
      TITLE 'Hello World!' ;
      MAIN
      DEFINE MAIN MENU
         DEFINE POPUP 'File'
            MENUITEM 'Change ItemCount' ACTION Form_1.Grid_1.ItemCount := Val(InputBox('New Value','Change ItemCount'))
         END POPUP
      END MENU
      @ 10,10 GRID Grid_1 ;
         WIDTH 400 ;
         HEIGHT 330 ;
         HEADERS {'Column 1','Column 2','Column 3'} ;
         WIDTHS {140,140,140};
         VIRTUAL ;
         ITEMCOUNT 100000000 ;
         ON QUERYDATA QueryTest()
  END WINDOW
  CENTER WINDOW Form_1
  ACTIVATE WINDOW Form_1
Return

Procedure QueryTest()
   This.QueryData := Str ( This.QueryRowIndex ) + ',' + Str ( This.QueryColIndex )
Return

Visible Property

Specifies whether a GUI object is visible

Syntax:

Visible <lValue>


VScrollBar Property

Specifies whether a vertical scrollbar will be included in an Edit or Browse control

Syntax:

VScrollBar <lValue>

Sample (Control Definition):

DEFINE BROWSE Browse_1
 ROW 50
 COL 100
 WIDTH 120
 HEIGHT 120
 VALUE 1
 WIDTHS {100,100}
 HEADERS {'Header 1',’Header 2’}
 WORKAREA Test
 FIELDS {'Test->Field1',’Test->Field2’}
 FONTNAME "Arial"
 FONTSIZE 9
 TOOLTIP "a browse!"
 VSCROLLBAR .T.
END BROWSE

results matching ""

    No results matching ""