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
 Including variables in a dialog box

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
Voostra Posted - 03/16/2005 : 2:09:57 PM
So, I'm pretty new to this stuff and I'm trying to bodge a program together to autoformat a bunch of graphs..

I have most of it down, but I'm stuckt one point - I've gotten the min and max values for the x value column stored in double variables

Dataset ds(col);
double dMin, dMax;
ds.GetMinMax(dMin, dMax);

, and now I want to put up a dialog where the user can specify min and max value. I can get a dialog where you can enter numbers (using a GETN), and I've got it so the program takes the numbers you enter and uses those to set the x axis, but I can't find a way to have the text beside the dialog display the min and max value of the x column data.

My Getn is set up like this right now:

GETN_BOX(tr)
GETN_NUM(xmin, "Minimum m/z axis value", 0)
GETN_NUM(xmax, "Maximum m/z axis value", 2000)
if( GetNBox(tr, "Specify m/z axis range") )
-then is sets the x axis min and max values to xmin and xmax.


So, I want to have the text be like

Minimim m/z axis value (data starts at "dMin")

where dMin is the value I've got stored. I guess it would also work if the dMin and dMax values I have were put into the dialog as the default values too.

Make sense? Can anyone help me out here?

Thanks,
Evan
2   L A T E S T    R E P L I E S    (Newest First)
Voostra Posted - 03/16/2005 : 3:35:03 PM
Sweet! Thanks
easwar Posted - 03/16/2005 : 2:34:21 PM
Hi Evan,

You can bring up the dialog with the values of dMin, dMax shown inside the edit boxes as follows:


GETN_BOX(tr)
GETN_NUM(xmin, "Minimum m/z axis value", dMin)
GETN_NUM(xmax, "Maximum m/z axis value", dMax)
if( GetNBox(tr, "Specify m/z axis range") )
{
}



If on the other hand you want the value to be part of the string, you can do the following:


string strMin, strMax;
strMin.Format("Min m/z axis value (%5.2f)", dMin);
strMax.Format("Max m/z axis value (%5.2f)", dMax);

GETN_BOX(tr)
GETN_NUM(xmin, strMin, 0)
GETN_NUM(xmax, strMax, 2000)
if( GetNBox(tr, "Specify m/z axis range") )
{
}



Of course you can do both, in which case, the line would look like:

strMin.Format("Min m/z axis value (%5.2f)", dMin);
strMax.Format("Max m/z axis value (%5.2f)", dMax);

GETN_BOX(tr)
GETN_NUM(xmin, strMin, dMin)
GETN_NUM(xmax, strMax, dMax)



Easwar
OriginLab



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