Sign in to follow this  
Guest BBryant

Newbie Panel Design Question

Recommended Posts

I'll get the code out of the way now and ask questions after.Airspeed.c://Airspeed.c#define GAUGE_NAME Airspeed// Set up gauge headerchar airspeed_gauge_name[] = GAUGE_NAME;extern PELEMENT_HEADER airspeed_list;extern MOUSERECT airspeed_mouse_rect[];GAUGE_HEADER_FS700(GAUGE_W, airspeed_gauge_name, &airspeed_list, airspeed_mouse_rect, 0, 0, 0, 0);#define GAUGE_CHARSET DEFAULT_CHARSET#define GAUGE_FONT_DEFAULT "Courier New"#define GAUGE_WEIGHT_DEFAULT FW_NORMAL/////////////////////////////////////////////////////////////////////////////FAILURE_RECORD airspeed_fail[] ={ {FAIL_GAUGE_AIRSPEED, FAIL_ACTION_NONE}, {FAIL_NONE, FAIL_ACTION_NONE}};FLOAT64 FSAPI airspeed_string_cb( PELEMENT_STRING pelement ){ FLOAT64 val = pelement->source_var[0].var_value.n; val *= 256; if( pelement->source_var[1].var_value.n == ENGLISH_UNITS ) val = val*9/5 +32; // limit var if ( val > 999 ) val = 999.0; else if( val < -99 ) val = -99; wsprintf(pelement->string, "%3d", (UINT32)val); return val;}MAKE_STRING( airspeed_string, NULL, airspeed_fail, IMAGE_USE_ERASE | IMAGE_USE_BRIGHT, 0, 2, 2, 71, 11, 3, AIRSPEED, DISPLAY_UNITS, MODULE_VAR_NONE, RGB(255,0,0), RGB(0,0,0), RGB(92,92,92), GAUGE_FONT_DEFAULT, GAUGE_WEIGHT_DEFAULT, GAUGE_CHARSET, 0, DT_CENTER | DT_VCENTER | DT_SINGLELINE, NULL, airspeed_string_cb)PELEMENT_HEADER airspeed_string_list = &airspeed_string.header;/////////////////////////////////////////////////////////////////////////////MAKE_STATIC( airspeed_background, BMP_AIRSPEED_BACKGROUND, &airspeed_string_list, NULL, IMAGE_USE_TRANSPARENCY, 0, 0,0)PELEMENT_HEADER airspeed_list = &airspeed_background.header;/////////////////////////////////////////////////////////////////////////////MOUSE_BEGIN( airspeed_mouse_rect, HELPID_GAUGE_AIRSPEED, 0, 0 )MOUSE_END/////////////////////////////////////////////////////////////////////////////#undef GAUGE_NAME#undef GAUGEHDR_VAR_NAME#undef GAUGE_WPanel.cfg excerpt (Default c172 with the bottom radiostack gauge taken out and my gauge in. Gauge is named SDK.gau.[Window01]BACKGROUND_COLOR=2,2,2size_mm=156,308position=8visible=0ident=RADIO_STACK_PANELgauge00=Bendix_King_Radio!Bendix-King Radio Audio, 0, 0gauge01=Bendix_King_Radio!Bendix-King Radio Nav-Comm 1, 0, 29gauge02=Bendix_King_Radio!Bendix-King Radio Nav-Comm 2, 0, 86gauge03=Bendix_King_Radio!Bendix-King Radio ADF, 0, 142gauge04=Bendix_King_Radio!Bendix-King Radio DME, 0, 180gauge05=Bendix_King_Radio!Bendix-King Radio Xpndr, 0, 217gauge06=SDK!Airspeed,0,262,70,15//gauge06=Bendix_King_Radio!Bendix-King Radio AP,0,262,70,15Attached is the background .BMP I am using. It is defined as 0x2602, and specified in the resource file.Now for the problem; It won't show up. The background bmp, which is a black box with a small white border, nor the supposedly red text, just plain won't show up. Any ideas?Thank you,

Share this post

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

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