Merge pull request #185 from dariomanesku/master

Minor imgui update.
This commit is contained in:
Branimir Karadžić 2014-11-20 16:47:18 -08:00
commit 68ef25a1aa
2 changed files with 14 additions and 3 deletions

View file

@ -1457,12 +1457,12 @@ struct Imgui
uint8_t ii = 0; uint8_t ii = 0;
for (; ii < enabledCount; ++ii) for (; ii < enabledCount; ++ii)
{ {
bool enabled = va_arg(_argList, int); const bool enabled = (0 != va_arg(_argList, int) );
tabEnabled[ii] = enabled; tabEnabled[ii] = enabled;
} }
for (; ii < _nEnabled; ++ii) for (; ii < _nEnabled; ++ii)
{ {
bool enabled = va_arg(_argList, int); const int enabled = va_arg(_argList, int);
BX_UNUSED(enabled); BX_UNUSED(enabled);
} }
for (; ii < _nTabs; ++ii) for (; ii < _nTabs; ++ii)
@ -1524,7 +1524,7 @@ struct Imgui
{ {
const uint32_t id = getId(); const uint32_t id = getId();
int32_t buttonX = xx + ii*tabWidth; int32_t buttonX = xx + ii*width/tabCount;
int32_t textX = buttonX + tabWidthHalf; int32_t textX = buttonX + tabWidthHalf;
const bool enabled = _enabled && tabEnabled[ii] && isEnabled(m_areaId); const bool enabled = _enabled && tabEnabled[ii] && isEnabled(m_areaId);
@ -3258,6 +3258,16 @@ uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int
return result; return result;
} }
uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, ...)
{
va_list argList;
va_start(argList, _nTabs);
const uint8_t result = s_imgui.tabs(_selected, _enabled, _align, _height, _r, _nTabs, 0, argList);
va_end(argList);
return result;
}
uint32_t imguiChooseUseMacroInstead(uint32_t _selected, ...) uint32_t imguiChooseUseMacroInstead(uint32_t _selected, ...)
{ {
va_list argList; va_list argList;

View file

@ -169,6 +169,7 @@ void imguiInput(const char* _label, char* _str, uint32_t _len, bool _enabled = t
/// In the above example, there are 2 enabled flags: 'Tab0' is specified as enabled and 'Tab1' is specified as disabled. /// In the above example, there are 2 enabled flags: 'Tab0' is specified as enabled and 'Tab1' is specified as disabled.
/// Tab2 is unspecified and therefore is treated as enabled. /// Tab2 is unspecified and therefore is treated as enabled.
uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, uint8_t _nEnabled, ...); uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, uint8_t _nEnabled, ...);
uint8_t imguiTabs(uint8_t _selected, bool _enabled, ImguiAlign::Enum _align, int32_t _height, int32_t _r, uint8_t _nTabs, ...);
uint32_t imguiChooseUseMacroInstead(uint32_t _selected, ...); uint32_t imguiChooseUseMacroInstead(uint32_t _selected, ...);
#define imguiChoose(...) imguiChooseUseMacroInstead(__VA_ARGS__, NULL) #define imguiChoose(...) imguiChooseUseMacroInstead(__VA_ARGS__, NULL)