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:
@@ -257,6 +257,7 @@ protected:
|
|||||||
wxRichTextObject* m_object;
|
wxRichTextObject* m_object;
|
||||||
wxArrayInt m_pageIds; // mapping of book control indexes to page ids
|
wxArrayInt m_pageIds; // mapping of book control indexes to page ids
|
||||||
int m_options; // UI options
|
int m_options; // UI options
|
||||||
|
bool m_ignoreUpdates;
|
||||||
|
|
||||||
static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory;
|
static wxRichTextFormattingDialogFactory* ms_FormattingDialogFactory;
|
||||||
static bool sm_showToolTips;
|
static bool sm_showToolTips;
|
||||||
|
@@ -103,6 +103,9 @@ public:
|
|||||||
/// Enable the checkboxes for position and size
|
/// Enable the checkboxes for position and size
|
||||||
static void EnablePositionAndSizeCheckboxes(bool enable) { sm_enablePositionAndSizeCheckboxes = enable; }
|
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
|
////@begin wxRichTextSizePage event handler declarations
|
||||||
|
|
||||||
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
|
/// wxEVT_UPDATE_UI event handler for ID_RICHTEXT_VERTICAL_ALIGNMENT_COMBOBOX
|
||||||
@@ -294,6 +297,7 @@ public:
|
|||||||
static bool sm_showFloatingAndAlignmentControls;
|
static bool sm_showFloatingAndAlignmentControls;
|
||||||
static bool sm_enablePositionAndSizeUnits;
|
static bool sm_enablePositionAndSizeUnits;
|
||||||
static bool sm_enablePositionAndSizeCheckboxes;
|
static bool sm_enablePositionAndSizeCheckboxes;
|
||||||
|
static bool sm_showMoveObjectControls;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -102,6 +102,7 @@ void wxRichTextFormattingDialog::Init()
|
|||||||
m_styleSheet = NULL;
|
m_styleSheet = NULL;
|
||||||
m_object = NULL;
|
m_object = NULL;
|
||||||
m_options = 0;
|
m_options = 0;
|
||||||
|
m_ignoreUpdates = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRichTextFormattingDialog::~wxRichTextFormattingDialog()
|
wxRichTextFormattingDialog::~wxRichTextFormattingDialog()
|
||||||
@@ -138,7 +139,11 @@ bool wxRichTextFormattingDialog::Create(long flags, wxWindow* parent, const wxSt
|
|||||||
{
|
{
|
||||||
int idx = m_pageIds.Index(sm_lastPage);
|
int idx = m_pageIds.Index(sm_lastPage);
|
||||||
if (idx != -1)
|
if (idx != -1)
|
||||||
|
{
|
||||||
|
m_ignoreUpdates = true;
|
||||||
GetBookCtrl()->SetSelection(idx);
|
GetBookCtrl()->SetSelection(idx);
|
||||||
|
m_ignoreUpdates = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -224,6 +229,9 @@ bool wxRichTextFormattingDialog::UpdateDisplay()
|
|||||||
/// up to date
|
/// up to date
|
||||||
void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event)
|
void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event)
|
||||||
{
|
{
|
||||||
|
if (m_ignoreUpdates)
|
||||||
|
return;
|
||||||
|
|
||||||
if (GetBookCtrl() != event.GetEventObject())
|
if (GetBookCtrl() != event.GetEventObject())
|
||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@@ -703,7 +711,7 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
|
|||||||
float value = 0.0;
|
float value = 0.0;
|
||||||
wxSscanf(str.c_str(), wxT("%f"), &value);
|
wxSscanf(str.c_str(), wxT("%f"), &value);
|
||||||
// Convert from cm
|
// Convert from cm
|
||||||
ret = (int) ((value * 100.0) + 0.5);
|
ret = (int) ((value * 100.0) /* + 0.5 */);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (unit == wxTEXT_ATTR_UNITS_PERCENTAGE)
|
else if (unit == wxTEXT_ATTR_UNITS_PERCENTAGE)
|
||||||
@@ -715,7 +723,7 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
|
|||||||
{
|
{
|
||||||
float value = 0.0;
|
float value = 0.0;
|
||||||
wxSscanf(str.c_str(), wxT("%f"), &value);
|
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)
|
else if (unit == wxTEXT_ATTR_UNITS_POINTS)
|
||||||
{
|
{
|
||||||
|
@@ -65,6 +65,7 @@ bool wxRichTextSizePage::sm_showAlignmentControls = true;
|
|||||||
bool wxRichTextSizePage::sm_showFloatingAndAlignmentControls = true;
|
bool wxRichTextSizePage::sm_showFloatingAndAlignmentControls = true;
|
||||||
bool wxRichTextSizePage::sm_enablePositionAndSizeUnits = true;
|
bool wxRichTextSizePage::sm_enablePositionAndSizeUnits = true;
|
||||||
bool wxRichTextSizePage::sm_enablePositionAndSizeCheckboxes = true;
|
bool wxRichTextSizePage::sm_enablePositionAndSizeCheckboxes = true;
|
||||||
|
bool wxRichTextSizePage::sm_showMoveObjectControls = true;
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* wxRichTextSizePage constructors
|
* wxRichTextSizePage constructors
|
||||||
@@ -117,6 +118,7 @@ wxRichTextSizePage::~wxRichTextSizePage()
|
|||||||
sm_showMinMaxSizeControls = true;
|
sm_showMinMaxSizeControls = true;
|
||||||
sm_showMinMaxSizeControls = true;
|
sm_showMinMaxSizeControls = true;
|
||||||
sm_enablePositionAndSizeCheckboxes = true;
|
sm_enablePositionAndSizeCheckboxes = true;
|
||||||
|
sm_showMoveObjectControls = true;
|
||||||
|
|
||||||
////@begin wxRichTextSizePage destruction
|
////@begin wxRichTextSizePage destruction
|
||||||
////@end wxRichTextSizePage destruction
|
////@end wxRichTextSizePage destruction
|
||||||
@@ -741,6 +743,9 @@ void wxRichTextSizePage::CreateControls()
|
|||||||
|
|
||||||
if (!sm_showPositionModeControls)
|
if (!sm_showPositionModeControls)
|
||||||
m_moveObjectParentSizer->Show(m_positionModeSizer, false);
|
m_moveObjectParentSizer->Show(m_positionModeSizer, false);
|
||||||
|
|
||||||
|
if (!sm_showMoveObjectControls)
|
||||||
|
m_moveObjectParentSizer->Show(m_moveObjectSizer, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRichTextAttr* wxRichTextSizePage::GetAttributes()
|
wxRichTextAttr* wxRichTextSizePage::GetAttributes()
|
||||||
|
Reference in New Issue
Block a user