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
maBtnOk( this, ScResId( BTN_OK ) ),
maBtnCancel( this, ScResId( BTN_CANCEL ) ),
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 ),
maPos(rPos),
mpDoc(pDoc),
......@@ -1137,6 +1138,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pCW, Window* p
maEdRange.SetModifyHdl( LINK( this, ScCondFormatDlg, EdRangeModifyHdl ) );
maBtnOk.SetClickHdl( LINK( this, ScCondFormatDlg, OkBtnHdl ) );
maBtnCancel.SetClickHdl( LINK( this, ScCondFormatDlg, CancelBtnHdl ) );
maEdRange.SetGetFocusHdl( LINK( this, ScCondFormatDlg, RangeGetFocusHdl ) );
FreeResource();
maEdRange.SetText(aRangeString);
......@@ -1148,12 +1150,36 @@ ScCondFormatDlg::~ScCondFormatDlg()
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
......@@ -1259,5 +1285,10 @@ IMPL_LINK_NOARG( ScCondFormatDlg, CancelBtnHdl )
return 0;
}
IMPL_LINK_NOARG( ScCondFormatDlg, RangeGetFocusHdl )
{
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -57,5 +57,6 @@
#define FT_RANGE 32
#define ED_RANGE 33
#define RB_RANGE 34
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -198,7 +198,8 @@ private:
OKButton maBtnOk;
CancelButton maBtnCancel;
FixedText maFtRange;
Edit maEdRange;
formula::RefEdit maEdRange;
formula::RefButton maRbRange;
ScCondFormatList maCondFormList;
......@@ -210,8 +211,13 @@ private:
DECL_LINK( EdRangeModifyHdl, Edit* );
DECL_LINK( OkBtnHdl, void* );
DECL_LINK( CancelBtnHdl, void* );
DECL_LINK( RangeGetFocusHdl, void* );
virtual sal_Bool Close();
protected:
virtual void RefInputDone( sal_Bool bForced = false );
public:
ScCondFormatDlg(SfxBindings* pB, SfxChildWindow* pSW, Window* pWindow, ScDocument* pDoc, const ScConditionalFormat* pFormat,
......@@ -221,6 +227,7 @@ public:
SC_DLLPUBLIC ScConditionalFormat* GetConditionalFormat() const;
virtual void SetReference(const ScRange&, ScDocument*);
virtual sal_Bool IsRefInputMode() const;
virtual void SetActive();
virtual sal_Bool IsTableLocked() const { return sal_True; }
};
......
......@@ -77,7 +77,13 @@ ModelessDialog RID_SCDLG_CONDFORMAT
Edit ED_RANGE
{
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;
};
};
......
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