1. modified wxMSW::wxCaret to use client coords
2. fixed uninit m_curXXX vars leading to a crash in wxMSW 3. fixed wxWindow::DoDrawBackground() for empty update region git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/wxUNIVERSAL@8406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -158,7 +158,10 @@ void wxCaret::DoMove()
|
||||
wxASSERT_MSG( wxWindow::FindFocus() == GetWindow(),
|
||||
wxT("how did we lose focus?") );
|
||||
|
||||
CALL_CARET_API(SetCaretPos, (m_x, m_y));
|
||||
// for compatibility with the generic version, the coordinates are
|
||||
// client ones
|
||||
wxPoint pt = GetWindow()->GetClientAreaOrigin();
|
||||
CALL_CARET_API(SetCaretPos, (m_x + pt.x, m_y + pt.y));
|
||||
}
|
||||
//else: we don't have caret right now, nothing to do (this does happen)
|
||||
}
|
||||
|
@@ -71,6 +71,10 @@ void wxTextCtrl::Init()
|
||||
m_isEditable = TRUE;
|
||||
|
||||
m_ofsHorz = 0;
|
||||
|
||||
m_curPos =
|
||||
m_curRow =
|
||||
m_curLine = 0;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::Create(wxWindow *parent,
|
||||
@@ -90,7 +94,9 @@ bool wxTextCtrl::Create(wxWindow *parent,
|
||||
|
||||
// FIXME use renderer
|
||||
wxCaret *caret = new wxCaret(this, 1, GetCharHeight());
|
||||
#ifndef __WXMSW__
|
||||
caret->SetBlinkTime(0);
|
||||
#endif // __WXMSW__
|
||||
SetCaret(caret);
|
||||
|
||||
SetCursor(wxCURSOR_IBEAM);
|
||||
|
@@ -17,7 +17,7 @@
|
||||
// headers
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// For compilers that support precompilation, includes "wx.h".
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
@@ -40,8 +40,11 @@
|
||||
#include "wx/univ/colschem.h"
|
||||
#include "wx/univ/theme.h"
|
||||
|
||||
// define this for tons of debugging messages
|
||||
#undef DEBUG_MOUSE
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants (to be removed)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static const wxCoord BORDER_THICKNESS = 10;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxGTKRenderer: draw the GUI elements in GTK style
|
||||
@@ -676,12 +679,14 @@ void wxGTKRenderer::DrawBorder(wxDC& dc,
|
||||
int WXUNUSED(flags),
|
||||
wxRect *rectIn)
|
||||
{
|
||||
size_t width;
|
||||
|
||||
wxRect rect = rectTotal;
|
||||
|
||||
switch ( border )
|
||||
{
|
||||
case wxBORDER_SUNKEN:
|
||||
for ( int width = 0; width < 10; width++ )
|
||||
for ( width = 0; width < BORDER_THICKNESS; width++ )
|
||||
{
|
||||
DrawAntiShadedRect(dc, &rect, m_penDarkGrey, m_penHighlight);
|
||||
DrawShadedRect(dc, &rect, m_penBlack, m_penLightGrey);
|
||||
@@ -693,8 +698,10 @@ void wxGTKRenderer::DrawBorder(wxDC& dc,
|
||||
break;
|
||||
|
||||
case wxBORDER_RAISED:
|
||||
for ( int width = 0; width < 10; width++ )
|
||||
for ( width = 0; width < BORDER_THICKNESS; width++ )
|
||||
{
|
||||
DrawRaisedBorder(dc, &rect);
|
||||
}
|
||||
break;
|
||||
|
||||
case wxBORDER_DOUBLE:
|
||||
|
@@ -170,10 +170,10 @@ public:
|
||||
|
||||
virtual wxRect GetTextTotalArea(const wxTextCtrl *text,
|
||||
const wxRect& rect)
|
||||
{ return rect; }
|
||||
{ wxRect rectTotal = rect; rectTotal.Inflate(1); return rectTotal; }
|
||||
virtual wxRect GetTextClientArea(const wxTextCtrl *text,
|
||||
const wxRect& rect)
|
||||
{ return rect; }
|
||||
{ wxRect rectText = rect; rectText.Inflate(-1); return rectText; }
|
||||
|
||||
protected:
|
||||
// common part of DrawLabel() and DrawItem()
|
||||
|
@@ -205,6 +205,13 @@ void wxWindow::OnPaint(wxPaintEvent& event)
|
||||
bool wxWindow::DoDrawBackground(wxDC& dc)
|
||||
{
|
||||
wxRect rect = GetUpdateRegion().GetBox();
|
||||
if ( !rect.width && !rect.height )
|
||||
{
|
||||
wxSize size = GetSize();
|
||||
rect.width = size.x;
|
||||
rect.height = size.y;
|
||||
}
|
||||
|
||||
if ( GetBackgroundBitmap().Ok() )
|
||||
{
|
||||
// get the bitmap and the flags
|
||||
|
Reference in New Issue
Block a user