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 make a GETNBOX with dynamic numbers of Che

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
marco.zorcic Posted - 01/24/2007 : 07:58:52 AM
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
2   L A T E S T    R E P L I E S    (Newest First)
marco.zorcic Posted - 01/25/2007 : 05:44:08 AM
Hallo Zachary,

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

Thanks a lot!!!

zachary_origin Posted - 01/24/2007 : 1:19:12 PM
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.


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