24 Commits
3.5 ... 3.6

Author SHA1 Message Date
Ray
aa81c167f1 Review description for raygui 3.6 release! 2023-05-10 00:12:20 +02:00
Ray
37992af28a REVIEWED: Support slider movement out-of-bounds 2023-05-09 21:01:03 +02:00
9cf37c5e51 Fix for sliders (#282)
A fix for sliders not dragging outside of bounds.
2023-05-09 20:54:47 +02:00
Ray
60e216283d Update raygui.h 2023-05-09 20:09:52 +02:00
7f46aa5929 GuiTextBox improvements (#281)
Adds support for HOME, END, and DELETE keys to GuiTextBox.
2023-05-09 16:51:06 +02:00
Ray
b54733ec12 Minor tweaks 2023-05-08 18:57:19 +02:00
Ray
7da92d224d Update custom_sliders.c 2023-05-08 18:48:14 +02:00
Ray
1c7ceb6fda Fixed #277 2023-05-08 18:43:22 +02:00
Ray
251f7fde3a Update README.md 2023-05-08 18:41:04 +02:00
80e802b18d Fix for #277 (#280)
Fixes incorrect comment from issue #277
2023-05-07 21:28:36 +02:00
6fc9337cd8 Update raygui.h (#279)
fix for #278
2023-05-07 20:25:41 +02:00
Ray
38a3d100e1 ADDED: GuiLoadStyleFromMemory() (binary only)
REVIEWED: `GetCodepointNext()`
2023-05-07 13:17:20 +02:00
Ray
628f2e0290 Remove trailing spaces 2023-05-01 14:03:06 +02:00
ab209bc5d1 Fixed C++ compilation in C literal in call to SetShapesTexture (#276)
* Fixed C++ compilation

* Use RAYGUI_CLITERAL
2023-04-29 13:14:40 +02:00
Ray
8c14e61214 Update raygui.h 2023-04-25 15:16:08 +02:00
Ray
27caba8834 Update raygui.h 2023-04-24 09:44:54 +02:00
Ray
31b097ee3e Update raygui.h 2023-04-23 23:54:33 +02:00
b0d7073551 Fix #274 - Adding semicolon (#275) 2023-04-23 15:34:35 +02:00
Ray
731bae72d5 REVIEWED: Some old TODOs 2023-04-22 21:17:08 +02:00
Ray
4ad311bd6f ADDED: Icon SAND_TIMER 2023-04-22 18:08:34 +02:00
Ray
c4d71e1c0b Update raygui.h 2023-04-22 18:01:18 +02:00
Ray
d04c68b915 Update raygui.h 2023-04-22 10:39:18 +02:00
Ray
42aaec6640 REVIEWED: GuiLabelButton(), avoid text cut
ADDED: Debug text rectangles
2023-04-21 09:36:22 +02:00
d05586ef0f Avoid using hardcoded values in whitechar (#273)
Proposed change avoids hardcoded values and creates white rectangle exaclty like in rcore.
2023-04-20 16:52:14 +02:00
4 changed files with 410 additions and 228 deletions

View File

@ -28,12 +28,12 @@
### basic controls
```
Label | Button | LabelButton | Toggle | ToggleGroup | CheckBox
ComboBox | DropdownBox | TextBox | TextBoxMulti | ValueBox | Spinner
ComboBox | DropdownBox | TextBox | ValueBox | Spinner
Slider | SliderBar | ProgressBar | StatusBar | DummyRec | Grid
```
### container/separator controls
```
WindowBox | GroupBox | Line | Panel | ScrollPanel
WindowBox | GroupBox | Line | Panel | ScrollPanel | TabBar
```
### advanced controls
```

View File

@ -144,7 +144,7 @@ int main()
// raygui: controls drawing
//----------------------------------------------------------------------------------
// Check all possible events that require GuiLock
if (dropDown000EditMode ||
if (dropDown000EditMode ||
dropDown001EditMode) GuiLock();
// First GUI column

View File

@ -29,11 +29,11 @@ float GuiVerticalSliderPro(Rectangle bounds, const char *textTop, const char *te
bool GuiSliderOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, bool editMode);
bool GuiSliderBarOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, bool editMode);
float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth, bool editMode);
bool GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth, bool editMode);
bool GuiVerticalSliderOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, bool editMode);
bool GuiVerticalSliderBarOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, bool editMode);
float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, int sliderHeight, bool editMode);
bool GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, int sliderHeight, bool editMode);
//------------------------------------------------------------------------------------
// Program main entry point
@ -67,7 +67,7 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
if (vSliderEditMode || vSliderBarEditMode) GuiLock();
else GuiUnlock();
@ -106,13 +106,13 @@ float GuiVerticalSliderPro(Rectangle bounds, const char *textTop, const char *te
int sliderValue = (int)(((value - minValue)/(maxValue - minValue)) * (bounds.height - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH)));
Rectangle slider = {
bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
Rectangle slider = {
bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
bounds.y + bounds.height - sliderValue,
bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING),
0.0f,
};
if (sliderHeight > 0) // Slider
{
slider.y -= sliderHeight/2;
@ -142,7 +142,7 @@ float GuiVerticalSliderPro(Rectangle bounds, const char *textTop, const char *te
if (sliderHeight > 0) slider.y = mousePoint.y - slider.height / 2; // Slider
else if (sliderHeight == 0) // SliderBar
{
slider.y = mousePoint.y;
slider.y = mousePoint.y;
slider.height = bounds.y + bounds.height - slider.y - GuiGetStyle(SLIDER, BORDER_WIDTH);
}
}
@ -162,7 +162,7 @@ float GuiVerticalSliderPro(Rectangle bounds, const char *textTop, const char *te
}
else if (sliderHeight == 0) // SliderBar
{
if (slider.y < (bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH)))
if (slider.y < (bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH)))
{
slider.y = bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH);
slider.height = bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH);
@ -215,7 +215,7 @@ float GuiVerticalSliderBar(Rectangle bounds, const char *textTop, const char *te
return GuiVerticalSliderPro(bounds, textTop, textBottom, value, minValue, maxValue, 0);
}
float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth, bool editMode)
bool GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *textRight, float *value, float minValue, float maxValue, int sliderWidth, bool editMode)
{
GuiState state = (GuiState)GuiGetState();
@ -224,10 +224,10 @@ float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *tex
int sliderValue = (int)(((tempValue - minValue)/(maxValue - minValue))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH)));
Rectangle slider = {
bounds.x,
bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
0,
Rectangle slider = {
bounds.x,
bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
0,
bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING)
};
@ -247,7 +247,7 @@ float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *tex
if ((state != STATE_DISABLED) && (editMode || !guiLocked))
{
Vector2 mousePoint = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
if (CheckCollisionPointRec(mousePoint, bounds))
@ -266,7 +266,7 @@ float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *tex
if (sliderWidth > 0) slider.x = mousePoint.x - slider.width/2; // Slider
else if (sliderWidth == 0) slider.width = (float)sliderValue; // SliderBar
}
else if (CheckCollisionPointRec(mousePoint, bounds))
{
@ -295,9 +295,9 @@ float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *tex
GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha));
// Draw slider internal bar (depends on state)
if ((state == STATE_NORMAL) || (state == STATE_PRESSED))
if ((state == STATE_NORMAL) || (state == STATE_PRESSED))
GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha));
else if (state == STATE_FOCUSED)
else if (state == STATE_FOCUSED)
GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha));
// Draw left/right text if provided
@ -323,7 +323,7 @@ float GuiSliderProOwning(Rectangle bounds, const char *textLeft, const char *tex
GuiDrawText(textRight, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha));
}
//--------------------------------------------------------------------
*value = tempValue;
return pressed;
}
@ -338,7 +338,7 @@ bool GuiSliderBarOwning(Rectangle bounds, const char *textLeft, const char *text
return GuiSliderProOwning(bounds, textLeft, textRight, value, minValue, maxValue, 0, editMode);
}
float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, int sliderHeight, bool editMode)
bool GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const char *textBottom, float *value, float minValue, float maxValue, int sliderHeight, bool editMode)
{
GuiState state = (GuiState)GuiGetState();
@ -347,13 +347,13 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
int sliderValue = (int)(((tempValue - minValue)/(maxValue - minValue)) * (bounds.height - 2 * GuiGetStyle(SLIDER, BORDER_WIDTH)));
Rectangle slider = {
bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
Rectangle slider = {
bounds.x + GuiGetStyle(SLIDER, BORDER_WIDTH) + GuiGetStyle(SLIDER, SLIDER_PADDING),
bounds.y + bounds.height - sliderValue,
bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH) - 2*GuiGetStyle(SLIDER, SLIDER_PADDING),
0.0f,
};
if (sliderHeight > 0) // Slider
{
slider.y -= sliderHeight/2;
@ -369,7 +369,7 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
if ((state != STATE_DISABLED) && (editMode || !guiLocked))
{
Vector2 mousePoint = GetMousePosition();
if (IsMouseButtonPressed(MOUSE_LEFT_BUTTON))
{
if (CheckCollisionPointRec(mousePoint, bounds))
@ -387,11 +387,11 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
float normalizedValue = (bounds.y + bounds.height - mousePoint.y - (float)(sliderHeight / 2)) / (bounds.height - (float)sliderHeight);
tempValue = (maxValue - minValue) * normalizedValue + minValue;
if (sliderHeight > 0) slider.y = mousePoint.y - slider.height / 2; // Slider
else if (sliderHeight == 0) // SliderBar
{
slider.y = mousePoint.y;
slider.y = mousePoint.y;
slider.height = bounds.y + bounds.height - slider.y - GuiGetStyle(SLIDER, BORDER_WIDTH);
}
}
@ -413,7 +413,7 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
}
else if (sliderHeight == 0) // SliderBar
{
if (slider.y < (bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH)))
if (slider.y < (bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH)))
{
slider.y = bounds.y + GuiGetStyle(SLIDER, BORDER_WIDTH);
slider.height = bounds.height - 2*GuiGetStyle(SLIDER, BORDER_WIDTH);
@ -426,9 +426,9 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
GuiDrawRectangle(bounds, GuiGetStyle(SLIDER, BORDER_WIDTH), Fade(GetColor(GuiGetStyle(SLIDER, BORDER + (state*3))), guiAlpha), Fade(GetColor(GuiGetStyle(SLIDER, (state != STATE_DISABLED)? BASE_COLOR_NORMAL : BASE_COLOR_DISABLED)), guiAlpha));
// Draw slider internal bar (depends on state)
if ((state == STATE_NORMAL) || (state == STATE_PRESSED))
if ((state == STATE_NORMAL) || (state == STATE_PRESSED))
GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, BASE_COLOR_PRESSED)), guiAlpha));
else if (state == STATE_FOCUSED)
else if (state == STATE_FOCUSED)
GuiDrawRectangle(slider, 0, BLANK, Fade(GetColor(GuiGetStyle(SLIDER, TEXT_COLOR_FOCUSED)), guiAlpha));
// Draw top/bottom text if provided
@ -454,7 +454,7 @@ float GuiVerticalSliderProOwning(Rectangle bounds, const char *textTop, const ch
GuiDrawText(textBottom, textBounds, TEXT_ALIGN_LEFT, Fade(GetColor(GuiGetStyle(SLIDER, TEXT + (state*3))), guiAlpha));
}
//--------------------------------------------------------------------
*value = tempValue;
return pressed;
}

File diff suppressed because it is too large Load Diff