28#include <sfx2/sfxsids.hrc>
50 if (eState != SfxItemState::DEFAULT || pState->
IsVoidItem())
52 auto pStringItem =
dynamic_cast<const SfxStringItem*
>(pState);
55 SAL_WARN(
"sd",
"Item wasn't a SfxStringItem");
63 if (rCEvt.
GetCommand() != CommandEventId::ContextMenu
77 std::unique_ptr<weld::Builder> xBuilder(
79 std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu(
"menu"));
81 sal_uInt16 aTable[12] = { 1, 2, 4, 5, 8, 10, 16, 20, 30, 40, 50, 100 };
83 for (sal_uInt16
i = 11;
i > 0;
i--)
84 xPopup->append(OUString::number(12 -
i), OUString::number(aTable[
i]) +
":1");
85 for (sal_uInt16
i = 0;
i < 12;
i++)
86 xPopup->append(OUString::number(12 +
i),
"1:" + OUString::number(aTable[
i]));
90 OUString sResult = xPopup->popup_at_rect(pParent, aRect);
91 if (sResult.isEmpty())
94 sal_Int32
i = sResult.toUInt32();
100 nX = aTable[(12 -
i) % 12];
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
virtual void StateChangedAtStatusBarControl(sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem *pState) override
virtual ~SdScaleControl() override
virtual void Command(const CommandEvent &rCEvt) override
SdScaleControl(sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb)
void SetUIScale(const Fraction &rScale)
void Invalidate(sal_uInt16 nId)
virtual bool IsVoidItem() const
StatusBar & GetStatusBar() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
void SetItemText(sal_uInt16 nItemId, const OUString &rText, int nCharsWidth=-1)
void SetQuickHelpText(sal_uInt16 nItemId, const OUString &rText)
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
static ViewShellBase * GetViewShellBase(SfxViewFrame const *pFrame)
When given a view frame this static method returns the corresponding sd::ViewShellBase object.
void UpdateBorder(bool bForce=false)
Update the border that is set with SfxViewShell::SetBorderPixel().
SdDrawDocument * GetDocument() const
#define SAL_WARN(area, stream)
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
SFX_IMPL_STATUSBAR_CONTROL(SdScaleControl, SfxStringItem)
OUString SdResId(TranslateId aId)