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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 how to create two or more user dialogs boxes?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

malkovich

Germany
14 Posts

Posted - 09/20/2013 :  09:44:41 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!

Penn

China
644 Posts

Posted - 09/29/2013 :  10:49:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000