Complete redesign of styling system

This commit is contained in:
Ray
2018-11-13 12:56:12 +01:00
parent 1fa1e001ff
commit a14a2f2989
2 changed files with 858 additions and 1366 deletions

View File

@ -75,6 +75,8 @@ int main()
char multiTextBoxText[141] = "Multi text box"; char multiTextBoxText[141] = "Multi text box";
bool multiTextBoxEditMode = false; bool multiTextBoxEditMode = false;
Color colorPickerValue = RED;
bool forceSquaredChecked = false; bool forceSquaredChecked = false;
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -97,7 +99,7 @@ int main()
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
BeginDrawing(); BeginDrawing();
ClearBackground(GetColor(style[DEFAULT_BACKGROUND_COLOR])); ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
// raygui: controls drawing // raygui: controls drawing
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
@ -110,7 +112,17 @@ int main()
if (GuiValueBox((Rectangle){ 25, 175, 125, 30 }, &valueBox002Value, 0, 100, valueBoxEditMode)) valueBoxEditMode = !valueBoxEditMode; if (GuiValueBox((Rectangle){ 25, 175, 125, 30 }, &valueBox002Value, 0, 100, valueBoxEditMode)) valueBoxEditMode = !valueBoxEditMode;
if (GuiTextBox((Rectangle){ 25, 215, 125, 30 }, textBoxText, 64, textBoxEditMode)) textBoxEditMode = !textBoxEditMode; if (GuiTextBox((Rectangle){ 25, 215, 125, 30 }, textBoxText, 64, textBoxEditMode)) textBoxEditMode = !textBoxEditMode;
if (GuiButton((Rectangle){ 25, 255, 125, 30 }, "SAMPLE TEXT")) { } if (GuiButton((Rectangle){ 25, 255, 125, 30 }, "SAMPLE TEXT")) { }
// NOTE: GuiDropdownBox must draw at the end of the column
GuiGroupBox((Rectangle){ 25, 310, 125, 150 }, "CONTROL STATES");
GuiLock();
GuiState(GUI_STATE_NORMAL); if (GuiButton((Rectangle){ 30, 320, 115, 30 }, "NORMAL")) { }
GuiState(GUI_STATE_FOCUSED); if (GuiButton((Rectangle){ 30, 355, 115, 30 }, "FOCUSED")) { }
GuiState(GUI_STATE_PRESSED); if (GuiButton((Rectangle){ 30, 390, 115, 30 }, "PRESSED")) { }
GuiState(GUI_STATE_DISABLED); if (GuiButton((Rectangle){ 30, 425, 115, 30 }, "DISABLED")) { }
GuiState(GUI_STATE_NORMAL);
GuiUnlock();
// NOTE: GuiDropdownBox must draw after any other control that can be covered on unfolding
if (GuiDropdownBox((Rectangle){ 25, 65, 125, 30 }, dropdownBox001TextList, 5, &dropdownBox001Active, dropDown001EditMode)) dropDown001EditMode = !dropDown001EditMode; if (GuiDropdownBox((Rectangle){ 25, 65, 125, 30 }, dropdownBox001TextList, 5, &dropdownBox001Active, dropDown001EditMode)) dropDown001EditMode = !dropDown001EditMode;
if (GuiDropdownBox((Rectangle){ 25, 25, 125, 30 }, dropdownBox000TextList, 3, &dropdownBox000Active, dropDown000EditMode)) dropDown000EditMode = !dropDown000EditMode; if (GuiDropdownBox((Rectangle){ 25, 25, 125, 30 }, dropdownBox000TextList, 3, &dropdownBox000Active, dropDown000EditMode)) dropDown000EditMode = !dropDown000EditMode;
@ -122,16 +134,9 @@ int main()
// Third GUI column // Third GUI column
if (GuiTextBoxMulti((Rectangle){ 325, 25, 225, 175 }, multiTextBoxText, 141, multiTextBoxEditMode)) multiTextBoxEditMode = !multiTextBoxEditMode; if (GuiTextBoxMulti((Rectangle){ 325, 25, 225, 175 }, multiTextBoxText, 141, multiTextBoxEditMode)) multiTextBoxEditMode = !multiTextBoxEditMode;
//GuiEnable(); colorPickerValue = GuiColorPicker((Rectangle){ 325, 220, 196, 192 }, colorPickerValue);
GuiUnlock();
// Fourth GUI column //GuiEnable();
GuiLock();
GuiState(GUI_STATE_NORMAL); if (GuiButton((Rectangle){ 600, 25, 125, 30 }, "NORMAL")) { }
GuiState(GUI_STATE_FOCUSED); if (GuiButton((Rectangle){ 600, 65, 125, 30 }, "FOCUSED")) { }
GuiState(GUI_STATE_PRESSED); if (GuiButton((Rectangle){ 600, 105, 125, 30 }, "PRESSED")) { }
GuiState(GUI_STATE_DISABLED); if (GuiButton((Rectangle){ 600, 145, 125, 30 }, "DISABLED")) { }
GuiState(GUI_STATE_NORMAL);
GuiUnlock(); GuiUnlock();
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff