RadioGroup can be MULTILINE
Moderator: Rathinagiri
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
RadioGroup can be MULTILINE
Hi Krzysztof and Eduardo.
Sorry, Krzysztof. Nothing missing is the same code I have, but... now I remembered that I had left more this BS_MULTILINE style in the functions: INITRADIOGROUP, INITRADIOBUTTON and SETRADIOSTYLE of the HMG source code. It had done in test character and ended up staying.
But now even removing and in trying to set style with BS_MULTILINE does not work the same way as when the RadioGroup is started.
I have no idea how to solve it. All tests I just done, doesn't work as being native of HMG function with plus this BS_MULTILINE.
Here's the executable file to be tested at yours:
It may would be solved if Claudio would accept BS_MULTILINE as more one property in the RadioGroup Style.
Anyway with ITEM_HEIGHT as 28 or handled higher, MULTILINE remains a necessary property and without prejudice.
Could it be done this Claudio ?
Sorry, Krzysztof. Nothing missing is the same code I have, but... now I remembered that I had left more this BS_MULTILINE style in the functions: INITRADIOGROUP, INITRADIOBUTTON and SETRADIOSTYLE of the HMG source code. It had done in test character and ended up staying.
But now even removing and in trying to set style with BS_MULTILINE does not work the same way as when the RadioGroup is started.
I have no idea how to solve it. All tests I just done, doesn't work as being native of HMG function with plus this BS_MULTILINE.
Here's the executable file to be tested at yours:
It may would be solved if Claudio would accept BS_MULTILINE as more one property in the RadioGroup Style.
Anyway with ITEM_HEIGHT as 28 or handled higher, MULTILINE remains a necessary property and without prejudice.
Could it be done this Claudio ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
RadioGroup can be MULTILINE
Another strange thing is the SETRADIOSTYLE C function that is never been used in HMG...
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
RadioGroup can be MULTILINE
@ Claudio
Resumiendo, quiero preguntarte:
Googled
In short, I want to ask you these questions Claudio:
@ Krzysztof
I found it fantastic to use STATIC in your source code. In fact I hardly ever use it.
I need to better understand how it works and what is the benefit of using it.
I need to learn and much ... thank you for sharing.
Resumiendo, quiero preguntarte:
- Que es lo que contiene (sé que es valor numérico) pero a que se refiere _HMG_SYSDATA [ 183 ] ?
_HMG_ActiveFrameRow based _HMG_FrameLevel, qué seria esto ? Un orden herarquico de los objetos ?
- Cuando un RadioGroup puede alcanzar a tener un valor diferente a: _HMG_SYSDATA [ 23 ] [x] == -1 ?
- Ya que el comportamiento es estraño al intentar colocar BS_MULTILINE (no obedece como deberia o al menos no sé si estoy haciendo algo mal) al estilo del RadioGroup.
Por lo tanto sugiero incluir más un estilo (BS_MULTILINE) fijo en las funcion en C del RadioGroup, puede ser ?
Googled
In short, I want to ask you these questions Claudio:
- What does it contain (I know it is numerical value) but what does _HMG_SYSDATA [183] refer to ?
- When a RadioGroup can reach a value other than: _HMG_SYSDATA [23] [x] == -1 ?
- Since the behavior is strange when trying to put BS_MULTILINE (does not obey as I should or at least I do not know if I'm doing something wrong) in the style of RadioGroup.
So I suggest including more a style (BS_MULTILINE) fixed in the C function of the RadioGroup, can it be ?
@ Krzysztof
I found it fantastic to use STATIC in your source code. In fact I hardly ever use it.
I need to better understand how it works and what is the benefit of using it.
I need to learn and much ... thank you for sharing.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: RadioGroup can be MULTILINE
Pablo
About STATIC variables you can read in Clipper documentation: http://www.itlnet.net/programming/progr ... 0ec05.html
The general rule: do not use PUBLIC and PRIVATE variables unless it is necessary.
Instead of PUBLIC and PRIVATE, use STATIC and LOCAL.
STATIC variables most commonly are used in GET/SET functions, example:
About STATIC variables you can read in Clipper documentation: http://www.itlnet.net/programming/progr ... 0ec05.html
The general rule: do not use PUBLIC and PRIVATE variables unless it is necessary.
Instead of PUBLIC and PRIVATE, use STATIC and LOCAL.
STATIC variables most commonly are used in GET/SET functions, example:
Code: Select all
#define GETSET_COLOR 1
#define GETSET_YEAR 2
#define GETSET_VISIBLE 3
FUNCTION Main()
MsgBox("Color is: " + GetSet(GETSET_COLOR)) //get color
GetSet(GETSET_COLOR, "Yellow") //set color
MsgBox("Now color is: " + GetSet(GETSET_COLOR)) //get color
MsgBox("Year is: " + Str(GetSet(GETSET_YEAR))) //get year
GetSet(GETSET_YEAR, 2018) //set year
MsgBox("Now year is: " + Str(GetSet(GETSET_YEAR))) //get year
RETURN NIL
FUNCTION GetSet(nParam, xNewValue)
STATIC cColor := "Red"
STATIC nYear := 2017
STATIC lVisible := .T.
LOCAL xOldValue
SWITCH nParam
CASE GETSET_COLOR
xOldValue := cColor
IF HB_IsString(xNewValue)
cColor := xNewValue
ENDIF
EXIT
CASE GETSET_YEAR
xOldValue := nYear
IF HB_IsNumeric(xNewValue)
nYear := xNewValue
ENDIF
EXIT
CASE GETSET_VISIBLE
xOldValue := lVisible
IF HB_IsLogical(xNewValue)
lVisible := xNewValue
ENDIF
EXIT
ENDSWITCH
RETURN xOldValue
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
RadioGroup can be MULTILINE
Nice one ! I liked much and I confess that I have not taken the real care of it. Very important and useful.
Thank you Krzysztof for your explanation. I have shared this experience in another forum denoting the STATIC importance.
Have you got any other successful result with RadioGroup (horizontal) using original source of c_radio.c function with my last demo code ?
Thank you Krzysztof for your explanation. I have shared this experience in another forum denoting the STATIC importance.
Have you got any other successful result with RadioGroup (horizontal) using original source of c_radio.c function with my last demo code ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: RadioGroup can be MULTILINE
In my opinion what could be changed/added/improved in RadioGroup:
#1
While initialization of the control, WS_TABSTOP style should be set for the selected item (VALUE). Now is set for the first item.
#2
Add GAP parameter in control definition as alternative to SPACING (SPACING | GAP)
GAP will be the gap between items.
#3
Add HEIGHT parameter.
It can be numeric type for fixed height of items or an array for variable height of items.
If HEIGHT is not specified, the items should be adjusted to the text height.
#4
Change WIDTH parameter.
It can be numeric type for fixed width of items (as now) or an array for variable width of items.
#5
Add MULTILINE parameter (lMultiLine | alMultiLine).
#1
While initialization of the control, WS_TABSTOP style should be set for the selected item (VALUE). Now is set for the first item.
#2
Add GAP parameter in control definition as alternative to SPACING (SPACING | GAP)
GAP will be the gap between items.
#3
Add HEIGHT parameter.
It can be numeric type for fixed height of items or an array for variable height of items.
If HEIGHT is not specified, the items should be adjusted to the text height.
#4
Change WIDTH parameter.
It can be numeric type for fixed width of items (as now) or an array for variable width of items.
#5
Add MULTILINE parameter (lMultiLine | alMultiLine).
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
RadioGroup can be MULTILINE
Good ideas for a very versatile RadioGroup.
I will try to do it.
Thank you Krzysztof for your recommendantions.
I will try to do it.
Thank you Krzysztof for your recommendantions.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: RadioGroup can be MULTILINE
Very smart ideas in my opinion!
Dzięki, Krzysztof
Dzięki, Krzysztof