当前位置: 首页>>代码示例>>C++>>正文


C++ Row::destroy方法代码示例

本文整理汇总了C++中Row::destroy方法的典型用法代码示例。如果您正苦于以下问题:C++ Row::destroy方法的具体用法?C++ Row::destroy怎么用?C++ Row::destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Row的用法示例。


在下文中一共展示了Row::destroy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: if

void
RecordView::AddSheetRecord (Sheet * sheet) {
	ASSERT (sheet != NULL);
	GtkSheet * gtksheet = GTK_SHEET (sheet->gtk_sheet);
	GtkSheetRange range = {gtksheet->range.row0, 0, gtksheet->range.rowi, 0};
	Row * tuple = row_new (gtksheet->maxcol + 1);
	gint sheet_rows = 1;
	
	// More than one row is selected; we must transpose them all into the RV sheet.
	if (range.row0 != range.rowi) {
		sheet_rows = range.rowi - range.row0 + 1;
	}
			
	Sheet * record_sheet = this->wb->add_new_sheet (this->wb,sheet->name,gtksheet->maxcol + 1,sheet_rows);
	int column = 0, row = 0;

	do {
		sheet->get_row (sheet, range.row0, tuple->cells, tuple->size);

		// Change the titles of the columns to the row titles. This is only going to work if the
		// row titles have been explicitly set somewhere inside of the plugin.
		record_sheet->set_column_title (record_sheet,
												  row,
												  sheet->row_titles->cells[range.row0]->value->str);
		
		for (int ii = 0; ii < tuple->size; ii++) {
			// We only need to change the row titles once. This can happen on our last iteration.
			if (range.row0 == range.rowi) {
				record_sheet->set_row_title (record_sheet,
													  ii,
													  sheet->column_titles->cells[ii]->value->str);

			}
			
			record_sheet->set_cell (record_sheet,
											ii,
											column,
											tuple->cells[ii]->value->str);

			if (sheet->cells[range.row0][ii]->attributes.highlighted == TRUE) {
				record_sheet->set_cell_background (record_sheet, ii, column, "#ffffcc");
			}
			else if (((ii + 1) % 2) == 0) {
				record_sheet->set_cell_background (record_sheet, ii, column, "#f9f7f9");
			}
		}
		
		range.row0++; column++; row++;
	} while (range.row0 <= range.rowi);

	tuple->destroy (tuple);
}
开发者ID:johnbellone,项目名称:gtkworkbook,代码行数:52,代码来源:RecordView.cpp


注:本文中的Row::destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。