示例#1
0
//添加栏目
void WSPopTable::AppendRows(std::string strRowName)
{
	int iLast = pFirstTable->numRows();
	iLast++;

	//RowTitle
	WTable * pTitleTable = new WTable((WContainerWidget *)pFirstTable->elementAt(iLast,0));
	pTitleTable->setStyleClass("padding_5");
	pTitleTable->resize(WLength(100,WLength::Percentage),WLength());
	pTitleTable->elementAt(0,0)->setStyleClass("textbold");
	pTitleText = new WText(strRowName, pTitleTable->elementAt(0,0));

	//Help
	if(bHelp)
	{
		pTitleTable->elementAt(0, 1)->setContentAlignment(AlignRight|AlignTop);
		pHelpImg = new WImage("/Images/help.png","", pTitleTable->elementAt(0, 1));
		pHelpImg->setStyleClass("hand");
	}

	//RowContent
	iLast++;
	pFirstTable->elementAt(iLast,0)->setStyleClass("padding_2");
	
	WTable * pRowContentTable = new WTable((WContainerWidget *)pFirstTable->elementAt(iLast, 0));
	
	pRowContentTable->resize(WLength(100,WLength::Percentage),WLength());
	
	//top
	ShowTop(pRowContentTable);

	//content
	pRowContentTable->elementAt(1, 0)->setStyleClass("pop_table_mid_l");	
	
	WTable * pReturnTable = new WTable((WContainerWidget *)pRowContentTable->elementAt(1, 1));
	
	pReturnTable->resize(WLength(100,WLength::Percentage),WLength());
	pReturnTable->setStyleClass("bgcolor");

	//
	pReturnTable->elementAt(0, 0)->setStyleClass("padding_5");
	m_pListContentTable.push_back(new WTable((WContainerWidget *)pReturnTable->elementAt(0, 0)));

	//分隔线
	pReturnTable->elementAt(1,0)->setStyleClass("padding_5");
	WTable * pLineTable = new WTable((WContainerWidget *)pReturnTable->elementAt(1, 0));
	pLineTable->resize(WLength(100,WLength::Percentage), WLength());
	pLineTable->elementAt(0, 0)->setStyleClass("table_data_input_space");
	new WImage("/Images/space.gif","",pLineTable->elementAt(0, 0));
	
	//ActionTable
	pReturnTable->elementAt(2,0)->setStyleClass("padding_2");
	m_pListActionTable.push_back(new WTable((WContainerWidget *)pReturnTable->elementAt(2,0)));

	pRowContentTable->elementAt(1, 2)->setStyleClass("pop_table_mid_r");
	
	//bottom
	ShowBottom(pRowContentTable);
}
示例#2
0
void CSVWholeview::NewInitForm()
{
    int pRow = numRows();
	//elementAt(pRow, 0)->resize(WLength(90, WLength::Percentage), 0);
	elementAt(pRow, 0)->setContentAlignment(AlignCenter);
	WTable *pSub = new WTable(elementAt(pRow, 0));
	if(pSub)
	{
		//elementAt(pRow, 0)->setStyleClass("padding_top");
		pSub->setStyleClass("padding_top");
		//pSub->setStyleClass("padding_2");
		pSub->resize(WLength(96, WLength::Percentage), 0);

		WText *pTitle = new WText(m_szTitle, pSub->elementAt(0, 0));
		pSub->elementAt(0, 0)->setStyleClass("textbold1");

		m_pTime = new WText("local time", pSub->elementAt(0, 1));
		pSub->elementAt(0, 1)->setContentAlignment(AlignRight | AlignTop);

		//m_pMainTable = new WSVMainTable(elementAt(pRow, 0), m_szTitle, false);
		//m_pTime = new WText("local time", m_pMainTable->GetContentTable()->elementAt(0, 0));
		//m_pMainTable->elementAt(0, 1)->setContentAlignment(AlignRight | AlignTop);

		svutil::TTime ttime = svutil::TTime::GetCurrentTimeEx();
		string curTime = ttime.Format();
		if(m_pTime)
		{
			m_pTime->setText(m_szRefreshTime + curTime);
		}
	}

	pRow = numRows();
	m_pMainTable = new WSVMainTable(elementAt(pRow, 0), "", false);
	m_pFlexTable = new WSVFlexTable(m_pMainTable->GetContentTable()->elementAt(1, 0), EntityDes, "");
	m_pContent = new WTable(m_pFlexTable->GetContentTable()->elementAt(1, 0));
	m_pContent->setStyleClass("widthauto");
}