20#undef SC_DLLIMPLEMENTATION
34#include <document.hxx>
38 : GenericDialogController(pParent,
"modules/scalc/ui/scenariodialog.ui",
"ScenarioDialog")
39 , aDefScenarioName(rName)
41 , m_xEdName(m_xBuilder->weld_entry(
"name"))
42 , m_xEdComment(m_xBuilder->weld_text_view(
"comment"))
43 , m_xCbShowFrame(m_xBuilder->weld_check_button(
"showframe"))
44 , m_xLbColor(new
ColorListBox(m_xBuilder->weld_menu_button(
"bordercolor"), [this] {
return m_xDialog.get(); }))
45 , m_xCbTwoWay(m_xBuilder->weld_check_button(
"copyback"))
46 , m_xCbCopyAll(m_xBuilder->weld_check_button(
"copysheet"))
47 , m_xCbProtect(m_xBuilder->weld_check_button(
"preventchanges"))
48 , m_xBtnOk(m_xBuilder->weld_button(
"ok"))
49 , m_xAltTitle(m_xBuilder->weld_label(
"alttitle"))
50 , m_xCreatedFt(m_xBuilder->weld_label(
"createdft"))
51 , m_xOnFt(m_xBuilder->weld_label(
"onft"))
53 m_xEdComment->set_size_request(m_xEdComment->get_approximate_digit_width() * 60,
54 m_xEdComment->get_height_rows(6));
57 m_xDialog->set_title(m_xAltTitle->get_label());
61 OUString sCreatedBy(m_xCreatedFt->get_label());
62 OUString sOn(m_xOnFt->get_label());
68 m_xEdComment->set_text(aComment);
69 m_xEdName->set_text(rName);
73 m_xLbColor->SelectEntry( COL_LIGHTGRAY );
74 m_xCbShowFrame->set_active(
true);
75 m_xCbTwoWay->set_active(
true);
76 m_xCbCopyAll->set_active(
false);
77 m_xCbProtect->set_active(
true);
80 m_xCbCopyAll->set_active(
false);
85 m_xCbProtect->set_active(
false);
133 m_xEdName->set_text(
aName);
138 VclMessageType::Info, VclButtonsType::Ok,
141 m_xEdName->grab_focus();
146 VclMessageType::Info, VclButtonsType::Ok,
147 ScResId(STR_NEWTABNAMENOTUNIQUE)));
149 m_xEdName->grab_focus();
159 if (&rBox == m_xCbShowFrame.get())
160 m_xLbColor->set_sensitive(m_xCbShowFrame->get_active());
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
OUString getDate(const Date &rDate) const
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
static SC_DLLPUBLIC const LocaleDataWrapper & getLocaleData()
std::unique_ptr< weld::CheckButton > m_xCbTwoWay
void GetScenarioData(OUString &rName, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
virtual ~ScNewScenarioDlg() override
OUString aDefScenarioName
std::unique_ptr< weld::TextView > m_xEdComment
std::unique_ptr< weld::CheckButton > m_xCbProtect
std::unique_ptr< weld::CheckButton > m_xCbShowFrame
std::unique_ptr< ColorListBox > m_xLbColor
void SetScenarioData(const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
ScNewScenarioDlg(weld::Window *pParent, const OUString &rName, bool bEdit, bool bSheetProtected)
std::unique_ptr< weld::CheckButton > m_xCbCopyAll
std::unique_ptr< weld::Entry > m_xEdName
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
OUString GetFirstName() const
OUString GetLastName() const
std::shared_ptr< weld::Dialog > m_xDialog
#define LINK(Instance, Class, Member)
OString strip(const OString &rIn, char c)
OUString ScResId(TranslateId aId)
IMPL_LINK(ScNewScenarioDlg, EnableHdl, weld::Toggleable &, rBox, void)
IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl, weld::Button &, void)