projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Never overflow the output buffer in wxBase64Decode().
[wxWidgets.git]
/
src
/
univ
/
winuniv.cpp
diff --git
a/src/univ/winuniv.cpp
b/src/univ/winuniv.cpp
index 6a03329594c297fbc4457a3188b9af76b537e134..ce34052eb89b80824814e8c965078bab872eed72 100644
(file)
--- a/
src/univ/winuniv.cpp
+++ b/
src/univ/winuniv.cpp
@@
-35,21
+35,21
@@
#include "wx/menu.h"
#include "wx/frame.h"
#include "wx/log.h"
#include "wx/menu.h"
#include "wx/frame.h"
#include "wx/log.h"
+ #include "wx/button.h"
#endif // WX_PRECOMP
#include "wx/univ/colschem.h"
#include "wx/univ/renderer.h"
#include "wx/univ/theme.h"
#endif // WX_PRECOMP
#include "wx/univ/colschem.h"
#include "wx/univ/renderer.h"
#include "wx/univ/theme.h"
+
#if wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
#if wxUSE_CARET
#include "wx/caret.h"
#endif // wxUSE_CARET
-// turn Refresh() debugging on/off
-#define WXDEBUG_REFRESH
-
-#ifndef __WXDEBUG__
- #undef WXDEBUG_REFRESH
+#if wxDEBUG_LEVEL >= 2
+ // turn Refresh() debugging on/off
+ #define WXDEBUG_REFRESH
#endif
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
#endif
#if defined(WXDEBUG_REFRESH) && defined(__WXMSW__) && !defined(__WXMICROWIN__)
@@
-92,6
+92,8
@@
public:
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMSW)
#elif defined(__WXGTK__)
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK)
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMSW)
#elif defined(__WXGTK__)
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK)
+#elif defined(__WXOSX_OR_COCOA__)
+ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMac)
#elif defined(__WXMGL__)
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL)
#elif defined(__WXDFB__)
#elif defined(__WXMGL__)
IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL)
#elif defined(__WXDFB__)
@@
-127,7
+129,7
@@
void wxWindow::Init()
{
#if wxUSE_SCROLLBAR
m_scrollbarVert =
{
#if wxUSE_SCROLLBAR
m_scrollbarVert =
- m_scrollbarHorz =
(wxScrollBar *)
NULL;
+ m_scrollbarHorz = NULL;
#endif // wxUSE_SCROLLBAR
m_isCurrent = false;
#endif // wxUSE_SCROLLBAR
m_isCurrent = false;
@@
-145,6
+147,11
@@
bool wxWindow::Create(wxWindow *parent,
long style,
const wxString& name)
{
long style,
const wxString& name)
{
+ // Get default border
+ wxBorder border = GetBorder(style);
+ style &= ~wxBORDER_MASK;
+ style |= border;
+
long actualStyle = style;
// we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW
long actualStyle = style;
// we add wxCLIP_CHILDREN to get the same ("natural") behaviour under MSW
@@
-217,7
+224,7
@@
bool wxWindow::Create(wxWindow *parent,
wxWindow::~wxWindow()
{
wxWindow::~wxWindow()
{
-
m_isBeingDeleted = true
;
+
SendDestroyEvent()
;
#if wxUSE_SCROLLBAR
// clear pointers to scrollbar before deleting the children: they are
#if wxUSE_SCROLLBAR
// clear pointers to scrollbar before deleting the children: they are
@@
-359,8
+366,13
@@
bool wxWindow::DoDrawBackground(wxDC& dc)
rect.height = size.y;
wxWindow * const parent = GetParent();
rect.height = size.y;
wxWindow * const parent = GetParent();
- if ( HasTransparentBackground() && parent )
+ if ( HasTransparentBackground() &&
!UseBgCol() &&
parent )
{
{
+ // DirectFB paints the parent first, then its child windows, so by
+ // the time this code is called, parent's background was already
+ // drawn and there's no point in (imperfectly!) duplicating the work
+ // here:
+#ifndef __WXDFB__
wxASSERT( !IsTopLevel() );
wxPoint pos = GetPosition();
wxASSERT( !IsTopLevel() );
wxPoint pos = GetPosition();
@@
-383,6
+395,7
@@
bool wxWindow::DoDrawBackground(wxDC& dc)
// Restore DC logical origin
dc.SetLogicalOrigin( org_x, org_y );
// Restore DC logical origin
dc.SetLogicalOrigin( org_x, org_y );
+#endif // !__WXDFB__
}
else
{
}
else
{
@@
-659,7
+672,7
@@
void wxWindow::OnSize(wxSizeEvent& event)
}
}
else
}
}
else
- if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER ))
+ if (HasFlag( wxSUNKEN_BORDER ) || HasFlag( wxRAISED_BORDER )
|| HasFlag( wxBORDER_THEME )
)
{
if (newSize.y > m_oldSize.y)
{
{
if (newSize.y > m_oldSize.y)
{
@@
-914,7
+927,7
@@
void wxWindow::SetScrollbar(int orient,
{
#if wxUSE_SCROLLBAR
wxASSERT_MSG( pageSize <= range,
{
#if wxUSE_SCROLLBAR
wxASSERT_MSG( pageSize <= range,
-
_
T("page size can't be greater than range") );
+
wx
T("page size can't be greater than range") );
bool hasClientSizeChanged = false;
wxScrollBar *scrollbar = GetScrollbar(orient);
bool hasClientSizeChanged = false;
wxScrollBar *scrollbar = GetScrollbar(orient);
@@
-1132,7
+1145,7
@@
void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect)
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
{
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
{
- wxASSERT_MSG( !dx || !dy,
_
T("can't be used for diag scrolling") );
+ wxASSERT_MSG( !dx || !dy,
wx
T("can't be used for diag scrolling") );
// the rect to refresh (which we will calculate)
wxRect rect;
// the rect to refresh (which we will calculate)
wxRect rect;
@@
-1147,7
+1160,7
@@
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
// location
wxSize sizeTotal = rectTotal ? rectTotal->GetSize() : GetClientSize();
// location
wxSize sizeTotal = rectTotal ? rectTotal->GetSize() : GetClientSize();
- wxLogTrace(
_T("scroll"), _
T("rect is %dx%d, scroll by %d, %d"),
+ wxLogTrace(
wxT("scroll"), wx
T("rect is %dx%d, scroll by %d, %d"),
sizeTotal.x, sizeTotal.y, dx, dy);
// the initial and end point of the region we move in client coords
sizeTotal.x, sizeTotal.y, dx, dy);
// the initial and end point of the region we move in client coords
@@
-1165,7
+1178,7
@@
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
if ( size.x <= 0 || size.y <= 0 )
{
// just redraw everything as nothing of the displayed image will stay
if ( size.x <= 0 || size.y <= 0 )
{
// just redraw everything as nothing of the displayed image will stay
- wxLogTrace(
_T("scroll"), _
T("refreshing everything"));
+ wxLogTrace(
wxT("scroll"), wx
T("refreshing everything"));
rect = rectTotal ? *rectTotal : wxRect(0, 0, sizeTotal.x, sizeTotal.y);
}
rect = rectTotal ? *rectTotal : wxRect(0, 0, sizeTotal.x, sizeTotal.y);
}
@@
-1217,8
+1230,8
@@
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
);
dc.Blit(ptDest, size, &dcMem, wxPoint(0,0));
);
dc.Blit(ptDest, size, &dcMem, wxPoint(0,0));
- wxLogTrace(
_
T("scroll"),
-
_
T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"),
+ wxLogTrace(
wx
T("scroll"),
+
wx
T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"),
ptSource.x, ptSource.y,
size.x, size.y,
ptDest.x, ptDest.y);
ptSource.x, ptSource.y,
size.x, size.y,
ptDest.x, ptDest.y);
@@
-1249,7
+1262,7
@@
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
rect.height = sizeTotal.y;
rect.height = sizeTotal.y;
- wxLogTrace(
_T("scroll"), _
T("refreshing (%d, %d)-(%d, %d)"),
+ wxLogTrace(
wxT("scroll"), wx
T("refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}
@@
-1270,7
+1283,7
@@
wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal)
rect.width = sizeTotal.x;
rect.width = sizeTotal.x;
- wxLogTrace(
_T("scroll"), _
T("refreshing (%d, %d)-(%d, %d)"),
+ wxLogTrace(
wxT("scroll"), wx
T("refreshing (%d, %d)-(%d, %d)"),
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}
rect.x, rect.y,
rect.GetRight() + 1, rect.GetBottom() + 1);
}