示例#1
0
void build_democontent(int parent) {
    // some persistent variables for demonstration
    static float progress1 = 0.25f;
    static float progress2 = 0.75f;
    static int option1 = 1;
    static int option2 = 0;
    static int option3 = 0;

    int col = column();
    uiInsert(parent, col);
    uiSetMargins(col, 10, 10, 10, 10);
    uiSetLayout(col, UI_TOP|UI_HFILL);
    
    column_append(col, button(BND_ICON_GHOST, "Item 1", demohandler));
    if (option3)
        column_append(col, button(BND_ICON_GHOST, "Item 2", demohandler));

    {
        int h = column_append(col, hbox());
        hgroup_append(h, radio(BND_ICON_GHOST, "Item 3.0", &enum1));
        if (option2)
            uiSetMargins(hgroup_append_fixed(h, radio(BND_ICON_REC, NULL, &enum1)), -1,0,0,0);
        uiSetMargins(hgroup_append_fixed(h, radio(BND_ICON_PLAY, NULL, &enum1)), -1,0,0,0);
        uiSetMargins(hgroup_append(h, radio(BND_ICON_GHOST, "Item 3.3", &enum1)), -1,0,0,0);
    }
    
    {
        int rows = column_append(col, row());
        int coll = row_append(rows, vgroup());
        vgroup_append(coll, label(-1, "Items 4.0:"));
        coll = vgroup_append(coll, vbox());
        vgroup_append(coll, button(BND_ICON_GHOST, "Item 4.0.0", demohandler));
        uiSetMargins(vgroup_append(coll, button(BND_ICON_GHOST, "Item 4.0.1", demohandler)),0,-2,0,0);
        int colr = row_append(rows, vgroup());
        uiSetMargins(colr, 8, 0, 0, 0);
        uiSetFrozen(colr, option1);
        vgroup_append(colr, label(-1, "Items 4.1:"));
        colr = vgroup_append(colr, vbox());
        vgroup_append(colr, slider("Item 4.1.0", &progress1));
        uiSetMargins(vgroup_append(colr, slider("Item 4.1.1", &progress2)),0,-2,0,0);
    }
    
    column_append(col, button(BND_ICON_GHOST, "Item 5", NULL));

    static char textbuffer[1024] = "The quick brown fox.";
    column_append(col, textbox(textbuffer, 1024));

    column_append(col, check("Frozen", &option1));
    column_append(col, check("Item 7", &option2));
    column_append(col, check("Item 8", &option3));
}
示例#2
0
void convert_lines(DataRow * row, std::vector<std::string> lines)
{
	std::vector<std::string>::iterator it = lines.begin();
	for (; it != lines.end(); it++) {
		DataCell * cell = cell_new(NULL, NULL);
		cell_set(cell, "", "", it->c_str(), 0);
		row_append(row, cell);
	}
}
示例#3
0
void convert_row(DataPage * page, std::vector<Cell> cells)
{
	if (cells.size() <= 0) {
		return;
	}
	
	DataRow * row = row_new(cells[0].key.row.c_str());
	std::vector<Hypertable::ThriftGen::Cell>::iterator it = cells.begin();
	int index = 1;
	for (; it != cells.end(); it++) {
		DataCell * cell = cell_new(NULL, NULL);
		cell_set(cell, it->key.column_family.c_str(),
				 it->key.column_qualifier.c_str(),
				 it->value.c_str(),
				 it->key.revision);
		row_append(row, cell);
		index++;
	}
	
	//add row
	page_append(page, row);
}