Exemple #1
0
void DiaGridView::OnInitialUpdate()
{
	// Call the base class OnInitialUpdate. This call is
	// essential for grid specific intialization (In
	// contrast to GXInit which performs application specific
	// intialization)
	CGXGridView::OnInitialUpdate();

	// Disable Undo mechanism for the following commands.
	// Objective Grid has a built in Undo/Redo  architecture
	// that can be disabled/enabled with this call.
	// We disable it here so that users are not able to
	// rollback changes that we make in code.
	GetParam()->EnableUndo(FALSE);	

  CMFCDiaDoc* pDoc = GetDocument();

  ASSERT_VALID(pDoc);
  if (!pDoc)
    return;
  m_entities = pDoc->getDrawEntities();

	SetRowCount(0);
	SetColCount(5);

	SetValueRange(CGXRange(0, 1), "figure type");
	SetValueRange(CGXRange(0, 2), "center x");
	SetValueRange(CGXRange(0, 3), "center y");
	SetValueRange(CGXRange(0, 4), "line type");
	SetValueRange(CGXRange(0, 5), "line color");

	// Re-enable undo mechanism
	GetParam()->EnableUndo(TRUE);
}
void CVariablesGrid::Init()
{
	LuaState* state = theApp.GetDocument()->GetState();
	
	m_buttonDatabase.SetGrid(this);
	m_imageList.Create(MAKEINTRESOURCE(IDB_FOLDERS), 16, 1, RGB(255,255,255));
    SetImageList(&m_imageList);

	SetColumnCount(2);
	SetDefCellHeight(ROW_HEIGHT);
	SetRowCount(0);
	SetColumnWidth(NAME_COL, NAME_WIDTH);
	SetColumnWidth(DATA_COL, DATA_WIDTH);

	CString fontName = "Arial";
	
	LOGFONT logFont;
	memset(&logFont, 0, sizeof(LOGFONT));
	logFont.lfCharSet = DEFAULT_CHARSET;
	logFont.lfWeight = 700;
	logFont.lfHeight = 80;
	lstrcpyn(logFont.lfFaceName, fontName, fontName.GetLength());

	m_titleFont.CreatePointFontIndirect(&logFont);
	m_dataFont.CreatePointFont(80, fontName);
}
// delete row
void __fastcall TColourStringGrid::DeleteRow(int row)
{

        if(row < FixedRows || row >= FRowCount)
            return;

        for(int cols = 0; cols < FColCount; cols++)
        {
            if(theColourGrid[cols][row])
            {
                delete (CellProperties*)theColourGrid[cols][row];
                theColourGrid[cols][row] = 0;
            }

            for(int firstrow = row; firstrow < FRowCount; firstrow++)
            {
                if((firstrow+1) < FRowCount)
                {
                    Cells[cols][firstrow] = Cells[cols][firstrow + 1];
                    theColourGrid[cols][firstrow] = theColourGrid[cols][firstrow + 1];
                    theColourGrid[cols][firstrow + 1] = 0;
                }
                else
                {
                    // last row - simply delete (colours already deleted above)
                    Cells[cols][firstrow] = "";
                }
            }
        }

        SetRowCount(FRowCount - 1);
}
Exemple #4
0
void CTradeGridBase::FillHeader(ITradeTable* pTradeTable)
{
	if (pTradeTable)
	{
		m_pTradeTable = pTradeTable;
		int iCount = m_pTradeTable->GetCount();
		SetColumnCount(iCount);
		SetRowCount(1);
		SetFixedRowCount(1);
		SetFixedTextColor(m_crWindowText);	
		SetFixedBkColor(m_cr3DFace);
		SetTextColor(m_crWindowText);
		SetGridBkColor(0xFFFFFF);
		SetTextBkColor(m_crWindowColour);
		//SetAutoSizeStyle(GVS_DEFAULT);
		CClientDC dc(this);
		short tmLen = (short)dc.GetTextExtent("0").cx;
		for (int i = 0; i < iCount; i++)
		{
			ITradeColumn* pItem = m_pTradeTable->GetItems(i);
			if (pItem)
			{
				SetItemData(0, i, (LPARAM)pItem);
				CString sTmp = pItem->GetDispName();
				int nLen = sTmp.GetLength();
				SetItemText(0, i, pItem->GetDispName());
				SetColumnWidth(i, nLen * tmLen);
			}
		}
	}
	
}
void ContentBoxCtrol::SetItemCount(size_t count)
{
    // the items are going to change, forget the old ones
    m_cache->Clear();

    SetRowCount(count);
}
void ProdRestartGridCtrl::ResetGrid()
{
  static const int maxRestart = 16;
  productionRestartTimes.ReAlloc(maxRestart);

  SetRowCount(maxRestart  + 1);
  SetColCount(2);

  SetCenteredText(0, 1, "Restart Time" );

  CString sRowHeader;
  for (int i = 0; i < maxRestart; i++)
  {
    int row = i + 1;
    sRowHeader.Format("%d", row);
    SetCenteredText(row, 0, sRowHeader );

    if (i > productionRestartTimes.UpperBound())
      productionRestartTimes[i] = nullReal;

    SetCell(row, 1, new ProdRestartTimeGridCell(i));
  }

  SetEditMode();
  SetBorderThickness(4);
  AutoSize();
  SetColSize(1, GetColSize(1) + 15);

  UpdateAllRows();
}
Exemple #7
0
void GridViewGridControl::UpdateGrid(const DC_GridData*   inGrid)
{
    CWaitCursor w; // this can be time consuming

    gGrid = inGrid;
    if (gGrid == 0)
    {
        SetRowCount(2);
        SetColCount(2);
        SetCenteredText(0, 1, "Col1");
        SetCenteredText(1, 0, "Row1");
        SetCenteredText(1, 1, "no data");
        AutoSize();
        return;
    }

    int nRows = gGrid->xData.Size();
    int nCols = gGrid->yData.Size();
    SetRowCount(nRows + 1);
    SetColCount(nCols + 1);

    CString str;
    char tempStr[80];

    int i;
    for (i = 0; i < nCols; i++)
    {
        gridFormat.RealToString(gGrid->yData[i], tempStr, 80);
        str = tempStr;
        SetCenteredText(0, i + 1, str);
    }


    for (i = 0; i < nRows; i++)
    {
        gridFormat.RealToString(gGrid->xData[i], tempStr, 80);
        str = tempStr;
        SetCenteredText(i + 1, 0, str);
        for (int j = 0; j < nCols; j++)
            SetCell(i + 1, j + 1, new GridViewValueCell(j, i, this));

    }

    UpdateGridData();

    lastWasNull = false;
}
void CVariablesGrid::UpdateWatch( LuaObject tableObj )
{
    SetRedraw(FALSE);

//	SaveExpandInfo(true);
	BuildWatch();

	SetRowCount(1);

	LuaState* state = tableObj.GetState();

	int tableCount = tableObj.GetCount();
	for ( int i = 0; i < tableCount; ++i )
	{
		LuaObject entryObj = tableObj[ i + 1 ];
		LuaObject indentLevelObj = entryObj[ 2 ];
		LuaObject valueObj = entryObj[ 3 ];

		CStringW ident = DebugBasicSerialize(entryObj[ 1 ]);
		int indentLevel = indentLevelObj.GetInteger();
		CStringW value = DebugBasicSerialize( valueObj );

		int curRow = AddEditProperty( indentLevel, ident, true );
		SetEditProperty( curRow, value );

		// Make an extra row.
		if ( valueObj.IsString()  &&  strcmp( valueObj.GetString(), "!!!TABLE!!!" ) == 0 )
		{
			bool addTreeRowForPlusMinus = false;

			if ( i < tableCount - 1 )
			{
				LuaObject nextIndentLevelObj = tableObj[ i + 2 ][ 2 ];
				int nextIndentLevel = nextIndentLevelObj.GetInteger();
				if ( nextIndentLevel != indentLevel + 1 )
				{
					addTreeRowForPlusMinus = true;
				}
			}
			else
			{
				addTreeRowForPlusMinus = true;
			}

			if ( addTreeRowForPlusMinus )
			{
				m_treeForcePlusArray[ curRow - 1 ] = true;
			}
		}
 
		m_treeLevelArray[ curRow - 1 ] |= 0x80;
	}

	m_treeLevelArray.Add(0);
	FixupRows(false);

    SetRedraw(TRUE);
}
Exemple #9
0
void CRGXDeskLogRows::clear()
{
	SetReadOnly(FALSE);
	SetTopRow(1);
	MoveCurrentCell(GX_TOPLEFT);
	SetRowCount(0);
	Redraw();
	SetReadOnly(TRUE);
}
void CVariablesGrid::AddSection(const CString& title, const CString& type)
{
	int curRow = GetRowCount();
	SetRowCount(curRow + 1);

	SetFont(&m_dataFont);

	SetItemText(curRow, NAME_COL, title);
	SetItemText(curRow, DATA_COL, type);
}
Exemple #11
0
void CRGXMainWndGrid::clear()
{
	setGridReadOnly(FALSE);
	SetTopRow(1);
	MoveCurrentCell(GX_TOPLEFT);
	SetRowCount(0);
	Redraw();
	//
	setGridReadOnly(TRUE);
}
Exemple #12
0
	void Init()
	{
		SetCallbackFunc(GridCallback, (LPARAM)this);
		SetCallbackFuncPrepCache(GridCallbackPrepCache, (LPARAM)this);
		SetCallbackFuncCellClick(GridCallbackCellClick, (LPARAM)this);
		SetFixedRowCount(1);
		SetFixedColumnCount(0);
		SetRowCount(m_attrs.size());
		SetColumnCount(4);
	}
