Esempio n. 1
0
uiBox *makePage16(void)
{
	uiBox *page16;
	uiTableModel *m;
	uiTable *t;
	uiTableColumn *tc;

	img[0] = uiNewImage(16, 16);
	appendImageNamed(img[0], "andlabs_16x16test_24june2016.png");
	appendImageNamed(img[0], "andlabs_32x32test_24june2016.png");
	img[1] = uiNewImage(16, 16);
	appendImageNamed(img[1], "tango-icon-theme-0.8.90_16x16_x-office-spreadsheet.png");
	appendImageNamed(img[1], "tango-icon-theme-0.8.90_32x32_x-office-spreadsheet.png");

	strcpy(row9text, "Part");

	memset(checkStates, 0, 15 * sizeof (int));

	page16 = newVerticalBox();

	mh.NumColumns = modelNumColumns;
	mh.ColumnType = modelColumnType;
	mh.NumRows = modelNumRows;
	mh.CellValue = modelCellValue;
	mh.SetCellValue = modelSetCellValue;
	m = uiNewTableModel(&mh);

	t = uiNewTable(m);
	uiBoxAppend(page16, uiControl(t), 1);

	uiTableAppendTextColumn(t, "Column 1", 0);

	tc = uiTableAppendColumn(t, "Column 2");
	uiTableColumnAppendImagePart(tc, 5, 0);
	uiTableColumnAppendTextPart(tc, 1, 0);
	uiTableColumnAppendTextPart(tc, 2, 1);
	uiTableColumnPartSetTextColor(tc, 1, 4);
	uiTableColumnPartSetEditable(tc, 2, 1);

	uiTableSetRowBackgroundColorModelColumn(t, 3);

	tc = uiTableAppendColumn(t, "Buttons");
	uiTableColumnAppendCheckboxPart(tc, 7, 0);
	uiTableColumnAppendButtonPart(tc, 6, 1);

	tc = uiTableAppendColumn(t, "Progress Bar");
	uiTableColumnAppendProgressBarPart(tc, 8, 0);

	return page16;
}
Esempio n. 2
0
int new_image( lua_State* L )
{
	uiImage* maybecopy = 0;
	if( lua_isuserdata( L, 1 ) )
	{
		int s;
		void* p = get_object( L, 1, &s );
		if( s == uiImageSignature )
		{
			maybecopy = p;
		}
	}

	uiImage* i = uiNewImage( maybecopy );
	
	if( lua_isstring( L, 1 ) )
	{
		uiImageLoad( i, lua_tostring( L, 1 ) );
	}
	
	object_create( L, i, uiImageSignature, image_members, 0 );
	return 1;
}