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 write code file from the GUI
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kineticesp

Colombia
12 Posts

Posted - 10/17/2008 :  11:57:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have a program that uses a GETN_BOX GUI to get parameters for the functions.
These parameters are GETN_NUM dVal type, and according to the syntax they are declared with default values.
I want to change these default values from the GUI itself, like change the value and click a checkbox that set this new value as the new default value.

Is it possible?

Thanks in advance

Iris_Bai

China
Posts

Posted - 10/29/2008 :  06:19:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

GetN support event function to handle this case, please see:

int testEvent(TreeNode& tr, int nRow, int nEvent, DWORD& dwEnables, LPCSTR lpcszNodeName, WndContainer& getNContainer, string& strAux, string& strErrMsg)
{

	TreeNode trN = tree_get_node(tr, nRow); // get changed tree node
	if( trN && trN.tagName == "test") 
	{
		tr.Value.dVal = trN.nVal;
	}

	return 0;//no error
}

void testGetNApplyButton()
{
	GETN_TREE(tr)
	GETN_CHECK(test, "Yes or No", 0)
	GETN_NUM(Value, "Value", 0)
	
	if( GetNBox(tr, testEvent) )
	{
		// enter here if click OK button
		out_tree(tr);
	}
}


Compile and run "testGetNApplyButton", click check box, Value control will be changed.

Iris
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