makefile typo
wxFileDialog now defaults to cwd, not home PS can now print in landscape (although upside-down) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4130b487dc
commit
ac2def68ed
@ -11,9 +11,14 @@
|
||||
|
||||
top_srcdir = @top_srcdir@
|
||||
top_builddir = ../../..
|
||||
program_dir = samples/html/help
|
||||
|
||||
VPATH = :$(top_srcdir)/samples/html/help
|
||||
|
||||
DATADIRS = helpfiles
|
||||
DATAFILES = helpfiles/Index.hhk helpfiles/book1.htm helpfiles/book2.htm \
|
||||
helpfiles/contents.hhc helpfiles/main.htm helpfiles/page2-b.htm helpfiles/testing.hhp
|
||||
|
||||
PROGRAM=help
|
||||
|
||||
OBJECTS=$(PROGRAM).o
|
||||
|
@ -1358,16 +1358,23 @@ void wxPostScriptDC::DoGetSize(int* width, int* height) const
|
||||
|
||||
if (!paper) paper = wxThePrintPaperDatabase->FindPaperType(wxPAPER_A4);
|
||||
|
||||
int w = 595;
|
||||
int h = 842;
|
||||
if (paper)
|
||||
{
|
||||
if (width) *width = paper->GetSizeDeviceUnits().x;
|
||||
if (height) *height = paper->GetSizeDeviceUnits().y;
|
||||
w = paper->GetSizeDeviceUnits().x;
|
||||
h = paper->GetSizeDeviceUnits().y;
|
||||
}
|
||||
else
|
||||
|
||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||
{
|
||||
if (width) *width = 595;
|
||||
if (height) *height = 842;
|
||||
int tmp = w;
|
||||
w = h;
|
||||
h = tmp;
|
||||
}
|
||||
|
||||
if (width) *width = w;
|
||||
if (height) *height = h;
|
||||
}
|
||||
|
||||
void wxPostScriptDC::DoGetSizeMM(int *width, int *height) const
|
||||
@ -1378,16 +1385,23 @@ void wxPostScriptDC::DoGetSizeMM(int *width, int *height) const
|
||||
|
||||
if (!paper) paper = wxThePrintPaperDatabase->FindPaperType(wxPAPER_A4);
|
||||
|
||||
int w = 210;
|
||||
int h = 297;
|
||||
if (paper)
|
||||
{
|
||||
if (width) *width = paper->GetWidth() / 10;
|
||||
if (height) *height = paper->GetHeight() / 10;
|
||||
w = paper->GetWidth() / 10;
|
||||
h = paper->GetHeight() / 10;
|
||||
}
|
||||
else
|
||||
|
||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||
{
|
||||
if (width) *width = 210;
|
||||
if (height) *height = 297;
|
||||
int tmp = w;
|
||||
w = h;
|
||||
h = tmp;
|
||||
}
|
||||
|
||||
if (width) *width = w;
|
||||
if (height) *height = h;
|
||||
}
|
||||
|
||||
// Resolution in pixels per logical inch
|
||||
@ -1461,7 +1475,7 @@ void wxPostScriptDC::EndDoc ()
|
||||
|
||||
fprintf( m_pstream, "%%!PS-Adobe-2.0\n" ); // PostScript magic strings
|
||||
fprintf( m_pstream, "%%%%Title: %s\n", (const char *)m_title.mb_str() );
|
||||
fprintf( m_pstream, "%%%%Creator: %s\n", (const char*)wxConvLibc.cWX2MB(wxTheApp->argv[0]) );
|
||||
fprintf( m_pstream, "%%%%Creator: %s\n", (const char*)wxConvCurrent->cWX2MB(wxTheApp->argv[0]) );
|
||||
fprintf( m_pstream, "%%%%CreationDate: %s\n", (const char *)wxNow().mb_str() );
|
||||
|
||||
wxChar userID[256];
|
||||
@ -1598,6 +1612,7 @@ void wxPostScriptDC::StartPage()
|
||||
|
||||
fprintf( m_pstream, "%%%%Page: %d\n", wxPageNumber++ );
|
||||
|
||||
// What is this one supposed to do? RR.
|
||||
// *m_pstream << "matrix currentmatrix\n";
|
||||
|
||||
// Added by Chris Breeze
|
||||
@ -1606,11 +1621,6 @@ void wxPostScriptDC::StartPage()
|
||||
// transformation and so we need to reset the origin
|
||||
// (and rotate the page for landscape printing)
|
||||
|
||||
/*
|
||||
m_scaleFactor = 1.0;
|
||||
m_logicalOriginX = 0;
|
||||
m_logicalOriginY = 0;
|
||||
*/
|
||||
// Output scaling
|
||||
long translate_x, translate_y;
|
||||
double scale_x, scale_y;
|
||||
@ -1623,16 +1633,17 @@ void wxPostScriptDC::StartPage()
|
||||
|
||||
if (m_printData.GetOrientation() == wxLANDSCAPE)
|
||||
{
|
||||
// translate_y -= m_maxY;
|
||||
// fprintf( m_pstream, "90 rotate\n" );
|
||||
|
||||
printf( "Hi.\n" );
|
||||
int h;
|
||||
GetSize( (int*) NULL, &h );
|
||||
translate_y -= h;
|
||||
fprintf( m_pstream, "90 rotate\n" );
|
||||
|
||||
fprintf( m_pstream, "90 rotate llx neg ury nef translate\n" );
|
||||
// I copied this one from a PostScript tutorial, but to no avail. RR.
|
||||
// fprintf( m_pstream, "90 rotate llx neg ury nef translate\n" );
|
||||
}
|
||||
|
||||
// fprintf( m_pstream, "%.8f %.8f scale\n", scale_x, scale_y );
|
||||
// fprintf( m_pstream, "%ld %ld translate\n", translate_x, translate_y );
|
||||
fprintf( m_pstream, "%.8f %.8f scale\n", scale_x, scale_y );
|
||||
fprintf( m_pstream, "%ld %ld translate\n", translate_x, translate_y );
|
||||
}
|
||||
|
||||
void wxPostScriptDC::EndPage ()
|
||||
|
@ -37,12 +37,13 @@
|
||||
#include "wx/tooltip.h"
|
||||
#endif
|
||||
|
||||
#include "sys/types.h"
|
||||
#include "sys/stat.h"
|
||||
#include "dirent.h"
|
||||
#include "pwd.h"
|
||||
#include "grp.h"
|
||||
#include "time.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "wx/generic/home.xpm"
|
||||
#include "wx/generic/listview.xpm"
|
||||
@ -560,7 +561,11 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
|
||||
m_message = message;
|
||||
m_dialogStyle = style;
|
||||
m_dir = defaultDir;
|
||||
if (m_dir.IsEmpty()) m_dir = wxGetUserHome();
|
||||
if (m_dir.IsEmpty())
|
||||
{
|
||||
char buf[200];
|
||||
m_dir = getcwd( buf, sizeof(buf) );
|
||||
}
|
||||
m_path = defaultDir;
|
||||
m_path += _T("/");
|
||||
m_path += defaultFile;
|
||||
|
@ -29,7 +29,7 @@ install_dirs:
|
||||
|
||||
install_data:
|
||||
@list='$(DATAFILES)'; for p in $$list; do \
|
||||
if test ! -e $(top_builddir)/$(program_dir)/Makefile.in; then \
|
||||
if test ! -s $(top_builddir)/$(program_dir)/$$p; then \
|
||||
cp -u $(top_srcdir)/$(program_dir)/$$p $(top_builddir)/$(program_dir)/$$p; \
|
||||
fi; \
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user