Sign in to follow this  
Guest Patrick_Waugh

Help with MAKE_STRING

Recommended Posts

Having never tried this before, I'm not sure what I'm doing wrong with this macro.#define GAUGE_CHARSET DEFAULT_CHARSET#define GAUGE_FONT_DEFAULT "Courier New"#define GAUGE_WEIGHT_DEFAULT FW_NORMAL CHAR atcID[] = "N001ST";FLOAT64 FSAPI string_cb( PELEMENT_STRING pelement ){ sprintf( pelement->string, "%s", atcID ); return 0;}MAKE_STRING( bac_id_string, NULL, NULL, IMAGE_USE_ERASE | IMAGE_USE_BRIGHT, 0, 2, 1, 87, 24, 6, MODULE_VAR_NONE, MODULE_VAR_NONE, MODULE_VAR_NONE, RGB(112,144,144), RGB(0,0,0), RGB(92,92,92), GAUGE_FONT_DEFAULT, GAUGE_WEIGHT_DEFAULT, GAUGE_CHARSET, 18, DT_CENTER | DT_VCENTER | DT_SINGLELINE, NULL, string_cb)from my code. What am I doing wrong?Patrick

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Ok, I figured out I had to change the 18 to 0 to allow FS to auto compute the size.I guess if you manually set that, then you have to set the width parameter to be the width of a character vs. width of the background, but I'm still not sure.Patrick

Share this post


Link to post
Share on other sites

>Ok, I figured out I had to change the 18 to 0 to allow FS to>auto compute the size.>>I guess if you manually set that, then you have to set the>width parameter to be the width of a character vs. width of>the background, but I'm still not sure."Specifies the font size for the string. A value of zero (0) means scale so that NUMCHARS capital W's fit into SIZE_X. A non-zero FONT_SIZE means fixed height."I've always used a zero entry here so that the font will rescale automatically regardless of gauge drawing size, etc.

Share this post


Link to post
Share on other sites

Thanks Bill.I have a niffty little gauge now that displays my customer's licensed registered aircraft id, and when you mouse over it shows their software key. =)It's kind of cool because each aircraft I sell now will have a unique official aircraft registration number.Eventually, I'll be able to set this up to issue these automatically over the web too.Patrick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this