20 #undef SC_DLLIMPLEMENTATION
30 #include <globstr.hrc>
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();
143 else if ( !bIsEdit && !rDoc.ValidNewTabName( aName ) )
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());
#define LINK(Instance, Class, Member)
std::shared_ptr< weld::Dialog > m_xDialog
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)
std::unique_ptr< weld::Entry > m_xEdName
std::unique_ptr< weld::CheckButton > m_xCbTwoWay
void GetScenarioData(OUString &rName, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
static SfxViewShell * Current()
std::unique_ptr< weld::TextView > m_xEdComment
OUString ScResId(const char *pId)
OUString GetFirstName() const
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
OUString getDate(const Date &rDate) const
OUString GetLastName() const
OUString aDefScenarioName
static SC_DLLPUBLIC bool ValidTabName(const OUString &rName)
OString strip(const OString &rIn, char c)
virtual ~ScNewScenarioDlg() override
Reference< XExecutableDialog > m_xDialog
ScNewScenarioDlg(weld::Window *pParent, const OUString &rName, bool bEdit, bool bSheetProtected)
IMPL_LINK(ScNewScenarioDlg, EnableHdl, weld::ToggleButton &, rBox, void)
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
std::unique_ptr< weld::CheckButton > m_xCbCopyAll
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl, weld::Button &, void)
std::unique_ptr< weld::CheckButton > m_xCbProtect