Modified files for SDL2.

This commit is contained in:
LuisAntonRebollo 2015-01-18 22:52:29 +01:00
parent d08db6cc54
commit 21d58bb191
33 changed files with 436 additions and 136 deletions

View file

@ -41,6 +41,8 @@
// MenuBar Methods
//-----------------------------------------------------------------------------
#ifndef TORQUE_SDL
void MenuBar::createPlatformPopupMenuData()
{
// mData = new PlatformMenuBarData;
@ -171,3 +173,5 @@ void MenuBar::removeFromCanvas()
mCanvas = NULL;
}
#endif

View file

@ -20,6 +20,8 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#ifndef TORQUE_SDL
#include "platform/menus/popupMenu.h"
#include "platformWin32/platformWin32.h"
#include "console/consoleTypes.h"
@ -169,7 +171,7 @@ void PopupMenu::createPlatformMenu()
// Public Methods
//////////////////////////////////////////////////////////////////////////
S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator)
S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, const char *)
{
Win32Window *pWindow = mCanvas ? dynamic_cast<Win32Window*>(mCanvas->getPlatformWindow()) : NULL;
bool isAttached = isAttachedToMenuBar();
@ -266,7 +268,7 @@ S32 PopupMenu::insertSubMenu(S32 pos, const char *title, PopupMenu *submenu)
return -1;
}
bool PopupMenu::setItem(S32 pos, const char *title, const char* accelerator)
bool PopupMenu::setItem(S32 pos, const char *title, const char* accelerator, const char *)
{
Win32Window *pWindow = mCanvas ? dynamic_cast<Win32Window*>(mCanvas->getPlatformWindow()) : NULL;
bool isAttached = isAttachedToMenuBar();
@ -740,3 +742,4 @@ S32 PopupMenu::getPosOnMenuBar()
return pos;
}
#endif

View file

@ -80,7 +80,7 @@ static U32 getMaskFromID(_FlagMap *map, S32 id)
}
//-----------------------------------------------------------------------------
#ifndef TORQUE_SDL
S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons buttons, MBIcons icon)
{
PlatformWindow *pWindow = WindowManager->getFirstWindow();
@ -127,3 +127,4 @@ S32 Platform::messageBox(const UTF8 *title, const UTF8 *message, MBButtons butto
return getMaskFromID(sgMsgBoxRetMap, ret);
}
#endif

View file

@ -153,6 +153,8 @@ DefineConsoleFunction( shellExecute, bool, (const char * executable, const char
return true;
}
#ifndef TORQUE_SDL
void Platform::openFolder(const char* path )
{
char filePath[1024];
@ -187,3 +189,5 @@ void Platform::openFile(const char* path )
::ShellExecute( NULL,TEXT("open"),p, NULL, NULL, SW_SHOWNORMAL);
}
#endif // !TORQUE_SDL

View file

@ -20,6 +20,7 @@
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
#if !defined( TORQUE_SDL )
#include "platformWin32/platformWin32.h"
#include "platform/platformInput.h"
@ -863,3 +864,4 @@ bool Platform::setClipboard(const char *text)
return true;
}
#endif

View file

@ -190,6 +190,7 @@ bool Platform::checkOtherInstances(const char *mutexName)
return false;
}
#ifndef TORQUE_SDL
//--------------------------------------
void Platform::AlertOK(const char *windowTitle, const char *message)
{
@ -232,6 +233,43 @@ bool Platform::AlertRetry(const char *windowTitle, const char *message)
#endif
}
Platform::ALERT_ASSERT_RESULT Platform::AlertAssert(const char *windowTitle, const char *message)
{
#ifndef TORQUE_TOOLS
ShowCursor(true);
#endif // TORQUE_TOOLS
#ifdef UNICODE
UTF16 messageUTF[1024], title[512];
convertUTF8toUTF16((UTF8 *)windowTitle, title, sizeof(title));
convertUTF8toUTF16((UTF8 *)message, messageUTF, sizeof(messageUTF));
#else
const char* messageUTF = message;
const char* title = windowTitle;
#endif
// TODO: Change this to a custom dialog that has Exit, Ignore, Ignore All, and Debug buttons
ALERT_ASSERT_RESULT alertResult = ALERT_ASSERT_DEBUG;
int result = MessageBox(winState.appWindow, messageUTF, title, MB_ABORTRETRYIGNORE | MB_ICONSTOP | MB_DEFBUTTON2 | MB_TASKMODAL | MB_SETFOREGROUND);
switch( result )
{
case IDABORT:
alertResult = ALERT_ASSERT_EXIT;
break;
case IDIGNORE:
alertResult = ALERT_ASSERT_IGNORE;
break;
default:
case IDRETRY:
alertResult = ALERT_ASSERT_DEBUG;
break;
}
return alertResult;
}
#endif
//--------------------------------------
HIMC gIMEContext;