void CVariablesGrid::BuildWatch()
{
	m_gridType = WATCH;

	m_titleList.RemoveAll();
	m_treeLevelArray.RemoveAll();
	m_treeForcePlusArray.RemoveAll();
	AddSection("Name", "Value");
	SetFixedRowCount(1);
	SetRowCount(2);
}
Exemple #14
0
void CRGXDeskLogRows::initGrid()
{
	GetParam()->EnableUndo(FALSE);
	SetRowCount(50);
	SetColCount(16);
	//
	// esimerkiksi r2s2 asetetaan valintalistaksi !
	//pLainarivit->SetStyleRange(CGXRange(2, 2), CGXStyle()
	//		.SetControl(GX_IDS_CTRL_TEXTFIT)
	//		.SetChoiceList(_T("one\ntwo\nthree\nfour\nfive\nsix\nseven\neight")));

	SetStyleRange(CGXRange(0,1), CGXStyle().SetValue("KS_Tunnus"));
	SetStyleRange(CGXRange(0,2), CGXStyle().SetValue("Aika"));
	SetStyleRange(CGXRange(0,3), CGXStyle().SetValue("AM"));
	SetStyleRange(CGXRange(0,4), CGXStyle().SetValue("LainaNr"));
	SetStyleRange(CGXRange(0,5), CGXStyle().SetValue("Tapahtuma"));
	SetStyleRange(CGXRange(0,6), CGXStyle().SetValue("Selite"));
	SetStyleRange(CGXRange(0,7), CGXStyle().SetValue("Siirrot"));	
	SetStyleRange(CGXRange(0,8), CGXStyle().SetValue("VanhaLaina"));
	SetStyleRange(CGXRange(0,9), CGXStyle().SetValue("UusiLaina"));
	SetStyleRange(CGXRange(0,10), CGXStyle().SetValue("Korot"));
	SetStyleRange(CGXRange(0,11), CGXStyle().SetValue("SHVMaksut"));
	SetStyleRange(CGXRange(0,12), CGXStyle().SetValue("Toimitusmaksut"));
	SetStyleRange(CGXRange(0,13), CGXStyle().SetValue("Pyöristys"));
	SetStyleRange(CGXRange(0,14), CGXStyle().SetValue("Maksettava"));
	SetStyleRange(CGXRange(0,15), CGXStyle().SetValue("Alijaama"));
	SetStyleRange(CGXRange(0,16), CGXStyle().SetValue("Ylijaama"));
	
	SetColWidth(0,0,0); // rivi#
	SetColWidth(1,1,17); // KS_Tunnus
	SetColWidth(2,2,100); // Aika
	SetColWidth(3,3,17); // AM
	SetColWidth(4,4,40); // LainaNr
	SetColWidth(5,5,25); // Tapahtuma
	SetColWidth(6,6,130); // Selite
	SetColWidth(7,7,60); // Summa
	SetColWidth(8,8,60); // VanhaLaina
	SetColWidth(9,9,60); // UusiLaina
	SetColWidth(10,10,50); // Korot
	SetColWidth(11,11,50); // SHVMaksut
	SetColWidth(12,12,50); // Toimitusmaksut
	SetColWidth(13,13,50); // Pyöristys
	SetColWidth(14,14,50); // Maksettava
	SetColWidth(15,15,50); // Alijaama
	SetColWidth(16,16,50); // Ylijaama

	SetStyleRange(CGXRange().SetCols(14), CGXStyle().SetInterior(RGB(255,255,192)));
	
	this->GetParam()->EnableSelection(FALSE);
	SetReadOnly(TRUE);

	GetParam()->EnableUndo(TRUE);
	SetFocus();
}
Exemple #15
0
void XYGridControl::SetXYRows(int nRows)
{
    int nRowCount = GetRowCount();
    SetRowCount(nRows);
    if (nRowCount < nRows) {
        CString str;
        for (int i = nRowCount; i < nRows; i++) {
            str.Format("%d", i);
            SetCenteredText(i, 0, str);
            SetCell(i, 1, new XCell(i-1, this));
            SetCell(i, 2, new YCell(i-1, this));
        }
    }
}
Exemple #16
0
void wxVListBox::SetItemCount(size_t count)
{
    // don't leave the current index invalid
    if ( m_current != wxNOT_FOUND && (size_t)m_current >= count )
        m_current = count - 1; // also ok when count == 0 as wxNOT_FOUND == -1

    if ( m_selStore )
    {
        // tell the selection store that our number of items has changed
        m_selStore->SetItemCount(count);
    }

    SetRowCount(count);
}
Exemple #17
0
void DiaGridView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
	CMFCDiaDoc* pDoc = GetDocument();

	ASSERT_VALID(pDoc);
	if (!pDoc)
		return;

  m_entities = pDoc->getDrawEntities();

	SetRowCount(m_entities->size());

  Redraw();
}
// initialise control from current min/max values
void wxSymbolListCtrl::SetupCtrl(bool scrollToSelection)
{
    wxSize sz = GetClientSize();

    m_symbolsPerLine = sz.x/(m_cellSize.x+m_ptMargins.x);
    int noLines = (1 + SymbolValueToLineNumber(m_maxSymbolValue));

    SetRowCount(noLines);
    Refresh();

    if (scrollToSelection && m_current != wxNOT_FOUND && m_current >= m_minSymbolValue && m_current <= m_maxSymbolValue)
    {
        ScrollToRow(SymbolValueToLineNumber(m_current));
    }
}
int CVariablesGrid::AddEditProperty( int treeDepth, const CStringW& title, bool expanded )
{
	int curRow = GetRowCount();
	SetRowCount(curRow + 1);
	SetFont(&m_dataFont);
	m_titleList.Add(title);
	m_treeLevelArray.Add(treeDepth | ( expanded ? 0x80 : 0 ) );
	m_treeForcePlusArray.Add( false );

	ControlInfo controlInfo;
	controlInfo.m_hasSpin = false;
	m_controlInfo.Add(controlInfo);
	
	return curRow;
}
Exemple #20
0
void XYViewGridControl::UpdateXY(const DC_XYData*   inXY)
{
    SetColCount(3);
    SetCenteredText(0, 1, "    X Data    ");
    SetCenteredText(0, 2, "    Y Data    ");


    gXY = inXY;
    if (gXY == 0)
    {
        SetRowCount(2);
        SetCenteredText(1, 0, "1");
        SetCenteredText(1, 1, "no data");
        SetCenteredText(1, 2, "no data");
        AutoSize();
        return;
    }


    int nRows = gXY->Size();
    SetRowCount(nRows + 1);

    CString str;

    for (int i = 0; i < nRows; i++)
    {
        str.Format("%d", i + 1);
        SetCenteredText(i + 1, 0, str);
        SetCell(i + 1, 1, new XYViewValueCell(true, i, this));
        SetCell(i + 1, 2, new XYViewValueCell(false, i, this));
    }

    UpdateXYData();

    lastWasNull = false;
}
Exemple #21
0
void CCombAnalysisReport::InitReport()
{
	SetRowCount(10);
	ColInfoStruct sInfo;
	sInfo.nWidth = 100;
	sInfo.nID = 0;
	for(int i = 0; i < 7; i ++)
	{
		CString str;
		str.Format("column_%d",i+1);
		InsertCol(GetColCount(),FALSE,str,TEXT_COLOR_TIME,TEXT_FONT_FIXED);
		SetColInfo(i, &sInfo);
	}
	SetFixRowCount(1);
	SetFixColCount(1);
}
Exemple #22
0
CDrawRStockTitle::CDrawRStockTitle(IHsUserDataCfg* pUserDefCfg, IHsColor* pColor, IHsFont* pFont)
{
	ASSERT(pUserDefCfg && pColor && pFont);
	m_iUserDefCfg = pUserDefCfg;
	m_pColor = pColor;
	m_pFont = pFont;

	SetStyle(TABLE_STYLE_SCREEN | TABLE_WIDTH_CHANGABLE | TABLE_HEIGHT_CHANGABLE);
	SetRowCount(1);
	SetColCount(1);

	CreateCell("", 0, 0, 0, CELL_TIP);

	ReadFile();
	m_pImageList = NULL;

}
    void ColorMapGridControl::Initialize()
    {
        SetColCount(5);
        SetRowCount(DC_ColorMap::maxCMcolors + 1);

        CString str;
        for (int i = 1; i <= DC_ColorMap::maxCMcolors; i++)
            {
                str.Format("%d", i);
                SetCenteredText(i, 0, str);
                SetCell(i , 1, new ValueCell(i - 1, 0, this));
                SetCell(i , 2, new ValueCell(i - 1, 1, this));
                SetCell(i , 3, new ValueCell(i - 1, 2, this));
                SetCell(i , 4, new ColorCell(i - 1, this));
            }
        SetColLabels();
    }
