]> git.saurik.com Git - wxWidgets.git/commitdiff
don't break lines in the middle of word
authorVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 Jul 2003 18:28:21 +0000 (18:28 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Tue, 15 Jul 2003 18:28:21 +0000 (18:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/html/htmlcell.h
include/wx/html/winpars.h

index c7f8a23a75a48f042f125701b6ee6a0ad5e14dc6..80f49c23e1479d34467fd74132a5623331d5f1bd 100644 (file)
@@ -254,6 +254,10 @@ public:
     // Sets cell's behaviour on pagebreaks (see AdjustPagebreak). Default
     // is true - the cell can be split on two pages
     void SetCanLiveOnPagebreak(bool can) { m_CanLiveOnPagebreak = can; }
+    
+    // Can the line be broken before this cell?
+    virtual bool IsLinebreakAllowed() const
+        { return !IsFormattingCell(); }
 
     // Returns y-coordinates that contraint the cell, i.e. left is highest
     // and right lowest coordinate such that the cell lays between then.
@@ -338,6 +342,9 @@ public:
               wxHtmlRenderingInfo& info);
     wxCursor GetCursor() const;
     wxString ConvertToText(wxHtmlSelection *sel) const;
+    bool IsLinebreakAllowed() const { return m_allowLinebreak; }
+
+    void SetPreviousWord(wxHtmlWordCell *cell);
 
 protected:
     void SetSelectionPrivPos(wxDC& dc, wxHtmlSelection *s) const;
@@ -346,6 +353,7 @@ protected:
                unsigned& pos1, unsigned& pos2) const;
     
     wxString m_Word;
+    bool     m_allowLinebreak;
 };
 
 
index d1eae9c92951dbe6ed7d4bc92234526c9632de06..5735e2c3cb819957f09cd95944aa0fd2a47984be 100644 (file)
@@ -176,13 +176,15 @@ private:
     wxString m_FontFaceFixed, m_FontFaceNormal;
             // html font sizes and faces of fixed and proportional fonts
 
-    DECLARE_NO_COPY_CLASS(wxHtmlWinParser)
-
 #if !wxUSE_UNICODE
     wxFontEncoding m_InputEnc, m_OutputEnc;
             // I/O font encodings
     wxEncodingConverter *m_EncConv;
 #endif
+
+    wxHtmlWordCell *m_lastWordCell;
+    
+    DECLARE_NO_COPY_CLASS(wxHtmlWinParser)
 };
 
 
@@ -190,12 +192,12 @@ private:
 
 
 
-//--------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 // wxHtmlWinTagHandler
 //                  This is basicly wxHtmlTagHandler except
 //                  it is extended with protected member m_Parser pointing to
 //                  the wxHtmlWinParser object
-//--------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
 
 class WXDLLIMPEXP_HTML wxHtmlWinTagHandler : public wxHtmlTagHandler
 {
@@ -217,13 +219,13 @@ protected:
 
 
 
-//--------------------------------------------------------------------------------
+//----------------------------------------------------------------------------
 // wxHtmlTagsModule
 //                  This is basic of dynamic tag handlers binding.
 //                  The class provides methods for filling parser's handlers
 //                  hash table.
 //                  (See documentation for details)
-//--------------------------------------------------------------------------------
+//----------------------------------------------------------------------------
 
 class WXDLLIMPEXP_HTML wxHtmlTagsModule : public wxModule
 {
@@ -236,8 +238,8 @@ public:
     virtual void OnExit();
 
     // This is called by wxHtmlWinParser.
-    // The method must simply call parser->AddTagHandler(new <handler_class_name>);
-    // for each handler
+    // The method must simply call parser->AddTagHandler(new
+    // <handler_class_name>); for each handler
     virtual void FillHandlersTable(wxHtmlWinParser * WXUNUSED(parser)) { }
 };
 
@@ -245,8 +247,3 @@ public:
 #endif
 
 #endif // _WX_WINPARS_H_
-
-
-
-
-