Fixed VC++ compile error in mstream; formatted window.cpp.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
75ed1d15d0
commit
2d0a075d90
@ -30,7 +30,7 @@
|
||||
wxMemoryInputStream::wxMemoryInputStream(const char *data, size_t len)
|
||||
: wxInputStream()
|
||||
{
|
||||
m_i_streambuf->SetBufferIO((char *)data, data+len);
|
||||
m_i_streambuf->SetBufferIO((char*) data, (char*) (data+len));
|
||||
m_i_streambuf->Fixed(TRUE);
|
||||
}
|
||||
|
||||
|
@ -97,11 +97,11 @@ wxWindow *wxFindWinFromHandle(WXHWND hWnd);
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxEvtHandler)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxWindow, wxEvtHandler)
|
||||
EVT_CHAR(wxWindow::OnChar)
|
||||
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
|
||||
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
|
||||
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
|
||||
EVT_IDLE(wxWindow::OnIdle)
|
||||
EVT_CHAR(wxWindow::OnChar)
|
||||
EVT_ERASE_BACKGROUND(wxWindow::OnEraseBackground)
|
||||
EVT_SYS_COLOUR_CHANGED(wxWindow::OnSysColourChanged)
|
||||
EVT_INIT_DIALOG(wxWindow::OnInitDialog)
|
||||
EVT_IDLE(wxWindow::OnIdle)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
#endif
|
||||
@ -225,8 +225,8 @@ wxWindow::wxWindow(void)
|
||||
m_minSizeY = -1;
|
||||
m_maxSizeX = -1;
|
||||
m_maxSizeY = -1;
|
||||
// m_paintHDC = 0;
|
||||
// m_tempHDC = 0;
|
||||
// m_paintHDC = 0;
|
||||
// m_tempHDC = 0;
|
||||
m_isBeingDeleted = FALSE;
|
||||
m_oldWndProc = 0;
|
||||
#ifndef __WIN32__
|
||||
@ -242,16 +242,16 @@ wxWindow::wxWindow(void)
|
||||
// m_backgroundColour = settings.GetSystemColour(wxSYS_COLOUR_WINDOW) ; ;
|
||||
m_foregroundColour = *wxBLACK;
|
||||
|
||||
/*
|
||||
/*
|
||||
wxColour(GetRValue(GetSysColor(COLOR_WINDOW)),
|
||||
GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE)));
|
||||
*/
|
||||
*/
|
||||
|
||||
// wxWnd
|
||||
m_lastMsg = 0;
|
||||
m_lastWParam = 0;
|
||||
m_lastLParam = 0;
|
||||
// m_acceleratorTable = 0;
|
||||
// m_acceleratorTable = 0;
|
||||
m_hMenu = 0;
|
||||
|
||||
m_xThumbSize = 0;
|
||||
@ -278,7 +278,7 @@ wxWindow::~wxWindow(void)
|
||||
// it to nearer the end. Unsure of side-effects
|
||||
// e.g. when deleting associated global data.
|
||||
// Restore old Window proc, if required
|
||||
// UnsubclassWin();
|
||||
// UnsubclassWin();
|
||||
|
||||
// Have to delete constraints/sizer FIRST otherwise
|
||||
// sizers may try to look at deleted windows as they
|
||||
@ -614,7 +614,7 @@ void wxWindow::ScreenToClient(int *x, int *y) const
|
||||
pt.y = *y;
|
||||
::ScreenToClient(hWnd, &pt);
|
||||
|
||||
/*
|
||||
/*
|
||||
// We may be faking the client origin.
|
||||
// So a window that's really at (0, 30) may appear
|
||||
// (to wxWin apps) to be at (0, 0).
|
||||
@ -624,7 +624,7 @@ void wxWindow::ScreenToClient(int *x, int *y) const
|
||||
pt.x -= pt1.x;
|
||||
pt.y -= pt1.y;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
*x = pt.x;
|
||||
*y = pt.y;
|
||||
@ -637,7 +637,7 @@ void wxWindow::ClientToScreen(int *x, int *y) const
|
||||
pt.x = *x;
|
||||
pt.y = *y;
|
||||
|
||||
/*
|
||||
/*
|
||||
// We may be faking the client origin.
|
||||
// So a window that's really at (0, 30) may appear
|
||||
// (to wxWin apps) to be at (0, 0).
|
||||
@ -647,7 +647,7 @@ void wxWindow::ClientToScreen(int *x, int *y) const
|
||||
pt.x += pt1.x;
|
||||
pt.y += pt1.y;
|
||||
}
|
||||
*/
|
||||
*/
|
||||
|
||||
::ClientToScreen(hWnd, &pt);
|
||||
|
||||
@ -674,8 +674,8 @@ void wxWindow::SetCursor(const wxCursor& cursor)
|
||||
}
|
||||
|
||||
// This will cause big reentrancy problems if wxFlushEvents is implemented.
|
||||
// wxFlushEvents();
|
||||
// return old_cursor;
|
||||
// wxFlushEvents();
|
||||
// return old_cursor;
|
||||
}
|
||||
|
||||
|
||||
@ -783,7 +783,7 @@ bool wxWindow::Show(bool show)
|
||||
{
|
||||
BringWindowToTop(hWnd);
|
||||
// Next line causes a crash on NT, apparently.
|
||||
// UpdateWindow(hWnd); // Should this be here or will it cause inefficiency?
|
||||
// UpdateWindow(hWnd); // Should this be here or will it cause inefficiency?
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@ -850,8 +850,8 @@ void wxWindow::GetTextExtent(const wxString& string, int *x, int *y,
|
||||
if (descent) *descent = tm.tmDescent;
|
||||
if (externalLeading) *externalLeading = tm.tmExternalLeading;
|
||||
|
||||
// if (fontToUse)
|
||||
// fontToUse->ReleaseResource();
|
||||
// if (fontToUse)
|
||||
// fontToUse->ReleaseResource();
|
||||
}
|
||||
|
||||
void wxWindow::Refresh(bool eraseBack, const wxRectangle *rect)
|
||||
@ -918,7 +918,7 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA
|
||||
// Stop right here if we don't have a valid handle
|
||||
// in our wxWnd object.
|
||||
if (wnd && !wnd->m_hWnd) {
|
||||
// wxDebugMsg("Warning: could not find a valid handle, wx_win.cc/wxWndProc.\n");
|
||||
// wxDebugMsg("Warning: could not find a valid handle, wx_win.cc/wxWndProc.\n");
|
||||
wnd->m_hWnd = (WXHWND) hWnd;
|
||||
long res = wnd->MSWDefWindowProc(message, wParam, lParam );
|
||||
wnd->m_hWnd = 0;
|
||||
@ -950,10 +950,10 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
m_lastWParam == wParam &&
|
||||
m_lastLParam == lParam );
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
#ifdef __WXDEBUG__
|
||||
wxLogTrace(wxTraceMessages, "Processing %s(%lx, %lx)",
|
||||
wxGetMessageName(message), wParam, lParam);
|
||||
#endif // WXDEBUG
|
||||
#endif // WXDEBUG
|
||||
|
||||
HWND hWnd = (HWND)m_hWnd;
|
||||
|
||||
@ -977,7 +977,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
case WM_SETFOCUS:
|
||||
{
|
||||
HWND hwnd = (HWND)wParam;
|
||||
// return OnSetFocus(hwnd);
|
||||
// return OnSetFocus(hwnd);
|
||||
|
||||
if (MSWOnSetFocus((WXHWND) hwnd))
|
||||
return 0;
|
||||
@ -987,7 +987,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
case WM_KILLFOCUS:
|
||||
{
|
||||
HWND hwnd = (HWND)lParam;
|
||||
// return OnKillFocus(hwnd);
|
||||
// return OnKillFocus(hwnd);
|
||||
if (MSWOnKillFocus((WXHWND) hwnd))
|
||||
return 0;
|
||||
else
|
||||
@ -1415,7 +1415,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
case WM_QUERYENDSESSION:
|
||||
{
|
||||
// Same as WM_CLOSE, but inverted results. Thx Microsoft :-)
|
||||
// return MSWOnClose();
|
||||
// return MSWOnClose();
|
||||
|
||||
return MSWOnQueryEndSession(lParam);
|
||||
break;
|
||||
@ -1462,7 +1462,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
|
||||
|
||||
// Dialog window proc
|
||||
LONG APIENTRY _EXPORT
|
||||
wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
wxDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -1630,14 +1630,14 @@ bool wxWindow::MSWOnDestroy(void)
|
||||
wxDebugMsg("wxWindow::MSWOnDestroy %d\n", handle);
|
||||
#endif
|
||||
// delete our drop target if we've got one
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
if ( m_pDropTarget != NULL ) {
|
||||
m_pDropTarget->Revoke(m_hWnd);
|
||||
|
||||
delete m_pDropTarget;
|
||||
m_pDropTarget = NULL;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1657,7 +1657,7 @@ bool wxWindow::MSWOnNotify(WXWPARAM wParam, WXLPARAM lParam)
|
||||
// This won't work now, though, because any number of controls
|
||||
// could respond to the same generic messages :-(
|
||||
|
||||
/* This doesn't work for toolbars, but try for other controls first.
|
||||
/* This doesn't work for toolbars, but try for other controls first.
|
||||
*/
|
||||
NMHDR *hdr = (NMHDR *)lParam;
|
||||
HWND hWnd = (HWND)hdr->hwndFrom;
|
||||
@ -1939,10 +1939,10 @@ long wxWindow::Default()
|
||||
if (m_lastMsg == 0)
|
||||
return 0;
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
#ifdef __WXDEBUG__
|
||||
wxLogTrace(wxTraceMessages, "Forwarding %s to DefWindowProc.",
|
||||
wxGetMessageName(m_lastMsg));
|
||||
#endif // WXDEBUG
|
||||
#endif // WXDEBUG
|
||||
|
||||
return this->MSWDefWindowProc(m_lastMsg, m_lastWParam, m_lastLParam);
|
||||
}
|
||||
@ -2247,7 +2247,7 @@ void wxWindow::MSWOnMButtonDown(int x, int y, WXUINT flags)
|
||||
|
||||
void wxWindow::MSWOnMButtonUp(int x, int y, WXUINT flags)
|
||||
{
|
||||
//wxDebugMsg("MButtonUp\n") ;
|
||||
//wxDebugMsg("MButtonUp\n") ;
|
||||
wxMouseEvent event(wxEVT_MIDDLE_UP);
|
||||
|
||||
event.m_x = x; event.m_y = y;
|
||||
@ -2745,8 +2745,8 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font)
|
||||
#if WXDEBUG > 1
|
||||
wxDebugMsg("wxGetCharSize: Selecting HFONT %X\n", fnt);
|
||||
#endif
|
||||
// the_font->UseResource();
|
||||
// the_font->RealizeResource();
|
||||
// the_font->UseResource();
|
||||
// the_font->RealizeResource();
|
||||
if ((fnt=(HFONT) the_font->GetResourceHandle()))
|
||||
was = (HFONT) SelectObject(dc,fnt) ;
|
||||
}
|
||||
@ -2762,8 +2762,8 @@ void wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font)
|
||||
*x = tm.tmAveCharWidth;
|
||||
*y = tm.tmHeight + tm.tmExternalLeading;
|
||||
|
||||
// if (the_font)
|
||||
// the_font->ReleaseResource();
|
||||
// if (the_font)
|
||||
// the_font->ReleaseResource();
|
||||
}
|
||||
|
||||
// Returns 0 if was a normal ASCII value, not a special key. This indicates that
|
||||
@ -2982,7 +2982,7 @@ wxWindow *wxGetActiveWindow(void)
|
||||
static HHOOK wxTheKeyboardHook = 0;
|
||||
static FARPROC wxTheKeyboardHookProc = 0;
|
||||
int APIENTRY _EXPORT
|
||||
wxKeyboardHook(int nCode, WORD wParam, DWORD lParam);
|
||||
wxKeyboardHook(int nCode, WORD wParam, DWORD lParam);
|
||||
|
||||
void wxSetKeyboardHook(bool doIt)
|
||||
{
|
||||
@ -2992,7 +2992,7 @@ void wxSetKeyboardHook(bool doIt)
|
||||
wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
|
||||
#ifdef __WIN32__
|
||||
GetCurrentThreadId());
|
||||
// (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
|
||||
// (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
|
||||
#else
|
||||
GetCurrentTask());
|
||||
#endif
|
||||
@ -3005,7 +3005,7 @@ void wxSetKeyboardHook(bool doIt)
|
||||
}
|
||||
|
||||
int APIENTRY _EXPORT
|
||||
wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
|
||||
wxKeyboardHook(int nCode, WORD wParam, DWORD lParam)
|
||||
{
|
||||
DWORD hiWord = HIWORD(lParam);
|
||||
if (nCode != HC_NOREMOVE && ((hiWord & KF_UP) == 0))
|
||||
@ -3019,10 +3019,10 @@ int APIENTRY _EXPORT
|
||||
|
||||
event.m_eventObject = NULL;
|
||||
event.m_keyCode = id;
|
||||
/* begin Albert's fix for control and shift key 26.5 */
|
||||
/* begin Albert's fix for control and shift key 26.5 */
|
||||
event.m_shiftDown = (::GetKeyState(VK_SHIFT)&0x100?TRUE:FALSE);
|
||||
event.m_controlDown = (::GetKeyState(VK_CONTROL)&0x100?TRUE:FALSE);
|
||||
/* end Albert's fix for control and shift key 26.5 */
|
||||
/* end Albert's fix for control and shift key 26.5 */
|
||||
event.SetTimestamp(wxApp::sm_lastMessageTime);
|
||||
|
||||
wxWindow *win = wxGetActiveWindow();
|
||||
@ -3077,7 +3077,7 @@ void wxWindow::Centre(int direction)
|
||||
/* TODO (maybe)
|
||||
void wxWindow::OnPaint(void)
|
||||
{
|
||||
PaintSelectionHandles();
|
||||
PaintSelectionHandles();
|
||||
}
|
||||
*/
|
||||
|
||||
@ -3135,11 +3135,11 @@ void wxWindow::OnEraseBackground(wxEraseEvent& event)
|
||||
HBRUSH hBrush = ::CreateSolidBrush(PALETTERGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
|
||||
int mode = ::SetMapMode((HDC) event.GetDC()->GetHDC(), MM_TEXT);
|
||||
|
||||
// ::GetClipBox((HDC) event.GetDC()->GetHDC(), &rect);
|
||||
// ::GetClipBox((HDC) event.GetDC()->GetHDC(), &rect);
|
||||
::FillRect ((HDC) event.GetDC()->GetHDC(), &rect, hBrush);
|
||||
::DeleteObject(hBrush);
|
||||
::SetMapMode((HDC) event.GetDC()->GetHDC(), mode);
|
||||
/*
|
||||
/*
|
||||
// Less efficient version (and doesn't account for scrolling)
|
||||
int w, h;
|
||||
GetClientSize(& w, & h);
|
||||
@ -3148,7 +3148,7 @@ void wxWindow::OnEraseBackground(wxEraseEvent& event)
|
||||
event.GetDC()->SetPen(wxTRANSPARENT_PEN);
|
||||
|
||||
event.GetDC()->DrawRectangle(0, 0, w+1, h+1);
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
@ -3369,13 +3369,13 @@ void wxWindow::SetScrollbar(int orient, int pos, int thumbVisible,
|
||||
int range, bool refresh)
|
||||
{
|
||||
/*
|
||||
SetScrollPage(orient, thumbVisible, FALSE);
|
||||
SetScrollPage(orient, thumbVisible, FALSE);
|
||||
|
||||
int oldRange = range - thumbVisible ;
|
||||
SetScrollRange(orient, oldRange, FALSE);
|
||||
|
||||
SetScrollPos(orient, pos, refresh);
|
||||
*/
|
||||
*/
|
||||
#if defined(__WIN95__)
|
||||
int oldRange = range - thumbVisible ;
|
||||
|
||||
@ -3840,8 +3840,8 @@ void wxWindow::SetSizer(wxSizer *sizer)
|
||||
}
|
||||
|
||||
/*
|
||||
* New version
|
||||
*/
|
||||
* New version
|
||||
*/
|
||||
|
||||
bool wxWindow::Layout(void)
|
||||
{
|
||||
@ -4172,8 +4172,8 @@ wxObject* wxWindow::GetChild(int number) const
|
||||
void wxWindow::OnDefaultAction(wxControl *initiatingItem)
|
||||
{
|
||||
/* This is obsolete now; if we wish to intercept listbox double-clicks,
|
||||
* we explicitly intercept the wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
|
||||
* event.
|
||||
* we explicitly intercept the wxEVT_COMMAND_LISTBOX_DOUBLECLICKED
|
||||
* event.
|
||||
|
||||
if (initiatingItem->IsKindOf(CLASSINFO(wxListBox)))
|
||||
{
|
||||
@ -4202,7 +4202,7 @@ void wxWindow::OnDefaultAction(wxControl *initiatingItem)
|
||||
event.SetEventObject(but);
|
||||
but->Command(event);
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
void wxWindow::Clear(void)
|
||||
@ -4285,15 +4285,15 @@ wxWindow *wxWindow::FindWindow(const wxString& name)
|
||||
// according to the cursor keys pressed
|
||||
void wxWindow::OnChar(wxKeyEvent& event)
|
||||
{
|
||||
int x_page = 0;
|
||||
int y_page = 0;
|
||||
int start_x = 0;
|
||||
int start_y = 0;
|
||||
// Bugfix Begin
|
||||
int v_width = 0;
|
||||
int v_height = 0;
|
||||
int y_pages = 0;
|
||||
// Bugfix End
|
||||
int x_page = 0;
|
||||
int y_page = 0;
|
||||
int start_x = 0;
|
||||
int start_y = 0;
|
||||
// Bugfix Begin
|
||||
int v_width = 0;
|
||||
int v_height = 0;
|
||||
int y_pages = 0;
|
||||
// Bugfix End
|
||||
|
||||
GetScrollUnitsPerPage(&x_page, &y_page);
|
||||
// Bugfix Begin
|
||||
@ -4304,11 +4304,11 @@ void wxWindow::OnChar(wxKeyEvent& event)
|
||||
if (vert_units)
|
||||
y_pages = (int)(v_height/vert_units) - y_page;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#ifdef __WXMSW__
|
||||
int y = 0;
|
||||
#else
|
||||
#else
|
||||
int y = y_page-1;
|
||||
#endif
|
||||
#endif
|
||||
// Bugfix End
|
||||
switch (event.keyCode)
|
||||
{
|
||||
@ -4379,7 +4379,7 @@ void wxWindow::OnChar(wxKeyEvent& event)
|
||||
}
|
||||
// end
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
|
Loading…
Reference in New Issue
Block a user