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 make a GETNBOX with dynamic numbers of Che
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

marco.zorcic

Germany
Posts

Posted - 01/24/2007 :  07:58:52 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5G Pro
Operating System:XP

Hallo,

i try to programming a dynamic Diloagbox with GetNBox.

I want to make a Dialog with between 2 - 8 Checkboxes. The number of the Checkboxes changed with the file which is currently open.

Is it possible to write something without if(....),
thats look like this:

GETN_BEGIN_BRANCH(SPara, "S-Parameter anzeigen")

if(iLauf<vsGlobalInfo.GetSize()){
GETN_CHECK(SParaS11, "S11", bGlobalSParaS11)
iLauf++;
}
if(iLauf<vsGlobalInfo.GetSize()){
GETN_CHECK(SParaS22, "S22", bGlobalSParaS22)
iLauf++;

}
if(iLauf<vsGlobalInfo.GetSize()){
GETN_CHECK(SParaS33, "S33", bGlobalSParaS33)
iLauf++;

}
.
.
.
.
//and so an....
GETN_END_BRANCH(SPara)
}





Edited by - marco.zorcic on 01/24/2007 11:08:26 AM

zachary_origin

China
Posts

Posted - 01/24/2007 :  1:19:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I am not sure what you exactly want to do. Do you mean you need create a dialog with several checkboxes and the number of the checkboxes are dynamic?

If it is, try the following code;

void test()
{

int nSize = 8; // int nSize = vsGlobalInfo.GetSize();

vector<bool> bGlobalS;
bGlobalS.SetSize(nSize);
bGlobalS= false;

int nCurNum = 0;
string strNodeName, strLabel;

GETN_TREE(testTree)
while (nCurNum < nSize)
{
strNodeName.Format("SParaS%d", nCurNum);
strLabel.Format("S%d", nCurNum);
_tmpSubNode = _tmpNode.AddNumericNode(bGlobalS[nCurNum], strNodeName, TRGP_CHECK);
TREE_ADD_LABEL(strLabel);
nCurNum ++;
}

if( GetNBox(testTree,"Test Check and Button","Test Check...", NULL, NULL) )
out_tree( testTree );

}



Zachary
OriginLab Technical Services.

Go to Top of Page

marco.zorcic

Germany
Posts

Posted - 01/25/2007 :  05:44:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hallo Zachary,

this is really excatly what i am searching for!!!!

Thanks a lot!!!

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