コード例 #1
0
ファイル: window_selectable.cpp プロジェクト: Zhek/Player
// Update Cursor Rect
void Window_Selectable::UpdateCursorRect() {
	int cursor_width = 0;
	int x = 0;
	if (index < 0) {
		SetCursorRect(Rect());
		return;
	}
	int row = index / column_max;
	if (row < GetTopRow()) {
		SetTopRow(row);
	} else if (row > GetTopRow() + (GetPageRowMax() - 1)) {
		SetTopRow(row - (GetPageRowMax() - 1));
	}

	if (column_max > 1){
		cursor_width = (width / column_max - 16) + 12;
		x = (index % column_max * cursor_width) - 4 ;
	}
	else{
		cursor_width = (width / column_max - 16) + 8;
		x = (index % column_max * (cursor_width + 16)) - 4;
	}

	int y = index / column_max * 16 - oy;
	SetCursorRect(Rect(x, y, cursor_width, 16));

}
コード例 #2
0
ファイル: RGXDeskLogRows.cpp プロジェクト: raimoj/pawnshop
void CRGXDeskLogRows::clear()
{
	SetReadOnly(FALSE);
	SetTopRow(1);
	MoveCurrentCell(GX_TOPLEFT);
	SetRowCount(0);
	Redraw();
	SetReadOnly(TRUE);
}
コード例 #3
0
ファイル: RGXMainWndGrid.cpp プロジェクト: raimoj/pawnshop
void CRGXMainWndGrid::clear()
{
	setGridReadOnly(FALSE);
	SetTopRow(1);
	MoveCurrentCell(GX_TOPLEFT);
	SetRowCount(0);
	Redraw();
	//
	setGridReadOnly(TRUE);
}
コード例 #4
0
///////////////////////////////////////////////////////////////////////////
// Set the highlighted selection
///////////////////////////////////////////////////////////////////////////
void CStreetSegmentBrowseGrid::SetRowSelection(int selStart_, int selEnd_)
{
	int oldSelStart = selStart;
	int oldSelEnd = selEnd;

	selStart = selStart_;
	selEnd = selEnd_;

	if (oldSelStart <= oldSelEnd) {
		// Unhilight previous selection
		RedrawRowCol(oldSelStart, 1, oldSelEnd, GetColCount());
	}

	if (selStart <= selEnd) {
		// Hilight new selection
		RedrawRowCol(selStart, 1, selEnd, GetColCount());
		// Put top of select at top row
		SetTopRow(selStart);
	}
}