//
// 和暦・西暦年号変換
//
// @copyright	(c)studio pahoo
// @author		パパぱふぅ
//

#include <windows.h>
#include <commctrl.h>
#include <richedit.h>
#include "resource.h"

//
// アプリケーション・ダイアログ
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_MAIN DIALOGEX 0, 0, 530, 300
STYLE DS_SETFONT | WS_CAPTION | WS_VISIBLE | WS_SYSMENU | WS_MINIMIZEBOX
CAPTION "和暦・西暦年号変換"
MENU IDR_MENU
FONT 10, "MS UI Gothic", 0, 0, 1
{
	LTEXT		"元のテキスト", IDC_TEXT_SOUR, 10, 10, 80, 15, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT
	CONTROL		"", IDC_EDIT_SOUR, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN | ES_NOHIDESEL, 10, 25, 250, 160, WS_EX_LEFT
	LTEXT		"変換後テキスト", IDC_TEXT_DEST, 270, 10, 80, 15, NOT WS_GROUP | SS_LEFT, WS_EX_LEFT
	CONTROL		"", IDC_EDIT_DEST, RICHEDIT_CLASS, WS_TABSTOP | WS_BORDER | ES_MULTILINE | ES_WANTRETURN | ES_NOHIDESEL, 270, 25, 250, 160, WS_EX_LEFT

	DEFPUSHBUTTON	"変換", IDC_BUTTON_EXEC, 10, 190, 35, 15, 0, WS_EX_LEFT
	PUSHBUTTON	"リセット", IDC_BUTTON_RESET, 50, 190, 35, 15, 0, WS_EX_LEFT
	PUSHBUTTON	"コピー", IDC_BUTTON_COPY, 270, 190, 35, 15, 0, WS_EX_LEFT
	PUSHBUTTON	"保存", IDC_BUTTON_SAVE, 310, 190, 35, 15, 0, WS_EX_LEFT

	GROUPBOX	"変換方式", IDC_GROUP_MODE, 10, 215, 250, 27, 0, WS_EX_LEFT
	CONTROL		"西暦に統一", IDC_RADIO_MODE_AD, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP, 30, 222, 60, 14, WS_EX_LEFT
	CONTROL		"和暦に統一", IDC_RADIO_MODE_ERA, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 100, 222, 60, 14, WS_EX_LEFT
	CONTROL		"西暦(和暦)", IDC_RADIO_MODE_ADERA, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 170, 222, 60, 14, WS_EX_LEFT

	GROUPBOX	"変換範囲", IDC_GROUP_SCOPE, 10, 250, 250, 27, 0, WS_EX_LEFT
	CONTROL		"奈良時代以降", IDC_RADIO_SCOPE_1, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP, 30, 257, 60, 14, WS_EX_LEFT
	CONTROL		"新暦以降", IDC_RADIO_SCOPE_2, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 100, 257, 60, 14, WS_EX_LEFT
	CONTROL		"変換しない", IDC_RADIO_SCOPE_0, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 170, 257, 60, 14, WS_EX_LEFT

	GROUPBOX	"数字変換（西暦）", IDC_GROUP_AD, 270, 215, 250, 27, 0, WS_EX_LEFT
	CONTROL		"半角数字", IDC_RADIO_AD_HAN, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP, 290, 222, 45, 14, WS_EX_LEFT
	CONTROL		"全角数字", IDC_RADIO_AD_ZEN, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 340, 222, 45, 14, WS_EX_LEFT
	CONTROL		"漢数字(単純)", IDC_RADIO_AD_KAN1, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 390, 222, 60, 14, WS_EX_LEFT
	CONTROL		"漢数字", IDC_RADIO_AD_KAN2, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 450, 222, 45, 14, WS_EX_LEFT

	GROUPBOX	"数字変換（和暦）", IDC_GROUP_ERA, 270, 250, 250, 27, 0, WS_EX_LEFT
	CONTROL		"半角数字", IDC_RADIO_ERA_HAN, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_GROUP, 290, 257, 45, 14, WS_EX_LEFT
	CONTROL		"全角数字", IDC_RADIO_ERA_ZEN, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 340, 257, 45, 14, WS_EX_LEFT
	CONTROL		"漢数字(単純)", IDC_RADIO_ERA_KAN1, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 390, 257, 60, 14, WS_EX_LEFT
	CONTROL		"漢数字", IDC_RADIO_ERA_KAN2, "BUTTON", WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON, 450, 257, 45, 14, WS_EX_LEFT

}

//
// メニュー
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDR_MENU MENU {
	POPUP "ファイル(&F)" {
		MENUITEM "開く(&O)", IDM_OPEN
		MENUITEM "変換(&N)", IDM_EXEC
		MENUITEM "保存(&S)", IDM_SAVE
		MENUITEM "終了(&Q)", IDM_QUIT
	}
	POPUP "編集(&E)" {
		MENUITEM "コピー(&C)", IDM_COPY
		MENUITEM "リセット(&X)", IDM_RESET
	}
	POPUP "ヘルプ(&H)" {
		MENUITEM "ヘルプ(&H)", IDM_HELP
		MENUITEM "バージョン情報(&V)", IDM_VERSION
		MENUITEM SEPARATOR
		MENUITEM "設定クリア＋終了", IDM_CLEAR_PARAMETER
		MENUITEM SEPARATOR
		MENUITEM "技術情報サイト(&P)", IDM_PAHOO
	}
}

//
// バージョン・ダイアログ
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG_VER DIALOG 0, 0, 260, 180
STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | WS_CAPTION | WS_VISIBLE | WS_POPUP | WS_SYSMENU
CAPTION "バージョン情報"
FONT 10, "MS UI Gothic"
{
	LTEXT			"", IDC_TEXT_HELP, 10, 10, 240, 180, SS_LEFT, WS_EX_LEFT
	DEFPUSHBUTTON	"OK", IDC_BUTTON_OK, 95, 155, 50, 14, 0, WS_EX_LEFT
}

//
// アイコン
//
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDI_ICON	ICON	".\\application.ico"
