git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36097
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
+// Name: src/common/wxchar.cpp
// Purpose: wxChar implementation
// Author: Ove Kåven
// Modified by: Ron Lee
// Purpose: wxChar implementation
// Author: Ove Kåven
// Modified by: Ron Lee
-WXDLLEXPORT size_t wxWcstombs (char * out, const wchar_t * in, size_t outlen)
+WXDLLEXPORT size_t wxWcstombs (char * out, const wchar_t * in, size_t outlen)
wxString str(psz);
if (str.ToDouble(& d))
return d;
wxString str(psz);
if (str.ToDouble(& d))
return d;
#else
return atof(wxConvLibc.cWX2MB(psz));
#endif
#else
return atof(wxConvLibc.cWX2MB(psz));
#endif
static int maxWidth = -1;
int fit = 0;
SIZE sz = {0,0};
static int maxWidth = -1;
int fit = 0;
SIZE sz = {0,0};
- int stlen = text.Length();
+ int stlen = text.length();
wxLogLastError(_T("AlphaBlend"));
}
wxLogLastError(_T("AlphaBlend"));
}
+#else
+ wxUnusedVar(hdcSrc);
#endif // defined(AC_SRC_OVER)
// AlphaBlend() unavailable of failed: use our own (probably much slower)
#endif // defined(AC_SRC_OVER)
// AlphaBlend() unavailable of failed: use our own (probably much slower)
str == wxMDIChildFrameClassNameNoRedraw ||
str == _T("wxTLWHiddenParent"))
return true; // Effectively means don't subclass
str == wxMDIChildFrameClassNameNoRedraw ||
str == _T("wxTLWHiddenParent"))
return true; // Effectively means don't subclass
#else
WNDCLASS cls;
if ( !::GetClassInfo(wxGetInstance(), wxGetWindowClass(hWnd), &cls) )
#else
WNDCLASS cls;
if ( !::GetClassInfo(wxGetInstance(), wxGetWindowClass(hWnd), &cls) )
{
wxBufferedPaintDC dc(this, m_bufferBitmap);
//wxLogDebug(wxT("OnPaint"));
{
wxBufferedPaintDC dc(this, m_bufferBitmap);
//wxLogDebug(wxT("OnPaint"));
if (m_freezeCount > 0)
return;
if (m_freezeCount > 0)
return;
// Paint the background
PaintBackground(dc);
// Paint the background
PaintBackground(dc);
wxRegion dirtyRegion = GetUpdateRegion();
wxRegion dirtyRegion = GetUpdateRegion();
wxRect drawingArea(GetLogicalPoint(wxPoint(0, 0)), GetClientSize());
wxRect availableSpace(GetClientSize());
if (GetBuffer().GetDirty())
wxRect drawingArea(GetLogicalPoint(wxPoint(0, 0)), GetClientSize());
wxRect availableSpace(GetClientSize());
if (GetBuffer().GetDirty())
GetBuffer().SetDirty(false);
SetupScrollbars();
}
GetBuffer().SetDirty(false);
SetupScrollbars();
}
GetBuffer().Draw(dc, GetBuffer().GetRange(), GetSelectionRange(), drawingArea, 0 /* descent */, 0 /* flags */);
}
GetBuffer().Draw(dc, GetBuffer().GetRange(), GetSelectionRange(), drawingArea, 0 /* descent */, 0 /* flags */);
}
Refresh(false);
return true;
}
Refresh(false);
return true;
}
}
/// Move to the end of the paragraph
}
/// Move to the end of the paragraph
((wxRichTextCtrl*)this)->PrepareDC(dc);
int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt, *pos);
((wxRichTextCtrl*)this)->PrepareDC(dc);
int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt, *pos);
- if (hit == wxRICHTEXT_HITTEST_BEFORE)
- return wxTE_HT_BEFORE;
- else if (hit == wxRICHTEXT_HITTEST_AFTER)
- return wxTE_HT_BEYOND;
- else if (hit == wxRICHTEXT_HITTEST_ON)
- return wxTE_HT_ON_TEXT;
- else
- return wxTE_HT_UNKNOWN;
+
+ switch ( hit )
+ {
+ case wxRICHTEXT_HITTEST_BEFORE:
+ return wxTE_HT_BEFORE;
+
+ case wxRICHTEXT_HITTEST_AFTER:
+ return wxTE_HT_BEYOND;
+
+ case wxRICHTEXT_HITTEST_ON:
+ return wxTE_HT_ON_TEXT;
+ }
+
+ return wxTE_HT_UNKNOWN;
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------
wxImage image2 = image;
if (imageBlock.MakeImageBlock(image2, bitmapType))
return WriteImage(imageBlock);
wxImage image2 = image;
if (imageBlock.MakeImageBlock(image2, bitmapType))
return WriteImage(imageBlock);
}
bool wxRichTextCtrl::WriteImage(const wxString& filename, int bitmapType)
}
bool wxRichTextCtrl::WriteImage(const wxString& filename, int bitmapType)
wxImage image;
if (imageBlock.MakeImageBlock(filename, bitmapType, image, false))
return WriteImage(imageBlock);
wxImage image;
if (imageBlock.MakeImageBlock(filename, bitmapType, image, false))
return WriteImage(imageBlock);
}
bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock)
}
bool wxRichTextCtrl::WriteImage(const wxRichTextImageBlock& imageBlock)
wxImage image = bitmap.ConvertToImage();
if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType))
return WriteImage(imageBlock);
wxImage image = bitmap.ConvertToImage();
if (image.Ok() && imageBlock.MakeImageBlock(image, bitmapType))
return WriteImage(imageBlock);
rect = wxRect(pt, wxSize(wxRICHTEXT_DEFAULT_CARET_WIDTH, height));
return true;
}
rect = wxRect(pt, wxSize(wxRICHTEXT_DEFAULT_CARET_WIDTH, height));
return true;
}
}
/// Gets the line for the visible caret position. If the caret is
}
/// Gets the line for the visible caret position. If the caret is
flags |= wxRICHTEXT_LAYOUT_SPECIFIED_RECT;
availableSpace.SetPosition(GetLogicalPoint(wxPoint(0, 0)));
}
flags |= wxRICHTEXT_LAYOUT_SPECIFIED_RECT;
availableSpace.SetPosition(GetLogicalPoint(wxPoint(0, 0)));
}
wxClientDC dc(this);
dc.SetFont(GetFont());
wxClientDC dc(this);
dc.SetFont(GetFont());
GetBuffer().Defragment();
GetBuffer().UpdateRanges(); // If items were deleted, ranges need recalculation
GetBuffer().Layout(dc, availableSpace, flags);
GetBuffer().SetDirty(false);
GetBuffer().Defragment();
GetBuffer().UpdateRanges(); // If items were deleted, ranges need recalculation
GetBuffer().Layout(dc, availableSpace, flags);
GetBuffer().SetDirty(false);
if (!IsFrozen())
SetupScrollbars();
}
if (!IsFrozen())
SetupScrollbars();
}
SetDefaultStyle(attr);
return true;
}
SetDefaultStyle(attr);
return true;
}
}
/// Returns the first visible position in the current view
}
/// Returns the first visible position in the current view