Caption Property

Set \/ Gets caption of a gui object

Syntax:

Caption <cValue>``(Control Definition)

<ParentWindowName>.<ControlName>.Caption [ (nIndex) ] := cCaption

<ParentWindowName>.<ControlName>.Caption [ (nIndex) ] --> cCaption

nIndex is available only for grid, radiogroup and tab controls.


CaretPos Property

Set \/ Gets the caret position of a textbox control

Syntax:

CaretPos <nValue> (Control Definition)

<ParentWindowName>.<ControlName>.CaretPos := nCaretPosition

<ParentWindowName>.<ControlName>.CaretPos --> nCaretPosition

Note: if you set CaretPos to -1 moves the caret to the end of text and scrolls the text.


CaseConvert Property

Specifies whether a character TextBox input will be automatically converted to lowercase or uppercase

Syntax:

CaseConvert Upper | Lower | None


Cell Property

Specifies or retrieves the content of a Grid cell

Syntax:

<ParentWindowName>.<ControlName>.Cell(nRow,nCol) := CellContent

<ParentWindowName>.<ControlName>.Cell(nRow,nCol) --> CellContent


CellNavigation Property

Specifies whether individual cells can be selected in Grid control

Syntax:

CellNavigation <lValue>

Sample:

#include "hmg.ch"
Function Main
   Local aRows [10] [3]
   DEFINE WINDOW Form_1 ;
      AT 0,0 ;
      WIDTH 640 ;
      HEIGHT 400 ;
      TITLE 'Cell Navigation Grid Test' ;
      MAIN
   DEFINE MAIN MENU
      DEFINE POPUP 'File'
         MENUITEM 'Set Value To {5,2}' ACTION Form_1.Grid_1.Value := {5,2}
         MENUITEM 'Set Value To {0,0}' ACTION Form_1.Grid_1.Value := {0,0}
         MENUITEM 'Get Value' ACTION GetSelectionValue()
         MENUITEM 'Delete Item 5' ACTION Form_1.Grid_1.DeleteItem(5)
         MENUITEM 'AddItem' ACTION Form_1.Grid_1.AddItem({'X','X','X'})
         MENUITEM 'Delete All Items' ACTION Form_1.Grid_1.DeleteAllItems
      END POPUP
   END MENU
   aRows [1] := {'Simpson','Homer','555-5555'}
   aRows [2] := {'Mulder','Fox','324-6432'}
   aRows [3] := {'Smart','Max','432-5892'}
   aRows [4] := {'Grillo','Pepe','894-2332'}
   aRows [5] := {'Kirk','James','346-9873'}
   aRows [6] := {'Barriga','Carlos','394-9654'}
   aRows [7] := {'Flanders','Ned','435-3211'}
   aRows [8] := {'Smith','John','123-1234'}
   aRows [9] := {'Pedemonti','Flavio','000-0000'}
   aRows [10] := {'Gomez','Juan','583-4832'}
   DEFINE GRID Grid_1
      ROW 10
      COL 10
      WIDTH 500
      HEIGHT 322
      HEADERS {'Column 1','Column 2','Column 3'}
      WIDTHS {100,100,100}
      ITEMS aRows
      ALLOWEDIT .T.
      CELLNAVIGATION .T.
      ONCHANGE GridChange()
      VALUE { 3 , 2 }
   END GRID
END WINDOW
Form_1.Grid_1.setfocus
CENTER WINDOW Form_1
ACTIVATE WINDOW Form_1
Return

Function GridChange()
   Static OnChangeCounter := 0
   a := this.value
   OnChangeCounter++
   form_1.title := ' Row: ' + alltrim(str(a [1])) + ' Col: ' + alltrim(str(a [2])) + Space(10) + 'OnChange Count: ' + alltrim(str(OnChangeCounter))
return

Function GetSelectionValue
   Local a
   a := Form_1.Grid_1.Value
   MsgInfo( Str ( a [1] ) + ' ' + Str ( a [2] ) )
Return nil

Center Property

Specifies whether a AnimateBox control content should be aligned to center

Syntax:

CENTER <lValue>


CenterAlign Property

Specifies whether a label or hyperlink control content should be alignet to center

Syntax:

CenterAlign <lValue>


Check Property

Specifies whether a ToolBar button should work as a CheckButton

Syntax:

Check <lValue>

Sample:

DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 85,85 FLAT BORDER
   BUTTON Button_1 ;
      CAPTION '&More ToolBars...' ;
      PICTURE 'button1.bmp' ;
      ACTION Modal_Click() TOOLTIP 'ONE'
   BUTTON Button_2 ;
      CAPTION '&Button 2' ;
      PICTURE 'button2.bmp' ;
      ACTION MsgInfo('Click! 2') TOOLTIP 'TWO'
   BUTTON Button_3 ;
      CAPTION 'Button &3' ;
      PICTURE 'button3.bmp' ;
      ACTION MsgInfo('Click! 3') TOOLTIP 'THREE' CHECK
END TOOLBAR

Checked Property

Set \/ Gets check state of a menu item

Syntax:

Checked <lValue>

<ParentWindowName>.<MenuItemName>.Checked := lCheckState

<ParentWindowName>.<MenuItemName>.Checked --> lCheckState


Col Property

Set \/ Gets column position of a gui object (window\/control)

Syntax:

Col <nValue> (Control Definition)

<ParentWindowName>.<ControlName>.Col := nCol

<ParentWindowName>.<ControlName>.Col --> nCol

<ParentWindowName>.Col := nCol

<ParentWindowName>.Col --> nCol


ColumnControls Property

Specifies controls to be used for each column in a Grid Control

Syntax:

ColumnControls {aControlDef1,aControlDef2,...aControlDefN}

Control Definition Array:

TEXTBOX

{ cControlType , cDataType , cInputMask , cFormat }

cControlType = 'TEXTBOX' (Required)

cDataType = 'CHARACTER' , 'NUMERIC' , 'DATE' (Required)

cInputMask = cInputMask (Optional)

cFormat = cFormat (Optional)

DATEPICKER

{ cControlType , cControlStyle }

cControlType = 'DATEPICKER' (Required)

cControlStyle = 'DROPDOWN' , 'UPDOWN' (Required)

TIMEPICKER

{ cControlType , cTimeFormat }

cControlType = 'TIMEPICKER' (Required)

cTimeFormat = '', _TIMELONG24H, _TIMELONG12H, _TIMESHORT24H, _TIMESHORT12H (Required)

COMBOBOX

{ cControlType , acItems }

cControlType 'COMBOBOX' (Required)

acItems (Required)

SPINNER

{ cControlType , nRangeMin , nRangeMax }

cControlType 'SPINNER' (Required)

nRangeMin (Required)

nRangeMax (Required)

CHECKBOX

{ cControlType , cCheckedLabel , cUnCheckedLabel }

cControlType 'CHECKBOX' (Required)

cCheckedLabel (Required)

cUnCheckedLabel (Required)

Data type for each column will depend control specified.

NUMERIC TEXTBOX : NUMERIC

DATE TEXTBOX : DATE

CHARACTER TEXTBOX : CHARACTER

SPINNER : NUMERIC

COMBOBOX : NUMERIC

CHECKBOX : LOGICAL

Sample:

@ 10,10 GRID Grid_1 ;
            WIDTH 620 ;
            HEIGHT 330 ;
            HEADERS {'Column 1','Column 2','Column 3','Column 4',;
                  'Column 5'} ;
            WIDTHS {140,140,140,140,140} ;
            ITEMS aRows ;
            EDIT ;
            COLUMNCONTROLS { {'TEXTBOX','NUMERIC','$ 999,999.99'},;
                  {'DATEPICKER','DROPDOWN'} ,;
                  {'COMBOBOX',{'One','Two','Three'}} , ;
                  { 'SPINNER' , 1 , 20 } , ;
                  { 'CHECKBOX' , 'Yes' , 'No' } }

ColumnValid Property

Codeblock array (one element per column) is evaluated at cell editing

Syntax:

ColumnValid <abValues>

This.CellValue variable are available at codeblock evaluation.

Sample:

COLUMNVALID { ; 
  { || This.CellValue > 100 } , ;
  { || This.CellValue = Date() } , ;
  Nil , ;
  Nil , ;
  Nil ;
  }

ColumnWhen Property

Codeblock array (one element per column) that is evaluated at cell editing

Syntax:

ColumnWhen <abValues>

This.CellValue variable are available at codeblock evaluation.

Sample:

COLUMNWHEN { ;
 { || This.CellValue >= 'M' } , ;
 { || This.CellValue >= 'C' } , ;
 { || ! Empty ( This.CellValue ) } ;
 }

Cursor Property

Specifies a cursor file or resource for a Window

Syntax:

Cursor <lValue>

Sample:

#include "hmg.ch"
Function Main
    DEFINE WINDOW Win_1 ;
       AT 0,0 ;
       WIDTH 400 ;
       HEIGHT 400 ;
       TITLE 'Hello World!' ;
       MAIN ;
       CURSOR "Finger.cur"
 END WINDOW
 ACTIVATE WINDOW Win_1
Return

results matching ""

    No results matching ""