Kaydet (Commit) ce2bcf89 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Added options list and other misc stuff.

Change-Id: Idd7b8823a26e2a272d911c097dbde350092ec0e8
üst f1010e94
...@@ -30,13 +30,98 @@ ...@@ -30,13 +30,98 @@
#include "calcoptionsdlg.hrc" #include "calcoptionsdlg.hrc"
#include "scresid.hxx" #include "scresid.hxx"
#include "svtools/svlbitm.hxx"
namespace {
class OptionString : public SvLBoxString
{
rtl::OUString maDesc;
rtl::OUString maValue;
public:
OptionString(const rtl::OUString& rDesc, const rtl::OUString& rValue) :
maDesc(rDesc), maValue(rValue) {}
virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry);
};
void OptionString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/)
{
Point aPos = rPos;
rtl::OUString aDesc = maDesc + rtl::OUString(": ");
rDev.DrawText(aPos, aDesc);
aPos.X() += rDev.GetTextWidth(aDesc);
Font aOldFont = rDev.GetFont();
Font aFont = aOldFont;
aFont.SetWeight(WEIGHT_BOLD);
rDev.SetFont(aFont);
rDev.DrawText(aPos, maValue);
rDev.SetFont(aOldFont);
}
}
ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) : ScCalcOptionsDialog::ScCalcOptionsDialog(Window* pParent) :
ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)), ModalDialog(pParent, ScResId(RID_SCDLG_FORMULA_CALCOPTIONS)),
maLbSettings(this, ScResId(LB_SETTINGS)),
maBtnEdit(this, ScResId(BTN_EDIT)),
maFlAnnotation(this, ScResId(FL_ANNOTATION)),
maFtAnnotation(this, ScResId(FT_ANNOTATION)),
maBtnOK(this, ScResId(BTN_OK)), maBtnOK(this, ScResId(BTN_OK)),
maBtnCancel(this, ScResId(BTN_CANCEL)) maBtnCancel(this, ScResId(BTN_CANCEL)),
maDescIndirectSyntax(ScResId(STR_INDIRECT_SYNTAX_DESC).toString())
{ {
maLbSettings.SetStyle(maLbSettings.GetStyle() | WB_CLIPCHILDREN | WB_FORCE_MAKEVISIBLE);
maLbSettings.SetHighlightRange();
maLbSettings.SetSelectHdl(LINK(this, ScCalcOptionsDialog, SettingsSelHdl));
maLbSettings.SetDoubleClickHdl(LINK(this, ScCalcOptionsDialog, SettingsDoubleClickHdl));
FillOptionsList();
FreeResource();
SelectionChanged();
} }
ScCalcOptionsDialog::~ScCalcOptionsDialog() {} ScCalcOptionsDialog::~ScCalcOptionsDialog() {}
void ScCalcOptionsDialog::FillOptionsList()
{
maLbSettings.SetUpdateMode(false);
SvLBoxTreeList* pModel = maLbSettings.GetModel();
SvLBoxEntry* pEntry = new SvLBoxEntry;
pEntry->AddItem(new SvLBoxString(pEntry, 0, rtl::OUString()));
pEntry->AddItem(new SvLBoxContextBmp(pEntry, 0, Image(), Image(), 0));
OptionString* pItem = new OptionString("Formula syntax INDIRECT function expects", "Calc A1");
pEntry->AddItem(pItem);
pModel->Insert(pEntry);
maLbSettings.SetUpdateMode(true);
}
void ScCalcOptionsDialog::SelectionChanged()
{
maFtAnnotation.SetText(maDescIndirectSyntax);
}
void ScCalcOptionsDialog::EditOption()
{
}
IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsSelHdl)
{
SelectionChanged();
return 0;
}
IMPL_LINK_NOARG(ScCalcOptionsDialog, SettingsDoubleClickHdl)
{
EditOption();
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -30,5 +30,11 @@ ...@@ -30,5 +30,11 @@
#define BTN_OK 1 #define BTN_OK 1
#define BTN_CANCEL 2 #define BTN_CANCEL 2
#define LB_SETTINGS 3
#define BTN_EDIT 4
#define FL_ANNOTATION 5
#define FT_ANNOTATION 6
#define STR_INDIRECT_SYNTAX_DESC 10
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
#include "vcl/dialog.hxx" #include "vcl/dialog.hxx"
#include "vcl/button.hxx" #include "vcl/button.hxx"
#include "vcl/fixed.hxx"
#include "svx/checklbx.hxx"
class ScCalcOptionsDialog : public ModalDialog class ScCalcOptionsDialog : public ModalDialog
{ {
...@@ -38,9 +40,25 @@ public: ...@@ -38,9 +40,25 @@ public:
ScCalcOptionsDialog(Window* pParent); ScCalcOptionsDialog(Window* pParent);
virtual ~ScCalcOptionsDialog(); virtual ~ScCalcOptionsDialog();
DECL_LINK( SettingsSelHdl, void* );
DECL_LINK( SettingsDoubleClickHdl, void* );
private:
void FillOptionsList();
void SelectionChanged();
void EditOption();
private: private:
SvxCheckListBox maLbSettings;
PushButton maBtnEdit;
FixedLine maFlAnnotation;
FixedText maFtAnnotation;
OKButton maBtnOK; OKButton maBtnOK;
CancelButton maBtnCancel; CancelButton maBtnCancel;
rtl::OUString maDescIndirectSyntax;
}; };
#endif #endif
......
...@@ -32,20 +32,56 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS ...@@ -32,20 +32,56 @@ ModalDialog RID_SCDLG_FORMULA_CALCOPTIONS
OutputSize = TRUE ; OutputSize = TRUE ;
Hide = TRUE ; Hide = TRUE ;
SVLook = TRUE ; SVLook = TRUE ;
Size = MAP_APPFONT ( 260, 200 ) ; Size = MAP_APPFONT ( 230, 200 ) ;
Text [ en-US ] = "Detailed Calculation Settings" ; Text [ en-US ] = "Detailed Calculation Settings" ;
Control LB_SETTINGS
{
Border = TRUE ;
Pos = MAP_APPFONT ( 6 , 10 ) ;
Size = MAP_APPFONT ( 218 , 67 ) ;
TabStop = TRUE ;
};
PushButton BTN_EDIT
{
Pos = MAP_APPFONT ( 8 , 82 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Edit...";
};
FixedLine FL_ANNOTATION
{
Pos = MAP_APPFONT ( 6 , 98 ) ;
Size = MAP_APPFONT ( 218 , 8 ) ;
TabStop = TRUE ;
};
FixedText FT_ANNOTATION
{
Pos = MAP_APPFONT ( 8 , 108 ) ;
Size = MAP_APPFONT ( 214 , 70 ) ;
WordBreak = TRUE ;
NoLabel = TRUE ;
};
OKButton BTN_OK OKButton BTN_OK
{ {
Pos = MAP_APPFONT ( 148 , 180 ) ; Pos = MAP_APPFONT ( 118 , 180 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
}; };
CancelButton BTN_CANCEL CancelButton BTN_CANCEL
{ {
Pos = MAP_APPFONT ( 204 , 180 ) ; Pos = MAP_APPFONT ( 174 , 180 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ; Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ; TabStop = TRUE ;
}; };
String STR_INDIRECT_SYNTAX_DESC
{
Text [ en-US ] = "Formula syntax that built-in function INDIRECT expects.";
};
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment