new wxHTML printing code ; parser now supports scaling

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4906 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
1999-12-11 21:50:44 +00:00
parent 56ac3e75d4
commit edbd0635f2
12 changed files with 102 additions and 93 deletions

View File

@@ -210,7 +210,7 @@ class WXDLLEXPORT wxHtmlContainerCell : public wxHtmlCell
void SetAlign(const wxHtmlTag& tag);
// sets alignment info based on given tag's params
void SetWidthFloat(int w, int units) {m_WidthFloat = w; m_WidthFloatUnits = units;}
void SetWidthFloat(const wxHtmlTag& tag);
void SetWidthFloat(const wxHtmlTag& tag, double pixel_scale = 1.0);
// sets floating width adjustment
// (examples : 32 percent of parent container,
// -15 pixels percent (this means 100 % - 15 pixels)

View File

@@ -38,17 +38,11 @@ class WXDLLEXPORT wxHtmlDCRenderer : public wxObject
~wxHtmlDCRenderer();
// Following 3 methods *must* be called before any call to Render:
void SetDC(wxDC *dc, int maxwidth);
void SetDC(wxDC *dc, double pixel_scale = 1.0);
// asign DC to this render
// maxwidth is width of area (on this DC) that is equivalent to screen's width, in pixels
// (you should set it to page width minus margins)
// Also see SetSize
void SetSize(int width, int height);
// sets size of output rectangle, in pixels. Note that you *can't* change
// width of the rectangle between calls to Render! (You can freely change height.)
// If you set width = maxwidth then HTML is rendered as if it were displayed in fullscreen.
// If you set width = 1/2 maxwidth the it is rendered as if it covered half the screen
// and so on..
void SetHtmlText(const wxString& html, const wxString& basepath = wxEmptyString, bool isdir = TRUE);
// sets the text to be displayed
//
@@ -79,7 +73,6 @@ class WXDLLEXPORT wxHtmlDCRenderer : public wxObject
wxFileSystem *m_FS;
wxHtmlContainerCell *m_Cells;
int m_MaxWidth, m_Width, m_Height;
double m_Scale;
};

View File

@@ -44,10 +44,11 @@ class WXDLLEXPORT wxHtmlWinParser : public wxHtmlParser
virtual void DoneParser();
virtual wxObject* GetProduct();
virtual void SetDC(wxDC *dc) {m_DC = dc;}
virtual void SetDC(wxDC *dc, double pixel_scale = 1.0) {m_DC = dc; m_PixelScale = pixel_scale;}
// Set's the DC used for parsing. If SetDC() is not called,
// parsing won't proceed
wxDC *GetDC() {return m_DC;}
double GetPixelScale() {return m_PixelScale;}
int GetCharHeight() const {return m_CharHeight;}
int GetCharWidth() const {return m_CharWidth;}
// NOTE : these functions do _not_ return _actual_
@@ -113,6 +114,7 @@ class WXDLLEXPORT wxHtmlWinParser : public wxHtmlParser
// temporary variable used by AddText
wxWindow *m_Window;
// window we're parsing for
double m_PixelScale;
wxDC *m_DC;
// Device Context we're parsing for
static wxList m_Modules;