void TreePropertySheet::hideTab() {
	CRect rcClient, rcTab, rcPage, rcWindow;
	CWindow tab = GetTabControl();
	CWindow page = IndexToHwnd(this->m_psh.nStartPage);

	GetClientRect(&rcClient);

	tab.GetWindowRect(&rcTab);
	page.GetClientRect(&rcPage);
	page.MapWindowPoints(m_hWnd,&rcPage);
	GetWindowRect(&rcWindow);
	::MapWindowPoints(NULL, m_hWnd, (LPPOINT)&rcTab, 2);

	ScrollWindow(SPACE_LEFT + TREE_WIDTH + SPACE_MID-rcPage.left, SPACE_TOP-rcPage.top);
	rcWindow.right += SPACE_LEFT + TREE_WIDTH + SPACE_MID - rcPage.left - (rcClient.Width()-rcTab.right) + SPACE_RIGHT;
	rcWindow.bottom += SPACE_TOP - rcPage.top;

	tab.ShowWindow(SW_HIDE);

	MoveWindow(&rcWindow, TRUE);

	tabContainer.SubclassWindow(tab.m_hWnd);
}
예제 #2
0
BOOL CMyPreferences::OnInitDialog(CWindow, LPARAM) {
	char temp[16];
	SendDlgItemMessage( IDC_INDEFINITE, BM_SETCHECK, cfg_indefinite );
	SendDlgItemMessage( IDC_WRITE, BM_SETCHECK, cfg_write );
	SendDlgItemMessage( IDC_WNSFE, BM_SETCHECK, cfg_write_nsfe );
	SendDlgItemMessage( IDC_NSFEPL, BM_SETCHECK, cfg_nsfe_ignore_playlists );
	SendDlgItemMessage( IDC_NSF4011, BM_SETCHECK, cfg_nsf_ignore_w4011 );
	SendDlgItemMessage( IDC_ANTISURROUND, BM_SETCHECK, cfg_spc_anti_surround );
	SendDlgItemMessage( IDC_GD3JAPANESE, BM_SETCHECK, cfg_vgm_gd3_prefers_japanese );
	SendDlgItemMessage( IDC_EFFECTS, BM_SETCHECK, cfg_effects_enable );
	print_time_crap( cfg_default_length, (char *)&temp );
	uSetDlgItemText( m_hWnd, IDC_DLENGTH, (char *)&temp );
	print_time_crap( cfg_default_fade, (char *)&temp );
	uSetDlgItemText( m_hWnd, IDC_DFADE, (char *)&temp );

	CWindow w;

	w = GetDlgItem( IDC_SLIDER_BASS );
	::SendMessage( w, TBM_SETRANGE, 0, MAKELONG( 0, 255 ) );
	::SendMessage( w, TBM_SETPOS, 1, cfg_effects_bass );

	w = GetDlgItem( IDC_SLIDER_TREBLE );
	::SendMessage( w, TBM_SETRANGE, 0, MAKELONG( 0, 255 ) );
	::SendMessage( w, TBM_SETPOS, 1, cfg_effects_treble );

	w = GetDlgItem( IDC_SLIDER_ECHO_DEPTH );
	::SendMessage( w, TBM_SETRANGE, 0, MAKELONG( 0, 255 ) );
	::SendMessage( w, TBM_SETPOS, 1, cfg_effects_echo_depth );

	int n,o;
	for(n=IDC_FORMAT_NSF,o=0;n<=IDC_FORMAT_SFM;n++,o++)
	{
		SendDlgItemMessage( n, BM_SETCHECK, cfg_format_enable & ( 1 << o ) );
	}
	for(n=tabsize(srate_tab);n--;)
	{
		if (srate_tab[n] != cfg_sample_rate)
		{
			itoa(srate_tab[n], temp, 10);
			cfg_history_rate.add_item(temp);
		}
	}
	itoa( cfg_sample_rate, temp, 10 );
	cfg_history_rate.add_item(temp);
	w = GetDlgItem( IDC_SAMPLERATE );
	cfg_history_rate.setup_dropdown( w );
	::SendMessage( w, CB_SETCURSEL, 0, 0 );

	w = GetDlgItem( IDC_VGMLOOPCOUNT );
	uSendMessageText( w, CB_ADDSTRING, 0, "none" );
	for (n = 1; n <= 10; n++)
	{
		itoa( n, temp, 10 );
		uSendMessageText( w, CB_ADDSTRING, 0, temp );
	}
	::SendMessage( w, CB_SETCURSEL, cfg_vgm_loop_count, 0 );

	enable_vgm_loop_count( !cfg_indefinite );

	w = GetDlgItem( IDC_INTERPOLATION );
	uSendMessageText( w, CB_ADDSTRING, 0, "None" );
	uSendMessageText( w, CB_ADDSTRING, 0, "Linear" );
	uSendMessageText( w, CB_ADDSTRING, 0, "Gaussian" );
	uSendMessageText( w, CB_ADDSTRING, 0, "Cubic" );
	uSendMessageText( w, CB_ADDSTRING, 0, "Sinc" );
	::SendMessage( w, CB_SETCURSEL, cfg_spc_interpolation + 2, 0 );

	union
	{
		RECT r;
		POINT p [2];
	};

	w = GetDlgItem( IDC_GROUPBOX );
	w.GetClientRect( &r );
	w.MapWindowPoints( m_hWnd, &p [1], 1 );

	CreateLogo( m_hWnd, p [1].x + 2, p [1].y - 181 );

	return FALSE;
}
예제 #3
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	idTimer = 0;
	picWidth = 4.0;
	picHeight = 3.0;
	picInchOrMM = 0; // inches
	memset(picFileName, 0, sizeof(picFileName));

	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	btnPlay = GetDlgItem(IDC_PLAY);
	btnStop = GetDlgItem(IDC_STOP);
	btnLoop = GetDlgItem(IDC_LOOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);

	CButton btnStyle = GetDlgItem(IDC_SAWTOOTH);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SAW), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SQUARE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SQUARE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SIN);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_SIN), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_RAMP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_RAMP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_COPYCLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEPIC);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_DISK), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVEWAV);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	pitchEd = GetDlgItem(IDC_PITCH);
	pitchEd.SetWindowText("48");

	for (int ndx = 0; ndx < WFI_MAXPART; ndx++)
	{
		sliders[ndx] = GetDlgItem(IDC_PART1+ndx);
		sliders[ndx].SetRange(0, 200, FALSE);
		sliders[ndx].SetTicFreq(20);
		sliders[ndx].SetLineSize(1);
		sliders[ndx].SetPageSize(10);
		levels[ndx] = GetDlgItem(IDC_LVL1+ndx);
	}

	SetDlgItemInt(IDC_PERIODS, 1);

	RECT rcPlot;
	CWindow frm = GetDlgItem(IDC_WVFRAME);
	frm.GetClientRect(&rcPlot);
	frm.MapWindowPoints(m_hWnd, &rcPlot);
	InflateRect(&rcPlot, -2, -2);
	wndPlot.Create(m_hWnd, rcPlot, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_BORDER, 0/*WS_EX_CLIENTEDGE*/);
	frm.ShowWindow(SW_HIDE);

	gibbs = FALSE;
	BOOL dummy;
	OnSin(0, IDC_SIN, btnStyle, dummy);

	return TRUE;
}