LibreOffice Module svx (master) 1
|
This control allows to input a rotation angle, visualized by a dial. More...
#include <dialcontrol.hxx>
Classes | |
struct | DialControl_Impl |
Public Member Functions | |
virtual void | SetDrawingArea (weld::DrawingArea *pDrawingArea) override |
virtual void | Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override |
virtual void | StyleUpdated () override |
virtual bool | MouseButtonDown (const MouseEvent &rMEvt) override |
virtual bool | MouseMove (const MouseEvent &rMEvt) override |
virtual bool | MouseButtonUp (const MouseEvent &rMEvt) override |
virtual bool | KeyInput (const KeyEvent &rKEvt) override |
virtual void | LoseFocus () override |
virtual void | Resize () override |
Degree100 | GetRotation () const |
Returns the current rotation angle in 1/100 degrees. More... | |
void | SetRotation (Degree100 nAngle) |
Sets the rotation to the passed value (in 1/100 degrees). More... | |
bool | HasRotation () const |
Returns true, if the control is not in "don't care" state. More... | |
void | SetNoRotation () |
Sets the control to "don't care" state. More... | |
void | SetLinkedField (weld::MetricSpinButton *pField, sal_Int32 nDecimalPlaces=0) |
Links the passed numeric edit field to the control (bi-directional). More... | |
void | SaveValue () |
Save value for later comparison. More... | |
bool | IsValueModified () const |
Compare value with the saved value. More... | |
const OUString & | GetText () const |
void | SetText (const OUString &rText) |
void | SetModifyHdl (const Link< DialControl &, void > &rLink) |
void | Init (const Size &rWinSize) |
void | set_visible (bool bVisible) |
Public Member Functions inherited from weld::CustomWidgetController | |
virtual css::uno::Reference< css::accessibility::XAccessible > | CreateAccessible () |
virtual void | Paint (vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)=0 |
virtual void | Resize () |
virtual bool | MouseButtonDown (const MouseEvent &) |
virtual bool | MouseMove (const MouseEvent &) |
virtual bool | MouseButtonUp (const MouseEvent &) |
virtual void | GetFocus () |
virtual void | LoseFocus () |
virtual void | StyleUpdated () |
virtual bool | Command (const CommandEvent &) |
virtual bool | KeyInput (const KeyEvent &) |
virtual tools::Rectangle | GetFocusRect () |
virtual FactoryFunction | GetUITestFactory () const |
virtual OUString | RequestHelp (tools::Rectangle &) |
virtual OUString | GetHelpText () const |
Size const & | GetOutputSizePixel () const |
void | SetOutputSizePixel (const Size &rSize) |
virtual void | SetDrawingArea (weld::DrawingArea *pDrawingArea) |
weld::DrawingArea * | GetDrawingArea () const |
void | Invalidate () |
void | Invalidate (const tools::Rectangle &rRect) |
virtual void | Show () |
virtual void | Hide () |
void | SetCursor (void *pData) |
void | GrabFocus () |
bool | HasFocus () const |
bool | HasChildFocus () const |
bool | IsVisible () const |
bool | IsReallyVisible () const |
bool | IsEnabled () const |
void | Enable () const |
void | Disable () const |
bool | IsActive () const |
int | GetTextHeight () const |
int | GetTextWidth (const OUString &rText) const |
OUString | GetAccessibleName () const |
OUString | GetAccessibleDescription () const |
void | CaptureMouse () |
bool | IsMouseCaptured () const |
Point | GetPointerPosPixel () const |
void | EnableRTL (bool bEnable) |
bool | IsRTLEnabled () const |
void | ReleaseMouse () |
void | SetPointer (PointerStyle ePointerStyle) |
void | SetHelpId (const OUString &rHelpId) |
void | SetAccessibleName (const OUString &rName) |
void | SetInputContext (const InputContext &rInputContext) |
void | SetCursorRect (const tools::Rectangle &rCursorRect, int nExtTextInputWidth) |
virtual int | GetSurroundingText (OUString &) |
virtual bool | DeleteSurroundingText (const Selection &) |
css::uno::Reference< css::datatransfer::dnd::XDropTarget > | GetDropTarget () |
css::uno::Reference< css::datatransfer::clipboard::XClipboard > | GetClipboard () const |
void | SetDragDataTransferable (rtl::Reference< TransferDataContainer > &rTransferable, sal_uInt8 eDNDConstants) |
virtual bool | StartDrag () |
void | set_size_request (int nWidth, int nHeight) |
void | queue_resize () |
CustomWidgetController () | |
virtual | ~CustomWidgetController () |
CustomWidgetController (CustomWidgetController const &)=default | |
CustomWidgetController (CustomWidgetController &&)=default | |
CustomWidgetController & | operator= (CustomWidgetController const &)=default |
CustomWidgetController & | operator= (CustomWidgetController &&)=default |
Private Member Functions | |
void | HandleMouseEvent (const Point &rPos, bool bInitial) |
void | HandleEscapeEvent () |
void | SetRotation (Degree100 nAngle, bool bBroadcast) |
void | Init (const Size &rWinSize, const vcl::Font &rWinFont) |
void | InvalidateControl () |
DECL_DLLPRIVATE_LINK (LinkedFieldModifyHdl, weld::MetricSpinButton &, void) | |
Private Attributes | |
std::unique_ptr< DialControl_Impl > | mpImpl |
Additional Inherited Members | |
Static Public Member Functions inherited from weld::CustomWidgetController | |
static bool | IsUpdateMode () |
This control allows to input a rotation angle, visualized by a dial.
Usage: A single click sets a rotation angle rounded to steps of 15 degrees. Dragging with the left mouse button sets an exact rotation angle. Pressing the ESCAPE key during mouse drag cancels the operation and restores the old state of the control.
It is possible to link a numeric field to this control using the function SetLinkedField(). The DialControl will take full control of this numeric field:
Definition at line 75 of file dialcontrol.hxx.
|
private |
Degree100 svx::DialControl::GetRotation | ( | ) | const |
Returns the current rotation angle in 1/100 degrees.
Definition at line 352 of file dialcontrol.cxx.
References mpImpl.
Referenced by SetRotation().
|
inline |
Definition at line 115 of file dialcontrol.hxx.
Referenced by InvalidateControl().
|
private |
Definition at line 466 of file dialcontrol.cxx.
References weld::CustomWidgetController::IsMouseCaptured(), mpImpl, weld::CustomWidgetController::ReleaseMouse(), and SetRotation().
Referenced by KeyInput(), and LoseFocus().
|
private |
Definition at line 447 of file dialcontrol.cxx.
References mpImpl, SetRotation(), Point::X(), and Point::Y().
Referenced by MouseButtonDown(), and MouseMove().
bool svx::DialControl::HasRotation | ( | ) | const |
Returns true, if the control is not in "don't care" state.
Definition at line 336 of file dialcontrol.cxx.
References mpImpl.
void svx::DialControl::Init | ( | const Size & | rWinSize | ) |
Definition at line 404 of file dialcontrol.cxx.
References OutputDevice::GetDefaultFont(), vcl::Font::GetFontHeight(), StyleSettings::GetLabelFont(), Application::GetSettings(), AllSettings::GetStyleSettings(), Init(), and vcl::Font::SetFontHeight().
Referenced by Init(), SetDrawingArea(), and StyleUpdated().
Definition at line 397 of file dialcontrol.cxx.
References weld::CustomWidgetController::EnableRTL(), mpImpl, and weld::CustomWidgetController::SetOutputSizePixel().
|
private |
Definition at line 416 of file dialcontrol.cxx.
References GetText(), weld::CustomWidgetController::Invalidate(), weld::CustomWidgetController::IsEnabled(), and mpImpl.
Referenced by Resize(), SetNoRotation(), SetRotation(), and StyleUpdated().
bool svx::DialControl::IsValueModified | ( | ) | const |
Compare value with the saved value.
Definition at line 392 of file dialcontrol.cxx.
References mpImpl.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 319 of file dialcontrol.cxx.
References vcl::KeyCode::GetCode(), KeyEvent::GetKeyCode(), vcl::KeyCode::GetModifier(), HandleEscapeEvent(), and KEY_ESCAPE.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 330 of file dialcontrol.cxx.
References HandleEscapeEvent().
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 289 of file dialcontrol.cxx.
References weld::CustomWidgetController::CaptureMouse(), MouseEvent::GetPosPixel(), weld::CustomWidgetController::GrabFocus(), HandleMouseEvent(), MouseEvent::IsLeft(), and mpImpl.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 308 of file dialcontrol.cxx.
References weld::CustomWidgetController::IsMouseCaptured(), mpImpl, and weld::CustomWidgetController::ReleaseMouse().
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 301 of file dialcontrol.cxx.
References MouseEvent::GetPosPixel(), HandleMouseEvent(), MouseEvent::IsLeft(), and weld::CustomWidgetController::IsMouseCaptured().
|
overridevirtual |
Implements weld::CustomWidgetController.
Definition at line 276 of file dialcontrol.cxx.
References OutputDevice::DrawBitmapEx(), and mpImpl.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 270 of file dialcontrol.cxx.
References weld::CustomWidgetController::GetOutputSizePixel(), InvalidateControl(), and mpImpl.
void svx::DialControl::SaveValue | ( | ) |
|
inline |
Definition at line 122 of file dialcontrol.hxx.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 257 of file dialcontrol.cxx.
References weld::Widget::get_approximate_digit_width(), weld::DrawingArea::get_ref_device(), weld::Widget::get_text_height(), Size::Height(), Init(), mpImpl, weld::Widget::set_size_request(), and Size::Width().
void svx::DialControl::SetLinkedField | ( | weld::MetricSpinButton * | pField, |
sal_Int32 | nDecimalPlaces = 0 |
||
) |
Links the passed numeric edit field to the control (bi-directional).
nDecimalPlaces: field value is unsign given decimal places default is 0 which means field values are in degrees, 2 means 100th of degree
Definition at line 362 of file dialcontrol.cxx.
References weld::MetricSpinButton::connect_value_changed(), LINK, and mpImpl.
void svx::DialControl::SetModifyHdl | ( | const Link< DialControl &, void > & | rLink | ) |
Definition at line 442 of file dialcontrol.cxx.
References mpImpl.
void svx::DialControl::SetNoRotation | ( | ) |
Sets the control to "don't care" state.
Definition at line 341 of file dialcontrol.cxx.
References InvalidateControl(), and mpImpl.
void svx::DialControl::SetRotation | ( | Degree100 | nAngle | ) |
Sets the rotation to the passed value (in 1/100 degrees).
Definition at line 357 of file dialcontrol.cxx.
References SetRotation().
Referenced by HandleEscapeEvent(), HandleMouseEvent(), svx::IMPL_LINK_NOARG(), and SetRotation().
|
private |
Definition at line 424 of file dialcontrol.cxx.
References get(), GetRotation(), InvalidateControl(), mpImpl, and NormAngle36000().
|
inline |
Definition at line 116 of file dialcontrol.hxx.
|
overridevirtual |
Reimplemented from weld::CustomWidgetController.
Definition at line 282 of file dialcontrol.cxx.
References Init(), InvalidateControl(), and mpImpl.
|
private |
Definition at line 152 of file dialcontrol.hxx.
Referenced by GetRotation(), HandleEscapeEvent(), HandleMouseEvent(), HasRotation(), svx::IMPL_LINK_NOARG(), Init(), InvalidateControl(), IsValueModified(), MouseButtonDown(), MouseButtonUp(), Paint(), Resize(), SaveValue(), SetDrawingArea(), SetLinkedField(), SetModifyHdl(), SetNoRotation(), SetRotation(), and StyleUpdated().