/**************************************************************************/ /*** SCICALC Scientific Calculator for Windows 3.00.12 ***/ /*** By Kraig Brockschmidt, Microsoft Co-op, Contractor, 1988-1989 ***/ /*** (c)1989 Microsoft Corporation. All Rights Reserved. ***/ /*** ***/ /*** sciset.c ***/ /*** ***/ /*** Functions contained: ***/ /*** SetRadix--Changes the number base and the radiobuttons. ***/ /*** SetBox--Handles the checkboxes for inv/hyp. ***/ /*** ***/ /*** Functions called: ***/ /*** none ***/ /*** ***/ /*** History: *** 12-Dec-1996 JonPa - Added SetMaxIntDigits *** Whenever-97 ToddB - Removed SetMaxIntDigits ***/ /**************************************************************************/ #include "scicalc.h" #include "unifunc.h" extern TCHAR szBlank[6]; extern INT gcIntDigits; extern TCHAR *rgpsz[CSTRINGS]; extern TCHAR szDec[]; extern RECT rcDeg[6]; extern HMENU g_hDecMenu; extern HMENU g_hHexMenu; long oldRadix = (unsigned)-1; void ActivateButtons() { static int aDecOnlyKeys[] = { IDC_FE, IDC_DMS, IDC_SIN, IDC_COS, IDC_TAN, IDC_EXP, IDC_PI }; // controls used only in Decimal mode if (oldRadix != nRadix) { int i; BOOL bDecMode = (nRadix == 10); // Only send messages to the the "Decimal Only keys" if this change in // base effects those keys if ((oldRadix == 10) || bDecMode) { // we are changing to or from decimal mode for ( i = 0; i <= ARRAYSIZE(aDecOnlyKeys) ; i++ ) { EnableWindow( GetDlgItem(g_hwndDlg, aDecOnlyKeys[i]), bDecMode ); } } // insure that nRadix is within the allowed range ASSERT( (nRadix >= 2) && (nRadix <= 16) ); // turn on digit keys less than nRadix and turn off digit keys >= nRadix for (i=2; i