diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-22 06:58:29 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-23 06:25:34 +0100 |
commit | 23da9369ae622e61b75a4cb72f60667cd4ff9fa5 (patch) | |
tree | 9b18e2536e721d9ccae2ce194da7f555a7aff9a6 | |
parent | 684b53cfcfa7ec9978426a13714471d2b8af6ce7 (diff) |
ManageNames: add RangeOptions button to Define Name dialog
-rw-r--r-- | sc/source/ui/inc/namedefdlg.hrc | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/namedefdlg.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namedefdlg.cxx | 54 | ||||
-rw-r--r-- | sc/source/ui/src/namedefdlg.src | 22 |
4 files changed, 72 insertions, 8 deletions
diff --git a/sc/source/ui/inc/namedefdlg.hrc b/sc/source/ui/inc/namedefdlg.hrc index 865487ac808b..b3602c60564f 100644 --- a/sc/source/ui/inc/namedefdlg.hrc +++ b/sc/source/ui/inc/namedefdlg.hrc @@ -20,3 +20,4 @@ #define STR_ERR_NAME_INVALID 18 #define STR_DEFAULT_INFO 19 #define RB_RANGE 20 +#define BTN_MORE 21 diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx index 14ba9198a1cf..1a25c2b34a37 100644 --- a/sc/source/ui/inc/namedefdlg.hxx +++ b/sc/source/ui/inc/namedefdlg.hxx @@ -44,6 +44,7 @@ class ScNameDefDlg : public ScAnyRefDlg private: PushButton maBtnAdd; PushButton maBtnCancel; + DisclosureButton maBtnMore; FixedText maFtInfo; FixedText maFtName; FixedText maFtRange; @@ -73,6 +74,7 @@ private: void CancelPushed(); void AddPushed(); + void MorePushed(); bool IsNameValid(); @@ -81,6 +83,7 @@ private: DECL_LINK( NameModifyHdl, void* ); DECL_LINK( EdModifyHdl, void * ); DECL_LINK( AssignGetFocusHdl, void * ); + DECL_LINK( MoreBtnHdl, void* ); protected: virtual void RefInputDone( sal_Bool bForced = sal_False ); diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index e1b2883d4937..209e0569960c 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -24,6 +24,7 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParen ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_NAMES_DEFINE ), maBtnAdd( this, ScResId( BTN_ADD ) ), maBtnCancel( this, ScResId( BTN_CANCEL ) ), + maBtnMore( this, ScResId( BTN_MORE ) ), maFtInfo( this, ScResId( FT_INFO ) ), maFtName( this, ScResId( FT_NAME ) ), maFtRange( this, ScResId( FT_RANGE ) ), @@ -57,12 +58,20 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParen maBtnCancel.SetClickHdl( LINK( this, ScNameDefDlg, CancelBtnHdl)); maBtnAdd.SetClickHdl( LINK( this, ScNameDefDlg, AddBtnHdl )); + maBtnMore.SetClickHdl( LINK( this, ScNameDefDlg, MoreBtnHdl )); maEdName.SetModifyHdl( LINK( this, ScNameDefDlg, NameModifyHdl )); maEdRange.SetGetFocusHdl( LINK( this, ScNameDefDlg, AssignGetFocusHdl ) ); maFtInfo.SetText(ResId::toString( ScResId( STR_DEFAULT_INFO ) )); maBtnAdd.Disable(); // empty name is invalid + + maBtnRowHeader.Hide(); + maBtnColHeader.Hide(); + maBtnCriteria.Hide(); + maBtnPrintArea.Hide(); + + FreeResource(); } void ScNameDefDlg::CancelPushed() @@ -226,6 +235,45 @@ void ScNameDefDlg::SetActive() RefInputDone(); } +namespace { + +void MoveWindow( Window& rButton, long nPixel) +{ + Point aPoint = rButton.GetPosPixel(); + aPoint.Y() += nPixel; + rButton.SetPosPixel(aPoint); +} + +} + +void ScNameDefDlg::MorePushed() +{ + Size nSize = GetSizePixel(); + + //depending on the state of the button, move all elements below up/down + long nPixel = 85; + if (!maBtnMore.GetState()) + { + nPixel *= -1; + maBtnRowHeader.Hide(); + maBtnColHeader.Hide(); + maBtnPrintArea.Hide(); + maBtnCriteria.Hide(); + } + else + { + maBtnRowHeader.Show(); + maBtnColHeader.Show(); + maBtnPrintArea.Show(); + maBtnCriteria.Show(); + } + nSize.Height() += nPixel; + SetSizePixel(nSize); + MoveWindow(maBtnAdd, nPixel); + MoveWindow(maBtnCancel, nPixel); + MoveWindow(maFlDiv, nPixel); +} + IMPL_LINK( ScNameDefDlg, CancelBtnHdl, void*, EMPTYARG) { CancelPushed(); @@ -255,3 +303,9 @@ IMPL_LINK( ScNameDefDlg, AssignGetFocusHdl, void *, EMPTYARG ) EdModifyHdl( &maEdRange ); return 0; } + +IMPL_LINK( ScNameDefDlg, MoreBtnHdl, void*, EMPTYARG) +{ + MorePushed(); + return 0; +} diff --git a/sc/source/ui/src/namedefdlg.src b/sc/source/ui/src/namedefdlg.src index 1e432cd1dce3..8022a4e0ab33 100644 --- a/sc/source/ui/src/namedefdlg.src +++ b/sc/source/ui/src/namedefdlg.src @@ -7,24 +7,30 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE HelpId = CMD_FID_ADD_NAME ; Hide = TRUE ; SVLook = TRUE ; - Size = MAP_APPFONT ( 200 , 100 ) ; + Size = MAP_APPFONT ( 200 , 120 ) ; Text [ en-US ] = "Define Name" ; Moveable = TRUE ; Closeable = TRUE; PushButton BTN_ADD { - Pos = MAP_APPFONT( 110, 80 ); + Pos = MAP_APPFONT( 110, 100 ); Size = MAP_APPFONT( 40, 14 ); TabStop = TRUE; Text [en-US] = "Add"; }; PushButton BTN_CANCEL { - Pos = MAP_APPFONT( 155, 80 ); + Pos = MAP_APPFONT( 155, 100 ); Size = MAP_APPFONT ( 40, 14 ); TabStop = TRUE; Text [en-US] = "Cancel"; }; + CheckBox BTN_MORE + { + Pos = MAP_APPFONT( 6, 82 ); + Size = MAP_APPFONT( 60, 14 ); + Text [en-US] = "RangeOptions"; + }; FixedText FT_INFO { Pos = MAP_APPFONT( 6, 6 ); @@ -72,7 +78,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE CheckBox BTN_PRINTAREA { HelpID = "sc:CheckBox:RID_SCDLG_NAMES:BTN_PRINTAREA"; - Pos = MAP_APPFONT ( 6 , 208 ) ; + Pos = MAP_APPFONT ( 6 , 100 ) ; Size = MAP_APPFONT ( 80 , 14 ) ; Text [ en-US ] = "~Print range" ; TabStop = TRUE ; @@ -80,7 +86,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE CheckBox BTN_CRITERIA { HelpID = "sc:CheckBox:RID_SCDLG_NAMES:BTN_CRITERIA"; - Pos = MAP_APPFONT ( 6 , 223 ) ; + Pos = MAP_APPFONT ( 6 , 118 ) ; Size = MAP_APPFONT ( 60 , 14 ) ; Text [ en-US ] = "~Filter" ; TabStop = TRUE ; @@ -88,7 +94,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE CheckBox BTN_ROWHEADER { HelpID = "sc:CheckBox:RID_SCDLG_NAMES:BTN_ROWHEADER"; - Pos = MAP_APPFONT ( 110, 223 ) ; + Pos = MAP_APPFONT ( 110, 118 ) ; Size = MAP_APPFONT ( 82 , 14 ) ; Text [ en-US ] = "Repeat ~row" ; TabStop = TRUE ; @@ -96,7 +102,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE CheckBox BTN_COLHEADER { HelpID = "sc:CheckBox:RID_SCDLG_NAMES:BTN_COLHEADER"; - Pos = MAP_APPFONT ( 110 , 208 ) ; + Pos = MAP_APPFONT ( 110 , 100 ) ; Size = MAP_APPFONT ( 82 , 14 ) ; Text [ en-US ] = "Repeat ~column" ; TabStop = TRUE ; @@ -111,7 +117,7 @@ ModelessDialog RID_SCDLG_NAMES_DEFINE }; FixedLine FL_DIV { - Pos = MAP_APPFONT( 0, 75 ); + Pos = MAP_APPFONT( 0, 95 ); Size = MAP_APPFONT(200, 3 ); }; |