GetControlType in CHECKBUTTON

Moderator: Rathinagiri

User avatar
gfilatov
Posts: 1087
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: GetControlType in CHECKBUTTON

Post 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-)
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: GetControlType in CHECKBUTTON

Post 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 :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetControlType in CHECKBUTTON

Post 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"
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

GetControlType in CHECKBUTTON

Post by Pablo César »

Yes Cláudio, thank you.

Who knows one day will be approved :roll:
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
srvet_claudio
Posts: 2193
Joined: Thu Feb 25, 2010 8:43 pm
Location: Uruguay
Contact:

Re: GetControlType in CHECKBUTTON

Post 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.
Best regards.
Dr. Claudio Soto
(from Uruguay)
http://srvet.blogspot.com
User avatar
Roberto Lopez
HMG Founder
Posts: 4004
Joined: Wed Jul 30, 2008 6:43 pm

Re: GetControlType in CHECKBUTTON

Post 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.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)
KDJ
Posts: 243
Joined: Mon Sep 05, 2016 3:04 am
Location: Poland

Re: GetControlType in CHECKBUTTON

Post 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().
Post Reply