• ORBITER-FORUM will be temporarily closed at 2026-07-23 18:00 UTC while we complete some OF maintenance tasks. The amount of downtime is expected to take up to one hour, but probably less.

SDK Question How to make scenario editor page go back

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,303
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
I don't know what's going on here especially since it was working before. I have a << Done button on a scenario editor page, but it's not going back to the scenario editor. Here's my .rc file:
Code:
IDD_DIALOG1 DIALOGEX 2, 2, 309, 225
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "<< Done",IDC_BACK,7,204,50,14
    COMBOBOX        IDC_COMBO1,48,7,48,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP
    LTEXT           "Type:",IDC_STATIC,7,7,20,8
    PUSHBUTTON      "Deploy Arrays",IDC_BUTTON1,18,65,52,14
    GROUPBOX        "Solar Truss Animations:",IDC_STATIC,7,51,81,96
    PUSHBUTTON      "Retract Arrays",IDC_BUTTON2,18,79,52,14
    PUSHBUTTON      "Reset Tracking",IDC_BUTTON3,18,103,51,14
    GROUPBOX        "Radiator Animations:",IDC_STATIC,94,52,74,95
    PUSHBUTTON      "Extend Panels",IDC_BUTTON4,103,66,51,14
    PUSHBUTTON      "Retract Panels",IDC_BUTTON5,103,81,51,14
    CONTROL         "STS (Type 2 only)",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,54,73,10
END
The button in question is the first one, which I noticed is defined as a "DEFPUSHBUTTON" instead of the normal "PUSHBUTTON." Here's my page callback edited down a bit for readability:
Code:
BOOL CALLBACK EdPg2Proc (HWND hTab, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg) 
	{
	case WM_INITDIALOG:
		{


		}
		break;
	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDC_COMBO1:
			if(HIWORD(wParam) == CBN_CLOSEUP)
			{
				
			}
			break;
		case IDC_COMBO2:
			if(HIWORD(wParam)==CBN_CLOSEUP)
			{

				
			}
		case IDC_BUTTON1:
			{
				
			}
			return TRUE;
			break;
		case IDC_BACK:
			{
				oapiWriteLog("BACK!");
			}
			break;
		default:
			break;
		}
	default:
		break;
	}
	return oapiDefDialogProc(hTab,uMsg,wParam,lParam);
}
Under the case IDC_BACK line, I also had oapiCloseDlg(hTab); but that did nothing, the oapiWriteLog was just there in this latest iteration to provide a break point to the debugger.

What do I need to do to fix the behavior of this button?
 
Last edited:
Well it's still not fixed of course. Does anyone know if the value of IDC_BACK makes a difference? The DG for instance defines IDC_Back as 1003, but my IDC_BACK was originally 1004, but because 1004 was shared by a number of other IDC_... tags, but I fixed that and made them unique, but it still doesn't work.
 
Back
Top