static void _updateColor(void) { uint32_t color; color = (unsigned)gwinSliderGetPosition(ghSliderR) << 16; color |= (unsigned)gwinSliderGetPosition(ghSliderG) << 8; color |= (unsigned)gwinSliderGetPosition(ghSliderB) << 0; gwinSetBgColor(ghWindow1, HTML2COLOR(color)); gwinClear(ghWindow1); }
/** * Set the value of the labels */ static void setLabels(void) { char tmp[20]; // The sliders snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider1)); gwinSetText(ghLabelSlider1, tmp, TRUE); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider2)); gwinSetText(ghLabelSlider2, tmp, TRUE); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider3)); gwinSetText(ghLabelSlider3, tmp, TRUE); snprintg(tmp, sizeof(tmp), "%d%%", gwinSliderGetPosition(ghSlider4)); gwinSetText(ghLabelSlider4, tmp, TRUE); // The radio buttons if (gwinRadioIsPressed(ghRadio1)) gwinSetText(ghLabelRadio1, "Yes", TRUE); else if (gwinRadioIsPressed(ghRadio2)) gwinSetText(ghLabelRadio1, "No", TRUE); }