Ejemplo n.º 1
0
/*------------------------------------------------
  When changed "Locale" combobox
--------------------------------------------------*/
void OnLocale(HWND hDlg)
{
	int ilang;
	
	ilang = CBGetItemData(hDlg, IDC_LOCALE, CBGetCurSel(hDlg, IDC_LOCALE));
	InitAutoFormat(ilang);
	
	OnCustom(hDlg, FALSE);
}
Ejemplo n.º 2
0
/*------------------------------------------------
   Dialog Procedure for the "Format" page
--------------------------------------------------*/
INT_PTR CALLBACK PageFormatProc(HWND hDlg, UINT message,
	WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
		case WM_INITDIALOG:
			OnInit(hDlg);
			return TRUE;
		case WM_COMMAND:
		{
			WORD id, code;
			id = LOWORD(wParam); code = HIWORD(wParam);
			switch(id)
			{
				case IDC_LOCALE:
					if(code == CBN_SELCHANGE)
						OnLocale(hDlg);
					break;
				case IDC_FORMAT:
#if TC_ENABLE_SYSINFO
				case IDC_SYSII:
#endif
					if(code == EN_CHANGE)
						SendPSChanged(hDlg);
					break;
				case IDC_CUSTOM:
					OnCustom(hDlg, TRUE);
					break;
				case IDC_12HOUR:
					On12Hour(hDlg);
					break;
				case IDC_FORMATDETAIL:
					OnDetail(hDlg);
					break;
			}
			if(IDC_YEAR4 <= id && id <= IDC_AMPM)
				OnFormatCheck(hDlg, id);
			return TRUE;
		}
		case WM_NOTIFY:
			switch(((NMHDR *)lParam)->code)
			{
				case PSN_APPLY: OnApply(hDlg); break;
				case PSN_HELP: MyHelp(GetParent(hDlg), "Format"); break;
			}
			return TRUE;
	}
	return FALSE;
}
Ejemplo n.º 3
0
/*------------------------------------------------
  Initialize the "Format" page
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	HFONT hfont;
	char s[BUFSIZE_FORMAT];
	int i, ilang;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Format", g_hfontDialog);
	
	hfont = (HFONT)GetStockObject(SYSTEM_FIXED_FONT);
	if(hfont)
		SendDlgItemMessage(hDlg, IDC_FORMAT, WM_SETFONT, (WPARAM)hfont, 0);
	
	// "Locale" combobox
	ilang = GetMyRegLong("", "Locale", (int)GetUserDefaultLangID());
	InitLocaleCombo(hDlg, IDC_LOCALE, ilang); // common/combobox.c
	
	InitAutoFormat(ilang); // common/autoformat.c
	
	// "year" -- "second"
	for(i = IDC_YEAR4; i <= IDC_KAIGYO; i++)
	{
		CheckDlgButton(hDlg, i,
			GetMyRegLong("", ENTRY(i), TRUE));
	}
	
	if(IsDlgButtonChecked(hDlg, IDC_YEAR))
		CheckRadioButton(hDlg, IDC_YEAR4, IDC_YEAR, IDC_YEAR);
	if(IsDlgButtonChecked(hDlg, IDC_YEAR4))
		CheckRadioButton(hDlg, IDC_YEAR4, IDC_YEAR, IDC_YEAR4);
	
	if(IsDlgButtonChecked(hDlg, IDC_MONTH))
		CheckRadioButton(hDlg, IDC_MONTH, IDC_MONTHS, IDC_MONTH);
	if(IsDlgButtonChecked(hDlg, IDC_MONTHS))
		CheckRadioButton(hDlg, IDC_MONTH, IDC_MONTHS, IDC_MONTHS);
	
	// "Internet Time" -- "Customize format"
	for(i = IDC_AMPM; i <= IDC_CUSTOM; i++)
	{
		CheckDlgButton(hDlg, i,
			GetMyRegLong("", ENTRY(i), FALSE));
	}
	
	GetMyRegStr("", "Format", s, BUFSIZE_FORMAT, "");
	SetDlgItemText(hDlg, IDC_FORMAT, s);
	
	GetMyRegStr("", "CustomFormat", m_CustomFormat, BUFSIZE_FORMAT, "");
	
	On12Hour(hDlg);
	OnCustom(hDlg, FALSE);
	
#if TC_ENABLE_SYSINFO
	// "Update interval"
	UpDown_SetBuddy(hDlg, IDC_SYSIISPIN, IDC_SYSII);
	UpDown_SetRange(hDlg, IDC_SYSIISPIN, 60, 1);
	i = GetMyRegLong(NULL, "IntervalSysInfo", 4);
	if(i < 1 || 60 < i) i = 4;
	UpDown_SetPos(hDlg, IDC_SYSIISPIN, i);
#endif
	
	m_bInit = TRUE;
}
Ejemplo n.º 4
0
INT_PTR CALLBACK
VirtMemDlgProc(HWND hwndDlg,
               UINT uMsg,
               WPARAM wParam,
               LPARAM lParam)
{
    PVIRTMEM pVirtMem;

    UNREFERENCED_PARAMETER(lParam);

    pVirtMem = (PVIRTMEM)GetWindowLongPtr(hwndDlg, DWLP_USER);

    switch (uMsg)
    {
        case WM_INITDIALOG:
            pVirtMem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(VIRTMEM));
            if (pVirtMem == NULL)
            {
                EndDialog(hwndDlg, 0);
                return FALSE;
            }

            SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pVirtMem);

            OnInitDialog(hwndDlg, pVirtMem);
            break;

        case WM_DESTROY:
            OnDestroy(pVirtMem);
            break;

        case WM_COMMAND:
            switch (LOWORD(wParam))
            {
                case IDCANCEL:
                    EndDialog(hwndDlg, 0);
                    return TRUE;

                case IDOK:
                    OnOk(pVirtMem);
                    EndDialog(hwndDlg, pVirtMem->bModified);
                    return TRUE;

                case IDC_NOPAGEFILE:
                    OnNoPagingFile(pVirtMem);
                    return TRUE;

                case IDC_SYSMANSIZE:
                    OnSysManSize(pVirtMem);
                    return TRUE;

                case IDC_CUSTOM:
                    OnCustom(pVirtMem);
                    return TRUE;

                case IDC_SET:
                    OnSet(pVirtMem);
                    return TRUE;

                case IDC_PAGEFILELIST:
                    switch (HIWORD(wParam))
                    {
                        case LBN_SELCHANGE:
                            OnSelChange(hwndDlg, pVirtMem);
                            return TRUE;
                    }
                    break;
            }
            break;
    }

    return FALSE;
}