42 switch( rNewEntryList.size() )
57 assert(rNewEntryList.size() % 3 == 0 &&
"ScScenarioListBox::UpdateEntries - wrong list size");
60 std::vector<OUString>::const_iterator iter;
61 for (iter = rNewEntryList.begin(); iter != rNewEntryList.end(); ++iter)
74 aEntry.
mbProtected = !(*iter).isEmpty() && (*iter)[0] !=
'0';
88 if (
const ScenarioEntry* pEntry = GetSelectedScenarioEntry())
89 SetComment(pEntry->maComment);
100 bool bHandled =
false;
120 bool bHandled =
false;
122 if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
124 if (
const ScenarioEntry* pEntry = GetSelectedScenarioEntry())
126 if (!pEntry->mbProtected)
129 std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu(
"menu"));
130 OUString sIdent(xPopup->popup_at_rect(m_xLbScenario.get(),
tools::Rectangle(rCEvt.GetMousePosPixel(),
Size(1,1))));
131 if (sIdent ==
"delete")
133 else if (sIdent ==
"edit")
154 pViewFrm->GetDispatcher()->ExecuteList(nSlotId,
155 SfxCallMode::SLOT | SfxCallMode::RECORD, { &aStringItem } );
176 VclMessageType::Question, VclButtonsType::YesNo,
177 ScResId(STR_QUERY_DELSCENARIO)));
178 xQueryBox->set_default_response(
RET_YES);
179 if (xQueryBox->run() ==
RET_YES)
187 const OUString& aQH_Comment)
188 : m_xLbScenario(rBuilder.weld_tree_view(
"scenariolist"))
189 , m_xEdComment(rBuilder.weld_text_view(
"scenariotext"))
207 rBindings.
Update( SID_SELECT_SCENARIO );
221 if (
auto pStringItem =
dynamic_cast<const SfxStringItem*
>( pState) )
223 const OUString& aNewEntry( pStringItem->GetValue() );
225 if (!aNewEntry.isEmpty())
230 else if (
auto pStringListItem =
dynamic_cast<const SfxStringListItem*
>( pState) )
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
std::unique_ptr< weld::TreeView > m_xLbScenario
void ExecuteScenarioSlot(sal_uInt16 nSlotId)
void NotifyState(const SfxPoolItem *pState)
const ScenarioEntry * GetSelectedScenarioEntry() const
void SetComment(const OUString &rComment)
std::unique_ptr< weld::TextView > m_xEdComment
ScScenarioWindow(weld::Builder &rBuilder, const OUString &rQH_List, const OUString &rQH_Comment)
std::vector< ScenarioEntry > m_aEntries
void UpdateEntries(const std::vector< OUString > &rNewEntryList)
void Update(sal_uInt16 nId)
void Invalidate(sal_uInt16 nId)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
sal_uInt16 GetCode() const
constexpr OUStringLiteral HID_SC_SCENWIN_TOP
constexpr OUStringLiteral HID_SC_SCENWIN_BOTTOM
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_DELETE
#define LINK(Instance, Class, Member)
OUString ScResId(TranslateId aId)
IMPL_LINK(ScScenarioWindow, KeyInputHdl, const KeyEvent &, rKEvt, bool)
IMPL_LINK_NOARG(ScScenarioWindow, SelectHdl, weld::TreeView &, void)