// insert a blank row at row
void __fastcall TColourStringGrid::InsertRow(int row)
{
	   if(row < FixedRows)
		return;

	   SetRowCount(FRowCount + 1);

	   for(int lastrow, cols = 0; cols < FColCount; cols++)
	   {
			for(lastrow = FRowCount - 1;lastrow > row; lastrow--)
			{
				Cells[cols][lastrow] = Cells[cols][lastrow - 1];
				theColourGrid[cols][lastrow] = theColourGrid[cols][lastrow - 1];
			}
			Cells[cols][lastrow] = "";
			theColourGrid[cols][lastrow] = NULL;
		}
}
Exemple #25
0
void CDrawInfo::CreateSelf()
{
	// 第一行第一列为股票名称 第二行第二列为股票代码
	int nCellCount = m_ayInfoIndex.GetCount() + 2;
	int nRowCount = nCellCount / INFO_COL_COUNT + ((nCellCount%INFO_COL_COUNT)==0?0:1); // 向上取整
	SetColCount(INFO_COL_COUNT);
	SetRowCount(nRowCount);
	SetRowHeight(INFO_ROW_HEIGHT);
	nCellCount = INFO_COL_COUNT * nRowCount;
	SetCellCount(nCellCount);

	int nCellIndex(0);
	int nAyIndex(0);
	CString str;
	InfoIndex* pInfoIndex = NULL;
	//////////////////////////////////////////////////////////////////////////
	// 第一列
	str = m_stkInfo.m_cStockName;   // 股票名称
	CreateCell(str, TEXT_COLOR_STOCKCODE, TEXT_FONT_FIXED, ITEM_TEXT_CENTER, CELL_BORDER_RIGHT | CELL_BORDER_BOTTOM, 0, nCellIndex++);
	
	str = m_stkInfo.m_ciStockCode.GetCode(); // 代码名称
	CreateCell(str, TEXT_COLOR_STOCKNAME, TEXT_FONT_FIXED, ITEM_TEXT_CENTER, CELL_BORDER_RIGHT | CELL_BORDER_BOTTOM, 0, nCellIndex++);
	
	//////////////////////////////////////////////////////////////////////////
	// 添加返回的数据
	for (int y = 0; y < GetRowCount(); y++)
	{
		for (int x = 1; x < GetColCount() - 1; x++)
		{
			nCellIndex = PointToIndex(CPoint(x,y));
			str = "";
			if (nAyIndex < m_ayInfoIndex.GetCount())
			{
				pInfoIndex = m_ayInfoIndex.GetAt(nAyIndex++);
				str = pInfoIndex->m_cTitle;
			}
			CreateCell(str, TEXT_COLOR_FIXEDNAME, TEXT_FONT_FIXED, ITEM_TEXT_CENTER, CELL_BORDER_RIGHT | CELL_BORDER_BOTTOM, 0, nCellIndex);
		}
		// 每一行最后一列单元格是按钮
		nCellIndex = PointToIndex(CPoint(GetColCount()-1, y));
		CreateCell("", TEXT_COLOR_FIXEDNAME, TEXT_FONT_FIXED, ITEM_TEXT_CENTER, CELL_BORDER_RIGHT | CELL_BORDER_BOTTOM, 0, nCellIndex);
	}
}
BOOL GMassMobAppearGrid::Create(const RECT& rect, CWnd* parent, UINT nID, DWORD dwStyle )
{
	if( !GGridCtrl::Create( rect, parent, nID, dwStyle ) )	
		return FALSE;

	SetFixedColumnCount( 0 );
	SetColumnCount( 4 );
	SetColumnWidth( 1, 40 );
	SetColumnWidth( 2, 70 );

	
	SetRowCount( 1 );
	SetItemText( 0, 0, GnText("몹 인덱스") );
	SetItemText( 0, 1, GnText("레벨") );
	SetItemText( 0, 2, GnText("출현 라인") );
	SetItemText( 0, 3, GnText("출현 개수") );

	return TRUE;
}
void
GRaggedFloatTableData::RemoveAllRows()
{
	const JSize colCount = itsCols->GetElementCount();
	for (JIndex i=1; i<=colCount; i++)
		{
		JArray<JFloat>* colData = itsCols->NthElement(i);
		colData->RemoveAll();
		}
	const JSize count	= GetRowCount();
	SetRowCount(0);
	if (itsBroadcast)
		{
		Broadcast(JTableData::RowsRemoved(1, count));
		}
	RowsAdded(1);
	if (itsBroadcast)
		{
		Broadcast(JTableData::RowsInserted(1, 1));
		}
}
Exemple #28
0
void CRGXMainWndGrid::OnInitialUpdate()
{
	CGXGridWnd/*CGXRecordWnd*/::OnInitialUpdate();  // Creates all objects and links them to the grid

	//GetParam()->EnableUndo(FALSE);
	//SetAccelArrowKey(TRUE);

	SetRowCount(256);
	SetColCount(17);

	//SetStyleRange(CGXRange(2, 2), CGXStyle()
	//		.SetControl(GX_IDS_CTRL_TEXTFIT)
	//		.SetChoiceList(_T("one\ntwo\nthree\nfour\nfive\nsix\nseven\neight"))
	//	);
	//GetParam()->EnableUndo(TRUE);

	// HUOM !
	//initialisointi voidaan tehdä myös view-luokan (CPanttiView) OnInitialUpdate():ssa


	pLainaRS->m_pDatabase = theApp.GetDatabase();

	this->GetParam()->EnableSelection(FALSE);

	SetColumnWidths();
	//ChangeStandardStyle(CGXStyle()
	//	.SetControl(GX_IDS_CTRL_STATIC)
	//	.SetReadOnly(TRUE));
	//
	// --- test ---
	setGridReadOnly(TRUE);
	/*SetStyleRange(CGXRange().SetCols(0,7),
								CGXStyle().SetReadOnly(TRUE));
	SetStyleRange(CGXRange().SetCols(8,8),
								CGXStyle().SetReadOnly(FALSE).SetInterior(RGB(192,192,192)));
	SetStyleRange(CGXRange().SetCols(9,17),
								CGXStyle().SetReadOnly(TRUE));
	*/
  }
