]> git.saurik.com Git - wxWidgets.git/commitdiff
implemented correct setting of background colour for text
authorKarsten Ballüder <ballueder@usa.net>
Wed, 29 Jul 1998 10:34:11 +0000 (10:34 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Wed, 29 Jul 1998 10:34:11 +0000 (10:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

user/wxLayout/wxLayout.cpp
user/wxLayout/wxllist.cpp
user/wxLayout/wxllist.h

index 925cba8edbbac7191268949bbac04f3aa825a136..87387fc68bdeb42ee462d85e04cb65823e81b4a1 100644 (file)
@@ -116,7 +116,7 @@ MyFrame::AddSampleText(wxLayoutList &llist)
    llist.Insert(" and ");
    llist.SetFont(-1,-1,-1,-1,-1,"red","black");
    llist.Insert("red on black");
-   llist.SetFont(-1,-1,-1,-1,-1,"black");
+   llist.SetFont(-1,-1,-1,-1,-1,"black","white");
    llist.Insert(" text.");
    llist.LineBreak();
 
index eae1b75cc47d82a3842e5a99e6362569653810d7..6303a0700560a16986e68c8ca592ce74727149bf 100644 (file)
@@ -322,10 +322,23 @@ wxLayoutList::Draw(wxDC &dc, bool findObject, wxPoint const &findCoords)
 
    // setting up the default:
    dc.SetTextForeground( *wxBLACK );
+   dc.SetTextBackground( *wxWHITE );
+   dc.SetBackgroundMode( wxSOLID ); // to enable setting of text background
    dc.SetFont( *wxNORMAL_FONT );
 
+
+   //FIXME: who frees the brush, how long does it need to exist?
    if(m_DefaultSetting)
+   {
       m_DefaultSetting->Draw(dc,wxPoint(0,0),0,true);
+      dc.SetBackground( wxBrush(* m_DefaultSetting->GetBGColour(),wxSOLID));
+   }
+   else
+      dc.SetBackground( wxBrush(wxColour("White"), wxSOLID) ); 
+
+   dc.Clear();
+
+
    
    // we calculate everything for drawing a line, then rewind to the
    // begin of line and actually draw it
@@ -850,6 +863,7 @@ wxLayoutList::Clear(int family, int size, int style, int weight,
    m_LineHeight = (BASELINESTRETCH*m_FontPtSize)/10;
    m_MaxX = 0; m_MaxY = 0;
 
+   
    if(m_DefaultSetting)
       delete m_DefaultSetting;
    m_DefaultSetting = new
index 48d70c2326ed2e05a99408f5fd7984fc9681d0eb..f8242f3f06548751489f470c80b1385517daa3a4 100644 (file)
@@ -157,8 +157,10 @@ public:
                 bool underline,
                 wxColour const *fg, wxColour const *bg);
    ~wxLayoutObjectCmd();
-   // caller must free pointer:
+   /// caller must free pointer:
    wxLayoutStyleInfo *GetStyle(void) const ;
+   /// return the background colour for setting colour of window
+   wxColour const *GetBGColour(void) const { return m_ColourBG; }
 private:
    /// the font to use
    wxFont *m_font;