示例#1
0
文件: ui.c 项目: Rodeo314/EZPushback
void show_button()
{
    if (ui_button_wid) {
        XPShowWidget(ui_button_wid);
        // debug("show button");
    }
}
示例#2
0
文件: main.c 项目: rhaamo/xpudpng
/* Handle the Menu */
void AboutMenuHandler(void *inMenuRef, void *inItemRef)
{
	switch ( (int)inItemRef )
	    {
	    case 1:
		    if (gMenuItem == 0) {
			    CreateAboutWidget(50, 900, 500, 250); /* left, top, right, bottom */
			    gMenuItem = 1;
		    } else {
			    if(!XPIsWidgetVisible(AboutWidget))
				    XPShowWidget(AboutWidget);
		    }
		    break;
	    }
}
示例#3
0
文件: ui.c 项目: Rodeo314/EZPushback
void show_dialog()
{
    if (ui_dialog_wid) {
        if (ui_dialog_open) {
            hide_dialog();
        }

        if (ui_dialog_x == UI_POSITION_DEFAULT || ui_dialog_y == UI_POSITION_DEFAULT) {
            set_dialog_default_position();
        }
        else if (!dialog_is_on_screen()) {
            debug("dialog is off screen");
            set_dialog_default_position();
        }

        XPShowWidget(ui_dialog_wid);
        XPBringRootWidgetToFront(ui_dialog_wid);
        // debug("showing dialog");
        ui_dialog_open = 1;
    }
}
示例#4
0
void MyHandleMenuCallback(void *inMenuRef, void *inItemRef)
{
    int item = (long) inItemRef;
    //char airport[32];
    
    if (item == 0 || item == 2)
        GetDepartureAirportId(icaoCode);
    else
        GetDestinationAirportId(icaoCode);
    
    //icaoCode = airport;
    XPLMDebugString(icaoCode);
    
    if (item == 0 || item == 1)
        requestType = REQUEST_ATIS;
    else
        requestType = REQUEST_METAR;
    
    pthread_t tid;
    pthread_create(&tid, NULL, PullUrl, NULL);
    
    XPShowWidget(mainWindow);
}
示例#5
0
void	RF_ShowPrefsDialog(void)
{
	if (sPrefsDialog == NULL)
	{
		sPrefsDialog = XPCreateWidgetLayout(
			0, XP_DIALOG_BOX, "Preferences", XP_DIALOG_CLOSEBOX, 1, 0, NULL,
				XP_COLUMN,
					XP_TABS, "Processing;View;Mesh;DEMs;DSF;Roads", &sPrefsTab,
						XP_COLUMN, XP_TAG, TAG_COMMAND_PREFS,
							XP_ROW, XP_CHECKBOX,"Calculate Terrain Slope", 		&gProcessingCmdPrefs.do_calc_slope, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Upsample Environment", 		&gProcessingCmdPrefs.do_upsample_environment, 	XP_END,
							XP_ROW, XP_CHECKBOX,"Hydro-Correct", 				&gProcessingCmdPrefs.do_hydro_correct, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Simplify Coastlines", 			&gProcessingCmdPrefs.do_hydro_simplify, 		XP_END,
							XP_ROW, XP_CHECKBOX,"Calculate Derived Raster Data",&gProcessingCmdPrefs.do_derive_dems, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Add Urban Roads",				&gProcessingCmdPrefs.do_add_urban_roads, 		XP_END,
							XP_ROW, XP_CHECKBOX,"Pick Road Types", 				&gProcessingCmdPrefs.do_build_roads, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Process Airports", 			&gProcessingCmdPrefs.do_airports, 				XP_END,
							XP_ROW, XP_CHECKBOX,"Do Zoning", 					&gProcessingCmdPrefs.do_zoning, 				XP_END,
							XP_ROW, XP_CHECKBOX,"Create Hi Res Mesh", 			&gProcessingCmdPrefs.do_triangulate, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Apply Terrain To Mesh", 		&gProcessingCmdPrefs.do_assign_landuse, 		XP_END,
							XP_ROW, XP_CHECKBOX,"Instantiate Forests",	 		&gProcessingCmdPrefs.remove_duplicate_objs, 	XP_END,
							XP_ROW, XP_CHECKBOX,"Remove Duplicate Features", 	&gProcessingCmdPrefs.build_3d_forests, 			XP_END,
							XP_ROW, XP_CHECKBOX,"Instantiate Face Objects", 	&gProcessingCmdPrefs.place_buildings, 			XP_END,
							XP_ROW, XP_BUTTON_ACTION, "Restore Default Processing Options", RestoreDefaultProcessing, XP_END,
						XP_END,
						XP_COLUMN,
							XP_ROW, XP_CAPTION, "Sun Azimuth", XP_EDIT_FLOAT, 6, 6, 0, &sShadingAzi, XP_END,
							XP_ROW, XP_CAPTION, "Sun Declination", XP_EDIT_FLOAT, 6, 6, 0, &sShadingDecl, XP_END,
						XP_END,
						XP_COLUMN,
							XP_ROW, XP_CAPTION, "Max Points:", XP_EDIT_INT, 15, 6, &gMeshPrefs.max_points, XP_END,
							XP_ROW, XP_CAPTION, "Max Error:", XP_EDIT_FLOAT, 15, 6, 1, &gMeshPrefs.max_error, XP_END,
							XP_ROW, XP_CAPTION, "Max Tri Size m:", XP_EDIT_FLOAT, 15, 6, 1, &gMeshPrefs.max_tri_size_m, XP_END,
							XP_ROW, XP_CAPTION, "Change Tex Length", XP_EDIT_FLOAT, 15, 6, 1, &gMeshPrefs.rep_switch_m, XP_END,
							XP_ROW, XP_CHECKBOX, "Match Borders", &gMeshPrefs.border_match, XP_END,
							XP_ROW, XP_CHECKBOX, "Optimize Transition Tris", &gMeshPrefs.optimize_borders, XP_END,
						XP_END,
						XP_COLUMN,
							XP_ROW, XP_CAPTION, "Local Area Search(1-8):", XP_EDIT_INT, 5, 5, &gDemPrefs.local_range, XP_END,
							XP_ROW, XP_CAPTION, "Temperature Elevation Calibration(0-1):", XP_EDIT_FLOAT, 5, 5, 1, &gDemPrefs.temp_percentile, XP_END,
							XP_ROW, XP_CAPTION, "Rain Variation(0-1):", XP_EDIT_FLOAT, 5, 5, 1, &gDemPrefs.rain_disturb, XP_END,
						XP_END,
						XP_COLUMN,
							XP_ROW, XP_CHECKBOX, "Export Roads", &gDSFBuildPrefs.export_roads, XP_END,
						XP_END,
						XP_COLUMN,
							XP_ROW, XP_CAPTION, "Road Elevation Sensitivity", XP_EDIT_FLOAT, 6, 6, 2, &gRoadPrefs.elevation_weight, XP_END,
							XP_ROW, XP_CAPTION, "Road Radial Sensitivity", XP_EDIT_FLOAT, 6, 6, 2, &gRoadPrefs.radial_weight, XP_END,
							XP_ROW, XP_CAPTION, "Road Slope Sensitivity", XP_EDIT_FLOAT, 6, 6, 2, &gRoadPrefs.slope_amp, XP_END,
							XP_ROW, XP_CAPTION, "Road Urban Density Sensitivity", XP_EDIT_FLOAT, 6, 6, 2, &gRoadPrefs.density_amp, XP_END,

						XP_END,
					XP_END,
					XP_ROW, XP_BUTTON_CANCEL, "Cancel", XP_BUTTON_OK, "OK", XP_END,
				XP_END,
			XP_END);
	}
	if (XPIsWidgetVisible(sPrefsDialog))
		XPBringRootWidgetToFront(sPrefsDialog);
	else {
		XPSendMessageToWidget(sPrefsDialog, xpMsg_DataToDialog, xpMode_Recursive, 0, 0);
		XPShowWidget(sPrefsDialog);
	}
}