|
@@ -154,7 +154,7 @@ class HAIKU_SDL_MessageBox : public BAlert
|
|
|
(aMessageBoxData->message[0]) ?
|
|
|
SetMessageText(aMessageBoxData->message) : SetMessageText(HAIKU_SDL_DefMessage);
|
|
|
|
|
|
- SetType(ConvertMessageBoxType(static_cast<SDL_MessageBoxFlags>(aMessageBoxData->flags)));
|
|
|
+ SetType(ConvertMessageBoxType(aMessageBoxData->flags));
|
|
|
}
|
|
|
|
|
|
void
|
|
@@ -264,23 +264,12 @@ class HAIKU_SDL_MessageBox : public BAlert
|
|
|
|
|
|
size_t countButtons = fButtons.size();
|
|
|
for (size_t i = 0; i < countButtons; ++i) {
|
|
|
- switch (fButtons[i]->flags)
|
|
|
- {
|
|
|
- case SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT:
|
|
|
- {
|
|
|
- fCloseButton = static_cast<int>(i);
|
|
|
- break;
|
|
|
- }
|
|
|
- case SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT:
|
|
|
- {
|
|
|
- fDefaultButton = static_cast<int>(i);
|
|
|
- break;
|
|
|
- }
|
|
|
- default:
|
|
|
- {
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (fButtons[i]->flags & SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT) {
|
|
|
+ fCloseButton = static_cast<int>(i);
|
|
|
+ }
|
|
|
+ if (fButtons[i]->flags & SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT) {
|
|
|
+ fDefaultButton = static_cast<int>(i);
|
|
|
+ }
|
|
|
AddButton(fButtons[i]->text);
|
|
|
}
|
|
|
|