OFF TOPIC: hmg3 object

54 views
Skip to first unread message

José Quintas

unread,
Nov 16, 2025, 5:20:15 PM (5 days ago) Nov 16
to Harbour Minigui
The only remaing part that I do not change to object is about grid
I do not understand this part
I do not understand if default values comes from a default control or not.


FUNCTION _GridEx_SET_DEFAULT_COLUMN_CONTROL (cControlName , cParentForm, nControl)

LOCAL k, DefaultData
LOCAL i := GetControlIndex(cControlName,cParentForm)
LOCAL nColumnCount := _GridEx_ColumnCount(cControlName,cParentForm)
...

   IF nControl == _GRID_COLUMN_ONHEADCLICK_ .OR. nControl == _GRID_COLUMN_HEADER_ .OR. nControl == _GRID_COLUMN_HEADER2_ .OR. nControl == _GRID_COLUMN_HEADERIMAGE_ .OR. nControl == _GRID_COLUMN_JUSTIFY_
      IF Valtype (_HMG_SYSDATA [ nControl ] [i]) == "A"
         FOR k = 1 TO nColumnCount
             IF Valtype (_HMG_SYSDATA [ nControl ] [i] [k]) == "U"
                _HMG_SYSDATA [ nControl ] [i] [k] := DefaultData
             ENDIF
         NEXT
      ENDIF
   ELSE
      IF Valtype (ControlByIndex( I ):CTRL040 [ nControl ]) == "A"
         FOR k = 1 TO nColumnCount
             IF Valtype (ControlByIndex( I ):CTRL040 [ nControl ] [k]) == "U"
                ControlByIndex( I ):CTRL040 [ nControl ] [k] := DefaultData
             ENDIF
         NEXT
      ENDIF
   ENDIF

RETURN NIL

José Quintas

unread,
Nov 16, 2025, 6:56:44 PM (5 days ago) Nov 16
to Harbour Minigui
May be I understand it now.

   oControl := ControlByIndex( I )
   DO CASE
   CASE nControl == _GRID_COLUMN_ONHEADCLICK_ ; aTmp := oControl:CTRL017
   CASE nControl == _GRID_COLUMN_HEADER_ ;      aTmp := oControl:CTRL007
   CASE nControl == _GRID_COLUMN_HEADER2_ ;     aTmp := oControl:CTRL033
   CASE nControl == _GRID_COLUMN_HEADERIMAGE_ ; aTmp := oControl:CTRL022
   CASE nControl == _GRID_COLUMN_JUSTIFY_ ;     aTmp := oControl:CTRL037
   OTHERWISE  ;                                 aTmp := oControl:CTRL040
   ENDCASE
   IF ValType( aTmp ) == "A"
      FOR K = 1 TO nColumnCount
         IF ValType( aTmp[ K ] ) == "U"
            aTmp[ K ] := DefaultData
         ENDIF
      NEXT
   ENDIF

Note: I do not define names for each property, using CTRLnnnn until rename all.

José M. C. Quintas
Reply all
Reply to author
Forward
0 new messages