Пример #1
0
void
TWindow::FrameResized(float w, float h)
{
	CalcViewablePixels();
	fFatBits->InitBuffers(fHPixelCount, fVPixelCount, fPixelSize, ShowGrid());
	UpdateInfoBarOnResize();
}
void CTDLFindTaskExpressionListCtrl::PreSubclassWindow() 
{
	// create child controls
	CreateControl(m_cbAttributes, ATTRIB_ID);
	CreateControl(m_cbOperators, OPERATOR_ID, FALSE);
	CreateControl(m_cbAndOr, ANDOR_ID, FALSE);
	CreateControl(m_dtcDate, DATE_ID);
	CreateControl(m_eTime, TIME_ID);
	CreateControl(m_cbListValues, LISTVALUES_ID);
	CreateControl(m_cbPriority, PRIORITY_ID);
	CreateControl(m_cbRisk, RISK_ID);

	CInputListCtrl::PreSubclassWindow(); // we need combo to be created first

	// build and/or combo too
	int nItem = m_cbAndOr.AddString(CEnString(IDS_FP_AND));
	m_cbAndOr.SetItemData(nItem, TRUE);
				
	nItem = m_cbAndOr.AddString(CEnString(IDS_FP_OR));
	m_cbAndOr.SetItemData(nItem, FALSE);

	// post message for our setup
	m_header.EnableTracking(FALSE);
	ShowGrid(TRUE, TRUE);

	InsertColumn(ATTRIB, CEnString(IDS_FT_ATTRIB), LVCFMT_LEFT, 120);
	InsertColumn(OPERATOR, CEnString(IDS_FT_MATCHES), LVCFMT_LEFT, 160);
	InsertColumn(VALUE, CEnString(IDS_FT_VALUE), LVCFMT_LEFT, 130);
	InsertColumn(ANDOR, CEnString(IDS_FT_ANDOR), LVCFMT_LEFT, 60);
	SetView(LVS_REPORT);
//	SetLastColumnStretchy(TRUE);

	AutoAdd(TRUE, FALSE);

	BuildListCtrl();

	SetColumnType(ATTRIB, ILCT_DROPLIST);
	SetColumnType(OPERATOR, ILCT_DROPLIST);
	SetColumnType(ANDOR, ILCT_DROPLIST);
}
Пример #3
0
void
TWindow::SetPixelSize(bool d)
{
	if (d) {		// grow
		fPixelSize++;
		if (fPixelSize > 16)
			fPixelSize = 16;
	} else {
		fPixelSize--;
		if (fPixelSize < 1)
			fPixelSize = 1;
	}

	float w = Bounds().Width();
	float h = Bounds().Height();
	CalcViewablePixels();
	ResizeWindow(fHPixelCount, fVPixelCount);

	//	the window might not actually change in size
	//	in that case force the buffers to the new dimension
	if (w == Bounds().Width() && h == Bounds().Height())
		fFatBits->InitBuffers(fHPixelCount, fVPixelCount, fPixelSize, ShowGrid());
}