Ejemplo n.º 1
0
			LRESULT draw_item(HWND hwnd, DRAWITEMSTRUCT* label_draw)
			{
				/* draw background */
				FillRect(label_draw->hDC, &label_draw->rcItem, CreateSolidBrush(this->get_widget(this->get_parent_handle()).get_background_color()));
				
				/* draw text */
				int background_mode = SetBkMode(label_draw->hDC, TRANSPARENT);
				COLORREF text_color = SetTextColor(label_draw->hDC, RGB(136, 136, 136));
		
				int text_length = Static_GetTextLength(label_draw->hwndItem);

				char* text_buffer = new char[text_length + 1];
				memset(text_buffer, 0, text_length + 1);

				text_length = Static_GetText(label_draw->hwndItem, text_buffer, text_length + 1);

				RECT rc_align(label_draw->rcItem);
				DrawText(label_draw->hDC, text_buffer, -1, &rc_align, DT_CALCRECT);
				DrawText(label_draw->hDC, text_buffer, -1, &label_draw->rcItem, (this->center ? DT_CENTER : DT_LEFT) | DT_SINGLELINE | DT_VCENTER);
				
				SetTextColor(label_draw->hDC, text_color);
				SetBkMode(label_draw->hDC, background_mode);

				delete[] text_buffer;
				return 0;
			}
Ejemplo n.º 2
0
HRESULT StaticSourcePage::OnApplyChanges(void)
{
	if (this->m_bDirty && this->m_staticSourceParams != NULL)
	{
		this->m_staticSourceParams->SetFrameRate(GetValue(IDC_EDIT_RATE));
		
		wchar_t path[MAX_PATH];
		Static_GetText(GetDlgItem(this->m_Dlg, IDC_EDIT_PATH), path, MAX_PATH);

		if (SetBitmapFile(path) != S_OK)
			Static_SetText(GetDlgItem(this->m_Dlg, IDC_EDIT_PATH), L"");

		RefreshValues();
	}

	return S_OK;
}