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
 Including variables in a dialog box
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Voostra

USA
Posts

Posted - 03/16/2005 :  2:09:57 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

easwar

USA
1965 Posts

Posted - 03/16/2005 :  2:34:21 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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


Go to Top of Page

Voostra

USA
Posts

Posted - 03/16/2005 :  3:35:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sweet! Thanks
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