view release on metacpan or search on metacpan
inc/inc_Locale-Maketext-Simple/Locale/Maketext/Simple.pm view on Meta::CPAN
More sophisticated example:
package Foo::Bar;
use Locale::Maketext::Simple (
Class => 'Foo', # search in auto/Foo/
Style => 'gettext', # %1 instead of [_1]
Export => 'maketext', # maketext() instead of loc()
Subclass => 'L10N', # Foo::L10N instead of Foo::I18N
Decode => 1, # decode entries to unicode-strings
Encoding => 'locale', # but encode lexicons in current locale
# (needs Locale::Maketext::Lexicon 0.36)
);
sub japh {
print maketext("Just another %1 hacker", "Perl");
}
=head1 DESCRIPTION
This module is a simple wrapper around B<Locale::Maketext::Lexicon>,
designed to alleviate the need of creating I<Language Classes> for
inc/inc_Locale-Maketext-Simple/Locale/Maketext/Simple.pm view on Meta::CPAN
=head2 Decode
If set to a true value, source entries will be converted into
utf8-strings (available in Perl 5.6.1 or later). This feature
needs the B<Encode> or B<Encode::compat> module.
=head2 Encoding
Specifies an encoding to store lexicon entries, instead of
utf8-strings. If set to C<locale>, the encoding from the current
locale setting is used. Implies a true value for C<Decode>.
=cut
sub import {
my ($class, %args) = @_;
$args{Class} ||= caller;
$args{Style} ||= 'maketext';
$args{Export} ||= 'loc';
$args{Subclass} ||= 'I18N';
inc/inc_version/version/vpp.pm view on Meta::CPAN
package version::vpp;
use strict;
use locale;
use vars qw ($VERSION @ISA @REGEXS);
$VERSION = 0.74;
push @REGEXS, qr/
^v? # optional leading 'v'
(\d*) # major revision not required
\. # requires at least one decimal
(?:(\d+)\.?){1,}
/x;
inc/inc_version/version/vpp.pm view on Meta::CPAN
if ( ref($value) && eval("$value->isa('version')") ) {
# Can copy the elements directly
$self->{version} = [ @{$value->{version} } ];
$self->{qv} = 1 if $value->{qv};
$self->{alpha} = 1 if $value->{alpha};
$self->{original} = ''.$value->{original};
return $self;
}
require POSIX;
my $currlocale = POSIX::setlocale(&POSIX::LC_ALL);
my $radix_comma = ( POSIX::localeconv()->{decimal_point} eq ',' );
if ( not defined $value or $value =~ /^undef$/ ) {
# RT #19517 - special case for undef comparison
# or someone forgot to pass a value
push @{$self->{version}}, 0;
$self->{original} = "0";
return ($self);
}
if ( $#_ == 2 ) { # must be CVS-style
inc/inc_version/version/vpp.pm view on Meta::CPAN
}
$value = _un_vstring($value);
# exponential notation
if ( $value =~ /\d+.?\d*e-?\d+/ ) {
$value = sprintf("%.9f",$value);
$value =~ s/(0+)$//;
}
# if the original locale used commas for decimal points, we
# just replace commas with decimal places, rather than changing
# locales
if ( $radix_comma ) {
$value =~ tr/,/./;
}
# This is not very efficient, but it is morally equivalent
# to the XS code (as that is the reference implementation).
# See vutil/vutil.c for details
my $qv = 0;
my $alpha = 0;
my $width = 3;
patches/wxMSW-2.8.10-makefiles.patch view on Meta::CPAN
Index: build/msw/makefile.gcc
===================================================================
--- build/msw/makefile.gcc (revisione 63679)
+++ build/msw/makefile.gcc (copia locale)
@@ -175,14 +175,14 @@
-DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) $(__DEBUG_DEFINE_p) \
$(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) $(__THREAD_DEFINE_p) \
$(__UNICODE_DEFINE_p) $(__MSLU_DEFINE_p) $(__GFXCTX_DEFINE_p) \
- -I$(SETUPHDIR) -I..\..\include -W -Wall -I..\..\src\tiff -I..\..\src\jpeg \
+ -I$(SETUPHDIR) -I..\..\include -Wall -I..\..\src\tiff -I..\..\src\jpeg \
-I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib \
-DwxUSE_BASE=1 -DWXMAKINGDLL $(CPPFLAGS) $(CFLAGS)
MONODLL_CXXFLAGS = $(__DEBUGINFO) $(__OPTIMIZEFLAG) $(__THREADSFLAG) \
$(GCCFLAGS) -DHAVE_W32API_H -D__WXMSW__ $(__WXUNIV_DEFINE_p) \
patches/wxMSW-2.8.10-w64-stc.patch view on Meta::CPAN
Index: contrib/include/wx/stc/stc.h
===================================================================
--- contrib/include/wx/stc/stc.h (revisione 63679)
+++ contrib/include/wx/stc/stc.h (copia locale)
@@ -3268,7 +3268,7 @@
// Send a message to Scintilla
- long SendMsg(int msg, long wp=0, long lp=0);
+ wxIntPtr SendMsg(int msg, wxUIntPtr wp=0, wxIntPtr lp=0);
// Set the vertical scrollbar to use instead of the ont that's built-in.
Index: contrib/src/stc/scintilla/include/Scintilla.h
===================================================================
--- contrib/src/stc/scintilla/include/Scintilla.h (revisione 63679)
+++ contrib/src/stc/scintilla/include/Scintilla.h (copia locale)
@@ -28,6 +28,9 @@
#if defined(_MSC_VER) && _MSC_VER >= 1300
#include <BaseTsd.h>
#endif
+#if defined(__MINGW32__)
+#include <windows.h>
+#endif
#ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t;
typedef LONG_PTR sptr_t;
Index: contrib/src/stc/PlatWX.cpp
===================================================================
--- contrib/src/stc/PlatWX.cpp (revisione 63679)
+++ contrib/src/stc/PlatWX.cpp (copia locale)
@@ -1397,7 +1397,7 @@
void *lParam) {
wxStyledTextCtrl* stc = (wxStyledTextCtrl*)w;
- return stc->SendMsg(msg, wParam, (long)lParam);
+ return stc->SendMsg(msg, wParam, (wxIntPtr)lParam);
}
Index: contrib/src/stc/stc.cpp
===================================================================
--- contrib/src/stc/stc.cpp (revisione 63679)
+++ contrib/src/stc/stc.cpp (copia locale)
@@ -194,7 +194,7 @@
//----------------------------------------------------------------------
-long wxStyledTextCtrl::SendMsg(int msg, long wp, long lp) {
+wxIntPtr wxStyledTextCtrl::SendMsg(int msg, wxUIntPtr wp, wxIntPtr lp) {
return m_swx->WndProc(msg, wp, lp);
}
@@ -229,17 +229,17 @@
patches/wxMSW-2.8.10-w64-winhash.patch view on Meta::CPAN
Index: src/msw/window.cpp
===================================================================
--- src/msw/window.cpp (revisione 63679)
+++ src/msw/window.cpp (copia locale)
@@ -3431,11 +3431,17 @@
// wxWindow <-> HWND map
// ----------------------------------------------------------------------------
-wxWinHashTable *wxWinHandleHash = NULL;
+// hash containing all our windows, it uses HWND keys and wxWindow* values
+WX_DECLARE_HASH_MAP(HWND, wxWindow *,
+ wxPointerHash, wxPointerEqual,
+ WindowHandles);
patches/wxMSW-2.8.10-w64-winhash.patch view on Meta::CPAN
void wxRemoveHandleAssociation(wxWindowMSW *win)
{
- wxWinHandleHash->Delete((long)win->GetHWND());
+ gs_windowHandles.erase(GetHwndOf(win));
}
// ----------------------------------------------------------------------------
Index: src/msw/app.cpp
===================================================================
--- src/msw/app.cpp (revisione 63679)
+++ src/msw/app.cpp (copia locale)
@@ -321,8 +321,6 @@
RegisterWindowClasses();
- wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
-
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
wxSetKeyboardHook(true);
#endif
@@ -494,9 +492,6 @@
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
Index: src/aui/framemanager.cpp
===================================================================
--- src/aui/framemanager.cpp (revisione 63679)
+++ src/aui/framemanager.cpp (copia locale)
@@ -973,7 +973,7 @@
if (pinfo.name.empty() || already_exists)
{
pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
- ((unsigned long)pinfo.window) & 0xffffffff,
+ wxPtrToUInt(pinfo.window) & 0xffffffff,
(unsigned int)time(NULL),
#ifdef __WXWINCE__
(unsigned int)GetTickCount(),
Index: src/common/utilscmn.cpp
===================================================================
--- src/common/utilscmn.cpp (revisione 63679)
+++ src/common/utilscmn.cpp (copia locale)
@@ -817,7 +817,7 @@
::ShellExecuteEx(&sei);
- const int nResult = (int) sei.hInstApp;
+ const int nResult = (INT_PTR) sei.hInstApp;
// Firefox returns file not found for some reason, so make an exception
// for it
Index: src/msw/dcprint.cpp
===================================================================
--- src/msw/dcprint.cpp (revisione 63679)
+++ src/msw/dcprint.cpp (copia locale)
@@ -319,7 +319,7 @@
}
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
+ HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
Index: src/msw/window.cpp
===================================================================
--- src/msw/window.cpp (revisione 63679)
+++ src/msw/window.cpp (copia locale)
@@ -2596,8 +2596,8 @@
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages,
- wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
- wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
+ wxT("Processing %s(hWnd=%p, wParam=%8lx, lParam=%8lx)"),
+ wxGetMessageName(message), hWnd, (long)wParam, lParam);
#endif // __WXDEBUG__
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
{
- wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
- (int) hWnd, win->GetClassInfo()->GetClassName());
+ wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
+ hWnd, win->GetClassInfo()->GetClassName());
}
else
Index: src/msw/toplevel.cpp
===================================================================
--- src/msw/toplevel.cpp (revisione 63679)
+++ src/msw/toplevel.cpp (copia locale)
@@ -1122,7 +1122,7 @@
{
// restore focus to the child which was last focused unless we already
// have it
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
+ wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd);
wxWindow *winFocus = FindFocus();
if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
@@ -1157,10 +1157,10 @@
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
+ _T("wxTLW %p deactivated, last focused: %p."),
+ m_hWnd,
+ (m_winLastFocused ? GetHwndOf(m_winLastFocused)
+ : NULL));
event.Skip();
}
Index: src/msw/menuitem.cpp
===================================================================
--- src/msw/menuitem.cpp (revisione 63679)
+++ src/msw/menuitem.cpp (copia locale)
@@ -188,7 +188,7 @@
// return the id for calling Win32 API functions
int wxMenuItem::GetRealId() const
{
- return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
+ return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu()) : GetId();
}
// get item state
Index: src/msw/mdi.cpp
===================================================================
--- src/msw/mdi.cpp (revisione 63679)
+++ src/msw/mdi.cpp (copia locale)
@@ -763,7 +763,7 @@
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
+ WM_MDICREATE, 0, (LPARAM)&mcs);
if ( !m_hWnd )
{
@@ -1433,14 +1433,14 @@
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
+ ::AppendMenu(hmenu, MF_POPUP, (UINT_PTR)subMenu, _("&Window"));
}
}
Index: src/msw/tooltip.cpp
===================================================================
--- src/msw/tooltip.cpp (revisione 63679)
+++ src/msw/tooltip.cpp (copia locale)
@@ -106,7 +106,7 @@
uFlags |= TTF_TRANSPARENT;
}
- uId = (UINT)hwndOwner;
+ uId = (UINT_PTR)hwndOwner;
}
};
Index: src/msw/menu.cpp
===================================================================
--- src/msw/menu.cpp (revisione 63679)
+++ src/msw/menu.cpp (copia locale)
@@ -370,14 +370,14 @@
// id is the numeric id for normal menu items and HMENU for submenus as
// required by ::AppendMenu() API
- UINT id;
+ UINT_PTR id;
wxMenu *submenu = pItem->GetSubMenu();
if ( submenu != NULL ) {
wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
#else
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
- (UINT)submenu, title) )
+ (UINT_PTR)submenu, title) )
{
wxLogLastError(wxT("AppendMenu"));
}
Index: src/msw/tbar95.cpp
===================================================================
--- src/msw/tbar95.cpp (revisione 63679)
+++ src/msw/tbar95.cpp (copia locale)
@@ -802,8 +802,8 @@
TBREPLACEBITMAP replaceBitmap;
replaceBitmap.hInstOld = NULL;
replaceBitmap.hInstNew = NULL;
- replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
- replaceBitmap.nIDNew = (UINT) hBitmap;
+ replaceBitmap.nIDOld = (UINT_PTR) oldToolBarBitmap;
+ replaceBitmap.nIDNew = (UINT_PTR) hBitmap;
replaceBitmap.nButtons = nButtons;
if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
const wxString& label = tool->GetLabel();
if ( !label.empty() )
- button.iString = (int)label.c_str();
+ button.iString = (INT_PTR)label.c_str();
}
button.idCommand = tool->GetId();
Index: src/msw/thread.cpp
===================================================================
--- src/msw/thread.cpp (revisione 63679)
+++ src/msw/thread.cpp (copia locale)
@@ -522,7 +522,7 @@
return (THREAD_RETVAL)-1;
}
- rc = (THREAD_RETVAL)thread->Entry();
+ rc = wxPtrToUInt(thread->Entry());
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
@@ -684,7 +684,7 @@
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
#ifdef wxUSE_BEGIN_THREAD
- _endthreadex((unsigned)status);
+ _endthreadex(wxPtrToUInt(status));
#else // !VC++
::ExitThread((DWORD)status);
#endif // VC++/!VC++
Index: src/msw/frame.cpp
===================================================================
--- src/msw/frame.cpp (revisione 63679)
+++ src/msw/frame.cpp (copia locale)
@@ -855,7 +855,8 @@
HDC hdc = ::BeginPaint(GetHwnd(), &ps);
// Erase background before painting or we get white background
- MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
+ // Commented out: according to MSDN it's only needed on NT 3.51
+ // MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
if ( hIcon )
{
patches/wxMSW-2.8.10-w64.patch view on Meta::CPAN
HICON hIcon = icon.Ok() ? GetHiconOf(icon)
: (HICON)GetDefaultIcon();
- rc = (long)hIcon;
+ rc = (WXLRESULT)hIcon;
processed = rc != 0;
}
break;
Index: src/msw/pen.cpp
===================================================================
--- src/msw/pen.cpp (revisione 63679)
+++ src/msw/pen.cpp (copia locale)
@@ -172,7 +172,7 @@
case wxSTIPPLE:
logb.lbStyle = BS_PATTERN ;
if (M_PENDATA->m_stipple.Ok())
- logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
+ logb.lbHatch = wxPtrToUInt(M_PENDATA->m_stipple.GetHBITMAP());
else
logb.lbHatch = (LONG)0;
break;
Index: src/msw/helpwin.cpp
===================================================================
--- src/msw/helpwin.cpp (revisione 63679)
+++ src/msw/helpwin.cpp (copia locale)
@@ -98,7 +98,7 @@
wxString str = GetValidFilename(m_helpFile);
- return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
+ return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (ULONG_PTR)(const wxChar*) k) != 0);
}
// Can't close the help window explicitly in WinHelp
Index: src/msw/printdlg.cpp
===================================================================
--- src/msw/printdlg.cpp (revisione 63679)
+++ src/msw/printdlg.cpp (copia locale)
@@ -129,10 +129,10 @@
wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
if ( hDevMode )
GlobalFree(hDevMode);
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
Index: src/aui/framemanager.cpp
===================================================================
--- src/aui/framemanager.cpp (revisione 63679)
+++ src/aui/framemanager.cpp (copia locale)
@@ -973,7 +973,7 @@
if (pinfo.name.empty() || already_exists)
{
pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
- ((unsigned long)pinfo.window) & 0xffffffff,
+ wxPtrToUInt(pinfo.window) & 0xffffffff,
(unsigned int)time(NULL),
#ifdef __WXWINCE__
(unsigned int)GetTickCount(),
Index: src/common/utilscmn.cpp
===================================================================
--- src/common/utilscmn.cpp (revisione 63679)
+++ src/common/utilscmn.cpp (copia locale)
@@ -822,7 +822,7 @@
//hInstApp member is only valid if the function fails, in which case it
//receives one of the following error values, which are less than or
//equal to 32.
- const int nResult = (int) sei.hInstApp;
+ const int nResult = (INT_PTR) sei.hInstApp;
// Firefox returns file not found for some reason, so make an exception
// for it
Index: src/msw/dcprint.cpp
===================================================================
--- src/msw/dcprint.cpp (revisione 63679)
+++ src/msw/dcprint.cpp (copia locale)
@@ -319,7 +319,7 @@
}
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
+ HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
Index: src/msw/window.cpp
===================================================================
--- src/msw/window.cpp (revisione 63679)
+++ src/msw/window.cpp (copia locale)
@@ -2596,8 +2596,8 @@
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages,
- wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
- wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
+ wxT("Processing %s(hWnd=%p, wParam=%8lx, lParam=%8lx)"),
+ wxGetMessageName(message), hWnd, (long)wParam, lParam);
#endif // __WXDEBUG__
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
{
- wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
- (int) hWnd, win->GetClassInfo()->GetClassName());
+ wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
+ hWnd, win->GetClassInfo()->GetClassName());
}
else
Index: src/msw/toplevel.cpp
===================================================================
--- src/msw/toplevel.cpp (revisione 63679)
+++ src/msw/toplevel.cpp (copia locale)
@@ -1122,7 +1122,7 @@
{
// restore focus to the child which was last focused unless we already
// have it
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
+ wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd);
wxWindow *winFocus = FindFocus();
if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
@@ -1157,10 +1157,10 @@
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
+ _T("wxTLW %p deactivated, last focused: %p."),
+ m_hWnd,
+ (m_winLastFocused ? GetHwndOf(m_winLastFocused)
+ : NULL));
event.Skip();
}
Index: src/msw/menuitem.cpp
===================================================================
--- src/msw/menuitem.cpp (revisione 63679)
+++ src/msw/menuitem.cpp (copia locale)
@@ -188,7 +188,7 @@
// return the id for calling Win32 API functions
int wxMenuItem::GetRealId() const
{
- return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
+ return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu()) : GetId();
}
// get item state
Index: src/msw/mdi.cpp
===================================================================
--- src/msw/mdi.cpp (revisione 63679)
+++ src/msw/mdi.cpp (copia locale)
@@ -763,7 +763,7 @@
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
+ WM_MDICREATE, 0, (LPARAM)&mcs);
if ( !m_hWnd )
{
@@ -1433,14 +1433,14 @@
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
+ ::AppendMenu(hmenu, MF_POPUP, (UINT_PTR)subMenu, _("&Window"));
}
}
Index: src/msw/tooltip.cpp
===================================================================
--- src/msw/tooltip.cpp (revisione 63679)
+++ src/msw/tooltip.cpp (copia locale)
@@ -106,7 +106,7 @@
uFlags |= TTF_TRANSPARENT;
}
- uId = (UINT)hwndOwner;
+ uId = (UINT_PTR)hwndOwner;
}
};
Index: src/msw/menu.cpp
===================================================================
--- src/msw/menu.cpp (revisione 63679)
+++ src/msw/menu.cpp (copia locale)
@@ -370,14 +370,14 @@
// id is the numeric id for normal menu items and HMENU for submenus as
// required by ::AppendMenu() API
- UINT id;
+ UINT_PTR id;
wxMenu *submenu = pItem->GetSubMenu();
if ( submenu != NULL ) {
wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
#else
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
- (UINT)submenu, title) )
+ (UINT_PTR)submenu, title) )
{
wxLogLastError(wxT("AppendMenu"));
}
Index: src/msw/tbar95.cpp
===================================================================
--- src/msw/tbar95.cpp (revisione 63679)
+++ src/msw/tbar95.cpp (copia locale)
@@ -802,8 +802,8 @@
TBREPLACEBITMAP replaceBitmap;
replaceBitmap.hInstOld = NULL;
replaceBitmap.hInstNew = NULL;
- replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
- replaceBitmap.nIDNew = (UINT) hBitmap;
+ replaceBitmap.nIDOld = (UINT_PTR) oldToolBarBitmap;
+ replaceBitmap.nIDNew = (UINT_PTR) hBitmap;
replaceBitmap.nButtons = nButtons;
if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
const wxString& label = tool->GetLabel();
if ( !label.empty() )
- button.iString = (int)label.c_str();
+ button.iString = (INT_PTR)label.c_str();
}
button.idCommand = tool->GetId();
Index: src/msw/thread.cpp
===================================================================
--- src/msw/thread.cpp (revisione 63679)
+++ src/msw/thread.cpp (copia locale)
@@ -522,7 +522,7 @@
return (THREAD_RETVAL)-1;
}
- rc = (THREAD_RETVAL)thread->Entry();
+ rc = wxPtrToUInt(thread->Entry());
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
@@ -684,7 +684,7 @@
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
#ifdef wxUSE_BEGIN_THREAD
- _endthreadex((unsigned)status);
+ _endthreadex(wxPtrToUInt(status));
#else // !VC++
::ExitThread((DWORD)status);
#endif // VC++/!VC++
Index: src/msw/frame.cpp
===================================================================
--- src/msw/frame.cpp (revisione 63679)
+++ src/msw/frame.cpp (copia locale)
@@ -855,7 +855,8 @@
HDC hdc = ::BeginPaint(GetHwnd(), &ps);
// Erase background before painting or we get white background
- MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
+ // Commented out: according to MSDN it's only needed on NT 3.51
+ // MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
if ( hIcon )
{
patches/wxMSW-2.8.11-w64.patch view on Meta::CPAN
HICON hIcon = icon.Ok() ? GetHiconOf(icon)
: (HICON)GetDefaultIcon();
- rc = (long)hIcon;
+ rc = (WXLRESULT)hIcon;
processed = rc != 0;
}
break;
Index: src/msw/pen.cpp
===================================================================
--- src/msw/pen.cpp (revisione 63679)
+++ src/msw/pen.cpp (copia locale)
@@ -172,7 +172,7 @@
case wxSTIPPLE:
logb.lbStyle = BS_PATTERN ;
if (M_PENDATA->m_stipple.Ok())
- logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
+ logb.lbHatch = wxPtrToUInt(M_PENDATA->m_stipple.GetHBITMAP());
else
logb.lbHatch = (LONG)0;
break;
Index: src/msw/helpwin.cpp
===================================================================
--- src/msw/helpwin.cpp (revisione 63679)
+++ src/msw/helpwin.cpp (copia locale)
@@ -98,7 +98,7 @@
wxString str = GetValidFilename(m_helpFile);
- return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
+ return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (ULONG_PTR)(const wxChar*) k) != 0);
}
// Can't close the help window explicitly in WinHelp
Index: src/msw/printdlg.cpp
===================================================================
--- src/msw/printdlg.cpp (revisione 63679)
+++ src/msw/printdlg.cpp (copia locale)
@@ -175,10 +175,10 @@
wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
if ( hDevMode )
GlobalFree(hDevMode);
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;
patches/wxMSW-2.8.12-w64-stc.patch view on Meta::CPAN
Index: contrib/src/stc/scintilla/include/Scintilla.h
===================================================================
--- contrib/src/stc/scintilla/include/Scintilla.h (revisione 63679)
+++ contrib/src/stc/scintilla/include/Scintilla.h (copia locale)
@@ -28,6 +28,9 @@
#if defined(_MSC_VER) && _MSC_VER >= 1300
#include <BaseTsd.h>
#endif
+#if defined(__MINGW32__)
+#include <windows.h>
+#endif
#ifdef MAXULONG_PTR
typedef ULONG_PTR uptr_t;
typedef LONG_PTR sptr_t;
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
Index: src/aui/framemanager.cpp
===================================================================
--- src/aui/framemanager.cpp (revisione 63679)
+++ src/aui/framemanager.cpp (copia locale)
@@ -973,7 +973,7 @@
if (pinfo.name.empty() || already_exists)
{
pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"),
- ((unsigned long)pinfo.window) & 0xffffffff,
+ wxPtrToUInt(pinfo.window) & 0xffffffff,
(unsigned int)time(NULL),
#ifdef __WXWINCE__
(unsigned int)GetTickCount(),
Index: src/common/utilscmn.cpp
===================================================================
--- src/common/utilscmn.cpp (revisione 63679)
+++ src/common/utilscmn.cpp (copia locale)
@@ -822,7 +822,7 @@
//hInstApp member is only valid if the function fails, in which case it
//receives one of the following error values, which are less than or
//equal to 32.
- const int nResult = (int) sei.hInstApp;
+ const int nResult = (INT_PTR) sei.hInstApp;
// Firefox returns file not found for some reason, so make an exception
// for it
Index: src/msw/dcprint.cpp
===================================================================
--- src/msw/dcprint.cpp (revisione 63679)
+++ src/msw/dcprint.cpp (copia locale)
@@ -319,7 +319,7 @@
}
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) data->GetDevMode();
+ HGLOBAL hDevMode = (HGLOBAL) data->GetDevMode();
DEVMODE *lpDevMode = hDevMode ? (DEVMODE *)::GlobalLock(hDevMode) : NULL;
Index: src/msw/window.cpp
===================================================================
--- src/msw/window.cpp (revisione 63679)
+++ src/msw/window.cpp (copia locale)
@@ -2596,8 +2596,8 @@
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
wxLogTrace(wxTraceMessages,
- wxT("Processing %s(hWnd=%08lx, wParam=%8lx, lParam=%8lx)"),
- wxGetMessageName(message), (long)hWnd, (long)wParam, lParam);
+ wxT("Processing %s(hWnd=%p, wParam=%8lx, lParam=%8lx)"),
+ wxGetMessageName(message), hWnd, (long)wParam, lParam);
#endif // __WXDEBUG__
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
{
- wxLogDebug(wxT("HWND %X already associated with another window (%s)"),
- (int) hWnd, win->GetClassInfo()->GetClassName());
+ wxLogDebug(wxT("HWND %p already associated with another window (%s)"),
+ hWnd, win->GetClassInfo()->GetClassName());
}
else
Index: src/msw/toplevel.cpp
===================================================================
--- src/msw/toplevel.cpp (revisione 63679)
+++ src/msw/toplevel.cpp (copia locale)
@@ -1122,7 +1122,7 @@
{
// restore focus to the child which was last focused unless we already
// have it
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
+ wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd);
wxWindow *winFocus = FindFocus();
if ( !winFocus || wxGetTopLevelParent(winFocus) != this )
@@ -1157,10 +1157,10 @@
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
+ _T("wxTLW %p deactivated, last focused: %p."),
+ m_hWnd,
+ (m_winLastFocused ? GetHwndOf(m_winLastFocused)
+ : NULL));
event.Skip();
}
Index: src/msw/menuitem.cpp
===================================================================
--- src/msw/menuitem.cpp (revisione 63679)
+++ src/msw/menuitem.cpp (copia locale)
@@ -188,7 +188,7 @@
// return the id for calling Win32 API functions
int wxMenuItem::GetRealId() const
{
- return m_subMenu ? (int)m_subMenu->GetHMenu() : GetId();
+ return m_subMenu ? wxPtrToUInt(m_subMenu->GetHMenu()) : GetId();
}
// get item state
Index: src/msw/mdi.cpp
===================================================================
--- src/msw/mdi.cpp (revisione 63679)
+++ src/msw/mdi.cpp (copia locale)
@@ -763,7 +763,7 @@
wxWindowCreationHook hook(this);
m_hWnd = (WXHWND)::SendMessage(GetWinHwnd(parent->GetClientWindow()),
- WM_MDICREATE, 0, (LONG)(LPSTR)&mcs);
+ WM_MDICREATE, 0, (LPARAM)&mcs);
if ( !m_hWnd )
{
@@ -1433,14 +1433,14 @@
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _("&Window"));
+ ::AppendMenu(hmenu, MF_POPUP, (UINT_PTR)subMenu, _("&Window"));
}
}
Index: src/msw/tooltip.cpp
===================================================================
--- src/msw/tooltip.cpp (revisione 63679)
+++ src/msw/tooltip.cpp (copia locale)
@@ -106,7 +106,7 @@
uFlags |= TTF_TRANSPARENT;
}
- uId = (UINT)hwndOwner;
+ uId = (UINT_PTR)hwndOwner;
}
};
Index: src/msw/menu.cpp
===================================================================
--- src/msw/menu.cpp (revisione 63679)
+++ src/msw/menu.cpp (copia locale)
@@ -370,14 +370,14 @@
// id is the numeric id for normal menu items and HMENU for submenus as
// required by ::AppendMenu() API
- UINT id;
+ UINT_PTR id;
wxMenu *submenu = pItem->GetSubMenu();
if ( submenu != NULL ) {
wxASSERT_MSG( submenu->GetHMenu(), wxT("invalid submenu") );
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
#else
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
- (UINT)submenu, title) )
+ (UINT_PTR)submenu, title) )
{
wxLogLastError(wxT("AppendMenu"));
}
Index: src/msw/tbar95.cpp
===================================================================
--- src/msw/tbar95.cpp (revisione 63679)
+++ src/msw/tbar95.cpp (copia locale)
@@ -802,8 +802,8 @@
TBREPLACEBITMAP replaceBitmap;
replaceBitmap.hInstOld = NULL;
replaceBitmap.hInstNew = NULL;
- replaceBitmap.nIDOld = (UINT) oldToolBarBitmap;
- replaceBitmap.nIDNew = (UINT) hBitmap;
+ replaceBitmap.nIDOld = (UINT_PTR) oldToolBarBitmap;
+ replaceBitmap.nIDNew = (UINT_PTR) hBitmap;
replaceBitmap.nButtons = nButtons;
if ( !::SendMessage(GetHwnd(), TB_REPLACEBITMAP,
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
const wxString& label = tool->GetLabel();
if ( !label.empty() )
- button.iString = (int)label.c_str();
+ button.iString = (INT_PTR)label.c_str();
}
button.idCommand = tool->GetId();
Index: src/msw/thread.cpp
===================================================================
--- src/msw/thread.cpp (revisione 63679)
+++ src/msw/thread.cpp (copia locale)
@@ -522,7 +522,7 @@
return (THREAD_RETVAL)-1;
}
- rc = (THREAD_RETVAL)thread->Entry();
+ rc = wxPtrToUInt(thread->Entry());
}
wxCATCH_ALL( wxTheApp->OnUnhandledException(); )
@@ -684,7 +684,7 @@
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
#ifdef wxUSE_BEGIN_THREAD
- _endthreadex((unsigned)status);
+ _endthreadex(wxPtrToUInt(status));
#else // !VC++
::ExitThread((DWORD)status);
#endif // VC++/!VC++
Index: src/msw/frame.cpp
===================================================================
--- src/msw/frame.cpp (revisione 63679)
+++ src/msw/frame.cpp (copia locale)
@@ -855,7 +855,8 @@
HDC hdc = ::BeginPaint(GetHwnd(), &ps);
// Erase background before painting or we get white background
- MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
+ // Commented out: according to MSDN it's only needed on NT 3.51
+ // MSWDefWindowProc(WM_ICONERASEBKGND, (WORD)(LONG)ps.hdc, 0L);
if ( hIcon )
{
patches/wxMSW-2.8.12-w64.patch view on Meta::CPAN
HICON hIcon = icon.Ok() ? GetHiconOf(icon)
: (HICON)GetDefaultIcon();
- rc = (long)hIcon;
+ rc = (WXLRESULT)hIcon;
processed = rc != 0;
}
break;
Index: src/msw/pen.cpp
===================================================================
--- src/msw/pen.cpp (revisione 63679)
+++ src/msw/pen.cpp (copia locale)
@@ -172,7 +172,7 @@
case wxSTIPPLE:
logb.lbStyle = BS_PATTERN ;
if (M_PENDATA->m_stipple.Ok())
- logb.lbHatch = (LONG)M_PENDATA->m_stipple.GetHBITMAP();
+ logb.lbHatch = wxPtrToUInt(M_PENDATA->m_stipple.GetHBITMAP());
else
logb.lbHatch = (LONG)0;
break;
Index: src/msw/helpwin.cpp
===================================================================
--- src/msw/helpwin.cpp (revisione 63679)
+++ src/msw/helpwin.cpp (copia locale)
@@ -98,7 +98,7 @@
wxString str = GetValidFilename(m_helpFile);
- return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (DWORD)(const wxChar*) k) != 0);
+ return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_PARTIALKEY, (ULONG_PTR)(const wxChar*) k) != 0);
}
// Can't close the help window explicitly in WinHelp
Index: src/msw/printdlg.cpp
===================================================================
--- src/msw/printdlg.cpp (revisione 63679)
+++ src/msw/printdlg.cpp (copia locale)
@@ -175,10 +175,10 @@
wxWindowsPrintNativeData::~wxWindowsPrintNativeData()
{
- HGLOBAL hDevMode = (HGLOBAL)(DWORD) m_devMode;
+ HGLOBAL hDevMode = (HGLOBAL) m_devMode;
if ( hDevMode )
GlobalFree(hDevMode);
- HGLOBAL hDevNames = (HGLOBAL)(DWORD) m_devNames;
+ HGLOBAL hDevNames = (HGLOBAL) m_devNames;