コード例 #1
0
ファイル: GuiPane.cpp プロジェクト: A7med-Shoukry/g3d
GuiDropDownList* GuiPane::addDropDownList
(const GuiText& caption, 
 const Array<std::string>& list,
 const Pointer<int>& pointer,
 const GuiControl::Callback& actionCallback) {

    Array<GuiText> c;
    c.resize(list.size());
    for (int i = 0; i < c.size(); ++i) {
        c[i] = list[i];
    }
    return addDropDownList(caption, c, pointer, actionCallback);
}
コード例 #2
0
ファイル: maingtk.c プロジェクト: emilw/MixedStuff
/**
* @brief Starts the whole application and calls the electrolibui to present the UI in GTK
*
* Starts the whole application and calls the electrolibui to present the UI in GTK
* @return void
**/
int main(int argc, char *argv[]){
    GtkWidget *calcButton;
    GtkWidget *closeButton;

    _mainGrid = createWindowAndMainGrid(argc, argv, destroy, delete_event);

    addOutputLabel(_mainGrid, "Ange basdata: ", 1, 1, 1);
    addInputSection("Ange spänningskälla i V: ",_mainGrid, voltageChanged, 1, 2,0);
    addCheckbox("Räkna med Parallell koppling istället för Seriell",_mainGrid, connectionTypeChanged, 1, 3);
    addDropDownList(10,_mainGrid, numberOfComponentsChanged, 1,4);
    
    addOutputLabel(_mainGrid, "Komponenter och spänning: ", 2, 1, 1);
    initResistanceListSection(getNumberOfComponents(),0, &_resistanceValueList, _mainGrid, resistanceListItemChanged);
    addButton("Beräkna!", _mainGrid, calculateAndPresentOutput, 1, 5, 2);
    addButton("Avsluta", _mainGrid, destroy, 1, 9, 2);
    addButton("Test!", _mainGrid, runTestsEvent, 1, 10, 2);

    gtk_main();
    return 0;
}