Esempio n. 1
0
kGUIDbTableDefRowObj::kGUIDbTableDefRowObj(kGUIDbTableDefWindowObj *parent,const char *name,int type,int length,int maxlength,bool prikey,bool indexed)
{
    unsigned int i;

    m_parent=parent;
    m_name.SetString(name);
    m_name.SetEventHandler(this,CALLBACKNAME(ChangeNameorType));
    m_oldname.SetString(name);

    m_type.SetNumEntries(sizeof(sqltypes)/sizeof(SQLTYPES_DEF));
    for(i=0; i<sizeof(sqltypes)/sizeof(SQLTYPES_DEF); ++i)
        m_type.SetEntry(i,sqltypes[i].name,sqltypes[i].num);

    m_type.SetSelection(type);
    m_oldtype=m_type.GetSelection();
    m_type.SetEventHandler(this,CALLBACKNAME(ChangeNameorType));

    m_length.SetInt(length);
    m_maxlength.SetInt(maxlength);

    m_prikey.SetSelected(prikey);
    m_prikey.SetEventHandler(this,CALLBACKNAME(ChangePriKey));

    m_indexed.SetSelected(indexed);
    m_indexed.SetEventHandler(this,CALLBACKNAME(ChangeIndexed));

    m_objptrs[0]=&m_name;
    m_objptrs[1]=&m_type;
    m_objptrs[2]=&m_length;
    m_objptrs[3]=&m_maxlength;
    m_objptrs[4]=&m_prikey;
    m_objptrs[5]=&m_indexed;
    SetRowHeight(20);
}
Esempio n. 2
0
void CLogSpreadSheet::InsertLogContentToSheet(int nRow,StLogContent logContent)
{
	if(logContent.complete == false)
		SetRowColorNotComplete(nRow);
	else
		SetRowColorComplete(nRow);

	double cellHeight = m_nDefaultRowHeight + m_nDefaultRowHeight * GetBiggestNumOfCRLF(logContent);
	SetRowHeight(nRow, cellHeight);
	/*
	idx = logContent.request.Find("\r\n")

	if(logContent.request.Find("\r\n")!=-1 ||
		logContent.result.Find("\r\n") != -1 ||
		logContent.comment.Find("\r\n") != -1)
	{
		curHeight += m_nDefaultRowHeight;
		SetRowHeight(nRow,curHeight);
	}
	*/
	//SetCellType(SS_TT_MULTILINE_MULTI);
	SetCellValue(colLogID, nRow,logContent.logContentID);
	SetCellValue(colWriter, nRow,logContent.writer_name);
	SetCellValue(colBigGroup, nRow,logContent.bigGroup_name);
	SetCellValue(colMarket, nRow,logContent.market_name);
	SetCellValue(colManager, nRow,logContent.manager_name);
	SetCellValue(colTask, nRow,logContent.task_name);
	SetCellValue(colRequest, nRow,logContent.request);
	SetCellValue(colResult, nRow,logContent.result);
	SetCellValue(colComment, nRow,logContent.comment);
	SetCellValue(colLogDate, nRow,logContent.log_date.Left(10));	//XXXX-XX-XX 를 제외한 뒤의 시간은 삭제한다.
}
void
JXRowHeaderWidget::Receive
	(
	JBroadcaster*	sender,
	const Message&	message
	)
{
	// scrollbar moved

	if (sender == const_cast<JXScrollbar*>(itsVScrollbar) &&
		message.Is(JXScrollbar::kScrolled))
		{
		ScrollTo(0, itsVScrollbar->GetValue());
		}

	// rows changed

	else if (sender == itsTable && message.Is(JTable::kRowHeightChanged))
		{
		const JTable::RowHeightChanged* info =
			dynamic_cast(const JTable::RowHeightChanged*, &message);
		assert( info != NULL );
		SetRowHeight(info->GetIndex(), info->GetNewRowHeight());
		}

	else if (sender == itsTable && message.Is(JTable::kAllRowHeightsChanged))
Esempio n. 4
0
kGUIDbTableDataRowObj::kGUIDbTableDataRowObj(int num,const int *coltypes,const char **row)
{
    int i;

    SetRowHeight(20);
    m_num=num;
    m_objptrs=new kGUIObj *[num];

    for(i=0; i<num; ++i)
    {
        if(coltypes[i]==0)
        {
            kGUIInputBoxObj *tobj;

            tobj=new kGUIInputBoxObj;
            tobj->SetString(row[i]);
            m_objptrs[i]=tobj;
        }
        else
        {
            kGUITickBoxObj *tbobj;

            tbobj=new kGUITickBoxObj;
            tbobj->SetSelected(row[i][0]=='1');
            m_objptrs[i]=tbobj;
        }
    }
}
Esempio n. 5
0
void OOPLyric::Create(const wxArrayString &colorArray) {
    m_strName.assign(L"OOPLyric");
    m_align = ALIGN_SYNC_X_Y;

    SetRowHeight(15);   // 行高
    SetLinesUpDown(0);   // 滚轮失去了作用
    SetScrollRate(1, 1);   // 每行高 1px
    SetShownItemsAddIn(1);   // 每屏多显示1行
    CalcShownItems();

    SetAddinStyle(VSWS_NO_SCROLLBAR | VLCS_NO_SELECT);

    //======================================================

    m_TextColor.Set(colorArray[0]);
    m_HilightColor.Set(colorArray[1]);
    m_BgColor.Set(colorArray[2]);
    m_crossBrush1 = m_crossBrush2 = wxBrush(m_BgColor, wxSOLID);

    InsertColumn(VdkLcColumnInitializer(this).
                 percentage(100).
                 width(m_Rect.width).
                 textAlign(TEXT_ALIGN_CENTER_X_Y).
                 textColor(m_TextColor));

    //======================================================

    m_WindowImpl->Bind(wxEVT_SHOW, &OOPLyric::OnParentShow, this);
    wxTheApp->Bind(wxEVT_TIMER, &OOPLyric::OnTimerNotify, this, m_timerId);
}
Esempio n. 6
0
kGUIDbTablesListRowObj::kGUIDbTablesListRowObj(kGUIDb *dbobj)
{
    SetRowHeight(20);
    m_objptrs[0]=&m_text;
    m_dbobj=dbobj;

    m_text.SetEventHandler(this,& CALLBACKNAME(NameEvent));
}
Esempio n. 7
0
void CRGXMainWndGrid::SetColumnWidths()
{
	BOOL bOldLock = LockUpdate();

	SetColWidth(0,0,15);
	SetColWidth(1,1,40); // Lainan numero
	SetColWidth(2,2, 140);// nimi
	SetColWidth(3,3, 59);// päiväys
	SetColWidth(4,4, 59);// eräpäivä
	SetColWidth(5,5,15); // tila
	SetColWidth(6,6,59); // Vakuusarvo
	SetColWidth(7,7,59); // Lainan määrä
	SetColWidth(8,8,90); // OdotusPv
	SetColWidth(9,9,70); // Viite#
	SetColWidth(10,10,0); // Korko%
	SetColWidth(11,11,30); // Kielto
	SetColWidth(12,12,0); // SäilVakMaksu
	SetColWidth(13,13,0); // Kuittimaksu
	SetColWidth(14,14,0); // YlimSäilMaksu
	SetColWidth(15,15,30); // Liitteet
	SetColWidth(16,16,40); // Huom
	SetColWidth(17,17,0); // Varasto
	//SetColWidth(18,18,20); //

	SetRowHeight(1,13,30); // Rivikork
	
	SetStyleRange(CGXRange(0,1), CGXStyle().SetValue("Laina"));
	SetStyleRange(CGXRange(0,2), CGXStyle().SetValue("LaNimi"));
	SetStyleRange(CGXRange(0,3), CGXStyle().SetValue("AlkuPv"));
	SetStyleRange(CGXRange(0,4), CGXStyle().SetValue("EräPv"));
	SetStyleRange(CGXRange(0,5), CGXStyle().SetValue("Tila"));
	SetStyleRange(CGXRange(0,6), CGXStyle().SetValue("VakArvo"));
	SetStyleRange(CGXRange(0,7), CGXStyle().SetValue("Laina"));
	 SetStyleRange(CGXRange(0,8), CGXStyle().SetValue("OdotusPv"));
	 SetStyleRange(CGXRange(0,9), CGXStyle().SetValue("Viite#"));

	SetStyleRange(CGXRange(0,10), CGXStyle().SetValue("Korko%"));
	SetStyleRange(CGXRange(0,11), CGXStyle().SetValue("Kielto"));

	SetStyleRange(CGXRange(0,12), CGXStyle().SetValue("Säilytysmaksu"));
	SetStyleRange(CGXRange(0,13), CGXStyle().SetValue("Kuittimaksu"));
	SetStyleRange(CGXRange(0,14), CGXStyle().SetValue("YlimSäilytysmaksu"));

	SetStyleRange(CGXRange(0,15), CGXStyle().SetValue("Liitteet"));
	SetStyleRange(CGXRange(0,16), CGXStyle().SetValue("Huom"));
	SetStyleRange(CGXRange(0,17), CGXStyle().SetValue("Varasto"));

	//SetStyleRange(CGXRange(0,17), CGXStyle().SetValue(""));
	//SetStyleRange(CGXRange(0,18), CGXStyle().SetValue(""));
	//SetStyleRange(CGXRange(0,19), CGXStyle().SetValue(""));
/*	SetStyleRange(CGXRange().SetCols(8),
								CGXStyle()
								.SetControl(GX_IDS_CTRL_DATETIME)
							);
*/
	LockUpdate(bOldLock);
}
void
JXColHeaderWidget::ApertureResized
	(
	const JCoordinate dw,
	const JCoordinate dh
	)
{
	JXEditTable::ApertureResized(dw,dh);
	SetRowHeight(1, GetApertureHeight());
}
Esempio n. 9
0
GPXMapPathRow::GPXMapPathRow()
{
	m_objectlist[0]=&m_path;
	m_objectlist[1]=&m_browse;
	m_browse.SetFontID(1);		/* bold */
	m_browse.SetFontSize(20);	/* big! */
	m_browse.SetString("...");
	m_browse.SetEventHandler(this,CALLBACKNAME(Browse));
	m_path.SetEventHandler(this,CALLBACKNAME(PathChangedEvent));
	SetRowHeight(20);
}
Esempio n. 10
0
BOOL CCombAnalysisReport::Create(IDrawBaseParam *pParam)
{
	//表格基本属性
	SetStyle(TABLE_STYLE_SCREEN | TABLE_ROW_SELECT);
	SetRowHeight(COMBANALYSISREPOR_ROW_HEIGHT);
	//垂直滚动条
	CreateVerScroll(HSSB_VERT | HSSB_RIGHT);
	m_pVerScrollBar->SetSize(20);
	//水平滚动条
	CreateHorScroll(HSSB_HORZ | HSSB_DOWN );
	m_pHorScrollBar->SetSize(20);
	InitReport();

	return TRUE;
}
Esempio n. 11
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);
	}
}
Esempio n. 12
0
GPXMapOverlayRow::GPXMapOverlayRow()
{
	m_objectlist[0]=&m_enabled;
	m_objectlist[1]=&m_alpha;
	m_objectlist[2]=&m_filename;
	m_objectlist[3]=&m_browse;
	m_browse.SetFontID(1);		/* bold */
	m_browse.SetFontSize(20);	/* big! */
	m_browse.SetString("...");
	m_browse.SetEventHandler(this,CALLBACKNAME(Browse));
	m_enabled.SetEventHandler(this,CALLBACKNAME(Changed));
	m_alpha.SetEventHandler(this,CALLBACKNAME(Changed));
	m_filename.SetEventHandler(this,CALLBACKNAME(NameChanged));

	gpx->InitAlphaCombo(&m_alpha);

	SetRowHeight(20);
	m_overlay=0;
}
Esempio n. 13
0
BOOL GGridCtrl::Create(const RECT& rect, CWnd* parent, UINT nID, DWORD dwStyle )
{	
	RECT rc;
	parent->GetClientRect( &rc );
	rc.left += 3; rc.top += 15; rc.right -= 3; rc.bottom -= 3;
	if( !CGridCtrl::Create( rc, parent, nID, dwStyle ) )	
		return FALSE;

	EnableDragAndDrop(TRUE);
	SetFixedColumnSelection(TRUE);
	SetFixedRowSelection(TRUE);
	EnableColumnHide();
	AutoSize();
	SetCompareFunction(CGridCtrl::pfnCellNumericCompare);
	SetFixedRowCount(1);
	SetFixedColumnCount(1);		
	EnableDragRowMode( FALSE );
	EnableDragAndDrop( FALSE );	
	SetSingleRowSelection(TRUE);
	SetFixedRowSelection( TRUE );
	SetFixedColumnSelection( TRUE );
	SetRowHeight(0,20);
	return TRUE;
}
Esempio n. 14
0
void CLayerTypeGrid::ExpandLayerGroup(int groupNameRowIndx)
{
   int rowCnt = GetNumberRows();
   int lastColIndx = GetNumberCols() - 1;

   bool keepGoing = true;
   for (int rowIndx = groupNameRowIndx+1; rowIndx < rowCnt && keepGoing; rowIndx++)
   {
      CString cellText( QuickGetText(lastColIndx, rowIndx) );
      int layerType = atoi(cellText);
      if (layerType < 0)
      {
         keepGoing = false;
      }
      else
      {
         SetRowHeight(rowIndx, m_expandedRowHeight);
      }
   }

   CString groupNameText( QuickGetText(0, groupNameRowIndx) );
   groupNameText.SetAt(0, '-');  // Is now expanded, show operator to collapse.
   QuickSetText(0, groupNameRowIndx, groupNameText);
}
Esempio n. 15
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;
}
Esempio n. 16
0
void CRGXMainWndGrid::updateLoanRowInfo(long loanNr)
{
	CString stmp = "";
	char buf[20];
	setGridReadOnly(FALSE);
	
	for (int i = 1; i <= int(this->GetRowCount()); i++)
	{
		if (atol(this->GetValueRowCol(i, 1)) == loanNr)
		{
			TRACE("Lainan rivi = %ld\n", i);
			break;
		}
	}
	try
	{
		pLainaRS->m_strFilter.Format("LA_Nr = %ld", loanNr);
		pLainaRS->Open();

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

			stmp.Format("%7.2f", pLainaRS->m_LA_VakSumma);
			SetValueRange(CGXRange(i, 6), stmp);
			stmp.Format("%7.2f", pLainaRS->m_LA_Laina);
			SetValueRange(CGXRange(i, 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(i, 8), buf);


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



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

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

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

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

	}
	pLainaRS->Close();
	//LockUpdate(bLock);
	Redraw();
	//
	setGridReadOnly(TRUE);
}
Esempio n. 17
0
void ctlSQLGrid::OnLabelDoubleClick(wxGridEvent &event)
{
	int maxHeight, maxWidth;
	GetClientSize(&maxWidth, &maxHeight);
	int row = event.GetRow();
	int col = event.GetCol();

	int extent, extentWant = 0;

	if (row >= 0)
	{
		for (col = 0 ; col < GetNumberCols() ; col++)
		{
			extent = GetBestSize(row, col).GetHeight();
			if (extent > extentWant)
				extentWant = extent;
		}

		extentWant += EXTRAEXTENT_HEIGHT;
		extentWant = wxMax(extentWant, GetRowMinimalAcceptableHeight());
		extentWant = wxMin(extentWant, maxHeight * 3 / 4);
		int currentHeight = GetRowHeight(row);

		if (currentHeight >= maxHeight * 3 / 4 || currentHeight == extentWant)
			extentWant = GetRowMinimalAcceptableHeight();
		else if (currentHeight < maxHeight / 4)
			extentWant = wxMin(maxHeight / 4, extentWant);
		else if (currentHeight < maxHeight / 2)
			extentWant = wxMin(maxHeight / 2, extentWant);
		else if (currentHeight < maxHeight * 3 / 4)
			extentWant = wxMin(maxHeight * 3 / 4, extentWant);

		if (extentWant != currentHeight)
		{
			BeginBatch();
			if(IsCellEditControlShown())
			{
				HideCellEditControl();
				SaveEditControlValue();
			}

			SetRowHeight(row, extentWant);
			EndBatch();
		}
	}
	else if (col >= 0)
	{
		// Holding Ctrl or Meta switches back to automatic column's sizing
		if (event.ControlDown() || event.CmdDown())
		{
			colSizes.erase(GetColKeyValue(col));
			BeginBatch();
			if(IsCellEditControlShown())
			{
				HideCellEditControl();
				SaveEditControlValue();
			}
			AutoSizeColumn(col, false);
			EndBatch();
		}
		else // toggle between some predefined sizes
		{

			if (col < (int)colMaxSizes.GetCount() && colMaxSizes[col] >= 0)
				extentWant = colMaxSizes[col];
			else
			{
				for (row = 0 ; row < GetNumberRows() ; row++)
				{
					if (CheckRowPresent(row))
					{
						extent = GetBestSize(row, col).GetWidth();
						if (extent > extentWant)
							extentWant = extent;
					}
				}
			}

			extentWant += EXTRAEXTENT_WIDTH;
			extentWant = wxMax(extentWant, GetColMinimalAcceptableWidth());
			extentWant = wxMin(extentWant, maxWidth * 3 / 4);
			int currentWidth = GetColumnWidth(col);

			if (currentWidth >= maxWidth * 3 / 4 || currentWidth == extentWant)
				extentWant = GetColMinimalAcceptableWidth();
			else if (currentWidth < maxWidth / 4)
				extentWant = wxMin(maxWidth / 4, extentWant);
			else if (currentWidth < maxWidth / 2)
				extentWant = wxMin(maxWidth / 2, extentWant);
			else if (currentWidth < maxWidth * 3 / 4)
				extentWant = wxMin(maxWidth * 3 / 4, extentWant);

			if (extentWant != currentWidth)
			{
				BeginBatch();
				if(IsCellEditControlShown())
				{
					HideCellEditControl();
					SaveEditControlValue();
				}
				SetColumnWidth(col, extentWant);
				EndBatch();
				colSizes[GetColKeyValue(col)] = extentWant;
			}
		}
	}
}
Esempio n. 18
0
void ctlSQLGrid::OnLabelDoubleClick(wxGridEvent &event)
{
	int maxHeight, maxWidth;
	GetClientSize(&maxWidth, &maxHeight);
	int row = event.GetRow();
	int col = event.GetCol();

	int extent, extentWant = 0;

	if (row >= 0)
	{
		for (col = 0 ; col < GetNumberCols() ; col++)
		{
			extent = GetBestSize(row, col).GetHeight();
			if (extent > extentWant)
				extentWant = extent;
		}

		extentWant += EXTRAEXTENT_HEIGHT;
		extentWant = wxMax(extentWant, GetRowMinimalAcceptableHeight());
		extentWant = wxMin(extentWant, maxHeight * 3 / 4);
		int currentHeight = GetRowHeight(row);

		if (currentHeight >= maxHeight * 3 / 4 || currentHeight == extentWant)
			extentWant = GetRowMinimalAcceptableHeight();
		else if (currentHeight < maxHeight / 4)
			extentWant = wxMin(maxHeight / 4, extentWant);
		else if (currentHeight < maxHeight / 2)
			extentWant = wxMin(maxHeight / 2, extentWant);
		else if (currentHeight < maxHeight * 3 / 4)
			extentWant = wxMin(maxHeight * 3 / 4, extentWant);

		if (extentWant != currentHeight)
		{
			BeginBatch();
			if(IsCellEditControlShown())
			{
				HideCellEditControl();
				SaveEditControlValue();
			}

			SetRowHeight(row, extentWant);
			EndBatch();
		}
	}
	else if (col >= 0)
	{
		for (row = 0 ; row < GetNumberRows() ; row++)
		{
			if (CheckRowPresent(row))
			{
				extent = GetBestSize(row, col).GetWidth();
				if (extent > extentWant)
					extentWant = extent;
			}
		}

		extentWant += EXTRAEXTENT_WIDTH;
		extentWant = wxMax(extentWant, GetColMinimalAcceptableWidth());
		extentWant = wxMin(extentWant, maxWidth * 3 / 4);
		int currentWidth = GetColumnWidth(col);

		if (currentWidth >= maxWidth * 3 / 4 || currentWidth == extentWant)
			extentWant = GetColMinimalAcceptableWidth();
		else if (currentWidth < maxWidth / 4)
			extentWant = wxMin(maxWidth / 4, extentWant);
		else if (currentWidth < maxWidth / 2)
			extentWant = wxMin(maxWidth / 2, extentWant);
		else if (currentWidth < maxWidth * 3 / 4)
			extentWant = wxMin(maxWidth * 3 / 4, extentWant);

		if (extentWant != currentWidth)
		{
			BeginBatch();
			if(IsCellEditControlShown())
			{
				HideCellEditControl();
				SaveEditControlValue();
			}
			SetColumnWidth(col, extentWant);
			EndBatch();
		}
	}
}
Esempio n. 19
0
BOOL CDrawRFinance::CreateSelf()
{
	m_ayTitleInt.RemoveAll();
	m_ayTitleStr.RemoveAll();
	m_ayTitleInt.Add(COLUMN_FINANCE_REPORT_DATE);         //38 报告期
	m_ayTitleStr.Add("报告期");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_TOTAL);        //1 总股本(万股)
	m_ayTitleStr.Add("总股本");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_PASS_A);	      //7 流通A股 
	m_ayTitleStr.Add("流通A股");
	m_ayTitleInt.Add(COLUMN_FINANCE_ASSETS_YIELD); 	      //37 净资收益率
	m_ayTitleStr.Add("净资收益率");
	m_ayTitleInt.Add(COLUMN_FINANCE_MAIN_INCOME);  	      //20 主营收入
	m_ayTitleStr.Add("主营收入");

	m_ayTitleInt.Add(COLUMN_FINANCE_TOTAL_PROFIT);	      //28 利润总额
	m_ayTitleStr.Add("利润总额");
	m_ayTitleInt.Add(COLUMN_FINANCE_PER_UNPAID);   	      //32 每股未分配
	m_ayTitleStr.Add("每股未分配");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_NATIONAL);	  //2 国家股
	m_ayTitleStr.Add("国家股");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_INITIATOR);	  //3 发起人法人股
	m_ayTitleStr.Add("发起人法人股");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_CORPORATION);  //4 法人股 
	m_ayTitleStr.Add("法人股");

	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_B);            //5 B股
	m_ayTitleStr.Add("B股");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_H);			  //6 H股
	m_ayTitleStr.Add("H股");
	m_ayTitleInt.Add(COLUMN_CAPITALIZATION_EMPLOYEE);     //8 职工股
	m_ayTitleStr.Add("职工股");
	m_ayTitleInt.Add(COLUMN_FINANCE_TOTAL_ASSETS);   	  //10 总资产
	m_ayTitleStr.Add("总资产");
	m_ayTitleInt.Add(COLUMN_FINANCE_CURRENT_ASSETS);	  //11 流动资产  
	m_ayTitleStr.Add("流动资产");

	m_ayTitleInt.Add(COLUMN_FINANCE_CAPITAL_ASSETS);	  //12 固定资产  
	m_ayTitleStr.Add("固定资产");
	m_ayTitleInt.Add(COLUMN_FINANCE_UNBODIED_ASSETS);	  //13 无形资产  
	m_ayTitleStr.Add("无形资产");
	m_ayTitleInt.Add(COLUMN_FINANCE_CURRENT_LIABILITIES); //15 流动负债 
	m_ayTitleStr.Add("流动负债");
	m_ayTitleInt.Add(COLUMN_FINANCE_LONG_LIABILITIES);	  //16 长期负债 
	m_ayTitleStr.Add("长期负债");
	m_ayTitleInt.Add(COLUMN_FINANCE_CAPITAL_ACCFUND);	  //17 资本公积金
	m_ayTitleStr.Add("资本公积金");

	m_ayTitleInt.Add(COLUMN_FINANCE_PERSTOCK_ACCFUND);	  //18 每股公积金
	m_ayTitleStr.Add("每股公积金");
	m_ayTitleInt.Add(COLUMN_FINANCE_PARTNER_RIGHT);	      //19 股东权益  
	m_ayTitleStr.Add("股东权益");
	m_ayTitleInt.Add(COLUMN_FINANCE_TAKING_PROFIT);	      //23 营业利润  
	m_ayTitleStr.Add("营业利润");
	m_ayTitleInt.Add(COLUMN_FINANCE_YIELD);   	          //24 投资收益  
	m_ayTitleStr.Add("投资收益");
	m_ayTitleInt.Add(COLUMN_FINANCE_OTHER_INCOME);	      //26 营业外收支
	m_ayTitleStr.Add("营业外收支");

	m_ayTitleInt.Add(COLUMN_FINANCE_SCOT_PROFIT);	       //29 税后利润
	m_ayTitleStr.Add("税后利润");
	m_ayTitleInt.Add(COLUMN_FINANCE_RETAINED_PROFITS);	   //30 净利润
	m_ayTitleStr.Add("净利润");
	m_ayTitleInt.Add(COLUMN_FINANCE_PER_INCOME);	       //33 每股收益
	m_ayTitleStr.Add("每股收益");
	m_ayTitleInt.Add(COLUMN_FINANCE_PER_ASSETS);		   //34 每股净资产
	m_ayTitleStr.Add("每股净资产");
	m_ayTitleInt.Add(COLUMN_FINANCE_PARTNER_RIGHT_RATIO);  //36 股东权益比
	m_ayTitleStr.Add("股东权益比");

	DWORD lItemStyle(-1);
	DWORD lCellStyle(-1);
	////////////////////////////  第一列  //////////////////////////////////////
	lItemStyle = ITEM_TEXT_LEFT;
	for (int i = 0; i < m_ayTitleInt.GetCount(); i++)
	{
		CreateCell(m_ayTitleStr.GetAt(i),  TEXT_COLOR_FIXEDNAME, TEXT_FONT_FINANCE, lItemStyle);
	}

	////////////////////////////  第二列  //////////////////////////////////////
	lItemStyle = ITEM_TEXT_RIGHT;
	for (int i = 0; i < m_ayTitleInt.GetCount(); i++)
	{
		CreateCell("", TEXT_COLOR_FIXEDNAME, TEXT_FONT_FINANCE, lItemStyle);
	}

	SetRowCount(m_ayTitleInt.GetCount());
	SetColCount(RFinance_COL);
	SetFixColCount(0);
	SetFixRowCount(0);
	SetRowHeight(RFinance_ROW_HEIGHT);
	
	return TRUE;
}