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
 how to create two or more user dialogs boxes?

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
malkovich Posted - 09/20/2013 : 09:44:41 AM
Origin Ver. 8.5G and Service Release SR1 (Select Help-->About Origin):
Operating System: Windows7 SP1 64bit

In some of my origin-C programs I use a custom dialog to get input from the user. I use the global function GetNBox(...) and the macros GETN_<...> to create these dialogs. This works fine but sometimes I want to create two or more dialogs within one function. The first dialog will get some input from the user and depending on that input I want a second dialog that asks for more input. The second dialog looks different to the first one and looks also different depending on what the user entered into the first dialog.
As far as I know the GETN_ macros can't be used more than once within one function. So is there a chance to realize multiple dialogs within one function somehow?

Thanks for help!
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 09/29/2013 : 10:49:39 PM
Hi,

You can try to make one function for one dialog, and then call these functions accordingly. For example:

void GETN_ex()
{
	GETN_TREE(tr)
		GETN_STR(type, "Type", "Name")
	GetNBox(tr, NULL, NULL, NULL, NULL);
	
	string strType = tr.type.strVal;
	if(strType == "Name")  // If input is "Name", open the dialog for name
	{
		Tree tr;
		tr = GETN1();
		out_tree(tr);
	}
	else if(strType == "Age")  // If input is "Age", open the dialog for age
	{
		Tree tr;
		tr = GETN2();
		out_tree(tr);
	}
}
 
Tree GETN1()
{
	GETN_TREE(tr)
		GETN_STR(name, "Name", "Jacky")
	GetNBox(tr, NULL, NULL, NULL, NULL);
	return tr;
}

Tree GETN2()
{
	GETN_TREE(tr)
		GETN_NUM(age, "Age", 31)
	GetNBox(tr, NULL, NULL, NULL, NULL);
	return tr;
}


Penn

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