Beispiel #1
0
/*------------------------------------------------
  initialize
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	char s[MAX_PATH];
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Misc", g_hfontDialog);
	
	CheckDlgButton(hDlg, IDC_NOCLOCK,
		GetMyRegLong(NULL, "NoClock", FALSE));
	
	CheckDlgButton(hDlg, IDC_MCIWAVE,
		GetMyRegLong(NULL, "MCIWave", FALSE));
	
	SetDlgItemInt(hDlg, IDC_DELAYSTART,
		GetMyRegLong(NULL, "DelayStart", 0), FALSE);
	
	CheckDlgButton(hDlg, IDC_TASKBARRESTART,
		GetMyRegLong(NULL, "TaskbarRestart", FALSE));
	
#if TC_ENABLE_DESKTOPICON
	CheckDlgButton(hDlg, IDC_DESKTOPICON,
		GetMyRegLong(NULL, "DeskTopIcon", FALSE));
	
	CheckDlgButton(hDlg, IDC_TRANSDESKTOPICONBK,
		GetMyRegLong(NULL, "TransDeskTopIconBK", FALSE));
#endif
	
	GetMyRegStr(NULL, "HelpURL", s, MAX_PATH, "");
	SetDlgItemText(hDlg, IDC_HELPURL, s);
	
	m_bInit = TRUE;
}
Beispiel #2
0
/*-------------------------------------------
  initialize main dialog
---------------------------------------------*/
void OnInitDialog(HWND hDlg)
{
	// common/tclang.c
	SetDialogLanguage(hDlg, "Property", g_hfontDialog);
	
	// hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_TCLOCK));
	// SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
	
	SetMyDialgPos(hDlg, 32, 32);
	
	InitTreeView(hDlg);
}
Beispiel #3
0
/*------------------------------------------------
  initialize
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	char s[MAX_PATH];

	m_bInit = FALSE;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "AnalogClock", g_hfontDialog);

	CheckDlgButton(hDlg, IDC_ANALOGCLOCK,
		GetMyRegLong(m_section, "UseAnalogClock", FALSE));

	OnAnalogClock(hDlg);

	InitColor(hDlg);
	
	CheckDlgButton(hDlg, IDC_HOURHANDBOLD,
		GetMyRegLong(m_section, "HourHandBold", FALSE));
	CheckDlgButton(hDlg, IDC_MINHANDBOLD,
		GetMyRegLong(m_section, "MinHandBold", FALSE));

	CheckRadioButton(hDlg, IDC_ANALOGPOSMIDDLE, IDC_ANALOGPOSRIGHT,
		GetMyRegLong(m_section, "AnalogClockPos", 0) + IDC_ANALOGPOSMIDDLE);

	UpDown_SetBuddy(hDlg, IDC_ANALOGHPOSSPIN, IDC_ANALOGHPOS);
	UpDown_SetRange(hDlg, IDC_ANALOGHPOSSPIN, 999, -999);
	UpDown_SetPos(hDlg, IDC_ANALOGHPOSSPIN,
		GetMyRegLong(m_section, "HorizontalPos", 0));
	UpDown_SetBuddy(hDlg, IDC_ANALOGVPOSSPIN, IDC_ANALOGVPOS);
	UpDown_SetRange(hDlg, IDC_ANALOGVPOSSPIN, 999, -999);
	UpDown_SetPos(hDlg, IDC_ANALOGVPOSSPIN,
		GetMyRegLong(m_section, "VerticalPos", 0));

	UpDown_SetBuddy(hDlg, IDC_ANALOGSIZESPIN, IDC_ANALOGSIZE);
	UpDown_SetRange(hDlg, IDC_ANALOGSIZESPIN, 99, 0);
	UpDown_SetPos(hDlg, IDC_ANALOGSIZESPIN,
		GetMyRegLong(m_section, "Size", 0));

	GetMyRegStr(m_section, "Bitmap", s, MAX_PATH, "");
	SetDlgItemText(hDlg, IDC_ANALOGBMP, s);

	m_bInit = TRUE;
}
Beispiel #4
0
/*------------------------------------------------
  initialize
--------------------------------------------------*/
BOOL InitSelectIcon(HWND hDlg)
{
	int i, count, index;
	HICON hicon, hiconl;
	char msg[MAX_PATH];
	char fname[MAX_PATH], num[10];
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "SelectIcon", g_hfontDialog);
	
	parse(fname, m_fname_index, 0, MAX_PATH);
	parse(num, m_fname_index, 1, 10);
	if(num[0] == 0) index = 0;
	else index = atoi(num);
	
	count = (int)(INT_PTR)ExtractIcon(m_hInst, fname, (UINT)-1);
	if(count == 0)
	{
		strcpy(msg, MyString(IDS_NOICON, "NoIcon"));
		strcat(msg, "\n");
		strcat(msg, fname);
		MessageBox(hDlg, msg, "TClock", MB_OK|MB_ICONEXCLAMATION);
		return FALSE;
	}
	
	EndSelectIcon(hDlg);
	SendDlgItemMessage(hDlg, IDC_LISTICON, LB_RESETCONTENT, 0, 0);
	
	for(i = 0; i < count; i++)
	{
		hiconl = NULL; hicon = NULL;
		ExtractIconEx(fname, i, &hiconl, &hicon, 1);
		if(hiconl) DestroyIcon(hiconl);
		SendDlgItemMessage(hDlg, IDC_LISTICON, LB_ADDSTRING, 0,
			(LPARAM)hicon);
	}
	SetDlgItemText(hDlg, IDC_FNAMEICON, fname);
	SendDlgItemMessage(hDlg, IDC_LISTICON, LB_SETCURSEL,
		index, 0);
	strcpy(m_fname_index, fname);
	return TRUE;
}
Beispiel #5
0
/*-------------------------------------------
  initialize main dialog
---------------------------------------------*/
void OnInit(HWND hDlg)
{
	HICON hIcon;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Player", g_hfontDialog);
	
	hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_TCLOCK));
	SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
	
	// common/dialog.c
	SetMyDialgPos(hDlg, 32, 32);
	
	CheckDlgButton(hDlg, IDC_SHOWTIME,
		GetMyRegLong(m_section, "Disp", FALSE));
	CheckRadioButton(hDlg, IDC_SHOWWHOLE, IDC_SHOWUSTR,
		IDC_SHOWWHOLE + GetMyRegLong(m_section, "DispType", 1));
	SetDlgItemInt(hDlg, IDC_SHOWUSTRNUM,
		GetMyRegLong(m_section, "UserStr", 0), FALSE);
	
	OnShowTime(hDlg);
}
Beispiel #6
0
/*------------------------------------------------
  initialize
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	int i;
	BOOL bAll;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "AlarmDay", g_hfontDialog);
	
	bAll = TRUE;
	for(i = 0; i < 7; i++)
	{
		if(m_pAS->wdays[i])
			CheckDlgButton(hDlg, IDC_ALARMDAY1+i, TRUE);
		else
			bAll = FALSE;
	}
	
	if(bAll)
	{
		CheckDlgButton(hDlg, IDC_ALARMDAY0, TRUE);
		OnEveryDay(hDlg);
	}
}
Beispiel #7
0
/*-------------------------------------------
  initialize main dialog
---------------------------------------------*/
void OnInit(HWND hDlg)
{
	HICON hIcon;
	char section[20];
	int i, count;
	TIMERSTRUCT item;
	PTIMERSTRUCT pitem;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Timer", g_hfontDialog);
	
	hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_TCLOCK));
	SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
	
	// ../common/dialog.c
	SetMyDialgPos(hDlg, 32, 32);
	
	SendDlgItemMessage(hDlg, IDC_TIMERTEST, BM_SETIMAGE, IMAGE_ICON,
		(LPARAM)g_hIconPlay);
	
	UpDown_SetBuddy(hDlg, IDC_TIMERSPIN1, IDC_TIMERMINUTE);
	UpDown_SetBuddy(hDlg, IDC_TIMERSPIN2, IDC_TIMERSECOND);
	
	UpDown_SetRange(hDlg, IDC_TIMERSPIN1, 1440, 0);
	UpDown_SetRange(hDlg, IDC_TIMERSPIN2, 59, 0);
	
	count = GetMyRegLong(NULL, "TimerNum", 0);
	m_pTimer = NULL;
	if(count > 0)
	{
		for(i = 0; i < count; i++)
		{
			memset(&item, 0, sizeof(TIMERSTRUCT));
			wsprintf(section, "Timer%d", i + 1);
			GetMyRegStr(section, "Name", item.name, BUFSIZE_NAME, section);
			item.minute = GetMyRegLong(section, "Minute", 3);
			item.second = GetMyRegLong(section, "Second", 0);
			GetMyRegStr(section, "File", item.fname, MAX_PATH, "");
			item.bRepeat = GetMyRegLong(section, "Repeat", FALSE);
			item.bBlink = GetMyRegLong(section, "Blink", FALSE);
			item.bDisp = GetMyRegLong(section, "Disp", FALSE);
			item.nDispType = GetMyRegLong(section, "DispType", 1);
			item.nUserStr = GetMyRegLong(section, "UserStr", 0);
			
			m_pTimer = copy_listitem(m_pTimer, &item, sizeof(TIMERSTRUCT));
			// common/list.c
		}
	}
	else
	{
		memset(&item, 0, sizeof(TIMERSTRUCT));
		strcpy(item.name, "Timer1");
		item.minute = 3;
		item.nDispType = 1;
		
		m_pTimer = copy_listitem(m_pTimer, &item, sizeof(TIMERSTRUCT));
	}
	
	pitem = m_pTimer;
	while(pitem)
	{
		CBAddString(hDlg, IDC_TIMERNAME, (LPARAM)pitem->name);
		pitem = pitem->next;
	}
	
	m_nCurrent = -1;
	CBSetCurSel(hDlg, IDC_TIMERNAME, 0);
	OnName(hDlg);
}
Beispiel #8
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;
}
Beispiel #9
0
/*------------------------------------------------
  Initialize
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	LOGFONT logfont;
	
	m_bInit = FALSE;
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Color", g_hfontDialog);
	
	// settings of "background" and "text"
	
	InitColor(hDlg);
	
	CheckDlgButton(hDlg, IDC_CHKCOLOR,
		GetMyRegLong(NULL, "UseBackColor", IsXPVisualStyle() ? FALSE : TRUE));
	CheckDlgButton(hDlg, IDC_CHKCOLOR2,
		GetMyRegLong(NULL, "UseBackColor2", FALSE));
	
	CheckRadioButton(hDlg, IDC_GRAD1, IDC_GRAD2,
		(GetMyRegLong(NULL, "GradDir", 0) == 0) ? IDC_GRAD1 : IDC_GRAD2);
	
	CheckDlgButton(hDlg, IDC_FILLTRAY,
		GetMyRegLong(NULL, "FillTray", FALSE));
	EnableDlgItem(hDlg, IDC_FILLTRAY,
		IsDlgButtonChecked(hDlg, IDC_CHKCOLOR));
	
	OnCheckColor(hDlg);
	
#if TC_ENABLE_CLOCKDECORATION
	// settings for decoration
	CheckRadioButton(hDlg, IDC_DECONONE, IDC_DECOBORDER,
		GetMyRegLong(NULL, "ClockDecoration", 0) + IDC_DECONONE);
	OnSelectDecoration(hDlg);
	UpDown_SetBuddy(hDlg, IDC_SHADOWRANGESPIN, IDC_SHADOWRANGE);
	UpDown_SetRange(hDlg, IDC_SHADOWRANGESPIN, 10, 1);
	UpDown_SetPos(hDlg, IDC_SHADOWRANGESPIN,
		GetMyRegLong(NULL, "ShadowRange", 1));
#endif
	
	// settings of "font" and "font size"
	
	InitFont(hDlg);
	OnFont(hDlg, TRUE);
	
	CheckDlgButton(hDlg, IDC_BOLD, GetMyRegLong(NULL, "Bold", FALSE));
	CheckDlgButton(hDlg, IDC_ITALIC, GetMyRegLong(NULL, "Italic", FALSE));
	
	m_hfontb = m_hfonti = NULL;
	if(g_hfontDialog)
	{
		char s[80];
		
		GetObject(g_hfontDialog, sizeof(LOGFONT), &logfont);
		logfont.lfWeight = FW_BOLD;
		m_hfontb = CreateFontIndirect(&logfont);
		SendDlgItemMessage(hDlg, IDC_BOLD, WM_SETFONT, (WPARAM)m_hfontb, 0);
		
		logfont.lfWeight = FW_NORMAL;
		logfont.lfItalic = 1;
		m_hfonti = CreateFontIndirect(&logfont);
		SendDlgItemMessage(hDlg, IDC_ITALIC, WM_SETFONT, (WPARAM)m_hfonti, 0);
		
		GetDlgItemText(hDlg, IDC_ITALIC, s, 77);
		strcat(s, "  ");
		SetDlgItemText(hDlg, IDC_ITALIC, s);
	}
	
	m_bInit = TRUE;
}
Beispiel #10
0
/*------------------------------------------------
  initialize
--------------------------------------------------*/
void OnInit(HWND hDlg)
{
	PMOUSESTRUCT pitem;
	RECT rc;
	BOOL b;
	
	m_bInit = FALSE;
	
	if(GetMyRegLong(m_section, "ver031031", 0) == 0)
	{
		SetMyRegLong(m_section, "ver031031", 1);
		ImportOldMouseFunc(); // common/mousestruct.c
	}
	
	// common/mousestruct.c
	m_pMouseCommand = LoadMouseFunc();
	
	// common/tclang.c
	SetDialogLanguage(hDlg, "Mouse", g_hfontDialog);
	
	GetWindowRect(GetDlgItem(hDlg, IDC_MOUSEOPT), &rc);
	m_widthOpt = rc.right - rc.left;
	
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_LEFTBUTTON, "LButton"));
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_RIGHTBUTTONM, "RButton"));
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_MIDDLEBUTTONM, "MButton"));
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_XBUTTON1, "XButton1"));
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_XBUTTON2, "XButton2"));
#if TC_ENABLE_WHEEL
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_WHEELUP, "WheelUp"));
	CBAddString(hDlg, IDC_MOUSEBUTTON,
		(LPARAM)MyString(IDS_WHEELDOWN, "WheelDown"));
#endif
	
	InitFunction(hDlg, IDC_MOUSEFUNC);
	
	pitem = m_pMouseCommand;
	while(pitem)
	{
		CBAddString(hDlg, IDC_NAMECLICK, (LPARAM)pitem->name);
		pitem = pitem->next;
	}
	
	m_nCurrent = -1;
	CBSetCurSel(hDlg, IDC_NAMECLICK, 0);
	OnName(hDlg);
	
	CheckDlgButton(hDlg, IDC_LMOUSEPASSTHRU,
		GetMyRegLong(m_section, "LeftMousePassThrough",
			(g_winver&WIN10RS1) != 0));
	
	b = GetMyRegLong(NULL, "RightClickMenu", TRUE);
	b = GetMyRegLong(m_section, "RightClickMenu", b);
	CheckDlgButton(hDlg, IDC_RCLICKMENU, b);
	
	m_bInit = TRUE;
}