Page 3 of 3

Re: GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 12:34 pm
by gfilatov
Roberto Lopez wrote: ...
1. I really miss the times when we worked together...
Dear Roberto,

Me too... ;)

Thanks a LOT for the MiniGUI library :!:

Viva HMG 8-)

Re: GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 12:39 pm
by Roberto Lopez
gfilatov wrote:
Roberto Lopez wrote: ...
1. I really miss the times when we worked together...
Dear Roberto,

Me too... ;)
Maybe we are getting old :)

Re: GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 1:19 pm
by srvet_claudio
Pablo César wrote: In my experience, I have replaced _HMG_SYSDATA [1] [k] := "CHECKBOX" for _HMG_SYSDATA [1] [k] := "CHECKBUTTON" and I noted there comes many errors due this "CHECKBUTTON" is not declared as control
Pablo, this is possible but requires many internal changes in the source code. For example each time it appears in the code

IF _HMG_SYSDATA [1] [k] == "CHECKBOX"

should be replaced by

IF _HMG_SYSDATA [1] [k] == "CHECKBOX" .OR. _HMG_SYSDATA [1] [k] == "CHECKBUTTON"

GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 1:24 pm
by Pablo César
Yes Cláudio, thank you.

Who knows one day will be approved :roll:

Re: GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 1:30 pm
by srvet_claudio
gfilatov wrote:
Roberto Lopez wrote:...
A new (user-level) function aimed to return a control type name, that be meaningful for a final user, could be done
Hi Roberto,

Thanks for this idea, Master :!:

For example, it may be as follow :arrow:

Code: Select all

*-----------------------------------------------------------------------------*
FUNCTION GetUserControlType ( ControlName, ParentForm )
*-----------------------------------------------------------------------------*
   LOCAL i, cRetName

   IF ( i := GetControlIndex ( ControlName, ParentForm ) ) == 0
      RETURN ''
   ENDIF

   cRetName := _HMG_aControlType [i]

   IF cRetName == 'CHECKBOX' .AND. ValType( _HMG_aControlPageMap [i] ) == 'A'
      cRetName := 'CHECKBUTTON'
   ELSEIF cRetName == 'COMBO'
      IF _HMG_aControlMiscData1 [i][1] == 0      // standard combo
         cRetName += 'BOX'
      ELSEIF _HMG_aControlMiscData1 [i][1] == 1  // extend combo
         cRetName += 'BOXEX'
      ENDIF
   ELSEIF "TEXT" $ cRetName .OR. "EDIT" $ cRetName .OR. "LIST" $ cRetName
      cRetName += 'BOX'
   ELSEIF "PICK" $ cRetName
      cRetName += 'ER'
   ELSEIF "MONTHCAL" $ cRetName
      cRetName += 'ENDAR'
   ENDIF

RETURN cRetName
Pablo, is it right now :?:
Thanks Grigory, I will adapt to HMG and include in the next release.

Re: GetControlType in CHECKBUTTON

Posted: Thu Oct 20, 2016 2:26 pm
by Roberto Lopez
srvet_claudio wrote: <...>
this is possible but requires many internal changes in the source code. For example each time it appears in the code

IF _HMG_SYSDATA [1] [k] == "CHECKBOX"

should be replaced by

IF _HMG_SYSDATA [1] [k] == "CHECKBOX" .OR. _HMG_SYSDATA [1] [k] == "CHECKBUTTON"
And... (most important) it will bring an (unnecessary) execution speed penalty.

Re: GetControlType in CHECKBUTTON

Posted: Fri Oct 21, 2016 7:25 pm
by KDJ
Roberto Lopez wrote:
GetControlType() IS AN INTERNAL FUNCTION, NOT AIMED TO BE EXPOSED TO THE FINAL USERS...
Maybe this function should be renamed to _GetControlType().