git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29697
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// kbd code translation
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym, WXLPARAM lParam = 0);
// kbd code translation
WXDLLEXPORT int wxCharCodeMSWToWX(int keySym, WXLPARAM lParam = 0);
-WXDLLEXPORT int wxCharCodeWXToMSW(int id, bool *IsVirtual);
+WXDLLEXPORT WXWORD wxCharCodeWXToMSW(int id, bool *IsVirtual);
// window creation helper class: before creating a new HWND, instantiate an
// object of this class on stack - this allows to process the messages sent to
// window creation helper class: before creating a new HWND, instantiate an
// object of this class on stack - this allows to process the messages sent to
still force a semicolon after the macro
*/
still force a semicolon after the macro
*/
+#ifdef __WATCOMC__
+ #define wxPRE_NO_WARNING_SCOPE for(int i=0;i<1;i++)
+ #define wxPOST_NO_WARNING_SCOPE
+#else
+ #define wxPRE_NO_WARNING_SCOPE do
+ #define wxPOST_NO_WARNING_SCOPE while ( 0 )
+#endif
+
#define wxCHECKED_DELETE(ptr) \
#define wxCHECKED_DELETE(ptr) \
+ wxPRE_NO_WARNING_SCOPE \
{ \
typedef char complete[sizeof(*ptr)]; \
delete ptr; \
{ \
typedef char complete[sizeof(*ptr)]; \
delete ptr; \
+ } wxPOST_NO_WARNING_SCOPE
#define wxCHECKED_DELETE_ARRAY(ptr) \
#define wxCHECKED_DELETE_ARRAY(ptr) \
+ wxPRE_NO_WARNING_SCOPE \
{ \
typedef char complete[sizeof(*ptr)]; \
delete [] ptr; \
{ \
typedef char complete[sizeof(*ptr)]; \
delete [] ptr; \
+ } wxPOST_NO_WARNING_SCOPE
/* These scoped pointers are *not* assignable and cannot be used
within a container. Look for wxDECLARE_SHARED_PTR for this
/* These scoped pointers are *not* assignable and cannot be used
within a container. Look for wxDECLARE_SHARED_PTR for this
M_ACCELDATA->m_ok = (hAccel != 0);
}
M_ACCELDATA->m_ok = (hAccel != 0);
}
-extern int wxCharCodeWXToMSW(int id, bool *isVirtual);
+extern WXWORD wxCharCodeWXToMSW(int id, bool *isVirtual);
// Create from an array
wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[])
// Create from an array
wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[])
- WORD key = (WORD)wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
+ WORD key = wxCharCodeWXToMSW(entries[i].GetKeyCode(), &isVirtual);
if (isVirtual)
fVirt |= FVIRTKEY;
arr[i].fVirt = fVirt;
arr[i].key = key;
if (isVirtual)
fVirt |= FVIRTKEY;
arr[i].fVirt = fVirt;
arr[i].key = key;
- arr[i].cmd = entries[i].GetCommand();
+ arr[i].cmd = (WORD)entries[i].GetCommand();
}
M_ACCELDATA->m_hAccel = ::CreateAcceleratorTable(arr, n);
}
M_ACCELDATA->m_hAccel = ::CreateAcceleratorTable(arr, n);
info->bmiHeader.biHeight = height;
info->bmiHeader.biPlanes = 1;
info->bmiHeader.biHeight = height;
info->bmiHeader.biPlanes = 1;
- info->bmiHeader.biBitCount = depth;
+ info->bmiHeader.biBitCount = (WORD)depth;
info->bmiHeader.biSizeImage = GetLineSize(width, depth)*height;
m_handle = ::CreateDIBSection
info->bmiHeader.biSizeImage = GetLineSize(width, depth)*height;
m_handle = ::CreateDIBSection
// initialize the palette header
pPalette->palVersion = 0x300; // magic number, not in docs but works
// initialize the palette header
pPalette->palVersion = 0x300; // magic number, not in docs but works
- pPalette->palNumEntries = biClrUsed;
+ pPalette->palNumEntries = (WORD)biClrUsed;
// and the colour table (it starts right after the end of the header)
const RGBQUAD *pRGB = (RGBQUAD *)((char *)&ds.dsBmih + ds.dsBmih.biSize);
// and the colour table (it starts right after the end of the header)
const RGBQUAD *pRGB = (RGBQUAD *)((char *)&ds.dsBmih + ds.dsBmih.biSize);
void wxNativeFontInfo::SetFamily(wxFontFamily family)
{
void wxNativeFontInfo::SetFamily(wxFontFamily family)
{
wxString facename;
switch ( family )
wxString facename;
switch ( family )
- lf.lfCharSet = info.charset;
+ lf.lfCharSet = (BYTE)info.charset;
}
bool wxNativeFontInfo::FromString(const wxString& s)
}
bool wxNativeFontInfo::FromString(const wxString& s)
(LPARAM)this) ;
#else // __WIN32__
LOGFONT lf;
(LPARAM)this) ;
#else // __WIN32__
LOGFONT lf;
- lf.lfCharSet = m_charset;
+ lf.lfCharSet = (BYTE)m_charset;
wxStrncpy(lf.lfFaceName, m_facename, WXSIZEOF(lf.lfFaceName));
lf.lfPitchAndFamily = 0;
::EnumFontFamiliesEx(hDC, &lf, (wxFONTENUMPROC)wxFontEnumeratorProc,
wxStrncpy(lf.lfFaceName, m_facename, WXSIZEOF(lf.lfFaceName));
lf.lfPitchAndFamily = 0;
::EnumFontFamiliesEx(hDC, &lf, (wxFONTENUMPROC)wxFontEnumeratorProc,
LOGFONT lf;
wxZeroMemory(lf); // all default values
LOGFONT lf;
wxZeroMemory(lf); // all default values
- lf.lfCharSet = info.charset;
+ lf.lfCharSet = (BYTE)info.charset;
wxStrncpy(lf.lfFaceName, info.facename, WXSIZEOF(lf.lfFaceName));
HFONT hfont = ::CreateFontIndirect(&lf);
wxStrncpy(lf.lfFaceName, info.facename, WXSIZEOF(lf.lfFaceName));
HFONT hfont = ::CreateFontIndirect(&lf);
break;
case WM_EXITMENULOOP:
break;
case WM_EXITMENULOOP:
- processed = HandleMenuLoop(wxEVT_MENU_CLOSE, wParam);
+ processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
break;
case WM_QUERYDRAGICON:
break;
case WM_QUERYDRAGICON:
return false;
npPal->palVersion = 0x300;
return false;
npPal->palVersion = 0x300;
- npPal->palNumEntries = n;
+ npPal->palNumEntries = (WORD)n;
int i;
for (i = 0; i < n; i ++)
int i;
for (i = 0; i < n; i ++)
-int wxCharCodeWXToMSW(int id, bool *isVirtual)
+WXWORD wxCharCodeWXToMSW(int id, bool *isVirtual)
switch (id)
{
case WXK_CANCEL: keySym = VK_CANCEL; break;
switch (id)
{
case WXK_CANCEL: keySym = VK_CANCEL; break;
default:
{
*isVirtual = false;
default:
{
*isVirtual = false;
bool wxGetKeyState(wxKeyCode key)
{
bool bVirtual;
bool wxGetKeyState(wxKeyCode key)
{
bool bVirtual;
- int vkey = wxCharCodeWXToMSW(key, &bVirtual);
+ WORD vkey = wxCharCodeWXToMSW(key, &bVirtual);
SHORT state;
switch (key)
SHORT state;
switch (key)