Kaydet (Commit) 5240022f authored tarafından Markus Mohrhard's avatar Markus Mohrhard

change to ref input field for range edit

Change-Id: I69eb352869e0bcaa362bb1be6022d30de8c2658c
üst a1e53f7d
...@@ -1120,7 +1120,8 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* p ...@@ -1120,7 +1120,8 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* p
maBtnOk( this, ScResId( BTN_OK ) ), maBtnOk( this, ScResId( BTN_OK ) ),
maBtnCancel( this, ScResId( BTN_CANCEL ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ),
maFtRange( this, ScResId( FT_RANGE ) ), maFtRange( this, ScResId( FT_RANGE ) ),
maEdRange( this, ScResId( ED_RANGE ) ), maEdRange( this, this, ScResId( ED_RANGE ) ),
maRbRange( this, ScResId( RB_RANGE ), &maEdRange, this ),
maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, eType ), maCondFormList( this, ScResId( CTRL_LIST ), pDoc, pFormat, rRange, rPos, eType ),
maPos(rPos), maPos(rPos),
mpDoc(pDoc), mpDoc(pDoc),
...@@ -1137,6 +1138,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* p ...@@ -1137,6 +1138,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* p
maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) ); maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) ); maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) );
maBtnCancel.SetClickHdl( LINK( this, ScCondFormatDlg, CancelBtnHdl ) ); maBtnCancel.SetClickHdl( LINK( this, ScCondFormatDlg, CancelBtnHdl ) );
maEdRange.SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
FreeResource(); FreeResource();
maEdRange.SetText(aRangeString); maEdRange.SetText(aRangeString);
...@@ -1148,12 +1150,36 @@ ScCondFormatDlg::~ScCondFormatDlg() ...@@ -1148,12 +1150,36 @@ ScCondFormatDlg::~ScCondFormatDlg()
void ScCondFormatDlg::SetActive() void ScCondFormatDlg::SetActive()
{ {
maEdRange.GrabFocus();
RefInputDone();
}
void ScCondFormatDlg::RefInputDone( sal_Bool bForced )
{
ScAnyRefDlg::RefInputDone(bForced);
}
sal_Bool ScCondFormatDlg::IsRefInputMode() const
{
return maEdRange.IsEnabled();
} }
void ScCondFormatDlg::SetReference(const ScRange&, ScDocument*) #define ABS_SREF SCA_VALID \
| SCA_COL_ABSOLUTE | SCA_ROW_ABSOLUTE | SCA_TAB_ABSOLUTE
#define ABS_DREF ABS_SREF \
| SCA_COL2_ABSOLUTE | SCA_ROW2_ABSOLUTE | SCA_TAB2_ABSOLUTE
void ScCondFormatDlg::SetReference(const ScRange& rRef, ScDocument*)
{ {
if( maEdRange.IsEnabled() )
{
if(rRef.aStart != rRef.aEnd)
RefInputStart(&maEdRange);
rtl::OUString aRefStr;
rRef.Format( aRefStr, ABS_DREF, mpDoc, ScAddress::Details(mpDoc->GetAddressConvention(), 0, 0) );
maEdRange.SetRefString( aRefStr );
}
} }
ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const ScConditionalFormat* ScCondFormatDlg::GetConditionalFormat() const
...@@ -1259,5 +1285,10 @@ IMPL_LINK_NOARG( ScCondFormatDlg, CancelBtnHdl ) ...@@ -1259,5 +1285,10 @@ IMPL_LINK_NOARG( ScCondFormatDlg, CancelBtnHdl )
return 0; return 0;
} }
IMPL_LINK_NOARG( ScCondFormatDlg, RangeGetFocusHdl )
{
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -57,5 +57,6 @@ ...@@ -57,5 +57,6 @@
#define FT_RANGE 32 #define FT_RANGE 32
#define ED_RANGE 33 #define ED_RANGE 33
#define RB_RANGE 34
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -198,7 +198,8 @@ private: ...@@ -198,7 +198,8 @@ private:
OKButton maBtnOk; OKButton maBtnOk;
CancelButton maBtnCancel; CancelButton maBtnCancel;
FixedText maFtRange; FixedText maFtRange;
Edit maEdRange; formula::RefEdit maEdRange;
formula::RefButton maRbRange;
ScCondFormatList maCondFormList; ScCondFormatList maCondFormList;
...@@ -210,8 +211,13 @@ private: ...@@ -210,8 +211,13 @@ private:
DECL_LINK( EdRangeModifyHdl, Edit* ); DECL_LINK( EdRangeModifyHdl, Edit* );
DECL_LINK( OkBtnHdl, void* ); DECL_LINK( OkBtnHdl, void* );
DECL_LINK( CancelBtnHdl, void* ); DECL_LINK( CancelBtnHdl, void* );
DECL_LINK( RangeGetFocusHdl, void* );
virtual sal_Bool Close(); virtual sal_Bool Close();
protected:
virtual void RefInputDone( sal_Bool bForced = false );
public: public:
ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pSW, Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat, ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pSW, Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat,
...@@ -221,6 +227,7 @@ public: ...@@ -221,6 +227,7 @@ public:
SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const; SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const;
virtual void SetReference(const ScRange&, ScDocument*); virtual void SetReference(const ScRange&, ScDocument*);
virtual sal_Bool IsRefInputMode() const;
virtual void SetActive(); virtual void SetActive();
virtual sal_Bool IsTableLocked() const { return sal_True; } virtual sal_Bool IsTableLocked() const { return sal_True; }
}; };
......
...@@ -77,7 +77,13 @@ ModelessDialog RID_SCDLG_CONDFORMAT ...@@ -77,7 +77,13 @@ ModelessDialog RID_SCDLG_CONDFORMAT
Edit ED_RANGE Edit ED_RANGE
{ {
Pos = MAP_APPFONT( 60, 262 ); Pos = MAP_APPFONT( 60, 262 );
Size = MAP_APPFONT( 200, 14 ); Size = MAP_APPFONT( 182, 14 );
Border = TRUE;
};
ImageButton RB_RANGE
{
Pos = MAP_APPFONT( 245, 262 );
Size = MAP_APPFONT( 14, 14 );
Border = TRUE; Border = TRUE;
}; };
}; };
......
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