compilation fixes for --disable-compat28
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2784,6 +2784,7 @@ static void TestStackWalk(const char *argv0)
|
|||||||
#ifdef TEST_STDPATHS
|
#ifdef TEST_STDPATHS
|
||||||
|
|
||||||
#include "wx/stdpaths.h"
|
#include "wx/stdpaths.h"
|
||||||
|
#include "wx/wxchar.h" // wxPrintf
|
||||||
|
|
||||||
static void TestStandardPaths()
|
static void TestStandardPaths()
|
||||||
{
|
{
|
||||||
|
@@ -790,9 +790,9 @@ void MyCanvas::DrawText(wxDC& dc)
|
|||||||
|
|
||||||
dc.DrawText( _T("This is Swiss 18pt text."), 110, 40 );
|
dc.DrawText( _T("This is Swiss 18pt text."), 110, 40 );
|
||||||
|
|
||||||
long length;
|
wxCoord length;
|
||||||
long height;
|
wxCoord height;
|
||||||
long descent;
|
wxCoord descent;
|
||||||
dc.GetTextExtent( _T("This is Swiss 18pt text."), &length, &height, &descent );
|
dc.GetTextExtent( _T("This is Swiss 18pt text."), &length, &height, &descent );
|
||||||
text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent );
|
text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent );
|
||||||
dc.DrawText( text, 110, 80 );
|
dc.DrawText( text, 110, 80 );
|
||||||
|
@@ -894,7 +894,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
dc.SetTextForeground(m_colour);
|
dc.SetTextForeground(m_colour);
|
||||||
|
|
||||||
// the size of one cell (Normally biggest char + small margin)
|
// the size of one cell (Normally biggest char + small margin)
|
||||||
long maxCharWidth, maxCharHeight;
|
wxCoord maxCharWidth, maxCharHeight;
|
||||||
dc.GetTextExtent(wxT("W"), &maxCharWidth, &maxCharHeight);
|
dc.GetTextExtent(wxT("W"), &maxCharWidth, &maxCharHeight);
|
||||||
int w = maxCharWidth + 5,
|
int w = maxCharWidth + 5,
|
||||||
h = maxCharHeight + 4;
|
h = maxCharHeight + 4;
|
||||||
@@ -907,7 +907,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
{
|
{
|
||||||
wxChar c = (wxChar)(32 * (i + 1) + j);
|
wxChar c = (wxChar)(32 * (i + 1) + j);
|
||||||
|
|
||||||
long charWidth, charHeight;
|
wxCoord charWidth, charHeight;
|
||||||
dc.GetTextExtent(c, &charWidth, &charHeight);
|
dc.GetTextExtent(c, &charWidth, &charHeight);
|
||||||
dc.DrawText
|
dc.DrawText
|
||||||
(
|
(
|
||||||
|
@@ -609,7 +609,7 @@ void MyPrintout::DrawPageTwo()
|
|||||||
|
|
||||||
{ // GetTextExtent demo:
|
{ // GetTextExtent demo:
|
||||||
wxString words[7] = {_T("This "), _T("is "), _T("GetTextExtent "), _T("testing "), _T("string. "), _T("Enjoy "), _T("it!")};
|
wxString words[7] = {_T("This "), _T("is "), _T("GetTextExtent "), _T("testing "), _T("string. "), _T("Enjoy "), _T("it!")};
|
||||||
long w, h;
|
wxCoord w, h;
|
||||||
long x = 200, y= 250;
|
long x = 200, y= 250;
|
||||||
wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL);
|
wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL);
|
||||||
|
|
||||||
@@ -681,7 +681,7 @@ dc->SetFont(headerFont);
|
|||||||
float topMarginLogical = (float)(mmToLogical*topMargin);
|
float topMarginLogical = (float)(mmToLogical*topMargin);
|
||||||
float rightMarginLogical = (float)(mmToLogical*(pageWidthMM - rightMargin));
|
float rightMarginLogical = (float)(mmToLogical*(pageWidthMM - rightMargin));
|
||||||
|
|
||||||
long xExtent, yExtent;
|
wxCoord xExtent, yExtent;
|
||||||
dc->GetTextExtent(text, &xExtent, &yExtent);
|
dc->GetTextExtent(text, &xExtent, &yExtent);
|
||||||
float xPos = (float)(((((pageWidthMM - leftMargin - rightMargin)/2.0)+leftMargin)*mmToLogical) - (xExtent/2.0));
|
float xPos = (float)(((((pageWidthMM - leftMargin - rightMargin)/2.0)+leftMargin)*mmToLogical) - (xExtent/2.0));
|
||||||
dc->DrawText(text, (long)xPos, (long)topMarginLogical);
|
dc->DrawText(text, (long)xPos, (long)topMarginLogical);
|
||||||
|
Reference in New Issue
Block a user