70 double fSin = sin( fAngle );
71 double fCos = cos( fAngle );
75 if ( !rText.isEmpty() )
87 DrawText( aRect, rText,
mbEnabled ? DrawTextFlags::NONE : DrawTextFlags::Disable );
95 Point pt2( pt1.
X() + nDx, pt1.
Y() + nDy);
103 bool bMain = (nAngle % 4500_deg100) != 0_deg100;
198 aLightColor.
Merge( aFullColor, 128 );
200 for(
int nAngle = 0; nAngle < 360; nAngle += 15 )
202 SetLineColor( (nAngle % 45) ? aLightColor : aFullColor );
222 mpLinkField( nullptr ),
223 mnLinkedFieldValueMultiplyer( 0 ),
235 maWinFont = rWinFont;
237 mxBmpBuffered->InitBitmap(maWinFont);
247 maWinSize =
Size( nMin, nMin );
249 mnCenterX = maWinSize.Width() / 2;
250 mnCenterY = maWinSize.Height() / 2;
252 mxBmpEnabled->DrawBackground( maWinSize,
true );
253 mxBmpDisabled->DrawBackground( maWinSize,
false );
254 mxBmpBuffered->SetSize( maWinSize );
259 CustomWidgetController::SetDrawingArea(pDrawingArea);
263 Size aSize(nDim, nDim);
284 CustomWidgetController::StyleUpdated();
314 mpImpl->mpLinkField->grab_focus();
327 return CustomWidgetController::KeyInput(rKEvt);
348 mpImpl->mpLinkField->set_text(
"");
364 mpImpl->mnLinkedFieldValueMultiplyer = 100 / std::pow(10.0,
double(nDecimalPlaces));
373 mpImpl->mpLinkField = pField;
399 mpImpl->Init( rWinSize, rWinFont );
410 DefaultFontType::UI_SANS,
Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::OnlyOne ) );
413 Init( rWinSize, aFont );
426 bool bOldSel =
mpImpl->mbNoRot;
431 if (!bOldSel || (
mpImpl->mnAngle != nAngle))
438 mpImpl->maModifyHdl.Call(*
this);
444 mpImpl->maModifyHdl = rLink;
451 double fH = std::hypot( nX, nY );
454 double fAngle = acos( nX / fH );
455 sal_Int32 nAngle = basegfx::rad2deg<100>(fAngle);
457 nAngle = 36000 - nAngle;
459 nAngle = ((nAngle + 750) / 1500) * 1500;
461 nAngle = (((nAngle + 50) / 100) * 100) % 36000;
473 mpImpl->mpLinkField->grab_focus();
BaseContainerNodeSharedPtr & mrParent
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
void DecreaseLuminance(sal_uInt8 cLumDec)
void Merge(const Color &rMergeColor, sal_uInt8 cTransparency)
void IncreaseLuminance(sal_uInt8 cLumInc)
const vcl::KeyCode & GetKeyCode() const
const Point & GetPosPixel() const
virtual void SetSettings(const AllSettings &rSettings)
const vcl::Font & GetFont() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
void SetFont(const vcl::Font &rNewFont)
void DrawEllipse(const tools::Rectangle &rRect)
void DrawLine(const Point &rStartPt, const Point &rEndPt)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void DrawPie(const tools::Rectangle &rRect, const Point &rStartPt, const Point &rEndPt)
tools::Long GetTextHeight() const
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
const AllSettings & GetSettings() const
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetMenuColor() const
const Color & GetLabelTextColor() const
const vcl::Font & GetLabelFont() const
const Color & GetDialogColor() const
const Color & GetHighlightColor() const
const Color & GetDisableColor() const
const Color & GetButtonTextColor() const
virtual void EnableRTL(bool bEnable=true) override
bool SetOutputSize(const Size &rNewSize)
void DrawElements(const OUString &rText, Degree100 nAngle)
const Color & GetScaleLineColor() const
const Color & GetTextColor() const
const Color & GetButtonFillColor(bool bMain) const
void InitBitmap(const vcl::Font &rFont)
DialControlBmp(OutputDevice &rReference)
void CopyBackground(const DialControlBmp &rSrc)
void SetSize(const Size &rSize)
const Color & GetButtonLineColor() const
Color GetBackgroundColor() const override
This control allows to input a rotation angle, visualized by a dial.
virtual bool KeyInput(const KeyEvent &rKEvt) override
void HandleMouseEvent(const Point &rPos, bool bInitial)
void SaveValue()
Save value for later comparison.
void SetModifyHdl(const Link< DialControl &, void > &rLink)
virtual void LoseFocus() override
void Init(const Size &rWinSize)
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
bool IsValueModified() const
Compare value with the saved value.
const OUString & GetText() const
bool HasRotation() const
Returns true, if the control is not in "don't care" state.
Degree100 GetRotation() const
Returns the current rotation angle in 1/100 degrees.
void SetLinkedField(weld::MetricSpinButton *pField, sal_Int32 nDecimalPlaces=0)
Links the passed numeric edit field to the control (bi-directional).
std::unique_ptr< DialControl_Impl > mpImpl
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void Resize() override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
void SetNoRotation()
Sets the control to "don't care" state.
virtual void StyleUpdated() override
void SetRotation(Degree100 nAngle)
Sets the rotation to the passed value (in 1/100 degrees).
virtual bool MouseMove(const MouseEvent &rMEvt) override
tools::Long GetFontHeight() const
void SetOrientation(Degree10 nLineOrientation)
void SetTransparent(bool bTransparent)
void SetColor(const Color &)
void SetWeight(FontWeight)
void SetFontHeight(tools::Long nHeight)
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
virtual OutputDevice & get_ref_device()=0
constexpr sal_uInt16 KEY_ESCAPE
#define LINK(Instance, Class, Member)
constexpr double deg2rad(double v)
const tools::Long DIAL_OUTER_WIDTH
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
void Init(const Size &rWinSize, const vcl::Font &rWinFont)
void SetSize(const Size &rWinSize)
DialControl_Impl(OutputDevice &rReference)
Degree100 NormAngle36000(Degree100 a)
Normalize angle to -180.00..179.99.