Example #1
0
static void InitializeControls (HWND hwnd)
{
   char *szMin = "0";
   HWND hwndCkpNumber = GetDlgItem (hwnd, IDC_AUDITDB_CKP_NUMBER);
   SubclassAllNumericEditControls (hwnd, EC_SUBCLASS);

   Edit_LimitText (hwndCkpNumber, 10);
   Edit_SetText   (hwndCkpNumber, szMin);
   LimitNumericEditControls (hwnd);
}
Example #2
0
static void OnDestroy(HWND hwnd)
{
	HLOCAL hmem = GetProp(hwnd, SZINFODEF);
	SetOIVers(oldIngresVer); // restore the Ingres Version stored on InitDialog

	SubclassAllNumericEditControls(hwnd, EC_RESETSUBCLASS);
	if (hmem)
	{
		LocalFree(hmem);
		RemoveProp(hwnd, SZINFODEF);
	}

	if (GetProp(hwnd, szErrorProp) != 0)
		RemoveProp(hwnd, szErrorProp);
	lpHelpStack = StackObject_POP (lpHelpStack);
}
Example #3
0
static void OnDestroy(HWND hwnd)
{
   SubclassAllNumericEditControls (hwnd, EC_RESETSUBCLASS);
   DeallocDlgProp(hwnd);
   lpHelpStack = StackObject_POP (lpHelpStack);
}
Example #4
0
static BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
	HWND hwndTempDoc;
	HLOCAL hmem = LocalAlloc(LHND, sizeof(infoDefaults));
	LPSTRUCTINFO lpinfo = hmem ? LocalLock(hmem) : NULL;

	if (!lpinfo)
	{
		if (hmem)
			LocalFree(hmem);
		EndDialog(hwnd, -1);
		return TRUE;
	}

	// Since we modify infoDefaults, make a copy of it for each instance
	// of the dialog
	oldIngresVer = GetOIVers();
	SetProp(hwnd, SZINFODEF, hmem);
	_fmemcpy(lpinfo, infoDefaults, sizeof(infoDefaults));
	if (oldIngresVer >= OIVERS_30)
	{
		int i =0;
		for (i=0; i<4; i++)
		{
			lpinfo[i].nRowWidth = MAX_ROW_WIDTH_R3;
		}
	}
	LocalUnlock(hmem);

	hwndTempDoc = GetWindow(hwndMDIClient, GW_CHILD);
	if (hwndTempDoc)
	{
		if (GetOIVers()>=OIVERS_26) {
			BOOL bResult = SQLGetPageTypesPerTableTypes(GetVirtNodeName(GetCurMdiNodeHandle ()), pagetypespertabletypes);
			if (!bResult) {
				MessageWithHistoryButton(GetFocus(), ResourceString(IDS_E_CONNECTION_FAILED));
				EndDialog(hwnd, -1);
				return TRUE;
			}
			if (PAGE_TYPE_V1 != 1 || PAGE_TYPE_V2 != 2 || PAGE_TYPE_V3 != 3 || PAGE_TYPE_V4 !=4 || PAGE_TYPE_V6 != 6 || PAGE_TYPE_V7 != 7) {
				myerror(ERR_INGRESPAGES); /* the parsing of dm34 trace output (in parse.cpp) assumes V1 == 1 V2 == 2 etc... */
				EndDialog(hwnd, -1);
				return TRUE;
			}
			Button_SetCheck (GetDlgItem (hwnd, IDC_TYPE_TABLE), TRUE);
		}
		if (GetOIVers()>=OIVERS_30)
			RetrieveTupLen4PageSize();
}
	else
	{
		oldIngresVer = SetOIVers(OIVERS_90); // Simulate the current Ingres version 9.0
		Button_SetCheck (GetDlgItem (hwnd, IDC_TYPE_TABLE), TRUE);
		pagetypespertabletypes [0]  = PAGE_TYPE_V1;
		pagetypespertabletypes [1]  = PAGE_TYPE_V3;
		pagetypespertabletypes [2]  = PAGE_TYPE_V3;
		pagetypespertabletypes [3]  = PAGE_TYPE_V3;
		pagetypespertabletypes [4]  = PAGE_TYPE_V3;
		pagetypespertabletypes [5]  = PAGE_TYPE_V3;
		pagetypespertabletypes [6]  = PAGE_TYPE_V1;
		pagetypespertabletypes [7]  = PAGE_TYPE_V4;
		pagetypespertabletypes [8]  = PAGE_TYPE_V4;
		pagetypespertabletypes [9]  = PAGE_TYPE_V4;
		pagetypespertabletypes [10] = PAGE_TYPE_V4;
		pagetypespertabletypes [11] = PAGE_TYPE_V4;
		if (bContinueShowMessage)
		{
			if (MSGContinueBox (ResourceString(IDS_W_CALCULATION_WITH_DEFAULT)))
				bContinueShowMessage = FALSE;
		}
	}

	// Force the catospin.dll to load
	SpinGetVersion();

	if (!OccupyStructureControl(hwnd) || !OccupyPageSizeControl(hwnd))
	{
		EndDialog(hwnd, -1);
		return TRUE;
	}
	if (GetOIVers() >= OIVERS_20)
		lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_OIV2_SPACECALC));
	else
		lpHelpStack = StackObject_PUSH (lpHelpStack, StackObject_INIT ((UINT)IDD_SPACECALC));

	SubclassAllNumericEditControls(hwnd, EC_SUBCLASS);

	InitialiseSpinControls(hwnd);
	InitialiseEditControls(hwnd);
	UpdateControls(hwnd,TRUE);
	DoCalculation(hwnd);
	richCenterDialog(hwnd);
	return TRUE;
}