mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Lock other controls when GuiTextInputBox is open (#512)
Previously, the color picker would end up eating inputs intended for the GuiTextInputBox!
This commit is contained in:
@ -208,6 +208,7 @@ int main()
|
|||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
// Check all possible events that require GuiLock
|
// Check all possible events that require GuiLock
|
||||||
if (dropDown000EditMode || dropDown001EditMode) GuiLock();
|
if (dropDown000EditMode || dropDown001EditMode) GuiLock();
|
||||||
|
if (showTextInputBox) GuiLock();
|
||||||
|
|
||||||
// First GUI column
|
// First GUI column
|
||||||
//GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
//GuiSetStyle(CHECKBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
@ -236,7 +237,9 @@ int main()
|
|||||||
GuiComboBox((Rectangle){ 25, 480, 125, 30 }, "default;Jungle;Lavanda;Dark;Bluish;Cyber;Terminal;Candy;Cherry;Ashes;Enefete;Sunny;Amber", &visualStyleActive);
|
GuiComboBox((Rectangle){ 25, 480, 125, 30 }, "default;Jungle;Lavanda;Dark;Bluish;Cyber;Terminal;Candy;Cherry;Ashes;Enefete;Sunny;Amber", &visualStyleActive);
|
||||||
|
|
||||||
// NOTE: GuiDropdownBox must draw after any other control that can be covered on unfolding
|
// NOTE: GuiDropdownBox must draw after any other control that can be covered on unfolding
|
||||||
GuiUnlock();
|
if (dropDown000EditMode || dropDown001EditMode) GuiUnlock();
|
||||||
|
if (showTextInputBox) GuiLock(); // Stay locked
|
||||||
|
|
||||||
GuiSetStyle(DROPDOWNBOX, TEXT_PADDING, 4);
|
GuiSetStyle(DROPDOWNBOX, TEXT_PADDING, 4);
|
||||||
GuiSetStyle(DROPDOWNBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
GuiSetStyle(DROPDOWNBOX, TEXT_ALIGNMENT, TEXT_ALIGN_LEFT);
|
||||||
if (GuiDropdownBox((Rectangle){ 25, 65, 125, 30 }, "#01#ONE;#02#TWO;#03#THREE;#04#FOUR", &dropdownBox001Active, dropDown001EditMode)) dropDown001EditMode = !dropDown001EditMode;
|
if (GuiDropdownBox((Rectangle){ 25, 65, 125, 30 }, "#01#ONE;#02#TWO;#03#THREE;#04#FOUR", &dropdownBox001Active, dropDown001EditMode)) dropDown001EditMode = !dropDown001EditMode;
|
||||||
@ -300,6 +303,8 @@ int main()
|
|||||||
|
|
||||||
if (showTextInputBox)
|
if (showTextInputBox)
|
||||||
{
|
{
|
||||||
|
GuiUnlock();
|
||||||
|
|
||||||
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
|
DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f));
|
||||||
int result = GuiTextInputBox((Rectangle){ (float)GetScreenWidth()/2 - 120, (float)GetScreenHeight()/2 - 60, 240, 140 }, GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Introduce output file name:", "Ok;Cancel", textInput, 255, NULL);
|
int result = GuiTextInputBox((Rectangle){ (float)GetScreenWidth()/2 - 120, (float)GetScreenHeight()/2 - 60, 240, 140 }, GuiIconText(ICON_FILE_SAVE, "Save file as..."), "Introduce output file name:", "Ok;Cancel", textInput, 255, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user