1. fixes for DrawRotatedText(), drawing sample extended to show it
2. implemented colour/font support for wxTreeCtrl items 3. corrected a bug in wxListCtrl colour/font support code, the items should now be deleted ok 4. SetProcessAffinityMask() correction, wxThread::SetConcurrency() kind of works (difficult to test on a UP machine) 5. wxMimeType::EnumAllFileTypes() added, works (somewhat) under MSW 6. made default fonts under MSW 10 points and not 12 - this is the standard size git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4849 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -666,7 +666,7 @@ void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
|
||||
: OPAQUE);
|
||||
|
||||
if ( ::TextOut(GetHdc(), XLOG2DEV(x), YLOG2DEV(y),
|
||||
text.c_str(), text.length()) != 0 )
|
||||
text.c_str(), text.length()) == 0 )
|
||||
{
|
||||
wxLogLastError("TextOut");
|
||||
}
|
||||
@@ -684,28 +684,39 @@ void wxDC::DoDrawRotatedText(const wxString& text,
|
||||
wxCoord x, wxCoord y,
|
||||
double angle)
|
||||
{
|
||||
if ( angle == 0.0 )
|
||||
// we test that we have some font because otherwise we should still use the
|
||||
// "else" part below to avoid that DrawRotatedText(angle = 180) and
|
||||
// DrawRotatedText(angle = 0) use different fonts (we can't use the default
|
||||
// font for drawing rotated fonts unfortunately)
|
||||
if ( (angle == 0.0) && m_font.Ok() )
|
||||
{
|
||||
DoDrawText(text, x, y);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NB: don't take DEFAULT_GUI_FONT because it's not TrueType and so
|
||||
// can't have non zero orientation/escapement
|
||||
wxFont font = m_font.Ok() ? m_font : *wxNORMAL_FONT;
|
||||
HFONT hfont = (HFONT)font.GetResourceHandle();
|
||||
LOGFONT lf;
|
||||
wxFillLogFont(&lf, &m_font);
|
||||
if ( ::GetObject(hfont, sizeof(lf), &lf) == 0 )
|
||||
{
|
||||
wxLogLastError("GetObject(hfont)");
|
||||
}
|
||||
|
||||
// GDI wants the angle in tenth of degree
|
||||
long angle10 = (long)(angle * 10);
|
||||
lf.lfEscapement = angle10;
|
||||
lf. lfOrientation = angle10;
|
||||
|
||||
HFONT hfont = ::CreateFontIndirect(&lf);
|
||||
hfont = ::CreateFontIndirect(&lf);
|
||||
if ( !hfont )
|
||||
{
|
||||
wxLogLastError("CreateFont");
|
||||
}
|
||||
else
|
||||
{
|
||||
HFONT hfontOld = ::SelectObject(GetHdc(), hfont);
|
||||
HFONT hfontOld = (HFONT)::SelectObject(GetHdc(), hfont);
|
||||
|
||||
DrawAnyText(text, x, y);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user