mirror of
https://github.com/raysan5/raygui.git
synced 2026-01-29 18:29:18 -05:00
Complete redesign of styling system
This commit is contained in:
@ -73,7 +73,9 @@ int main()
|
|||||||
bool listViewExEditMode = false;
|
bool listViewExEditMode = false;
|
||||||
|
|
||||||
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,9 +112,19 @@ 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
|
|
||||||
if (GuiDropdownBox((Rectangle){ 25, 65, 125, 30 }, dropdownBox001TextList, 5, &dropdownBox001Active, dropDown001EditMode)) dropDown001EditMode = !dropDown001EditMode;
|
GuiGroupBox((Rectangle){ 25, 310, 125, 150 }, "CONTROL STATES");
|
||||||
if (GuiDropdownBox((Rectangle){ 25, 25, 125, 30 }, dropdownBox000TextList, 3, &dropdownBox000Active, dropDown000EditMode)) dropDown000EditMode = !dropDown000EditMode;
|
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, 25, 125, 30 }, dropdownBox000TextList, 3, &dropdownBox000Active, dropDown000EditMode)) dropDown000EditMode = !dropDown000EditMode;
|
||||||
|
|
||||||
// Second GUI column
|
// Second GUI column
|
||||||
if (GuiListView((Rectangle){ 185, 25, 120, 100 }, listViewList, 6, &listViewScrollIndex, &listViewActive, listViewEditMode)) listViewEditMode = !listViewEditMode;
|
if (GuiListView((Rectangle){ 185, 25, 120, 100 }, listViewList, 6, &listViewScrollIndex, &listViewActive, listViewEditMode)) listViewEditMode = !listViewEditMode;
|
||||||
@ -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();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
2191
src/raygui.h
2191
src/raygui.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user