mirror of
https://github.com/raysan5/raygui.git
synced 2025-12-25 10:22:33 -05:00
Integrated 4.0-dev branch (#288)
* WARNING: Library redesign to support return result values REVIEWED: All example projects * REVIEWED: Cast values to improve Zig interconnection (#286) * Update version and header info * REVIEWED: `GuiListView()`, parameter order bug * Update raygui.h * REVIEWED: `GuiTabBar()` toggle logic * Update raygui.h * Update raygui.h
This commit is contained in:
@ -543,7 +543,7 @@ void GuiDMPropertyList(Rectangle bounds, GuiDMProperty* props, int count, int* f
|
||||
// draw property value
|
||||
const bool locked = guiLocked;
|
||||
GuiLock(); // lock the checkbox since we changed the value manually
|
||||
GuiCheckBox((Rectangle){propBounds.x+propBounds.width/2, propBounds.y + height/4, height/2, height/2}, props[p].value.vbool ? "Yes" : "No", props[p].value.vbool);
|
||||
GuiCheckBox((Rectangle){propBounds.x+propBounds.width/2, propBounds.y + height/4, height/2, height/2}, props[p].value.vbool? "Yes" : "No", &props[p].value.vbool);
|
||||
if(!locked) GuiUnlock(); // only unlock when needed
|
||||
} break;
|
||||
|
||||
@ -584,8 +584,8 @@ void GuiDMPropertyList(Rectangle bounds, GuiDMProperty* props, int count, int* f
|
||||
// draw property name
|
||||
GuiDrawText(props[p].name, (Rectangle){propBounds.x + PROPERTY_PADDING, propBounds.y, propBounds.width/2-PROPERTY_PADDING, GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT)}, TEXT_ALIGN_LEFT, textColor);
|
||||
// draw property value
|
||||
props[p].value.vselect.active = GuiComboBox((Rectangle){propBounds.x+propBounds.width/2, propBounds.y + 1, propBounds.width/2, GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) - 2},
|
||||
props[p].value.vselect.val, props[p].value.vselect.active);
|
||||
GuiComboBox((Rectangle){propBounds.x+propBounds.width/2, propBounds.y + 1, propBounds.width/2, GuiGetStyle(LISTVIEW, LIST_ITEMS_HEIGHT) - 2},
|
||||
props[p].value.vselect.val, &props[p].value.vselect.active);
|
||||
} break;
|
||||
|
||||
case GUI_PROP_VECTOR2: case GUI_PROP_VECTOR3: case GUI_PROP_VECTOR4: {
|
||||
|
||||
@ -61,6 +61,8 @@ int main()
|
||||
// Tweak the default raygui style a bit
|
||||
GuiSetStyle(LISTVIEW, LIST_ITEMS_HEIGHT, 24);
|
||||
GuiSetStyle(LISTVIEW, SCROLLBAR_WIDTH, 12);
|
||||
|
||||
Vector2 gridMouseCell = { 0 };
|
||||
|
||||
SetTargetFPS(60);
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -74,7 +76,7 @@ int main()
|
||||
|
||||
ClearBackground(GetColor(GuiGetStyle(DEFAULT, BACKGROUND_COLOR)));
|
||||
|
||||
GuiGrid((Rectangle){0, 0, screenWidth, screenHeight}, "Property List", 20.0f, 2); // Draw a fancy grid
|
||||
GuiGrid((Rectangle){0, 0, screenWidth, screenHeight}, "Property List", 20.0f, 2, &gridMouseCell); // Draw a fancy grid
|
||||
|
||||
GuiDMPropertyList((Rectangle){(screenWidth - 180)/2, (screenHeight - 280)/2, 180, 280}, prop, SIZEOF(prop), &focus, &scroll);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user