Пример #1
0
wxString generate_table() {
    myTable     table(4,2);
    wxString    sHTML;

    D(debug(wxT("generate_table()\n")));

    table.set_border(1);
    table.set_caption( wxT("Information Matrix") );
    //table.set_row_class(1, wxT("even"));

    table.cell(0, 0) = myCell( wxT("Field") );
    table.cell(0, 1) = myCell( wxT("Value") );
    table.cell(1, 0) = myCell( wxT("User name :") );
    table.cell(1, 1) = myCell( wxT("Michael Uman") );
    table.cell(2, 0) = myCell( wxT("Phone # :") );
    table.cell(2, 1) = myCell( wxT("(XXX) XXX-XXXX") );
    table.cell(3, 0) = myCell( wxT("User ID :") );
    table.cell(3, 1) = myCell( wxT("muman613") );
    //table.dump();
    //table.cell(0,0).Class( wxT("special") );

    sHTML = table.HTML();

    //printf("%s", sHTML.c_str());

    return sHTML;
}
Пример #2
0
int main (int argc, char ** argv)
{

	double temp;
	int tempint;
	//SpreadsheetCell tempCell(3.0);


	Spreadsheet s1(4,3);std::cout << "temp id s1 is" << s1.getId() <<std::endl;
	Spreadsheet s2(3,3);std::cout << "temp id s2 is" << s2.getId() <<std::endl;

	(s1.getCellAt(1,1)).setValue(3.0);
	
	s1.printSpreadsheet();	
	std::cout << std::endl;
	s2.printSpreadsheet();


	// exercise on overloading //
	SpreadsheetCell myCell(4), anotherCell(2), aThirdCell;
	std::string str = "hello";
	aThirdCell=myCell + str;

	temp=aThirdCell.getValue();
	
	//std::cout <<std::endl;
	std::cout << "temp is" << temp <<std::endl;
	

	/* exercise copy constructor*/
	//s1.setCellAt(1,1,tempCell);

	//tempint=s2.getId();
	//std::cout << "temp id is" << tempint <<std::endl;

	//play with copy cistructor
	
	//temp=(s2.getCellAt(1,1)).getValue();
	//std::cout << "temp is" << temp <<std::endl;

	//s1.setCellAt(2,2,tempCell);
	//s1.printSpreadsheet();	s2.printSpreadsheet();

	return (0);

}