zoomctrl.cxx (2e94ffde) | zoomctrl.cxx (07662b26) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 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 9 * with the License. You may obtain a copy of the License at | 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 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26#include <tools/shl.hxx> 27#ifndef _STATUS_HXX //autogen --- 75 unchanged lines hidden (view full) --- 103 case ZOOM_WHOLE_PAGE: nZoom = 0; break; 104 105 } 106} 107 108// class SvxZoomStatusBarControl ------------------------------------------ 109 110SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId, | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26#include <tools/shl.hxx> 27#ifndef _STATUS_HXX //autogen --- 75 unchanged lines hidden (view full) --- 103 case ZOOM_WHOLE_PAGE: nZoom = 0; break; 104 105 } 106} 107 108// class SvxZoomStatusBarControl ------------------------------------------ 109 110SvxZoomStatusBarControl::SvxZoomStatusBarControl( sal_uInt16 _nSlotId, |
111 sal_uInt16 _nId, | 111 sal_uInt16 _nId, |
112 StatusBar& rStb ) : 113 114 SfxStatusBarControl( _nSlotId, _nId, rStb ), 115 nZoom( 100 ), 116 nValueSet( SVX_ZOOM_ENABLE_ALL ) 117{ 118} 119 --- 7 unchanged lines hidden (view full) --- 127 GetStatusBar().SetItemText( GetId(), String() ); 128 nValueSet = 0; 129 } 130 else if ( pState->ISA( SfxUInt16Item) ) 131 { 132 const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState; 133 nZoom = pItem->GetValue(); 134 String aStr( String::CreateFromInt32(nZoom) ); | 112 StatusBar& rStb ) : 113 114 SfxStatusBarControl( _nSlotId, _nId, rStb ), 115 nZoom( 100 ), 116 nValueSet( SVX_ZOOM_ENABLE_ALL ) 117{ 118} 119 --- 7 unchanged lines hidden (view full) --- 127 GetStatusBar().SetItemText( GetId(), String() ); 128 nValueSet = 0; 129 } 130 else if ( pState->ISA( SfxUInt16Item) ) 131 { 132 const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState; 133 nZoom = pItem->GetValue(); 134 String aStr( String::CreateFromInt32(nZoom) ); |
135 aStr.AppendAscii( " %" ); | 135 aStr.AppendAscii( " %" ); |
136 GetStatusBar().SetItemText( GetId(), aStr ); 137 138 if ( pState->ISA(SvxZoomItem) ) 139 { 140 nValueSet = ((const SvxZoomItem*)pState)->GetValueSet(); 141/*!!! 142 SvxZoomType eType = ((const SvxZoomItem*)pState)->GetType(); 143 --- 19 unchanged lines hidden (view full) --- 163 } 164} 165 166// ----------------------------------------------------------------------- 167 168void SvxZoomStatusBarControl::Paint( const UserDrawEvent& ) 169{ 170 String aStr( String::CreateFromInt32( nZoom )); | 136 GetStatusBar().SetItemText( GetId(), aStr ); 137 138 if ( pState->ISA(SvxZoomItem) ) 139 { 140 nValueSet = ((const SvxZoomItem*)pState)->GetValueSet(); 141/*!!! 142 SvxZoomType eType = ((const SvxZoomItem*)pState)->GetType(); 143 --- 19 unchanged lines hidden (view full) --- 163 } 164} 165 166// ----------------------------------------------------------------------- 167 168void SvxZoomStatusBarControl::Paint( const UserDrawEvent& ) 169{ 170 String aStr( String::CreateFromInt32( nZoom )); |
171 aStr.AppendAscii( " %" ); | 171 aStr.AppendAscii( " %" ); |
172 GetStatusBar().SetItemText( GetId(), aStr ); 173} 174 175// ----------------------------------------------------------------------- 176 177void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt ) 178{ 179 if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && 0 != nValueSet ) --- 9 unchanged lines hidden (view full) --- 189 190 switch( aPop.GetCurId() ) 191 { 192 case ZOOM_OPTIMAL: aZoom.SetType( SVX_ZOOM_OPTIMAL ); break; 193 case ZOOM_PAGE_WIDTH: aZoom.SetType( SVX_ZOOM_PAGEWIDTH ); break; 194 case ZOOM_WHOLE_PAGE: aZoom.SetType( SVX_ZOOM_WHOLEPAGE ); break; 195 } 196 | 172 GetStatusBar().SetItemText( GetId(), aStr ); 173} 174 175// ----------------------------------------------------------------------- 176 177void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt ) 178{ 179 if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && 0 != nValueSet ) --- 9 unchanged lines hidden (view full) --- 189 190 switch( aPop.GetCurId() ) 191 { 192 case ZOOM_OPTIMAL: aZoom.SetType( SVX_ZOOM_OPTIMAL ); break; 193 case ZOOM_PAGE_WIDTH: aZoom.SetType( SVX_ZOOM_PAGEWIDTH ); break; 194 case ZOOM_WHOLE_PAGE: aZoom.SetType( SVX_ZOOM_WHOLEPAGE ); break; 195 } 196 |
197 ::com::sun::star::uno::Any a; 198 INetURLObject aObj( m_aCommandURL ); 199 200 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 201 aArgs[0].Name = aObj.GetURLPath(); 202 aZoom.QueryValue( a ); 203 aArgs[0].Value = a; 204 205 execute( aArgs ); | 197 ::com::sun::star::uno::Any a; 198 INetURLObject aObj( m_aCommandURL ); 199 200 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aArgs( 1 ); 201 aArgs[0].Name = aObj.GetURLPath(); 202 aZoom.QueryValue( a ); 203 aArgs[0].Value = a; 204 205 execute( aArgs ); |
206 } 207 ReleaseMouse(); 208 } 209 else 210 SfxStatusBarControl::Command( rCEvt ); 211} 212 213sal_uIntPtr SvxZoomStatusBarControl::GetDefItemWidth(const StatusBar& rStb) 214{ | 206 } 207 ReleaseMouse(); 208 } 209 else 210 SfxStatusBarControl::Command( rCEvt ); 211} 212 213sal_uIntPtr SvxZoomStatusBarControl::GetDefItemWidth(const StatusBar& rStb) 214{ |
215 long nWidth1 = rStb.GetTextWidth(String::CreateFromAscii("XXXXX %")); | 215 long nWidth1 = rStb.GetTextWidth(String::CreateFromAscii("XXXXX %")); |
216 return nWidth1; 217} 218 | 216 return nWidth1; 217} 218 |
219 | 219/* vim: set noet sw=4 ts=4: */ |