MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / messageBox

Method messageBox

Engine/source/platformSDL/sdlMsgBox.cpp:73–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71
72#ifdef TORQUE_SDL
73S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons buttons, MBIcons icon)
74{
75 if(needInitMsgBox)
76 initMsgBox_ButtonData();
77
78 SDL_Window *window = WindowManager->getFirstWindow() ? SDL_GetWindowFromID( WindowManager->getFirstWindow()->getWindowId() ) : NULL;
79
80 if (window) //release the mouse from the window constaints
81 SDL_SetWindowGrab(window, SDL_FALSE);
82
83 if(buttons == MBOk)
84 return SDL_ShowSimpleMessageBox(0, title, message, window );
85
86 SDL_MessageBoxData boxData;
87 boxData.title = title;
88 boxData.message = message;
89 boxData.window = window;
90 boxData.flags = 0;
91 boxData.colorScheme = NULL;
92 boxData.buttons = NULL;
93 boxData.numbuttons = 0;
94
95 int res = MBOk;
96
97 switch(buttons)
98 {
99 case MBOkCancel:
100 {
101 boxData.buttons = &MBOkCancelData[0];
102 boxData.numbuttons = 2;
103 break;
104 }
105 case MBRetryCancel:
106 {
107 boxData.buttons = &MBRetryCancelData[0];
108 boxData.numbuttons = 2;
109 break;
110 }
111 case MBSaveDontSave:
112 {
113 boxData.buttons = &MBSaveDontSaveData[0];
114 boxData.numbuttons = 2;
115 break;
116 }
117 case MBSaveDontSaveCancel:
118 {
119 boxData.buttons = &MBSaveDontSaveCancelData[0];
120 boxData.numbuttons = 3;
121 break;
122 }
123 case MBAlertAssert:
124 {
125 boxData.buttons = &MBAlertAssetData[0];
126 boxData.numbuttons = 4;
127 break;
128 }
129 default:
130 {

Callers

nothing calls this directly

Calls 7

initMsgBox_ButtonDataFunction · 0.85
SDL_GetWindowFromIDFunction · 0.85
SDL_SetWindowGrabFunction · 0.85
SDL_ShowSimpleMessageBoxFunction · 0.85
SDL_ShowMessageBoxFunction · 0.85
getFirstWindowMethod · 0.45
getWindowIdMethod · 0.45

Tested by

no test coverage detected