void cMenu::addPropertyField( uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t property, uint32_t subProperty, uint32_t hue, uint32_t subProperty2 ) { VAR_TYPE t = getPropertyType( property ); int32_t props = getIntFromProps( property, subProperty, subProperty2 ); if( t==T_BOOL ) { addCheckbox( x, y, 0x00D2, 0x00D3, getPropertyFieldBool( buffer[0], buffer[1], property, subProperty, subProperty2 ), props ); } else { addInputField( x, y, width, height, props, getPropertyField( buffer[0], buffer[1], property, subProperty, subProperty2 ), hue ); } editProps.insert( make_pair( props, rc_serialCurrent-1 ) ); }
void DemoInterface::initGUI() { // Check CGFinterface.h and GLUI documentation for the types of controls available GLUI_Panel *varPanel= addPanel("Teapot Shader", 1); addSpinnerToPanel(varPanel, "normScale", 2,NULL, 1); addColumn(); varPanel= addPanel("Display List", 1); addCheckboxToPanel(varPanel, "Use", &(((DemoScene*) scene)->myDLObj->usingDL), 2); addColumn(); varPanel= addPanel("Animations", 1); addButtonToPanel(varPanel, "Reset", 3); addColumn(); addCheckbox( "Wireframe", &(((DemoScene*) scene)->wireframe), 4); }
/** * @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; }