MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Show

Method Show

Source/Engine/Platform/SDL/SDLPlatform.Linux.cpp:1808–1962  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1806}
1807
1808DialogResult MessageBox::Show(Window* parent, const StringView& text, const StringView& caption, MessageBoxButtons buttons, MessageBoxIcon icon)
1809{
1810 StringAnsi textAnsi(text);
1811 StringAnsi captionAnsi(caption);
1812
1813 SDL_MessageBoxData data;
1814 SDL_MessageBoxButtonData dataButtons[3];
1815 data.window = parent ? static_cast<SDLWindow*>(parent)->_window : nullptr;
1816 data.title = captionAnsi.GetText();
1817 data.message = textAnsi.GetText();
1818 data.colorScheme = nullptr;
1819
1820 switch (icon)
1821 {
1822 case MessageBoxIcon::Error:
1823 case MessageBoxIcon::Hand:
1824 case MessageBoxIcon::Stop:
1825 data.flags |= SDL_MESSAGEBOX_ERROR;
1826 break;
1827 case MessageBoxIcon::Asterisk:
1828 case MessageBoxIcon::Information:
1829 case MessageBoxIcon::Question:
1830 data.flags |= SDL_MESSAGEBOX_INFORMATION;
1831 break;
1832 case MessageBoxIcon::Exclamation:
1833 case MessageBoxIcon::Warning:
1834 data.flags |= SDL_MESSAGEBOX_WARNING;
1835 break;
1836 default:
1837 break;
1838 }
1839
1840 switch (buttons)
1841 {
1842 case MessageBoxButtons::AbortRetryIgnore:
1843 dataButtons[0] =
1844 {
1845 SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
1846 (int)DialogResult::Abort,
1847 "Abort"
1848 };
1849 dataButtons[1] =
1850 {
1851 SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT,
1852 (int)DialogResult::Retry,
1853 "Retry"
1854 };
1855 dataButtons[2] =
1856 {
1857 0,
1858 (int)DialogResult::Ignore,
1859 "Ignore"
1860 };
1861 data.numbuttons = 3;
1862 break;
1863 case MessageBoxButtons::OK:
1864 dataButtons[0] =
1865 {

Callers

nothing calls this directly

Calls 2

StringClass · 0.50
GetTextMethod · 0.45

Tested by

no test coverage detected