void SaveConfigDisplayAttr(int no)
{
    WCHAR num[64];

    if(no == 0)
    {
        WriterStartSection(pXmlWriter, SectionDisplayAttr);	//Start of SectionDisplayAttr
    }

    for(int i = 0; i < _countof(displayAttr[no]) && displayAttr[no][i].key != nullptr; i++)
    {
        _snwprintf_s(num, _TRUNCATE, displayAttrFormat,
                     displayAttr[no][i].se,
                     displayAttr[no][i].da.crText.type, displayAttr[no][i].da.crText.cr,
                     displayAttr[no][i].da.crBk.type, displayAttr[no][i].da.crBk.cr,
                     displayAttr[no][i].da.lsStyle, displayAttr[no][i].da.fBoldLine,
                     displayAttr[no][i].da.crLine.type, displayAttr[no][i].da.crLine.cr,
                     displayAttr[no][i].da.bAttr);
        WriterKey(pXmlWriter, displayAttr[no][i].key, num);
    }

    if(no == 1)
    {
        WriterEndSection(pXmlWriter);	//End of SectionDisplayAttr
    }
}
Exemple #2
0
INT_PTR CALLBACK DlgProcKeyMap(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam, int no)
{
	switch(message)
	{
	case WM_INITDIALOG:
		for(int i = 0; i < _countof(KeyMap[no]); i++)
		{
			LoadKeyMap(hDlg, KeyMap[no][i].idd, SectionName[no], KeyMap[no][i].keyName, KeyMap[no][i].defaultValue);
		}
		return TRUE;

	case WM_COMMAND:
		switch(LOWORD(wParam))
		{
		case IDC_EDIT_KANA:
		case IDC_EDIT_CONV_CHAR:
		case IDC_EDIT_JLATIN:
		case IDC_EDIT_ASCII:
		case IDC_EDIT_JMODE:
		case IDC_EDIT_ABBREV:
		case IDC_EDIT_AFFIX:
		case IDC_EDIT_NEXT_CAND:
		case IDC_EDIT_PREV_CAND:
		case IDC_EDIT_PURGE_DIC:
		case IDC_EDIT_NEXT_COMP:
		case IDC_EDIT_PREV_COMP:
		case IDC_EDIT_HINT:
		case IDC_EDIT_CONV_POINT:
		case IDC_EDIT_DIRECT:
		case IDC_EDIT_ENTER:
		case IDC_EDIT_CANCEL:
		case IDC_EDIT_BACK:
		case IDC_EDIT_DELETE:
		case IDC_EDIT_VOID:
		case IDC_EDIT_LEFT:
		case IDC_EDIT_UP:
		case IDC_EDIT_RIGHT:
		case IDC_EDIT_DOWN:
		case IDC_EDIT_PASTE:
		case IDC_EDIT_OTHERIME:
		case IDC_EDIT_VIESC:
			switch(HIWORD(wParam))
			{
			case EN_CHANGE:
				PropSheet_Changed(GetParent(hDlg), hDlg);
				return TRUE;
			default:
				break;
			}
			break;
		default:
			break;
		}
		break;

	case WM_NOTIFY:
		switch(((LPNMHDR)lParam)->code)
		{
		case PSN_APPLY:
			WriterStartSection(pXmlWriter, SectionName[no]);	//Start of SectionKeyMap or SectionVKeyMap

			for(int i = 0; i < _countof(KeyMap[no]); i++)
			{
				SaveKeyMap(hDlg, KeyMap[no][i].idd, KeyMap[no][i].keyName);
			}

			WriterEndSection(pXmlWriter);	//End of SectionKeyMap or SectionVKeyMap

			return TRUE;

		default:
			break;
		}
		break;

	default:
		break;
	}

	return FALSE;
}