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
 Origin Forum
 Output GETN_BRANCH_OPTION

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
peter.cook Posted - 01/14/2006 : 09:14:14 AM
Origin Version (Select Help-->About Origin): 7.5 SR5
Operating System: Win2000

Hi,

Can anyone help?

I'm messing around with getn macro and one thing I want to do is to determine the state (collapsible) of a branch dependent on a variable. I can set this okay eg
if(Collapse==1) GETN_BRANCH_OPTION(GETN_BRANCH_OPEN)
but the next step is to save the state somehow on clicking the okay button eg to set the value of 'Collapse' variable.

Any clues?

Cheers,

Pete

1   L A T E S T    R E P L I E S    (Newest First)
TreeNode Posted - 11/06/2009 : 06:24:54 AM
Hi Pete!

I got busy myself with GetN macros, and think I understand something
about, how it works.
So perhabs I can helb you.

When putting: GETN_OPTION_BRANCH(GETN_BRANCH_OPEN)
in your code, there will be created an Attribute for this TreeNode, by calling method: SetAttribute()
You can then get this Attribute by using method: GetAttribute()

int save_state_collapsible_ex() {
	
	GETN_TREE(myTree)
 
	GETN_BEGIN_BRANCH(clientData, "Collapsible Branch")	GETN_OPTION_BRANCH(GETN_BRANCH_OPEN)
		GETN_STR(name, "Name", "Enter name")
		GETN_STR(adress, "Adress", "Enter adress")	 	 
		GETN_STR(contact, "Contact", "Enter contact")	 
	GETN_END_BRANCH(clientData)
 
	// This code will be execute when pressing "OK" button
	if( GetNBox(myTree, "Client Data", "Input client data") )	{
	
		int collap;
	
		if ( myTree.GetAttribute("Branch", collap) ) {	// dont know exactly if Attribute is named "Branch"
														// but you can check it in debug mode
			out_str("Found Attribute: " + collap);
			return collap;
		}
		else {
			out_str("Could not find Attribute!");
			return -1;
		}
	}
}


I dont know exactly how the Attribute is called. But you can check it
up in debug mode, viewing the TreeNode of your branch.
It has more than one Attributes. One is called "NodeID", another called "Label". And there must be created one, where the value of your collapsible option is saved.

You can get this value like in the example above. This method GetAttribute() awaits two parameters. The Attribute name, and a variable where to put the value.

The way how you export this value, and where, to use it for whatever you want it, you have to think about yourself! ;D

Hope I could help you!
greetz



<!-- helping each other is a good thing...like TreeNode holding the branches and leaves of a Tree -->

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