Removed rounding that didn't work for negative numbers; added ability to hide "move object" controls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
4d331cea32
commit
ba7e065a34
@ -257,6 +257,7 @@ protected:
|
||||
wxRichTextObject* m_object;
|
||||
wxArrayInt m_pageIds; // mapping of book control indexes to page ids
|
||||
int m_options; // UI options
|
||||
bool m_ignoreUpdates;
|
||||
|
||||
static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory;
|
||||
static bool sm_showToolTips;
|
||||
|
@ -103,6 +103,9 @@ public:
|
||||
/// Enable the checkboxes for position and size
|
||||
static void EnablePositionAndSizeCheckboxes(bool enable) { sm_enablePositionAndSizeCheckboxes = enable; }
|
||||
|
||||
/// Enable the move object controls
|
||||
static void ShowMoveObjectControls(bool enable) { sm_showMoveObjectControls = enable; }
|
||||
|
||||
////@begin wxRichTextSizePage event handler declarations
|
||||
|
||||
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
|
||||
@ -294,6 +297,7 @@ public:
|
||||
static bool sm_showFloatingAndAlignmentControls;
|
||||
static bool sm_enablePositionAndSizeUnits;
|
||||
static bool sm_enablePositionAndSizeCheckboxes;
|
||||
static bool sm_showMoveObjectControls;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -102,6 +102,7 @@ void wxRichTextFormattingDialog::Init()
|
||||
m_styleSheet = NULL;
|
||||
m_object = NULL;
|
||||
m_options = 0;
|
||||
m_ignoreUpdates = false;
|
||||
}
|
||||
|
||||
wxRichTextFormattingDialog::~wxRichTextFormattingDialog()
|
||||
@ -138,7 +139,11 @@ bool wxRichTextFormattingDialog::Create(long flags, wxWindow* parent, const wxSt
|
||||
{
|
||||
int idx = m_pageIds.Index(sm_lastPage);
|
||||
if (idx != -1)
|
||||
{
|
||||
m_ignoreUpdates = true;
|
||||
GetBookCtrl()->SetSelection(idx);
|
||||
m_ignoreUpdates = false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -224,6 +229,9 @@ bool wxRichTextFormattingDialog::UpdateDisplay()
|
||||
/// up to date
|
||||
void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event)
|
||||
{
|
||||
if (m_ignoreUpdates)
|
||||
return;
|
||||
|
||||
if (GetBookCtrl() != event.GetEventObject())
|
||||
{
|
||||
event.Skip();
|
||||
@ -703,7 +711,7 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
|
||||
float value = 0.0;
|
||||
wxSscanf(str.c_str(), wxT("%f"), &value);
|
||||
// Convert from cm
|
||||
ret = (int) ((value * 100.0) + 0.5);
|
||||
ret = (int) ((value * 100.0) /* + 0.5 */);
|
||||
return true;
|
||||
}
|
||||
else if (unit == wxTEXT_ATTR_UNITS_PERCENTAGE)
|
||||
@ -715,7 +723,7 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
|
||||
{
|
||||
float value = 0.0;
|
||||
wxSscanf(str.c_str(), wxT("%f"), &value);
|
||||
ret = (int) ((value * 100.0) + 0.5);
|
||||
ret = (int) ((value * 100.0) /* + 0.5 */);
|
||||
}
|
||||
else if (unit == wxTEXT_ATTR_UNITS_POINTS)
|
||||
{
|
||||
|
@ -65,6 +65,7 @@ bool wxRichTextSizePage::sm_showAlignmentControls = true;
|
||||
bool wxRichTextSizePage::sm_showFloatingAndAlignmentControls = true;
|
||||
bool wxRichTextSizePage::sm_enablePositionAndSizeUnits = true;
|
||||
bool wxRichTextSizePage::sm_enablePositionAndSizeCheckboxes = true;
|
||||
bool wxRichTextSizePage::sm_showMoveObjectControls = true;
|
||||
|
||||
/*!
|
||||
* wxRichTextSizePage constructors
|
||||
@ -117,6 +118,7 @@ wxRichTextSizePage::~wxRichTextSizePage()
|
||||
sm_showMinMaxSizeControls = true;
|
||||
sm_showMinMaxSizeControls = true;
|
||||
sm_enablePositionAndSizeCheckboxes = true;
|
||||
sm_showMoveObjectControls = true;
|
||||
|
||||
////@begin wxRichTextSizePage destruction
|
||||
////@end wxRichTextSizePage destruction
|
||||
@ -741,6 +743,9 @@ void wxRichTextSizePage::CreateControls()
|
||||
|
||||
if (!sm_showPositionModeControls)
|
||||
m_moveObjectParentSizer->Show(m_positionModeSizer, false);
|
||||
|
||||
if (!sm_showMoveObjectControls)
|
||||
m_moveObjectParentSizer->Show(m_moveObjectSizer, false);
|
||||
}
|
||||
|
||||
wxRichTextAttr* wxRichTextSizePage::GetAttributes()
|
||||
|
Loading…
Reference in New Issue
Block a user