some changes, untested
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2452 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -340,7 +340,7 @@ wxLayoutObjectCmd::wxLayoutObjectCmd(int size, int family, int style, int
|
|||||||
{
|
{
|
||||||
m_StyleInfo = new
|
m_StyleInfo = new
|
||||||
wxLayoutStyleInfo(size,family,style,weight,underline,fg,bg);
|
wxLayoutStyleInfo(size,family,style,weight,underline,fg,bg);
|
||||||
m_font = m_StyleInfo->GetFont(NULL);
|
m_font = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLayoutObject *
|
wxLayoutObject *
|
||||||
@@ -374,7 +374,7 @@ wxLayoutObjectCmd::Copy(void)
|
|||||||
wxLayoutObjectCmd::~wxLayoutObjectCmd()
|
wxLayoutObjectCmd::~wxLayoutObjectCmd()
|
||||||
{
|
{
|
||||||
delete m_StyleInfo;
|
delete m_StyleInfo;
|
||||||
delete m_font;
|
if(m_font) delete m_font;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxLayoutStyleInfo *
|
wxLayoutStyleInfo *
|
||||||
@@ -396,6 +396,10 @@ wxLayoutObjectCmd::Draw(wxDC &dc, wxPoint const & /* coords */,
|
|||||||
void
|
void
|
||||||
wxLayoutObjectCmd::Layout(wxDC &dc, class wxLayoutList * llist)
|
wxLayoutObjectCmd::Layout(wxDC &dc, class wxLayoutList * llist)
|
||||||
{
|
{
|
||||||
|
if(m_font) delete m_font;
|
||||||
|
m_font = m_StyleInfo->GetFont(llist->GetStyleInfo());
|
||||||
|
|
||||||
|
|
||||||
// this get called, so that recalculation uses right font sizes
|
// this get called, so that recalculation uses right font sizes
|
||||||
Draw(dc, wxPoint(0,0), llist);
|
Draw(dc, wxPoint(0,0), llist);
|
||||||
}
|
}
|
||||||
@@ -1199,14 +1203,32 @@ wxLayoutList::SetFont(int family, int size, int style, int weight,
|
|||||||
int underline, wxColour *fg,
|
int underline, wxColour *fg,
|
||||||
wxColour *bg)
|
wxColour *bg)
|
||||||
{
|
{
|
||||||
if(family != -1) m_FontFamily = family;
|
if(family != -1) m_CurrentSetting.family = family;
|
||||||
if(size != -1) m_FontPtSize = size;
|
if(size != -1) m_CurrentSetting.size = size;
|
||||||
if(style != -1) m_FontStyle = style;
|
if(style != -1) m_CurrentSetting.style = style;
|
||||||
if(weight != -1) m_FontWeight = weight;
|
if(weight != -1) m_CurrentSetting.weight = weight;
|
||||||
if(underline != -1) m_FontUnderline = underline != 0;
|
if(underline != -1) m_CurrentSetting.underline = underline != 0;
|
||||||
|
if(fg)
|
||||||
|
{
|
||||||
|
m_CurrentSetting.fg_valid = true;
|
||||||
|
m_CurrentSetting.fg_red = fg->Red();
|
||||||
|
m_CurrentSetting.fg_blue = fg->Blue();
|
||||||
|
m_CurrentSetting.fg_green = fg->Green();
|
||||||
|
}
|
||||||
|
if(bg)
|
||||||
|
{
|
||||||
|
m_CurrentSetting.bg_valid = true;
|
||||||
|
m_CurrentSetting.bg_red = bg->Red();
|
||||||
|
m_CurrentSetting.bg_blue = bg->Blue();
|
||||||
|
m_CurrentSetting.bg_green = bg->Green();
|
||||||
|
}
|
||||||
Insert(
|
Insert(
|
||||||
new wxLayoutObjectCmd(m_FontPtSize,m_FontFamily,m_FontStyle,m_FontWeight,m_FontUnderline,
|
new wxLayoutObjectCmd(
|
||||||
fg, bg));
|
m_CurrentSetting.size,
|
||||||
|
m_CurrentSetting.family,
|
||||||
|
m_CurrentSetting.style,
|
||||||
|
m_CurrentSetting.weight,
|
||||||
|
m_CurrentSetting.underline, fg, bg));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Reference in New Issue
Block a user