The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 X-Function Radio Button - get value, use in event1

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
TreeNode Posted - 04/01/2010 : 11:00:46 AM
Origin Ver.8 SR6
Operating System: XP

Hi,

I want to use a "Radio Button" in X-Function, that controls - depending on selection - which
elements of the dialog are Enabled.

the method:
int my_xfunction_event1(TreeNode& trGetN, int nRow, int nEventID...
should check the selection of my "Radio Button", and then for example should
disable a "Combo Box" in my dialog.

I know how to disable the "Combo Box"...:

if(int nValueOfRadioButton == 0) // dont know how to get the current value of "Radio Button"
	bEnable = true;	         // in my_xfunction_event1 method
else
	bEnable = false;
	
	trGetN.combo.SetAttribute("Enable", bEnable);

... but I dont know how to get the integer value of my Input variable: int radio, Control: Radio: a|b|c
trGetN.radio.nVal (dVal, strVal) doesnt work, because node has no value. Could see that when viewing in debug mode.
And I cant find an Attribute where the current selection is stored.

I printed out all Attributes and its values of TreeNode trGetN.radio in my_function_event1,
and all values of Attributes stays the same, when switching "Radio Button" in dialog.

Can anybody help?

|-- TreeNode
...|-- a??
...|-- ha!!
2   L A T E S T    R E P L I E S    (Newest First)
TreeNode Posted - 04/07/2010 : 03:40:40 AM
Hi,

thank you for reply. Your example works fine.
I thought that I did it in the same way, so I didnt understood why it did not work.

Sadly I can not reproduce my mistake, because I deleted the code ;-/

I imagine that I used expression like : trGetN.tr.radio.nVal, because in other function
I used a GetN Tree with GETN_USE.

Because I remember that I received a error-message like:
"TreeNode doesnt exist, access denied". Perhabs that was my mistake.

Thank you very much for your help!

|-- TreeNode
...|-- a??
...|-- ha!!
Penn Posted - 04/01/2010 : 10:15:20 PM
Hi,

I have made a simple test with only a radio and a combo. In the body of _event1 function, the following code works.

int nRadio = trGetN.radio.nVal;  // get radio's value
out_int("radio=", nRadio);  // output radio's value
if(nRadio == 1)  // if the second option is selected
	trGetN.combo.Enable = false;  // disable combo
else
	trGetN.combo.Enable = true;  // other options, enable combo
return true;  // return true to update the dialog

I hope this can work in your computer too.

Penn
OriginLab Technical Services

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000