ParaLineSpacingControl.cxx (d29c2fc2) ParaLineSpacingControl.cxx (3fca590b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 53 unchanged lines hidden (view full) ---

62aLineDistAtMetricBox ( this, SVX_RES( ED_SBINDE_LINEDISTPOINT ) ),
63maCustomFT ( this, SVX_RES( FT_CUSTOM ) ),
64maLSpacingFT ( this, SVX_RES( FT_LINE_SPACING ) ),
65maOfFT ( this, SVX_RES( FT_OF ) ),
66maSpacing1 (SVX_RES(IMG_SPACING1)),
67maSpacing115 (SVX_RES(IMG_SPACING115)),
68maSpacing15 (SVX_RES(IMG_SPACING15)),
69maSpacing2 (SVX_RES(IMG_SPACING2)),
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 53 unchanged lines hidden (view full) ---

62aLineDistAtMetricBox ( this, SVX_RES( ED_SBINDE_LINEDISTPOINT ) ),
63maCustomFT ( this, SVX_RES( FT_CUSTOM ) ),
64maLSpacingFT ( this, SVX_RES( FT_LINE_SPACING ) ),
65maOfFT ( this, SVX_RES( FT_OF ) ),
66maSpacing1 (SVX_RES(IMG_SPACING1)),
67maSpacing115 (SVX_RES(IMG_SPACING115)),
68maSpacing15 (SVX_RES(IMG_SPACING15)),
69maSpacing2 (SVX_RES(IMG_SPACING2)),
70maLPCustom (SVX_RES(IMG_SPACINGLCUSTOM)),
71maSelSpacing1 (SVX_RES(IMG_SEL_SPACING1)),
72maSelSpacing115 (SVX_RES(IMG_SEL_SPACING115)),
73maSelSpacing15 (SVX_RES(IMG_SEL_SPACING15)),
74maSelSpacing2 (SVX_RES(IMG_SEL_SPACING2)),
75maImgCusGrey (SVX_RES(IMG_CUSTOM_GRAY)),
76maImgCus (SVX_RES(IMG_CUSTOM)),
77maStrCus (SVX_RES(STR_LCVALUE)),
78pActLineDistFld ( &aLineDistAtPercentBox ),

--- 21 unchanged lines hidden (view full) ---

100 delete[] mpImg;
101 delete[] mpImgSel;
102 delete[] mpStr;
103 delete[] mpStrTip;
104}
105
106void ParaLineSpacingControl::initial()
107{
70maSelSpacing1 (SVX_RES(IMG_SEL_SPACING1)),
71maSelSpacing115 (SVX_RES(IMG_SEL_SPACING115)),
72maSelSpacing15 (SVX_RES(IMG_SEL_SPACING15)),
73maSelSpacing2 (SVX_RES(IMG_SEL_SPACING2)),
74maImgCusGrey (SVX_RES(IMG_CUSTOM_GRAY)),
75maImgCus (SVX_RES(IMG_CUSTOM)),
76maStrCus (SVX_RES(STR_LCVALUE)),
77pActLineDistFld ( &aLineDistAtPercentBox ),

--- 21 unchanged lines hidden (view full) ---

99 delete[] mpImg;
100 delete[] mpImgSel;
101 delete[] mpStr;
102 delete[] mpStrTip;
103}
104
105void ParaLineSpacingControl::initial()
106{
108 //maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
109 //maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetMenuColor());
110 //maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
111 //maLineSpacing.SetMinFont();
107 maLineSpacing.SetStyle( maLineSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
112
108
113 maLineSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
114 GetSettings().GetStyleSettings().GetMenuColor():
115 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
116 maLineSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
117 GetSettings().GetStyleSettings().GetMenuColor():
118 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
119 maLineSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
120 GetSettings().GetStyleSettings().GetMenuColor():
121 sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
122 //maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
123 //GetSettings().GetStyleSettings().GetMenuColor():
124 //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
125 //maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
126 //GetSettings().GetStyleSettings().GetMenuColor():
127 //sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
109 maLineSpacing.SetControlBackground(
110 GetSettings().GetStyleSettings().GetHighContrastMode()
111 ? GetSettings().GetStyleSettings().GetMenuColor()
112 : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
113 maLineSpacing.SetColor(
114 GetSettings().GetStyleSettings().GetHighContrastMode()
115 ? GetSettings().GetStyleSettings().GetMenuColor()
116 : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
117 maLineSpacing.SetBackground(
118 GetSettings().GetStyleSettings().GetHighContrastMode()
119 ? GetSettings().GetStyleSettings().GetMenuColor()
120 : sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
128
121
129 mpImg = new Image[4];
130 mpImg[0] = maSpacing1;
131 mpImg[1] = maSpacing115;
132 mpImg[2] = maSpacing15;
133 mpImg[3] = maSpacing2;
122 mpImg = new Image[4];
123 mpImg[0] = maSpacing1;
124 mpImg[1] = maSpacing115;
125 mpImg[2] = maSpacing15;
126 mpImg[3] = maSpacing2;
134
127
135 mpImgSel = new Image[4];
136 mpImgSel[0] = maSelSpacing1;
137 mpImgSel[1] = maSelSpacing115;
138 mpImgSel[2] = maSelSpacing15;
139 mpImgSel[3] = maSelSpacing2;
128 mpImgSel = new Image[4];
129 mpImgSel[0] = maSelSpacing1;
130 mpImgSel[1] = maSelSpacing115;
131 mpImgSel[2] = maSelSpacing15;
132 mpImgSel[3] = maSelSpacing2;
140
133
141 mpStr = new XubString[4];
142 mpStr[0] = XubString(SVX_RES(STR_SPACING1));
143 mpStr[1] = XubString(SVX_RES(STR_SPACING115));
144 mpStr[2] = XubString(SVX_RES(STR_SPACING15));
145 mpStr[3] = XubString(SVX_RES(STR_SPACING2));
134 mpStr = new XubString[4];
135 mpStr[0] = XubString(SVX_RES(STR_SPACING1));
136 mpStr[1] = XubString(SVX_RES(STR_SPACING115));
137 mpStr[2] = XubString(SVX_RES(STR_SPACING15));
138 mpStr[3] = XubString(SVX_RES(STR_SPACING2));
146
139
147 mpStrTip = new XubString[4];
148 mpStrTip[0] = XubString(SVX_RES(STR_LS_SINGLE));
149 mpStrTip[1] = XubString(SVX_RES(STR_LS_115));
150 mpStrTip[2] = XubString(SVX_RES(STR_LS_15));
151 mpStrTip[3] = XubString(SVX_RES(STR_LS_DOUBLE));
152 for (int i=0;i<4;i++)
153 maLineSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
140 mpStrTip = new XubString[4];
141 mpStrTip[0] = XubString(SVX_RES(STR_LS_SINGLE));
142 mpStrTip[1] = XubString(SVX_RES(STR_LS_115));
143 mpStrTip[2] = XubString(SVX_RES(STR_LS_15));
144 mpStrTip[3] = XubString(SVX_RES(STR_LS_DOUBLE));
145 for (int i=0;i<4;i++)
146 maLineSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
154
147
155 maLineSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
148 maLineSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
156
149
157 SetAllNoSel();
158 Link aLink = LINK(this, ParaLineSpacingControl,VSSelHdl );
159 maLineSpacing.SetSelectHdl(aLink);
160 maLineSpacing.StartSelection();
161 maLineSpacing.Show();
150 SetAllNoSel();
151 Link aLink = LINK(this, ParaLineSpacingControl,VSSelHdl );
152 maLineSpacing.SetSelectHdl(aLink);
153 maLineSpacing.StartSelection();
154 maLineSpacing.Show();
162
155
163 aLink = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl );
164 aLineDist.SetSelectHdl(aLink);
165 aLineDist.SelectEntryPos( LLINESPACE_1 ) ;
166 aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl );
167 aLineDistAtPercentBox.SetModifyHdl( aLink );
168 aLineDistAtMetricBox.SetModifyHdl( aLink );
156 aLink = LINK( this, ParaLineSpacingControl, LineSPDistHdl_Impl );
157 aLineDist.SetSelectHdl(aLink);
158 aLineDist.SelectEntryPos( LLINESPACE_1 ) ;
159 aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl );
160 aLineDistAtPercentBox.SetModifyHdl( aLink );
161 aLineDistAtMetricBox.SetModifyHdl( aLink );
169}
162}
170void ParaLineSpacingControl::ToGetFocus(bool bType)
171{
172 if(!bType)
173 aLineDist.GrabFocus();
174 else
175 maLineSpacing.GrabFocus(); //wj
176}
177
163
164
178void ParaLineSpacingControl::PopupModeEndCallback()
179{
180 if( mbUseLineSPCustom )
181 {
182 //maLinePos = mpLineSPPage->maPos;
183 //maLineValue = mpLineSPPage->maValue;
184
185 SvtViewOptions aWinOpt( E_WINDOW, LSP_POS_GLOBAL_VALUE );

--- 293 unchanged lines hidden (view full) ---

479 aLineDist.SetNoSelection();
480 maLineSpacing.SetNoSelection();
481 maLineSpacing.SelectItem(0);
482 mbUseLineSPCustom = DO_NOT_CUSTOM;
483 }
484
485 aLineDist.SaveValue();
486
165void ParaLineSpacingControl::PopupModeEndCallback()
166{
167 if( mbUseLineSPCustom )
168 {
169 //maLinePos = mpLineSPPage->maPos;
170 //maLineValue = mpLineSPPage->maValue;
171
172 SvtViewOptions aWinOpt( E_WINDOW, LSP_POS_GLOBAL_VALUE );

--- 293 unchanged lines hidden (view full) ---

466 aLineDist.SetNoSelection();
467 maLineSpacing.SetNoSelection();
468 maLineSpacing.SelectItem(0);
469 mbUseLineSPCustom = DO_NOT_CUSTOM;
470 }
471
472 aLineDist.SaveValue();
473
487 /*sal_uInt16 nID = pBox->GetCurItemId();
488 pBox->SetItemDown(nID, sal_True);
489
490 Size aFloatSz = GetOutputSizePixel();
491
492 GetLineSPFloatWin()->SetSizePixel( aFloatSz );
493
494 Point aPos=maLineSPTbx->GetPosPixel();
495 aPos.setX(aPos.getX());
496 aPos = OutputToScreenPixel( aPos );
497 Size aSize = maLineSPTbx->GetSizePixel();
498 Rectangle aRect( aPos, aSize );
499
500 GetLineSPFloatWin()->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_NOFOCUSCLOSE);
501 GetLineSPFloatWin()->SetPopupModeFlags(GetLineSPFloatWin()->GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE );
502
503 pLineSPPage->ToGetFocus(bValueSetFocus);
504 */
505 sal_uInt16 uCount = aLineDist.GetEntryCount();
506 if( uCount == LLINESPACE_FIX + 1 )
507 {
508 switch (currentContext.GetCombinedContext())
509 {
510 case CombinedEnumContext(Application_Impress, Context_Table):
511 case CombinedEnumContext(Application_Draw, Context_Table):
512 case CombinedEnumContext(Application_Writer, Context_DrawText):

--- 305 unchanged lines hidden ---
474 sal_uInt16 uCount = aLineDist.GetEntryCount();
475 if( uCount == LLINESPACE_FIX + 1 )
476 {
477 switch (currentContext.GetCombinedContext())
478 {
479 case CombinedEnumContext(Application_Impress, Context_Table):
480 case CombinedEnumContext(Application_Draw, Context_Table):
481 case CombinedEnumContext(Application_Writer, Context_DrawText):

--- 305 unchanged lines hidden ---