Converted boolean flags for component creation in windows to using enum bitwise attributes.

This commit is contained in:
2023-11-06 01:00:17 -06:00
parent c82a3c5980
commit 2e248e30b4
11 changed files with 79 additions and 31 deletions
+4 -4
View File
@@ -3,13 +3,13 @@
typedef Attribute A;
MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string label,MenuFunc onClick,bool selectable,bool selectableViaKeyboard)
:parentMenu(parent),rect(rect),label(label),menuDest(MenuType::ENUM_END),onClick(onClick),hoverEffect(0),selectable(selectable),selectableViaKeyboard(selectableViaKeyboard),memoryLeakInfo(Menu::GetMemoryLeakReportInfo()){
MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string label,MenuFunc onClick,ButtonAttr attributes)
:parentMenu(parent),rect(rect),label(label),menuDest(MenuType::ENUM_END),onClick(onClick),hoverEffect(0),selectable(!(attributes&ButtonAttr::UNSELECTABLE)),selectableViaKeyboard(!(attributes&ButtonAttr::UNSELECTABLE_VIA_KEYBOARD)),memoryLeakInfo(Menu::GetMemoryLeakReportInfo()){
Menu::unhandledComponents.push_back(this);
}
MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,bool selectable,bool selectableViaKeyboard)
:MenuComponent(parent,rect,label,onClick,selectable,selectableViaKeyboard){
MenuComponent::MenuComponent(MenuType parent,geom2d::rect<float>rect,std::string label,MenuType menuDest,MenuFunc onClick,ButtonAttr attributes)
:MenuComponent(parent,rect,label,onClick,attributes){
//NOTE: This constructor also calls the other constructor above!
this->menuDest=menuDest;
}