From 303f0be79e904523d3b2e912ab1a5c7ab812d2b6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sun, 15 Jan 2012 18:26:58 +0000 Subject: [PATCH] Added min and max size to box attributes; made property editing more customisable git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/richtext/richtextbuffer.h | 35 + include/wx/richtext/richtextctrl.h | 12 +- include/wx/richtext/richtextsizepage.h | 36 + interface/wx/richtext/richtextbuffer.h | 36 + interface/wx/richtext/richtextctrl.h | 12 +- src/richtext/richtextbuffer.cpp | 21 +- src/richtext/richtextctrl.cpp | 24 +- src/richtext/richtextdialogs.pjd | 1369 ++++++++++++++++++++---- src/richtext/richtextsizepage.cpp | 268 ++++- src/richtext/richtextxml.cpp | 24 + 10 files changed, 1598 insertions(+), 239 deletions(-) diff --git a/include/wx/richtext/richtextbuffer.h b/include/wx/richtext/richtextbuffer.h index ddab6cd5d5..621d9516df 100644 --- a/include/wx/richtext/richtextbuffer.h +++ b/include/wx/richtext/richtextbuffer.h @@ -588,10 +588,12 @@ public: Sets the width. */ void SetWidth(int value, wxTextAttrDimensionFlags flags) { m_width.SetValue(value, flags); } + /** Sets the width. */ void SetWidth(int value, wxTextAttrUnits units) { m_width.SetValue(value, units); } + /** Sets the width. */ @@ -607,15 +609,22 @@ public: Sets the height. */ void SetHeight(int value, wxTextAttrDimensionFlags flags) { m_height.SetValue(value, flags); } + /** Sets the height. */ void SetHeight(int value, wxTextAttrUnits units) { m_height.SetValue(value, units); } + /** Sets the height. */ void SetHeight(const wxTextAttrDimension& dim) { m_height.SetValue(dim); } + /** + Is the size valid? + */ + bool IsValid() const { return m_width.IsValid() && m_height.IsValid(); } + wxTextAttrDimension m_width; wxTextAttrDimension m_height; }; @@ -1322,11 +1331,35 @@ public: wxTextAttrSize& GetSize() { return m_size; } const wxTextAttrSize& GetSize() const { return m_size; } + /** + Returns the object minimum size. + */ + + wxTextAttrSize& GetMinSize() { return m_minSize; } + const wxTextAttrSize& GetMinSize() const { return m_minSize; } + + /** + Returns the object maximum size. + */ + + wxTextAttrSize& GetMaxSize() { return m_maxSize; } + const wxTextAttrSize& GetMaxSize() const { return m_maxSize; } + /** Sets the object size. */ void SetSize(const wxTextAttrSize& sz) { m_size = sz; } + /** + Sets the object minimum size. + */ + void SetMinSize(const wxTextAttrSize& sz) { m_minSize = sz; } + + /** + Sets the object maximum size. + */ + void SetMaxSize(const wxTextAttrSize& sz) { m_maxSize = sz; } + /** Returns the object width. */ @@ -1363,6 +1396,8 @@ public: wxTextAttrDimensions m_position; wxTextAttrSize m_size; + wxTextAttrSize m_minSize; + wxTextAttrSize m_maxSize; wxTextAttrBorders m_border; wxTextAttrBorders m_outline; diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index 81f7a3e3ce..3eeedef9cc 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -135,7 +135,7 @@ public: Adds appropriate menu items for the current container and clicked on object (and container's parent, if appropriate). */ - int AddItems(wxRichTextObject* container, wxRichTextObject* obj); + int AddItems(wxRichTextCtrl* ctrl, wxRichTextObject* container, wxRichTextObject* obj); /** Clears the items. @@ -1621,6 +1621,16 @@ public: */ virtual int PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool addPropertyCommands = true); + /** + Returns @true if we can edit the object's properties via a GUI. + */ + virtual bool CanEditProperties(wxRichTextObject* obj) const { return obj->CanEditProperties(); } + + /** + Edits the object's properties via a GUI. + */ + virtual bool EditProperties(wxRichTextObject* obj, wxWindow* parent) { return obj->EditProperties(parent, & GetBuffer()); } + // Command handlers /** diff --git a/include/wx/richtext/richtextsizepage.h b/include/wx/richtext/richtextsizepage.h index 42007fce1f..a840f63a39 100644 --- a/include/wx/richtext/richtextsizepage.h +++ b/include/wx/richtext/richtextsizepage.h @@ -89,6 +89,18 @@ public: /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_HEIGHT void OnRichtextHeightUpdate( wxUpdateUIEvent& event ); + /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH + void OnRichtextMinWidthUpdate( wxUpdateUIEvent& event ); + + /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT + void OnRichtextMinHeightUpdate( wxUpdateUIEvent& event ); + + /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH + void OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event ); + + /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT + void OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event ); + /// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX void OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEvent& event ); @@ -125,6 +137,18 @@ public: wxCheckBox* m_heightCheckbox; wxTextCtrl* m_height; wxComboBox* m_unitsH; + wxCheckBox* m_minWidthCheckbox; + wxTextCtrl* m_minWidth; + wxComboBox* m_unitsMinW; + wxCheckBox* m_minHeightCheckbox; + wxTextCtrl* m_minHeight; + wxComboBox* m_unitsMinH; + wxCheckBox* m_maxWidthCheckbox; + wxTextCtrl* m_maxWidth; + wxComboBox* m_unitsMaxW; + wxCheckBox* m_maxHeightCheckbox; + wxTextCtrl* m_maxHeight; + wxComboBox* m_unitsMaxH; wxBoxSizer* m_alignmentControls; wxCheckBox* m_verticalAlignmentCheckbox; wxComboBox* m_verticalAlignmentComboBox; @@ -144,6 +168,18 @@ public: ID_RICHTEXT_HEIGHT_CHECKBOX = 10705, ID_RICHTEXT_HEIGHT = 10706, ID_RICHTEXT_UNITS_H = 10707, + ID_RICHTEXT_MIN_WIDTH_CHECKBOX = 10715, + ID_RICHTEXT_MIN_WIDTH = 10716, + ID_RICHTEXT_UNITS_MIN_W = 10717, + ID_RICHTEXT_MIN_HEIGHT_CHECKBOX = 10718, + ID_RICHTEXT_MIN_HEIGHT = 10719, + ID_RICHTEXT_UNITS_MIN_H = 10720, + ID_RICHTEXT_MAX_WIDTH_CHECKBOX = 10721, + ID_RICHTEXT_MAX_WIDTH = 10722, + ID_RICHTEXT_UNITS_MAX_W = 10723, + ID_RICHTEXT_MAX_HEIGHT_CHECKBOX = 10724, + ID_RICHTEXT_MAX_HEIGHT = 10725, + ID_RICHTEXT_UNITS_MAX_H = 10726, ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX = 10708, ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX = 10709, ID_RICHTEXT_OFFSET_CHECKBOX = 10710, diff --git a/interface/wx/richtext/richtextbuffer.h b/interface/wx/richtext/richtextbuffer.h index 147d8b0c94..a23f360527 100644 --- a/interface/wx/richtext/richtextbuffer.h +++ b/interface/wx/richtext/richtextbuffer.h @@ -472,10 +472,12 @@ public: Sets the width. */ void SetWidth(int value, wxTextAttrDimensionFlags flags) { m_width.SetValue(value, flags); } + /** Sets the width. */ void SetWidth(int value, wxTextAttrUnits units) { m_width.SetValue(value, units); } + /** Sets the width. */ @@ -491,15 +493,22 @@ public: Sets the height. */ void SetHeight(int value, wxTextAttrDimensionFlags flags) { m_height.SetValue(value, flags); } + /** Sets the height. */ void SetHeight(int value, wxTextAttrUnits units) { m_height.SetValue(value, units); } + /** Sets the height. */ void SetHeight(const wxTextAttrDimension& dim) { m_height.SetValue(dim); } + /** + Is the size valid? + */ + bool IsValid() const { return m_width.IsValid() && m_height.IsValid(); } + wxTextAttrDimension m_width; wxTextAttrDimension m_height; }; @@ -1206,11 +1215,36 @@ public: wxTextAttrSize& GetSize() { return m_size; } const wxTextAttrSize& GetSize() const { return m_size; } + /** + Returns the object minimum size. + */ + + wxTextAttrSize& GetMinSize() { return m_minSize; } + const wxTextAttrSize& GetMinSize() const { return m_minSize; } + + /** + Returns the object maximum size. + */ + + wxTextAttrSize& GetMaxSize() { return m_maxSize; } + const wxTextAttrSize& GetMaxSize() const { return m_maxSize; } + /** Sets the object size. */ void SetSize(const wxTextAttrSize& sz) { m_size = sz; } + /** + Sets the object minimum size. + */ + void SetMinSize(const wxTextAttrSize& sz) { m_minSize = sz; } + + /** + Sets the object maximum size. + */ + void SetMaxSize(const wxTextAttrSize& sz) { m_maxSize = sz; } + + /** /** Returns the object width. */ @@ -1247,6 +1281,8 @@ public: wxTextAttrDimensions m_position; wxTextAttrSize m_size; + wxTextAttrSize m_minSize; + wxTextAttrSize m_maxSize; wxTextAttrBorders m_border; wxTextAttrBorders m_outline; diff --git a/interface/wx/richtext/richtextctrl.h b/interface/wx/richtext/richtextctrl.h index 831b184965..42746118b8 100644 --- a/interface/wx/richtext/richtextctrl.h +++ b/interface/wx/richtext/richtextctrl.h @@ -111,7 +111,7 @@ public: Adds appropriate menu items for the current container and clicked on object (and container's parent, if appropriate). */ - int AddItems(wxRichTextObject* container, wxRichTextObject* obj); + int AddItems(wxRichTextCtrl* ctrl, wxRichTextObject* container, wxRichTextObject* obj); /** Clears the items. @@ -1580,6 +1580,16 @@ public: */ virtual int PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool addPropertyCommands); + /** + Returns @true if we can edit the object's properties via a GUI. + */ + virtual bool CanEditProperties(wxRichTextObject* obj) const { return obj->CanEditProperties(); } + + /** + Edits the object's properties via a GUI. + */ + virtual bool EditProperties(wxRichTextObject* obj, wxWindow* parent) { return obj->EditProperties(parent, & GetBuffer()); } + // Command handlers /** diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 71a54cc8af..4c0ce37240 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -10777,6 +10777,8 @@ void wxTextBoxAttr::Reset() m_position.Reset(); m_size.Reset(); + m_minSize.Reset(); + m_maxSize.Reset(); m_border.Reset(); m_outline.Reset(); @@ -10797,6 +10799,8 @@ bool wxTextBoxAttr::operator== (const wxTextBoxAttr& attr) const m_position == attr.m_position && m_size == attr.m_size && + m_minSize == attr.m_minSize && + m_maxSize == attr.m_maxSize && m_border == attr.m_border && m_outline == attr.m_outline && @@ -10828,6 +10832,15 @@ bool wxTextBoxAttr::EqPartial(const wxTextBoxAttr& attr) const if (!m_position.EqPartial(attr.m_position)) return false; + // Size + + if (!m_size.EqPartial(attr.m_size)) + return false; + if (!m_minSize.EqPartial(attr.m_minSize)) + return false; + if (!m_maxSize.EqPartial(attr.m_maxSize)) + return false; + // Margins if (!m_margins.EqPartial(attr.m_margins)) @@ -10891,6 +10904,8 @@ bool wxTextBoxAttr::Apply(const wxTextBoxAttr& attr, const wxTextBoxAttr* compar m_position.Apply(attr.m_position, compareWith ? (& attr.m_position) : (const wxTextAttrDimensions*) NULL); m_size.Apply(attr.m_size, compareWith ? (& attr.m_size) : (const wxTextAttrSize*) NULL); + m_minSize.Apply(attr.m_minSize, compareWith ? (& attr.m_minSize) : (const wxTextAttrSize*) NULL); + m_maxSize.Apply(attr.m_maxSize, compareWith ? (& attr.m_maxSize) : (const wxTextAttrSize*) NULL); m_border.Apply(attr.m_border, compareWith ? (& attr.m_border) : (const wxTextAttrBorders*) NULL); m_outline.Apply(attr.m_outline, compareWith ? (& attr.m_outline) : (const wxTextAttrBorders*) NULL); @@ -10924,6 +10939,8 @@ bool wxTextBoxAttr::RemoveStyle(const wxTextBoxAttr& attr) m_position.RemoveStyle(attr.m_position); m_size.RemoveStyle(attr.m_size); + m_minSize.RemoveStyle(attr.m_minSize); + m_maxSize.RemoveStyle(attr.m_maxSize); m_border.RemoveStyle(attr.m_border); m_outline.RemoveStyle(attr.m_outline); @@ -11035,6 +11052,8 @@ void wxTextBoxAttr::CollectCommonAttributes(const wxTextBoxAttr& attr, wxTextBox m_position.CollectCommonAttributes(attr.m_position, clashingAttr.m_position, absentAttr.m_position); m_size.CollectCommonAttributes(attr.m_size, clashingAttr.m_size, absentAttr.m_size); + m_minSize.CollectCommonAttributes(attr.m_minSize, clashingAttr.m_minSize, absentAttr.m_minSize); + m_maxSize.CollectCommonAttributes(attr.m_maxSize, clashingAttr.m_maxSize, absentAttr.m_maxSize); m_border.CollectCommonAttributes(attr.m_border, clashingAttr.m_border, absentAttr.m_border); m_outline.CollectCommonAttributes(attr.m_outline, clashingAttr.m_outline, absentAttr.m_outline); @@ -11043,7 +11062,7 @@ void wxTextBoxAttr::CollectCommonAttributes(const wxTextBoxAttr& attr, wxTextBox bool wxTextBoxAttr::IsDefault() const { return GetFlags() == 0 && !m_border.IsValid() && !m_outline.IsValid() && - !m_size.GetWidth().IsValid() && !m_size.GetHeight().IsValid() && + !m_size.IsValid() && !m_minSize.IsValid() && !m_maxSize.IsValid() && !m_position.IsValid() && !m_padding.IsValid() && !m_margins.IsValid(); } diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index ec5e1186f1..ef16e23b4e 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -3340,8 +3340,8 @@ void wxRichTextCtrl::OnProperties(wxCommandEvent& event) if (idx >= 0 && idx < m_contextMenuPropertiesInfo.GetCount()) { wxRichTextObject* obj = m_contextMenuPropertiesInfo.GetObject(idx); - if (obj && obj->CanEditProperties()) - obj->EditProperties(this, & GetBuffer()); + if (obj && CanEditProperties(obj)) + EditProperties(obj, this); m_contextMenuPropertiesInfo.Clear(); } @@ -3394,18 +3394,18 @@ int wxRichTextCtrl::PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool add } if (addPropertyCommands) - m_contextMenuPropertiesInfo.AddItems(actualContainer, hitObj); + m_contextMenuPropertiesInfo.AddItems(this, actualContainer, hitObj); } else { if (addPropertyCommands) - m_contextMenuPropertiesInfo.AddItems(GetFocusObject(), NULL); + m_contextMenuPropertiesInfo.AddItems(this, GetFocusObject(), NULL); } } else { if (addPropertyCommands) - m_contextMenuPropertiesInfo.AddItems(GetFocusObject(), NULL); + m_contextMenuPropertiesInfo.AddItems(this, GetFocusObject(), NULL); } } else @@ -3422,12 +3422,12 @@ int wxRichTextCtrl::PrepareContextMenu(wxMenu* menu, const wxPoint& pt, bool add if (hitObj && actualContainer) { if (addPropertyCommands) - m_contextMenuPropertiesInfo.AddItems(actualContainer, hitObj); + m_contextMenuPropertiesInfo.AddItems(this, actualContainer, hitObj); } else { if (addPropertyCommands) - m_contextMenuPropertiesInfo.AddItems(GetFocusObject(), NULL); + m_contextMenuPropertiesInfo.AddItems(this, GetFocusObject(), NULL); } } @@ -4375,7 +4375,6 @@ void wxRichTextCtrl::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResu wxRichTextParagraphLayoutBox* originContainer = GetSelection().GetContainer(); wxRichTextParagraphLayoutBox* destContainer = GetFocusObject(); // This will be the drop container, not necessarily the same as the origin one - wxRichTextBuffer* richTextBuffer = ((wxRichTextBufferDataObject*)DataObj)->GetRichTextBuffer(); if (richTextBuffer) { @@ -4407,7 +4406,6 @@ void wxRichTextCtrl::OnDrop(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), wxDragResu originContainer->DeleteRangeWithUndo(selectionrange, this, &GetBuffer()); } - SelectNone(); Refresh(); } @@ -4673,16 +4671,16 @@ int wxRichTextContextMenuPropertiesInfo::AddMenuItems(wxMenu* menu, int startCmd // Add appropriate menu items for the current container and clicked on object // (and container's parent, if appropriate). -int wxRichTextContextMenuPropertiesInfo::AddItems(wxRichTextObject* container, wxRichTextObject* obj) +int wxRichTextContextMenuPropertiesInfo::AddItems(wxRichTextCtrl* ctrl, wxRichTextObject* container, wxRichTextObject* obj) { Clear(); - if (obj && obj->CanEditProperties()) + if (obj && ctrl->CanEditProperties(obj)) AddItem(obj->GetPropertiesMenuLabel(), obj); - if (container && container != obj && container->CanEditProperties() && m_labels.Index(container->GetPropertiesMenuLabel()) == wxNOT_FOUND) + if (container && container != obj && ctrl->CanEditProperties(container) && m_labels.Index(container->GetPropertiesMenuLabel()) == wxNOT_FOUND) AddItem(container->GetPropertiesMenuLabel(), container); - if (container && container->GetParent() && container->GetParent()->CanEditProperties() && m_labels.Index(container->GetParent()->GetPropertiesMenuLabel()) == wxNOT_FOUND) + if (container && container->GetParent() && ctrl->CanEditProperties(container->GetParent()) && m_labels.Index(container->GetParent()->GetPropertiesMenuLabel()) == wxNOT_FOUND) AddItem(container->GetParent()->GetPropertiesMenuLabel(), container->GetParent()); return GetCount(); diff --git a/src/richtext/richtextdialogs.pjd b/src/richtext/richtextdialogs.pjd index 6cf9e64dd1..e4b1afab91 100644 --- a/src/richtext/richtextdialogs.pjd +++ b/src/richtext/richtextdialogs.pjd @@ -189,6 +189,7 @@ "%AUTO%" "%AUTO%" "%AUTO%" + "%AUTO%" 0 1 @@ -2216,6 +2217,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -5373,6 +5382,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -7053,6 +7070,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -8913,6 +8938,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -10475,6 +10508,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -14496,6 +14537,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -15221,7 +15270,7 @@ "wbFlexGridSizerProxy" "" "" - 2 + 4 0 0 0 @@ -15287,7 +15336,7 @@ -1 -1 -1 - "Centre" + "Left" "Centre" 0 5 @@ -15392,7 +15441,7 @@ "" -1 -1 - 65 + 60 -1 "Left" "Centre" @@ -15523,7 +15572,7 @@ -1 -1 -1 - "Centre" + "Left" "Centre" 0 5 @@ -15628,7 +15677,7 @@ "" -1 -1 - 65 + 60 -1 "Left" "Centre" @@ -15710,86 +15759,30 @@ "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Vertical" - "m_alignmentControls" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - "wxStaticText: wxID_STATIC" + "wxCheckBox: ID_RICHTEXT_MIN_WIDTH_CHECKBOX" "dialog-control-document" "" - "statictext" + "checkbox" 0 1 0 0 - "wbStaticTextProxy" - "wxID_STATIC" - 5105 + "wbCheckBoxProxy" + "ID_RICHTEXT_MIN_WIDTH_CHECKBOX" + 10715 "" - "wxStaticText" - "wxStaticText" + "wxCheckBox" + "wxCheckBox" 1 0 "" "" - "" - "Alignment" - -1 - "" + "m_minWidthCheckbox" + "Min width:" + 0 + "Enable the minimum width value." "" - "" - "" - "wxSYS_DEFAULT_GUI_FONT:default,default,default, wxBOLD, false" - 0 - 1 - "<Any platform>" "" "" "" @@ -15797,74 +15790,16 @@ "" "" "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticLine: wxID_STATIC" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "wbStaticLineProxy" - "wxID_STATIC" - 5105 - "" - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "" "" "" "" 0 1 "<Any platform>" - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 + 0 + 0 + 0 + 0 0 0 0 @@ -15873,75 +15808,1133 @@ -1 -1 -1 - "Centre" + "Left" "Centre" - 1 + 0 5 1 - 1 + 0 1 1 0 0 0 + "" + "" - - - "wxBoxSizer H" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "wbBoxSizerProxy" - "Horizontal" - "" - "Expand" - "Centre" - 0 - 5 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "<Any platform>" - "Spacer" + "wxBoxSizer H" "dialog-control-document" "" - "spacer" + "sizer" 0 1 0 0 - "wbSpacerProxy" - 5 - 5 - "Centre" + "wbBoxSizerProxy" + "Horizontal" + "" + "Left" "Centre" 0 5 - 1 - 1 - 1 - 1 + 0 + 0 + 0 + 0 0 0 0 "<Any platform>" - - - "wxCheckBox: ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX" - "dialog-control-document" - "" - "checkbox" - 0 - 1 + + "wxTextCtrl: ID_RICHTEXT_MIN_WIDTH" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "wbTextCtrlProxy" + "wxEVT_UPDATE_UI|OnRichtextMinWidthUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_MIN_WIDTH" + 10716 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_minWidth" + "" + 0 + "The object minimum width." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxComboBox: ID_RICHTEXT_UNITS_MIN_W" + "dialog-control-document" + "" + "combobox" + 0 + 1 + 0 + 0 + "wbComboBoxProxy" + "wxEVT_UPDATE_UI|OnRichtextMinWidthUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_UNITS_MIN_W" + 10717 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_unitsMinW" + "px|cm|percent" + "px" + "Units for the minimum object width." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + + "wxCheckBox: ID_RICHTEXT_MIN_HEIGHT_CHECKBOX" + "dialog-control-document" + "" + "checkbox" + 0 + 1 + 0 + 0 + "wbCheckBoxProxy" + "ID_RICHTEXT_MIN_HEIGHT_CHECKBOX" + 10718 + "" + "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" + "m_minHeightCheckbox" + "Min height:" + 0 + "Enable the minimum height value." + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Horizontal" + "" + "Left" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "wxTextCtrl: ID_RICHTEXT_MIN_HEIGHT" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "wbTextCtrlProxy" + "wxEVT_UPDATE_UI|OnRichtextMinHeightUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_MIN_HEIGHT" + 10719 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_minHeight" + "" + 0 + "The object minmum height." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxComboBox: ID_RICHTEXT_UNITS_MIN_H" + "dialog-control-document" + "" + "combobox" + 0 + 1 + 0 + 0 + "wbComboBoxProxy" + "wxEVT_UPDATE_UI|OnRichtextMinHeightUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_UNITS_MIN_H" + 10720 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_unitsMinH" + "px|cm|percent" + "px" + "Units for the minimum object height." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + + "wxCheckBox: ID_RICHTEXT_MAX_WIDTH_CHECKBOX" + "dialog-control-document" + "" + "checkbox" + 0 + 1 + 0 + 0 + "wbCheckBoxProxy" + "ID_RICHTEXT_MAX_WIDTH_CHECKBOX" + 10721 + "" + "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" + "m_maxWidthCheckbox" + "Max width:" + 0 + "Enable the maximum width value." + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Horizontal" + "" + "Left" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "wxTextCtrl: ID_RICHTEXT_MAX_WIDTH" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "wbTextCtrlProxy" + "wxEVT_UPDATE_UI|OnRichtextMaxWidthUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_MAX_WIDTH" + 10722 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_maxWidth" + "" + 0 + "The object maximum width." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxComboBox: ID_RICHTEXT_UNITS_MAX_W" + "dialog-control-document" + "" + "combobox" + 0 + 1 + 0 + 0 + "wbComboBoxProxy" + "wxEVT_UPDATE_UI|OnRichtextMaxWidthUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_UNITS_MAX_W" + 10723 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_unitsMaxW" + "px|cm|percent" + "px" + "Units for the maximum object width." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + + "wxCheckBox: ID_RICHTEXT_MAX_HEIGHT_CHECKBOX" + "dialog-control-document" + "" + "checkbox" + 0 + 1 + 0 + 0 + "wbCheckBoxProxy" + "ID_RICHTEXT_MAX_HEIGHT_CHECKBOX" + 10724 + "" + "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" + "m_maxHeightCheckbox" + "Max height:" + 0 + "Enable the height value." + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Horizontal" + "" + "Left" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "wxTextCtrl: ID_RICHTEXT_MAX_HEIGHT" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "wbTextCtrlProxy" + "wxEVT_UPDATE_UI|OnRichtextMaxHeightUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_MAX_HEIGHT" + 10725 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_maxHeight" + "" + 0 + "The object maximum height." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Left" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxComboBox: ID_RICHTEXT_UNITS_MAX_H" + "dialog-control-document" + "" + "combobox" + 0 + 1 + 0 + 0 + "wbComboBoxProxy" + "wxEVT_UPDATE_UI|OnRichtextMaxHeightUpdate|NONE||wxRichTextSizePage" + "ID_RICHTEXT_UNITS_MAX_H" + 10726 + "" + "wxComboBox" + "wxComboBox" + 1 + 0 + "" + "" + "m_unitsMaxH" + "px|cm|percent" + "px" + "Units for the maximum object height." + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 60 + -1 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + + + + "wxBoxSizer V" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Vertical" + "m_alignmentControls" + "Expand" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Horizontal" + "" + "Expand" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "wxStaticText: wxID_STATIC" + "dialog-control-document" + "" + "statictext" + 0 + 1 + 0 + 0 + "wbStaticTextProxy" + "wxID_STATIC" + 5105 + "" + "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" + "" + "Alignment" + -1 + "" + "" + "" + "" + "wxSYS_DEFAULT_GUI_FONT:default,default,default, wxBOLD, false" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxStaticLine: wxID_STATIC" + "dialog-control-document" + "" + "staticline" + 0 + 1 + 0 + 0 + "wbStaticLineProxy" + "wxID_STATIC" + 5105 + "" + "wxStaticLine" + "wxStaticLine" + 1 + 0 + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Centre" + "Centre" + 1 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "wbBoxSizerProxy" + "Horizontal" + "" + "Expand" + "Centre" + 0 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + "Spacer" + "dialog-control-document" + "" + "spacer" + 0 + 1 + 0 + 0 + "wbSpacerProxy" + 5 + 5 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "<Any platform>" + + + "wxCheckBox: ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX" + "dialog-control-document" + "" + "checkbox" + 0 + 1 0 0 "wbCheckBoxProxy" @@ -16872,6 +17865,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 @@ -23814,6 +24815,14 @@ "wbBoxSizerProxy" "Vertical" "" + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 0 0 0 diff --git a/src/richtext/richtextsizepage.cpp b/src/richtext/richtextsizepage.cpp index b046a3a35b..65281d9cf9 100644 --- a/src/richtext/richtextsizepage.cpp +++ b/src/richtext/richtextsizepage.cpp @@ -37,6 +37,22 @@ BEGIN_EVENT_TABLE( wxRichTextSizePage, wxRichTextDialogPage ) EVT_UPDATE_UI( ID_RICHTEXT_UNITS_H, wxRichTextSizePage::OnRichtextHeightUpdate ) + EVT_UPDATE_UI( ID_RICHTEXT_MIN_WIDTH, wxRichTextSizePage::OnRichtextMinWidthUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MIN_W, wxRichTextSizePage::OnRichtextMinWidthUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_MIN_HEIGHT, wxRichTextSizePage::OnRichtextMinHeightUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MIN_H, wxRichTextSizePage::OnRichtextMinHeightUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_MAX_WIDTH, wxRichTextSizePage::OnRichtextMaxWidthUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MAX_W, wxRichTextSizePage::OnRichtextMaxWidthUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_MAX_HEIGHT, wxRichTextSizePage::OnRichtextMaxHeightUpdate ) + + EVT_UPDATE_UI( ID_RICHTEXT_UNITS_MAX_H, wxRichTextSizePage::OnRichtextMaxHeightUpdate ) + EVT_UPDATE_UI( ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX, wxRichTextSizePage::OnRichtextVerticalAlignmentComboboxUpdate ) EVT_UPDATE_UI( ID_RICHTEXT_OFFSET, wxRichTextSizePage::OnRichtextOffsetUpdate ) @@ -116,6 +132,18 @@ void wxRichTextSizePage::Init() m_heightCheckbox = NULL; m_height = NULL; m_unitsH = NULL; + m_minWidthCheckbox = NULL; + m_minWidth = NULL; + m_unitsMinW = NULL; + m_minHeightCheckbox = NULL; + m_minHeight = NULL; + m_unitsMinH = NULL; + m_maxWidthCheckbox = NULL; + m_maxWidth = NULL; + m_unitsMaxW = NULL; + m_maxHeightCheckbox = NULL; + m_maxHeight = NULL; + m_unitsMaxH = NULL; m_alignmentControls = NULL; m_verticalAlignmentCheckbox = NULL; m_verticalAlignmentComboBox = NULL; @@ -194,7 +222,7 @@ void wxRichTextSizePage::CreateControls() itemBoxSizer16->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxFlexGridSizer* itemFlexGridSizer18 = new wxFlexGridSizer(0, 2, 0, 0); + wxFlexGridSizer* itemFlexGridSizer18 = new wxFlexGridSizer(0, 4, 0, 0); itemBoxSizer16->Add(itemFlexGridSizer18, 0, wxALIGN_CENTER_VERTICAL, 5); m_widthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_WIDTH_CHECKBOX, _("&Width:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -202,12 +230,12 @@ void wxRichTextSizePage::CreateControls() m_widthCheckbox->SetHelpText(_("Enable the width value.")); if (wxRichTextSizePage::ShowToolTips()) m_widthCheckbox->SetToolTip(_("Enable the width value.")); - itemFlexGridSizer18->Add(m_widthCheckbox, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + itemFlexGridSizer18->Add(m_widthCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer18->Add(itemBoxSizer20, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); - m_width = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); + m_width = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); m_width->SetHelpText(_("The object width.")); if (wxRichTextSizePage::ShowToolTips()) m_width->SetToolTip(_("The object width.")); @@ -229,12 +257,12 @@ void wxRichTextSizePage::CreateControls() m_heightCheckbox->SetHelpText(_("Enable the height value.")); if (wxRichTextSizePage::ShowToolTips()) m_heightCheckbox->SetToolTip(_("Enable the height value.")); - itemFlexGridSizer18->Add(m_heightCheckbox, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + itemFlexGridSizer18->Add(m_heightCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer18->Add(itemBoxSizer24, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); - m_height = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); + m_height = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); m_height->SetHelpText(_("The object height.")); if (wxRichTextSizePage::ShowToolTips()) m_height->SetToolTip(_("The object height.")); @@ -251,30 +279,138 @@ void wxRichTextSizePage::CreateControls() m_unitsH->SetToolTip(_("Units for the object height.")); itemBoxSizer24->Add(m_unitsH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_minWidthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MIN_WIDTH_CHECKBOX, _("Min width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_minWidthCheckbox->SetValue(false); + m_minWidthCheckbox->SetHelpText(_("Enable the minimum width value.")); + if (wxRichTextSizePage::ShowToolTips()) + m_minWidthCheckbox->SetToolTip(_("Enable the minimum width value.")); + itemFlexGridSizer18->Add(m_minWidthCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer18->Add(itemBoxSizer28, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); + + m_minWidth = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MIN_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); + m_minWidth->SetHelpText(_("The object minimum width.")); + if (wxRichTextSizePage::ShowToolTips()) + m_minWidth->SetToolTip(_("The object minimum width.")); + itemBoxSizer28->Add(m_minWidth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxArrayString m_unitsMinWStrings; + m_unitsMinWStrings.Add(_("px")); + m_unitsMinWStrings.Add(_("cm")); + m_unitsMinWStrings.Add(_("percent")); + m_unitsMinW = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MIN_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMinWStrings, wxCB_READONLY ); + m_unitsMinW->SetStringSelection(_("px")); + m_unitsMinW->SetHelpText(_("Units for the minimum object width.")); + if (wxRichTextSizePage::ShowToolTips()) + m_unitsMinW->SetToolTip(_("Units for the minimum object width.")); + itemBoxSizer28->Add(m_unitsMinW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + m_minHeightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MIN_HEIGHT_CHECKBOX, _("Min height:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_minHeightCheckbox->SetValue(false); + m_minHeightCheckbox->SetHelpText(_("Enable the minimum height value.")); + if (wxRichTextSizePage::ShowToolTips()) + m_minHeightCheckbox->SetToolTip(_("Enable the minimum height value.")); + itemFlexGridSizer18->Add(m_minHeightCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxBoxSizer* itemBoxSizer32 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer18->Add(itemBoxSizer32, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); + + m_minHeight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MIN_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); + m_minHeight->SetHelpText(_("The object minmum height.")); + if (wxRichTextSizePage::ShowToolTips()) + m_minHeight->SetToolTip(_("The object minmum height.")); + itemBoxSizer32->Add(m_minHeight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxArrayString m_unitsMinHStrings; + m_unitsMinHStrings.Add(_("px")); + m_unitsMinHStrings.Add(_("cm")); + m_unitsMinHStrings.Add(_("percent")); + m_unitsMinH = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MIN_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMinHStrings, wxCB_READONLY ); + m_unitsMinH->SetStringSelection(_("px")); + m_unitsMinH->SetHelpText(_("Units for the minimum object height.")); + if (wxRichTextSizePage::ShowToolTips()) + m_unitsMinH->SetToolTip(_("Units for the minimum object height.")); + itemBoxSizer32->Add(m_unitsMinH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + m_maxWidthCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MAX_WIDTH_CHECKBOX, _("Max width:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maxWidthCheckbox->SetValue(false); + m_maxWidthCheckbox->SetHelpText(_("Enable the maximum width value.")); + if (wxRichTextSizePage::ShowToolTips()) + m_maxWidthCheckbox->SetToolTip(_("Enable the maximum width value.")); + itemFlexGridSizer18->Add(m_maxWidthCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer18->Add(itemBoxSizer36, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); + + m_maxWidth = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MAX_WIDTH, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); + m_maxWidth->SetHelpText(_("The object maximum width.")); + if (wxRichTextSizePage::ShowToolTips()) + m_maxWidth->SetToolTip(_("The object maximum width.")); + itemBoxSizer36->Add(m_maxWidth, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxArrayString m_unitsMaxWStrings; + m_unitsMaxWStrings.Add(_("px")); + m_unitsMaxWStrings.Add(_("cm")); + m_unitsMaxWStrings.Add(_("percent")); + m_unitsMaxW = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MAX_W, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMaxWStrings, wxCB_READONLY ); + m_unitsMaxW->SetStringSelection(_("px")); + m_unitsMaxW->SetHelpText(_("Units for the maximum object width.")); + if (wxRichTextSizePage::ShowToolTips()) + m_unitsMaxW->SetToolTip(_("Units for the maximum object width.")); + itemBoxSizer36->Add(m_unitsMaxW, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + + m_maxHeightCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_MAX_HEIGHT_CHECKBOX, _("Max height:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_maxHeightCheckbox->SetValue(false); + m_maxHeightCheckbox->SetHelpText(_("Enable the height value.")); + if (wxRichTextSizePage::ShowToolTips()) + m_maxHeightCheckbox->SetToolTip(_("Enable the height value.")); + itemFlexGridSizer18->Add(m_maxHeightCheckbox, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxBoxSizer* itemBoxSizer40 = new wxBoxSizer(wxHORIZONTAL); + itemFlexGridSizer18->Add(itemBoxSizer40, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 5); + + m_maxHeight = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_MAX_HEIGHT, wxEmptyString, wxDefaultPosition, wxSize(60, -1), 0 ); + m_maxHeight->SetHelpText(_("The object maximum height.")); + if (wxRichTextSizePage::ShowToolTips()) + m_maxHeight->SetToolTip(_("The object maximum height.")); + itemBoxSizer40->Add(m_maxHeight, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + + wxArrayString m_unitsMaxHStrings; + m_unitsMaxHStrings.Add(_("px")); + m_unitsMaxHStrings.Add(_("cm")); + m_unitsMaxHStrings.Add(_("percent")); + m_unitsMaxH = new wxComboBox( itemRichTextDialogPage1, ID_RICHTEXT_UNITS_MAX_H, _("px"), wxDefaultPosition, wxSize(60, -1), m_unitsMaxHStrings, wxCB_READONLY ); + m_unitsMaxH->SetStringSelection(_("px")); + m_unitsMaxH->SetHelpText(_("Units for the maximum object height.")); + if (wxRichTextSizePage::ShowToolTips()) + m_unitsMaxH->SetToolTip(_("Units for the maximum object height.")); + itemBoxSizer40->Add(m_unitsMaxH, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_alignmentControls = new wxBoxSizer(wxVERTICAL); m_parentSizer->Add(m_alignmentControls, 0, wxGROW, 5); - wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); - m_alignmentControls->Add(itemBoxSizer28, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer44 = new wxBoxSizer(wxHORIZONTAL); + m_alignmentControls->Add(itemBoxSizer44, 0, wxGROW, 5); - wxStaticText* itemStaticText29 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText29->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); - itemBoxSizer28->Add(itemStaticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText45 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Alignment"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText45->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemBoxSizer44->Add(itemStaticText45, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticLine* itemStaticLine30 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - itemBoxSizer28->Add(itemStaticLine30, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticLine* itemStaticLine46 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + itemBoxSizer44->Add(itemStaticLine46, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer31 = new wxBoxSizer(wxHORIZONTAL); - m_alignmentControls->Add(itemBoxSizer31, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer47 = new wxBoxSizer(wxHORIZONTAL); + m_alignmentControls->Add(itemBoxSizer47, 0, wxGROW, 5); - itemBoxSizer31->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer47->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_verticalAlignmentCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_VERTICAL_ALIGNMENT_CHECKBOX, _("&Vertical alignment:"), wxDefaultPosition, wxDefaultSize, 0 ); m_verticalAlignmentCheckbox->SetValue(false); m_verticalAlignmentCheckbox->SetHelpText(_("Enable vertical alignment.")); if (wxRichTextSizePage::ShowToolTips()) m_verticalAlignmentCheckbox->SetToolTip(_("Enable vertical alignment.")); - itemBoxSizer31->Add(m_verticalAlignmentCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer47->Add(m_verticalAlignmentCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_verticalAlignmentComboBoxStrings; m_verticalAlignmentComboBoxStrings.Add(_("Top")); @@ -285,45 +421,45 @@ void wxRichTextSizePage::CreateControls() m_verticalAlignmentComboBox->SetHelpText(_("Vertical alignment.")); if (wxRichTextSizePage::ShowToolTips()) m_verticalAlignmentComboBox->SetToolTip(_("Vertical alignment.")); - itemBoxSizer31->Add(m_verticalAlignmentComboBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer47->Add(m_verticalAlignmentComboBox, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_positionControls = new wxBoxSizer(wxVERTICAL); m_parentSizer->Add(m_positionControls, 0, wxGROW, 5); - wxBoxSizer* itemBoxSizer36 = new wxBoxSizer(wxHORIZONTAL); - m_positionControls->Add(itemBoxSizer36, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer52 = new wxBoxSizer(wxHORIZONTAL); + m_positionControls->Add(itemBoxSizer52, 0, wxGROW, 5); - wxStaticText* itemStaticText37 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Position"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticText37->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); - itemBoxSizer36->Add(itemStaticText37, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText53 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("Position"), wxDefaultPosition, wxDefaultSize, 0 ); + itemStaticText53->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT(""))); + itemBoxSizer52->Add(itemStaticText53, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxStaticLine* itemStaticLine38 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - itemBoxSizer36->Add(itemStaticLine38, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticLine* itemStaticLine54 = new wxStaticLine( itemRichTextDialogPage1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + itemBoxSizer52->Add(itemStaticLine54, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxBoxSizer* itemBoxSizer39 = new wxBoxSizer(wxHORIZONTAL); - m_positionControls->Add(itemBoxSizer39, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer55 = new wxBoxSizer(wxHORIZONTAL); + m_positionControls->Add(itemBoxSizer55, 0, wxGROW, 5); - itemBoxSizer39->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer55->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_moveObjectParentSizer = new wxBoxSizer(wxVERTICAL); - itemBoxSizer39->Add(m_moveObjectParentSizer, 0, wxALIGN_TOP, 5); + itemBoxSizer55->Add(m_moveObjectParentSizer, 0, wxALIGN_TOP, 5); - wxBoxSizer* itemBoxSizer42 = new wxBoxSizer(wxHORIZONTAL); - m_moveObjectParentSizer->Add(itemBoxSizer42, 0, wxGROW, 5); + wxBoxSizer* itemBoxSizer58 = new wxBoxSizer(wxHORIZONTAL); + m_moveObjectParentSizer->Add(itemBoxSizer58, 0, wxGROW, 5); m_offsetYCheckbox = new wxCheckBox( itemRichTextDialogPage1, ID_RICHTEXT_OFFSET_CHECKBOX, _("Vertical &Offset:"), wxDefaultPosition, wxDefaultSize, 0 ); m_offsetYCheckbox->SetValue(false); m_offsetYCheckbox->SetHelpText(_("Enable vertical offset.")); if (wxRichTextSizePage::ShowToolTips()) m_offsetYCheckbox->SetToolTip(_("Enable vertical offset.")); - itemBoxSizer42->Add(m_offsetYCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + itemBoxSizer58->Add(m_offsetYCheckbox, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); m_offset = new wxTextCtrl( itemRichTextDialogPage1, ID_RICHTEXT_OFFSET, wxEmptyString, wxDefaultPosition, wxSize(65, -1), 0 ); m_offset->SetMaxLength(10); m_offset->SetHelpText(_("The vertical offset relative to the paragraph.")); if (wxRichTextSizePage::ShowToolTips()) m_offset->SetToolTip(_("The vertical offset relative to the paragraph.")); - itemBoxSizer42->Add(m_offset, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + itemBoxSizer58->Add(m_offset, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); wxArrayString m_unitsOffsetStrings; m_unitsOffsetStrings.Add(_("px")); @@ -333,25 +469,25 @@ void wxRichTextSizePage::CreateControls() m_unitsOffset->SetHelpText(_("Units for the object offset.")); if (wxRichTextSizePage::ShowToolTips()) m_unitsOffset->SetToolTip(_("Units for the object offset.")); - itemBoxSizer42->Add(m_unitsOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemBoxSizer58->Add(m_unitsOffset, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_moveObjectSizer = new wxBoxSizer(wxHORIZONTAL); m_moveObjectParentSizer->Add(m_moveObjectSizer, 0, wxGROW, 5); - wxStaticText* itemStaticText47 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Move the object to:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_moveObjectSizer->Add(itemStaticText47, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxStaticText* itemStaticText63 = new wxStaticText( itemRichTextDialogPage1, wxID_STATIC, _("&Move the object to:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_moveObjectSizer->Add(itemStaticText63, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxButton* itemButton48 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_UP, _("&Previous Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton48->SetHelpText(_("Moves the object to the previous paragraph.")); + wxButton* itemButton64 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_UP, _("&Previous Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton64->SetHelpText(_("Moves the object to the previous paragraph.")); if (wxRichTextSizePage::ShowToolTips()) - itemButton48->SetToolTip(_("Moves the object to the previous paragraph.")); - m_moveObjectSizer->Add(itemButton48, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + itemButton64->SetToolTip(_("Moves the object to the previous paragraph.")); + m_moveObjectSizer->Add(itemButton64, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxButton* itemButton49 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_DOWN, _("&Next Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton49->SetHelpText(_("Moves the object to the next paragraph.")); + wxButton* itemButton65 = new wxButton( itemRichTextDialogPage1, ID_RICHTEXT_PARA_DOWN, _("&Next Paragraph"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton65->SetHelpText(_("Moves the object to the next paragraph.")); if (wxRichTextSizePage::ShowToolTips()) - itemButton49->SetToolTip(_("Moves the object to the next paragraph.")); - m_moveObjectSizer->Add(itemButton49, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); + itemButton65->SetToolTip(_("Moves the object to the next paragraph.")); + m_moveObjectSizer->Add(itemButton65, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); ////@end wxRichTextSizePage content construction } @@ -416,6 +552,10 @@ bool wxRichTextSizePage::TransferDataToWindow() wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width, m_unitsW, m_widthCheckbox); wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height, m_unitsH, m_heightCheckbox); + wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth, m_unitsMinW, m_minWidthCheckbox); + wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight, m_unitsMinH, m_minHeightCheckbox); + wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth, m_unitsMaxW, m_maxWidthCheckbox); + wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight, m_unitsMaxH, m_maxHeightCheckbox); wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_offset, m_unitsOffset, m_offsetYCheckbox); return true; @@ -437,6 +577,10 @@ bool wxRichTextSizePage::TransferDataFromWindow() wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetWidth(), m_width, m_unitsW, m_widthCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetHeight(), m_height, m_unitsH, m_heightCheckbox); + wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetWidth(), m_minWidth, m_unitsMinW, m_minWidthCheckbox); + wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMinSize().GetHeight(), m_minHeight, m_unitsMinH, m_minHeightCheckbox); + wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetWidth(), m_maxWidth, m_unitsMaxW, m_maxWidthCheckbox); + wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetMaxSize().GetHeight(), m_maxHeight, m_unitsMaxH, m_maxHeightCheckbox); wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetTop(), m_offset, m_unitsOffset, m_offsetYCheckbox); return true; @@ -625,3 +769,41 @@ void wxRichTextSizePage::OnRichtextVerticalAlignmentComboboxUpdate( wxUpdateUIEv event.Enable(m_verticalAlignmentCheckbox->GetValue()); } + +/*! + * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_WIDTH + */ + +void wxRichTextSizePage::OnRichtextMinWidthUpdate( wxUpdateUIEvent& event ) +{ + event.Enable(m_minWidthCheckbox->GetValue()); +} + +/*! + * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MIN_HEIGHT + */ + +void wxRichTextSizePage::OnRichtextMinHeightUpdate( wxUpdateUIEvent& event ) +{ + event.Enable(m_minHeightCheckbox->GetValue()); +} + + +/*! + * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_WIDTH + */ + +void wxRichTextSizePage::OnRichtextMaxWidthUpdate( wxUpdateUIEvent& event ) +{ + event.Enable(m_maxWidthCheckbox->GetValue()); +} + + +/*! + * wxEVT_UPDATE_UI event handler for ID_RICHTEXT_MAX_HEIGHT + */ + +void wxRichTextSizePage::OnRichtextMaxHeightUpdate( wxUpdateUIEvent& event ) +{ + event.Enable(m_maxHeightCheckbox->GetValue()); +} diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index a8d3894417..adc89322c3 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -1193,6 +1193,10 @@ wxString wxRichTextXMLHandler::AddAttributes(const wxRichTextAttr& attr, bool is AddAttribute(str, wxT("outline"), attr.GetTextBoxAttr().GetOutline()); AddAttribute(str, wxT("width"), attr.GetTextBoxAttr().GetWidth()); AddAttribute(str, wxT("height"), attr.GetTextBoxAttr().GetHeight()); + AddAttribute(str, wxT("minwidth"), attr.GetTextBoxAttr().GetMinSize().GetWidth()); + AddAttribute(str, wxT("minheight"), attr.GetTextBoxAttr().GetMinSize().GetHeight()); + AddAttribute(str, wxT("maxwidth"), attr.GetTextBoxAttr().GetMaxSize().GetWidth()); + AddAttribute(str, wxT("maxheight"), attr.GetTextBoxAttr().GetMaxSize().GetHeight()); if (attr.GetTextBoxAttr().HasVerticalAlignment()) { @@ -1484,6 +1488,10 @@ bool wxRichTextXMLHandler::AddAttributes(wxXmlNode* node, wxRichTextAttr& attr, AddAttribute(node, wxT("outline"), attr.GetTextBoxAttr().GetOutline()); AddAttribute(node, wxT("width"), attr.GetTextBoxAttr().GetWidth()); AddAttribute(node, wxT("height"), attr.GetTextBoxAttr().GetHeight()); + AddAttribute(node, wxT("minwidth"), attr.GetTextBoxAttr().GetMinSize().GetWidth()); + AddAttribute(node, wxT("minheight"), attr.GetTextBoxAttr().GetMinSize().GetHeight()); + AddAttribute(node, wxT("maxwidth"), attr.GetTextBoxAttr().GetMaxSize().GetWidth()); + AddAttribute(node, wxT("maxheight"), attr.GetTextBoxAttr().GetMaxSize().GetHeight()); if (attr.GetTextBoxAttr().HasVerticalAlignment()) { @@ -1863,6 +1871,22 @@ bool wxRichTextXMLHandler::ImportStyle(wxRichTextAttr& attr, wxXmlNode* node, bo { attr.GetTextBoxAttr().GetHeight().SetValue(wxRichTextParseDimension(value)); } + else if (name == wxT("minwidth")) + { + attr.GetTextBoxAttr().GetMinSize().GetWidth().SetValue(wxRichTextParseDimension(value)); + } + else if (name == wxT("minheight")) + { + attr.GetTextBoxAttr().GetMinSize().GetHeight().SetValue(wxRichTextParseDimension(value)); + } + else if (name == wxT("maxwidth")) + { + attr.GetTextBoxAttr().GetMaxSize().GetWidth().SetValue(wxRichTextParseDimension(value)); + } + else if (name == wxT("maxheight")) + { + attr.GetTextBoxAttr().GetMaxSize().GetHeight().SetValue(wxRichTextParseDimension(value)); + } else if (name == wxT("verticalalignment")) { -- 2.45.2