void QuoteTableCtrlGeneralSort::InitRowData()
{
	int count = m_pStock.GetCount();
	SetRowCount(count+1);
	InitFixedDataItem(count+1,1);
}
Exemple #30
0
CString CRGXMainWndGrid::ShowPawnTicketNumbers(/*CString sHtun*/ long AsId)
{
	long lRows = 0;
	m_lLainojaKpl = 0;
	m_dLainojaYhtEuro = 0;
	m_lAktiivisiaKpl = 0;
	m_lLunastetutKpl = 0;
	m_dAktLainojaYhtEuro = 0;

	char buf[20];
	CString strResult;
	CString stmp = "";
	CString sAsId = "";
		//TRACE(" --- ShowPawnTicketNumbers\n");
	//BOOL bLock = LockUpdate();
	clear();
	setGridReadOnly(FALSE);
	try
	{
		//pLainaRS->Close();
		/*pLainaRS->m_strFilter.Format("LA_AS_HTun='"
			+ sHtun
			+ "' order by LA_Nr");*/
		sAsId.Format("%ld", AsId);
		pLainaRS->m_strFilter.Format("LA_AS_ID="
			+ sAsId
			+ " order by LA_Tila, LA_Nr");
		TRACE("...where %s\n", pLainaRS->m_strFilter);
		pLainaRS->Open();

		while (!pLainaRS->IsEOF())
		{
			lRows++;
			m_lLainojaKpl++;
			SetRowCount(lRows);

			SetValueRange(CGXRange(lRows, 1), pLainaRS->m_LA_Nr);
			SetValueRange(CGXRange(lRows, 2), pLainaRS->m_LA_LainanNimi);
			
			// --- lainan perustamispäivä ----
			sprintf(buf, "%s", pLainaRS->m_LA_AlkupPv.Format("%d.%m.%Y"));
			SetValueRange(CGXRange(lRows, 3), buf);
			//
			// --- Eräpäivä ---
			sprintf(buf, "%s", pLainaRS->m_LA_EraPv.Format("%d.%m.%Y"));
			SetValueRange(CGXRange(lRows, 4), buf);
			//
			// --- Lainan tila ---
			SetValueRange(CGXRange(lRows, 5), pLainaRS->m_LA_Tila);
			if (pLainaRS->m_LA_Tila == "L")		// lunastettu -> sininen
			{
				m_lLunastetutKpl++;
				SetStyleRange(CGXRange(lRows, 1, lRows, 16),
								CGXStyle().SetInterior(RGB(128,255,255))
								);
			}
			else if (pLainaRS->m_LA_Tila == "A")  // uudistettu -> vihreä ?
			{
				m_lAktiivisiaKpl++;
				m_dAktLainojaYhtEuro = m_dAktLainojaYhtEuro + pLainaRS->m_LA_Laina;
				SetStyleRange(CGXRange(lRows, 1, lRows, 16),
								CGXStyle().SetInterior(RGB(64,255,192))
								);
			}
			else if (pLainaRS->m_LA_Tila == "H")  // huutokaupassa -> orange ?
			{
				SetStyleRange(CGXRange(lRows, 1, lRows, 16),
								CGXStyle().SetInterior(RGB(255,128,128))
								);
			}
			else if (pLainaRS->m_LA_Tila == "M")  // myyty huutokaupassa -> light gray ?
			{
				SetStyleRange(CGXRange(lRows, 1, lRows, 16),
								CGXStyle().SetInterior(RGB(192,192,192))
								);
			}

			stmp.Format("%7.2f", pLainaRS->m_LA_VakSumma);
			SetValueRange(CGXRange(lRows, 6), stmp);
			stmp.Format("%7.2f", pLainaRS->m_LA_Laina);
			m_dLainojaYhtEuro = m_dLainojaYhtEuro + pLainaRS->m_LA_Laina;
			SetValueRange(CGXRange(lRows, 7), stmp);


			//
			// --- Odotuspäivä ---
			if(!pLainaRS->IsFieldNull(&pLainaRS->m_LA_OdotusPv))
				sprintf(buf, "%s", pLainaRS->m_LA_OdotusPv.Format("%d.%m.%Y"));
			else
				sprintf(buf, "");
			SetValueRange(CGXRange(lRows, 8), buf);


			// --- Viite ---
			sprintf(buf, "%s", theApp.buildReferenceNumberFor(pLainaRS->m_LA_Nr));
			SetValueRange(CGXRange(lRows, 9), buf);



			stmp.Format("%7.1f", pLainaRS->m_LA_Korko);
			SetValueRange(CGXRange(lRows, 10), stmp);
			SetValueRange(CGXRange(lRows, 11), pLainaRS->m_LA_Kielto);

			if (!pLainaRS->IsFieldNull(&pLainaRS->m_LA_KieltoRajaPv))
			{
				SetStyleRange(CGXRange(lRows, 1, lRows, 17),
								CGXStyle().SetInterior(RGB(255,0,0)) // red
								);
			}
			stmp.Format("%7.1f", pLainaRS->m_LA_SaVakMaksuPr);
			SetValueRange(CGXRange(lRows, 12), stmp);
			SetValueRange(CGXRange(lRows, 13), "0");
			stmp.Format("%7.2f", pLainaRS->m_LA_YlimSaMaksu);
			SetValueRange(CGXRange(lRows, 14), stmp);

			SetValueRange(CGXRange(lRows, 15), pLainaRS->m_LA_Liitteet);
			SetValueRange(CGXRange(lRows, 16), pLainaRS->m_LA_Huom);
			SetValueRange(CGXRange(lRows, 17), pLainaRS->m_LA_Varasto);

			if (pLainaRS->m_LA_EraPv < CTime::GetCurrentTime() &&
				!(pLainaRS->m_LA_Tila == "M" || pLainaRS->m_LA_Tila == "L"))
			{
				SetStyleRange(CGXRange(lRows, 4, lRows, 4),
								CGXStyle().SetInterior(RGB(250,141,69)) // rusk.punainen
								);
			}
			
			SetRowHeight(lRows,lRows,30); // Rivikork
			pLainaRS->MoveNext();
		}
	}
	catch (CDBException* e)
	{
		AfxMessageBox(e->m_strError);
		e->Delete();

	}
	pLainaRS->Close();
	//LockUpdate(bLock);
	Redraw();
	//
	setGridReadOnly(TRUE);
	
	if (lRows >= 1)
	{
		SetCurrentCell(1,0);
		strResult = GetValueRowCol(1,1);
		this->FindRow(atol(strResult));
	}
	else
	{
		SetCurrentCell(0,0);
		strResult = "";
	}

	this->resetWaitDateParam();

	//TRACE("Viimeisin lainanumero = %s\n", strResult);
	return strResult;
}