X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0bb22c23120f1e96caa8304f62b7d772ad803d6..c0a83c519b566f9a306990cfc8275e512352628f:/samples/richedit/wxllist.cpp diff --git a/samples/richedit/wxllist.cpp b/samples/richedit/wxllist.cpp index a674ae577d..e215fed80f 100644 --- a/samples/richedit/wxllist.cpp +++ b/samples/richedit/wxllist.cpp @@ -25,7 +25,7 @@ # pragma implementation "wxllist.h" #endif -#include +#include "wx/wxprec.h" #ifdef __BORLANDC__ # pragma hdrstop @@ -45,7 +45,11 @@ #endif #ifndef USE_PCH -# include +#if wxUSE_IOSTREAMH + #include +#else + #include +#endif # include # include @@ -69,15 +73,15 @@ # define TypeString(t) g_aTypeStrings[t] # define WXLO_DEBUG(x) wxLogDebug x - static const char *g_aTypeStrings[] = + static const wxChar *g_aTypeStrings[] = { - "invalid", "text", "cmd", "icon" + _T("invalid"), _T("text"), _T("cmd"), _T("icon") }; wxString wxLayoutObject::DebugDump(void) const { wxString str; - str.Printf("%s",g_aTypeStrings[GetType()]); + str.Printf(wxT("%s"), g_aTypeStrings[GetType()]); return str; } #else @@ -172,12 +176,17 @@ bool Contains(const wxRect &r, const wxPoint &p) static void ReadString(wxString &to, wxString &from) { - to = ""; - const char *cptr = from.c_str(); - while(*cptr && *cptr != '\n') - to += *cptr++; - if(*cptr) cptr++; - from = cptr; + to = wxT(""); + const wxChar *cptr = from.c_str(); + while(*cptr && *cptr != wxT('\n')) + { + to += cptr; + cptr++; + } + + if(*cptr) cptr++; + + from = cptr; } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -190,22 +199,23 @@ void ReadString(wxString &to, wxString &from) wxLayoutObject * wxLayoutObject::Read(wxString &istr) { - wxString tmp; - ReadString(tmp, istr); - int type = WXLO_TYPE_INVALID; - sscanf(tmp.c_str(),"%d", &type); - - switch(type) - { - case WXLO_TYPE_TEXT: - return wxLayoutObjectText::Read(istr); - case WXLO_TYPE_CMD: - return wxLayoutObjectCmd::Read(istr); - case WXLO_TYPE_ICON: - return wxLayoutObjectIcon::Read(istr); - default: - return NULL; - } + wxString tmp; + ReadString(tmp, istr); + long l = WXLO_TYPE_INVALID; + tmp.ToLong(&l); + int type = (int) l; + + switch(type) + { + case WXLO_TYPE_TEXT: + return wxLayoutObjectText::Read(istr); + case WXLO_TYPE_CMD: + return wxLayoutObjectCmd::Read(istr); + case WXLO_TYPE_ICON: + return wxLayoutObjectIcon::Read(istr); + default: + return NULL; + } } /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -323,7 +333,7 @@ wxLayoutObjectText::GetOffsetScreen(wxDC &dc, CoordType xpos) const } void -wxLayoutObjectText::Layout(wxDC &dc, class wxLayoutList *llist) +wxLayoutObjectText::Layout(wxDC &dc, class wxLayoutList *WXUNUSED(llist)) { long descent = 0l; @@ -336,12 +346,12 @@ wxLayoutObjectText::Layout(wxDC &dc, class wxLayoutList *llist) #ifdef __WXDEBUG__ CoordType a,b,c,d,e,f; - dc.GetTextExtent("test ", &a, &b, &c); - dc.GetTextExtent("test", &d, &e, &f); + dc.GetTextExtent(_T("test "), &a, &b, &c); + dc.GetTextExtent(_T("test"), &d, &e, &f); wxASSERT(a != d); wxASSERT(b == e); wxASSERT(c == f); - dc.GetTextExtent(" ", &d, &e, &f); + dc.GetTextExtent(_T(" "), &d, &e, &f); wxASSERT(a > 0); #endif dc.GetTextExtent(m_Text, &m_Width, &m_Height, &descent); @@ -381,7 +391,7 @@ wxLayoutObjectText::DebugDump(void) const wxString str; str = wxLayoutObject::DebugDump(); wxString str2; - str2.Printf(" `%s`", m_Text.c_str()); + str2.Printf(wxT(" `%s`"), m_Text.c_str()); return str+str2; } #endif @@ -396,7 +406,7 @@ wxLayoutObjectIcon::wxLayoutObjectIcon(wxBitmap const &icon) { if ( !icon.Ok() ) { - wxFAIL_MSG("invalid icon"); + wxFAIL_MSG(wxT("invalid icon")); m_Icon = NULL; @@ -418,7 +428,7 @@ wxLayoutObjectIcon::Write(wxString &ostr) { /* Exports icon through a temporary file. */ - wxString file = wxGetTempFileName("wxloexport"); + wxString file = wxGetTempFileName(_T("wxloexport")); ostr << (int) WXLO_TYPE_ICON << '\n' << file << '\n'; @@ -462,8 +472,8 @@ wxLayoutObjectIcon::wxLayoutObjectIcon(wxBitmap *icon) void wxLayoutObjectIcon::Draw(wxDC &dc, wxPoint const &coords, - wxLayoutList *wxllist, - CoordType begin, CoordType /* len */) + wxLayoutList *WXUNUSED(wxllist), + CoordType WXUNUSED(begin), CoordType WXUNUSED(len) ) { dc.DrawBitmap(*m_Icon, coords.x, coords.y-m_Icon->GetHeight(), (m_Icon->GetMask() == NULL) ? FALSE : TRUE); @@ -586,46 +596,76 @@ wxLayoutObjectCmd::Write(wxString &ostr) wxLayoutObjectCmd * wxLayoutObjectCmd::Read(wxString &istr) { - wxLayoutObjectCmd *obj = new wxLayoutObjectCmd; - - wxString tmp; - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->family); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->size); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->style); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->weight); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->underline); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->m_fg_valid); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &obj->m_StyleInfo->m_bg_valid); - if(obj->m_StyleInfo->m_fg_valid) - { - int red, green, blue; - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &red); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &green); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &blue); - obj->m_StyleInfo->m_fg = wxColour(red, green, blue); - } - if(obj->m_StyleInfo->m_bg_valid) - { - int red, green, blue; - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &red); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &green); - ReadString(tmp, istr); - sscanf(tmp.c_str(),"%d", &blue); - obj->m_StyleInfo->m_bg = wxColour(red, green, blue); - } - return obj; + wxLayoutObjectCmd *obj = new wxLayoutObjectCmd; + + long l = 0; + wxString tmp; + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->family = (int) l; + + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->size = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->style = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->weight = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->underline = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->m_fg_valid = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + obj->m_StyleInfo->m_bg_valid = (int) l; + + if(obj->m_StyleInfo->m_fg_valid) + { + int red, green, blue; + ReadString(tmp, istr); + tmp.ToLong(&l); + red = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + green = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + blue = (int) l; + + obj->m_StyleInfo->m_fg = wxColour(red, green, blue); + } + + if(obj->m_StyleInfo->m_bg_valid) + { + int red, green, blue; + ReadString(tmp, istr); + tmp.ToLong(&l); + red = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + green = (int) l; + + ReadString(tmp, istr); + tmp.ToLong(&l); + blue = (int) l; + + obj->m_StyleInfo->m_bg = wxColour(red, green, blue); + } + + return obj; } @@ -641,9 +681,9 @@ wxLayoutObjectCmd::GetStyle(void) const } void -wxLayoutObjectCmd::Draw(wxDC &dc, wxPoint const & /* coords */, +wxLayoutObjectCmd::Draw(wxDC &dc, wxPoint const & WXUNUSED(coords), wxLayoutList *wxllist, - CoordType begin, CoordType /* len */) + CoordType WXUNUSED(begin), CoordType WXUNUSED(len)) { wxASSERT(m_StyleInfo); wxllist->ApplyStyle(*m_StyleInfo, dc); @@ -977,49 +1017,53 @@ wxLayoutLine::Delete(CoordType xpos, CoordType npos) bool wxLayoutLine::DeleteWord(CoordType xpos) { - wxASSERT(xpos >= 0); - CoordType offset; - MarkDirty(xpos); - - wxLOiterator i = FindObject(xpos, &offset); - - for(;;) - { - if(i == NULLIT) return false; - if((**i).GetType() != WXLO_TYPE_TEXT) - { - // This should only happen when at end of line, behind a non-text - // object: - if(offset == (**i).GetLength()) return false; - m_Length -= (**i).GetLength(); // -1 - m_ObjectList.erase(i); - return true; // we are done - } - else - { // text object: - if(offset == (**i).GetLength()) // at end of object - { - i++; offset = 0; - continue; - } - wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i; - size_t count = 0; - wxString str = tobj->GetText(); - str = str.substr(offset,str.Length()-offset); - // Find out how many positions we need to delete: - // 1. eat leading space - while(isspace(str.c_str()[count])) count++; - // 2. eat the word itself: - while(isalnum(str.c_str()[count])) count++; - // now delete it: - wxASSERT(count+offset <= (size_t) (**i).GetLength()); - ((wxLayoutObjectText *)*i)->GetText().erase(offset,count); - m_Length -= count; - return true; - } - } + wxASSERT(xpos >= 0); + CoordType offset; + MarkDirty(xpos); + + wxLOiterator i = FindObject(xpos, &offset); + + for(;;) + { + if(i == NULLIT) return false; + if((**i).GetType() != WXLO_TYPE_TEXT) + { + // This should only happen when at end of line, behind a non-text + // object: + if(offset == (**i).GetLength()) return false; + m_Length -= (**i).GetLength(); // -1 + m_ObjectList.erase(i); + return true; // we are done + } + else + { // text object: + if(offset == (**i).GetLength()) // at end of object + { + i++; offset = 0; + continue; + } - wxFAIL_MSG("unreachable"); + wxLayoutObjectText *tobj = (wxLayoutObjectText *)*i; + size_t count = 0; + wxString str = tobj->GetText(); + str = str.substr(offset,str.Length()-offset); + // Find out how many positions we need to delete: + // 1. eat leading space + while(isspace(str.c_str()[count])) count++; + // 2. eat the word itself: + while(isalnum(str.c_str()[count])) count++; + // now delete it: + wxASSERT(count+offset <= (size_t) (**i).GetLength()); + ((wxLayoutObjectText *)*i)->GetText().erase(offset,count); + m_Length -= count; + + return true; + } + } + + #if 0 + wxFAIL_MSG(wxT("unreachable")); + #endif } wxLayoutLine * @@ -1060,7 +1104,7 @@ wxLayoutLine::Draw(wxDC &dc, CoordType xpos = 0; // cursorpos, lenght of line - CoordType from, to, tempto; + CoordType from, to; int highlight = llist->IsSelected(this, &from, &to); // WXLO_DEBUG(("highlight=%d", highlight )); @@ -1074,7 +1118,7 @@ wxLayoutLine::Draw(wxDC &dc, if(highlight == -1) // partially highlight line { // parts of the line need highlighting - tempto = xpos+(**i).GetLength(); + xpos+(**i).GetLength(); (**i).Draw(dc, pos, llist, from-xpos, to-xpos); } else @@ -1096,7 +1140,7 @@ wxLayoutLine::Layout(wxDC &dc, wxPoint *cursorSize, wxLayoutStyleInfo *cursorStyle, int cx, - bool suppressSIupdate) + bool WXUNUSED(suppressSIupdate)) { wxLayoutObjectList::iterator i; @@ -1157,7 +1201,7 @@ wxLayoutLine::Layout(wxDC &dc, if(len < obj->GetLength()) str = (*(wxLayoutObjectText*)*i).GetText().substr(len,1); else - str = WXLO_CURSORCHAR; + str = _T(WXLO_CURSORCHAR); dc.GetTextExtent(str, &width, &height, &descent); if(cursorStyle) // set style info @@ -1230,7 +1274,7 @@ wxLayoutLine::Layout(wxDC &dc, if(m_Height == 0) { CoordType width, height, descent; - dc.GetTextExtent(WXLO_CURSORCHAR, &width, &height, &descent); + dc.GetTextExtent(_T(WXLO_CURSORCHAR), &width, &height, &descent); m_Height = height; m_BaseLine = m_Height - descent; } @@ -1249,7 +1293,7 @@ wxLayoutLine::Layout(wxDC &dc, if(cursorSize->x < WXLO_MINIMUM_CURSOR_WIDTH) { CoordType width, height, descent; - dc.GetTextExtent(WXLO_CURSORCHAR, &width, &height, &descent); + dc.GetTextExtent(_T(WXLO_CURSORCHAR), &width, &height, &descent); cursorSize->x = width; cursorSize->y = height; } @@ -1318,14 +1362,15 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist) // find the object which covers the wrapmargin: CoordType offset; wxLOiterator i = FindObject(wrapmargin, &offset); - wxCHECK_MSG( i != NULLIT, FALSE, "Cannot find object covering wrapmargin."); + wxCHECK_MSG( i != NULLIT, FALSE, + wxT("Cannot find object covering wrapmargin.")); // from this object on, the rest of the line must be copied to the // next one: wxLOiterator copyObject = NULLIT; // if we split a text-object, we must pre-pend some text to the // next line later on, remember it here: - wxString prependText = ""; + wxString prependText = _T(""); // we might need to adjust the cursor position later, so remember it size_t xpos = llist->GetCursorPos().x; // by how much did we shorten the current line: @@ -1427,7 +1472,10 @@ wxLayoutLine::Wrap(CoordType wrapmargin, wxLayoutList *llist) { xpos = objectCursorPos + (xpos - objectCursorPos - breakpos - ((xpos > breakpos) ? 1 : 0 )); + #if 0 + // this assert is useless when xpos has unsigned type wxASSERT(xpos >= 0); + #endif llist->MoveCursorTo( wxPoint( xpos, m_Next->GetLineNumber()) ); } return TRUE; // we wrapped the line @@ -1447,7 +1495,8 @@ wxLayoutLine::ReNumber(void) void wxLayoutLine::MergeNextLine(wxLayoutList *llist) { - wxCHECK_RET(GetNextLine(),"wxLayout internal error: no next line to merge"); + wxCHECK_RET( GetNextLine(), + wxT("wxLayout internal error: no next line to merge")); wxLayoutObjectList &list = GetNextLine()->m_ObjectList; wxLOiterator i; @@ -1565,7 +1614,7 @@ void wxLayoutLine::Debug(void) const { wxPoint pos = GetPosition(); - WXLO_DEBUG(("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d", + WXLO_DEBUG((wxT("Line %ld, Pos (%ld,%ld), Height %ld, BL %ld, Font: %d"), (long int) GetLineNumber(), (long int) pos.x, (long int) pos.y, (long int) GetHeight(), @@ -1671,7 +1720,7 @@ wxLayoutList::~wxLayoutList() Empty(); m_FirstLine->DeleteLine(false, this); - wxASSERT_MSG( m_numLines == 0, "line count calculation broken" ); + wxASSERT_MSG( m_numLines == 0, wxT("line count calculation broken")); } void @@ -1724,8 +1773,10 @@ wxLayoutList::Read(wxString &istr) // check for a linebreak: wxString tmp; tmp = istr.BeforeFirst('\n'); - int type = WXLO_TYPE_INVALID; - sscanf(tmp.c_str(),"%d", &type); + long l = WXLO_TYPE_INVALID; + tmp.ToLong(&l); + int type = (int) l; + if(type == WXLO_TYPE_LINEBREAK) { LineBreak(); @@ -1767,7 +1818,7 @@ wxLayoutList::SetFont(int family, int size, int style, int weight, void wxLayoutList::SetFont(int family, int size, int style, int weight, - int underline, char const *fg, char const *bg) + int underline, wxChar const *fg, wxChar const *bg) { wxColour @@ -1958,8 +2009,8 @@ wxLayoutList::MoveCursorHorizontally(int n) bool wxLayoutList::MoveCursorWord(int n, bool untilNext) { - wxCHECK_MSG( m_CursorLine, false, "no current line" ); - wxCHECK_MSG( n == -1 || n == +1, false, "not implemented yet" ); + wxCHECK_MSG( m_CursorLine, false, wxT("no current line") ); + wxCHECK_MSG( n == -1 || n == +1, false, wxT("not implemented yet") ); CoordType moveDistance = 0; CoordType offset; @@ -2048,9 +2099,9 @@ wxLayoutList::MoveCursorWord(int n, bool untilNext) if ( canAdvance ) { const wxString& text = tobj->GetText(); - const char *start = text.c_str(); - const char *end = start + text.length(); - const char *p = start + offset; + const wxChar *start = text.c_str(); + const wxChar *end = start + text.length(); + const wxChar *p = start + offset; if ( n < 0 ) { @@ -2119,7 +2170,8 @@ bool wxLayoutList::Insert(wxString const &text) { wxASSERT(m_CursorLine); - wxASSERT_MSG( text.Find('\n') == wxNOT_FOUND, "use wxLayoutImportText!" ); + wxASSERT_MSG( text.Find(wxT('\n')) == wxNOT_FOUND, + wxT("use wxLayoutImportText!") ); if ( !text ) return true; @@ -2241,7 +2293,7 @@ wxLayoutList::WrapAll(CoordType column) bool wxLayoutList::Delete(CoordType npos) { - wxCHECK_MSG(m_CursorLine, false, "can't delete in non existing line"); + wxCHECK_MSG(m_CursorLine, false, wxT("can't delete in non existing line")); if ( npos == 0 ) return true; @@ -2296,7 +2348,7 @@ wxLayoutList::Delete(CoordType npos) } else { - wxFAIL_MSG("can't delete all this"); + wxFAIL_MSG(wxT("can't delete all this")); return false; } @@ -2533,8 +2585,8 @@ wxLayoutList::Draw(wxDC &dc, } InvalidateUpdateRect(); - WXLO_DEBUG(("Selection is %s : %ld,%ld/%ld,%ld", - m_Selection.m_valid ? "valid" : "invalid", + WXLO_DEBUG((wxT("Selection is %s : %ld,%ld/%ld,%ld"), + m_Selection.m_valid ? wxT("valid") : wxT("invalid"), m_Selection.m_CursorA.x, m_Selection.m_CursorA.y, m_Selection.m_CursorB.x, m_Selection.m_CursorB.y)); } @@ -2637,7 +2689,19 @@ wxLayoutList::GetSize(void) const void -wxLayoutList::DrawCursor(wxDC &dc, bool active, wxPoint const &translate) +wxLayoutList::DrawCursor(wxDC & + #ifdef WXLAYOUT_USE_CARET + WXUNUSED(dc) + #else + dc + #endif + , bool + #ifdef WXLAYOUT_USE_CARET + WXUNUSED(active) + #else + active + #endif + , wxPoint const &translate) { if ( m_movedCursor ) m_movedCursor = false; @@ -2646,14 +2710,14 @@ wxLayoutList::DrawCursor(wxDC &dc, bool active, wxPoint const &translate) coords += translate; #ifdef WXLAYOUT_DEBUG - WXLO_DEBUG(("Drawing cursor (%ld,%ld) at %ld,%ld, size %ld,%ld, line: %ld, len %ld", + WXLO_DEBUG((wxT("Drawing cursor (%ld,%ld) at %ld,%ld, size %ld,%ld, line: %ld, len %ld"), (long)m_CursorPos.x, (long)m_CursorPos.y, (long)coords.x, (long)coords.y, (long)m_CursorSize.x, (long)m_CursorSize.y, (long)m_CursorLine->GetLineNumber(), (long)m_CursorLine->GetLength())); - wxLogStatus("Cursor is at (%d, %d)", m_CursorPos.x, m_CursorPos.y); + wxLogStatus(wxT("Cursor is at (%d, %d)"), m_CursorPos.x, m_CursorPos.y); #endif #ifdef WXLAYOUT_USE_CARET @@ -2707,7 +2771,7 @@ wxLayoutList::StartSelection(const wxPoint& cposOrig, const wxPoint& spos) wxPoint cpos(cposOrig); if ( cpos.x == -1 ) cpos = m_CursorPos; - WXLO_DEBUG(("Starting selection at %ld/%ld", cpos.x, cpos.y)); + WXLO_DEBUG((wxT("Starting selection at %ld/%ld"), cpos.x, cpos.y)); m_Selection.m_CursorA = cpos; m_Selection.m_CursorB = cpos; m_Selection.m_ScreenA = spos; @@ -2725,7 +2789,7 @@ wxLayoutList::ContinueSelection(const wxPoint& cposOrig, const wxPoint& spos) wxASSERT(m_Selection.m_selecting == true); wxASSERT(m_Selection.m_valid == false); - WXLO_DEBUG(("Continuing selection at %ld/%ld", cpos.x, cpos.y)); + WXLO_DEBUG((wxT("Continuing selection at %ld/%ld"), cpos.x, cpos.y)); m_Selection.m_ScreenB = spos; m_Selection.m_CursorB = cpos; @@ -2737,7 +2801,7 @@ wxLayoutList::EndSelection(const wxPoint& cposOrig, const wxPoint& spos) wxPoint cpos(cposOrig); if(cpos.x == -1) cpos = m_CursorPos; ContinueSelection(cpos, spos); - WXLO_DEBUG(("Ending selection at %ld/%ld", cpos.x, cpos.y)); + WXLO_DEBUG((wxT("Ending selection at %ld/%ld"), cpos.x, cpos.y)); // we always want m_CursorA <= m_CursorB! if( m_Selection.m_CursorA > m_Selection.m_CursorB ) { @@ -2926,7 +2990,7 @@ wxLayoutLine * wxLayoutList::GetLine(CoordType index) const { wxASSERT_MSG( (0 <= index) && (index < (CoordType)m_numLines), - "invalid index" ); + wxT("invalid index") ); wxLayoutLine *line; CoordType n = index; @@ -3078,7 +3142,7 @@ wxLayoutList::ApplyStyle(wxLayoutStyleInfo const &si, wxDC &dc) void wxLayoutList::Debug(void) { - WXLO_DEBUG(("Cursor is in line %d, screen pos = (%d, %d)", + WXLO_DEBUG((wxT("Cursor is in line %d, screen pos = (%d, %d)"), m_CursorLine->GetLineNumber(), m_CursorScreenPos.x, m_CursorScreenPos.y)); @@ -3178,7 +3242,7 @@ bool wxLayoutPrintout::OnPrintPage(int page) top = (page - 1)*m_PrintoutHeight; bottom = top + m_PrintoutHeight; - WXLO_DEBUG(("OnPrintPage(%d) printing from %d to %d", page, top, + WXLO_DEBUG((wxT("OnPrintPage(%d) printing from %d to %d"), page, top, bottom)); // SetDeviceOrigin() doesn't work here, so we need to manually // translate all coordinates. @@ -3197,7 +3261,7 @@ void wxLayoutPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, determine the correct paper size and scaling. We don't actually print anything on it. */ #if defined(__WXMSW__) - wxPrinterDC *psdc = new wxPrinterDC("","",WXLLIST_TEMPFILE,false); + wxPrinterDC *psdc = new wxPrinterDC(wxEmptyString,wxEmptyString,_T(WXLLIST_TEMPFILE),false); #else wxPostScriptDC *psdc = new wxPostScriptDC(WXLLIST_TEMPFILE,false); #endif @@ -3228,7 +3292,7 @@ void wxLayoutPrintout::GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, *selPageTo = m_NumOfPages; psdc->EndDoc(); delete psdc; - wxRemoveFile(WXLLIST_TEMPFILE); + wxRemoveFile(_T(WXLLIST_TEMPFILE)); } bool wxLayoutPrintout::HasPage(int pageNum)