From 78084643febb7f0d67fcc8d98faa3061f8f400a5 Mon Sep 17 00:00:00 2001 From: koldo Date: Wed, 22 Jul 2015 07:28:28 +0000 Subject: [PATCH] *SDL: Added fixes git-svn-id: svn://ultimatepp.org/upp/trunk@8722 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- bazaar/SDL/SDLCtrl.cpp | 12 ++++++------ bazaar/SDL/SDLCtrl.h | 6 +++--- bazaar/SDL/SDLWrapper.h | 2 ++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bazaar/SDL/SDLCtrl.cpp b/bazaar/SDL/SDLCtrl.cpp index c31deda72..be3b67c08 100644 --- a/bazaar/SDL/SDLCtrl.cpp +++ b/bazaar/SDL/SDLCtrl.cpp @@ -2,7 +2,7 @@ using namespace Upp; -#include +#include "SDLCtrl.h" SDL_Cursor *CursorFromImage(const Image &image) { int width = image.GetWidth(); @@ -67,7 +67,7 @@ SDLCtrl::SDLCtrlIn::SDLCtrlIn() { return; } #ifdef PLATFORM_WIN32 - hwndSDL = long(wmInfo.window); + hwndSDL = wmInfo.window; #else wmInfo.info.x11.lock_func(); hwnd = long(wmInfo.info.x11.wmwindow); @@ -113,7 +113,7 @@ void SDLCtrl::SDLCtrlIn::Layout() { SetWindowPos(hwnd, NULL, r.left, r.top, r.GetWidth(), r.GetHeight(), SWP_NOACTIVATE|SWP_NOZORDER); } - ShowWindow(HWND(hwndSDL), IsVisible() ? SW_SHOW : SW_HIDE); + ShowWindow(hwndSDL, IsVisible() ? SW_SHOW : SW_HIDE); #endif if(!CreateScreen()) return; @@ -130,8 +130,8 @@ void SDLCtrl::SDLCtrlIn::State(int reason) { CloseHWND(); HWND phwnd = GetTopCtrl()->GetHWND(); if(phwnd) { - hwnd = HWND(hwndSDL); - SetParent(HWND(hwndSDL), phwnd); + hwnd = hwndSDL; + SetParent(hwndSDL, phwnd); } } break; @@ -144,5 +144,5 @@ void SDLCtrl::SDLCtrlIn::State(int reason) { void SDLCtrl::SDLCtrlIn::SetError(String str) { if (!strError.IsEmpty()) strError << "\n"; - strError << ToUpper(str[0]) + DeQtfLf(str.Mid(1)); + strError << InitCaps(str); } \ No newline at end of file diff --git a/bazaar/SDL/SDLCtrl.h b/bazaar/SDL/SDLCtrl.h index 7289c3286..a07e6eb13 100644 --- a/bazaar/SDL/SDLCtrl.h +++ b/bazaar/SDL/SDLCtrl.h @@ -1,7 +1,7 @@ #ifndef _SDLCtrl_h_ #define _SDLCtrl_h_ -#include +#include "SDLWrapper.h" inline bool Odd_(int val) {return val%2;} @@ -58,7 +58,7 @@ protected: class SDLCtrl : public Ctrl { typedef SDLCtrl CLASSNAME; class SDLCtrlIn : public DHCtrl, public SDLSurface { - typedef SDLCtrl CLASSNAME; + typedef SDLCtrlIn CLASSNAME; public: SDLCtrlIn(); ~SDLCtrlIn(); @@ -70,7 +70,7 @@ typedef SDLCtrl CLASSNAME; #ifdef PLATFORM_POSIX XDisplay *display; #else - long hwndSDL; + HWND hwndSDL; #endif int videoflags; int bpp; diff --git a/bazaar/SDL/SDLWrapper.h b/bazaar/SDL/SDLWrapper.h index 906a74794..c94405916 100644 --- a/bazaar/SDL/SDLWrapper.h +++ b/bazaar/SDL/SDLWrapper.h @@ -13,7 +13,9 @@ #undef main +#ifndef INT64_C #define INT64_C(val) val##LL #define UINT64_C(val) val##ULL +#endif #endif