diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 16:07:07 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 16:07:07 +0000 |
commit | fd069bee7e57ad529c3c0974559fd2d84ec3151a (patch) | |
tree | ef2eddeefb786feaf966d6a1c0c291872c0ae420 /svx/source/stbctrls | |
parent | 04c1c754ab9d0ad07f2c5362d46597d13efe75c2 (diff) |
initial import
Diffstat (limited to 'svx/source/stbctrls')
-rw-r--r-- | svx/source/stbctrls/insctrl.cxx | 166 | ||||
-rw-r--r-- | svx/source/stbctrls/makefile.mk | 122 | ||||
-rw-r--r-- | svx/source/stbctrls/modctrl.cxx | 134 | ||||
-rw-r--r-- | svx/source/stbctrls/pszctrl.cxx | 486 | ||||
-rw-r--r-- | svx/source/stbctrls/selctrl.cxx | 177 | ||||
-rw-r--r-- | svx/source/stbctrls/stbctrls.h | 88 | ||||
-rw-r--r-- | svx/source/stbctrls/stbctrls.src | 565 | ||||
-rw-r--r-- | svx/source/stbctrls/zoomctrl.cxx | 257 |
8 files changed, 1995 insertions, 0 deletions
diff --git a/svx/source/stbctrls/insctrl.cxx b/svx/source/stbctrls/insctrl.cxx new file mode 100644 index 000000000000..05b25fcc0991 --- /dev/null +++ b/svx/source/stbctrls/insctrl.cxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * $RCSfile: insctrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// include --------------------------------------------------------------- + +#ifndef _SHL_HXX +#include <tools/shl.hxx> +#endif +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +#ifndef _SFXAPP_HXX //autogen +#include <sfx2/app.hxx> +#endif +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif +#pragma hdrstop + +#define _SVX_INSCTRL_CXX + +#include "dialogs.hrc" + +#include "insctrl.hxx" +#include "dialmgr.hxx" + +#define PAINT_OFFSET 5 + +SFX_IMPL_STATUSBAR_CONTROL(SvxInsertStatusBarControl, SfxBoolItem); + +// class SvxInsertStatusBarControl --------------------------------------- + +SvxInsertStatusBarControl::SvxInsertStatusBarControl( USHORT nId, + StatusBar& rStb, + SfxBindings& rBind ) : + + SfxStatusBarControl( nId, rStb, rBind ), + + bInsert( TRUE ) +{ +} + +// ----------------------------------------------------------------------- + +SvxInsertStatusBarControl::~SvxInsertStatusBarControl() +{ +} + +// ----------------------------------------------------------------------- + +void SvxInsertStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + if ( SFX_ITEM_AVAILABLE != eState ) + GetStatusBar().SetItemText( GetId(), String() ); + else + { + DBG_ASSERT( pState->ISA( SfxBoolItem ), "invalid item type" ); + SfxBoolItem* pItem = (SfxBoolItem*)pState; + bInsert = pItem->GetValue(); + DrawItemText_Impl(); + } +} + +// ----------------------------------------------------------------------- + +void SvxInsertStatusBarControl::Click() +{ + if ( !GetStatusBar().GetItemText( GetId() ).Len() ) + return; + bInsert = !bInsert; + SfxBoolItem aIns( GetId(), bInsert ); + GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aIns, 0L ); +} + +// ----------------------------------------------------------------------- + +void SvxInsertStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + DrawItemText_Impl(); +} + +// ----------------------------------------------------------------------- + +void SvxInsertStatusBarControl::DrawItemText_Impl() +{ + USHORT nId = RID_SVXSTR_OVERWRITE_TEXT; + + if ( bInsert ) + nId = RID_SVXSTR_INSERT_TEXT; + GetStatusBar().SetItemText( GetId(), SVX_RESSTR( nId ) ); +} + +ULONG SvxInsertStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +{ + long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_OVERWRITE_TEXT)); + long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_INSERT_TEXT)); + + if(nWidth1<nWidth2) + nWidth1=nWidth2; + + return nWidth1+PAINT_OFFSET; +} + + diff --git a/svx/source/stbctrls/makefile.mk b/svx/source/stbctrls/makefile.mk new file mode 100644 index 000000000000..173519668a17 --- /dev/null +++ b/svx/source/stbctrls/makefile.mk @@ -0,0 +1,122 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* +PRJ=..$/.. + +PROJECTPCH4DLL=TRUE +PROJECTPCH=svxpch +PROJECTPCHSOURCE=$(PRJ)$/util$/svxpch + +PRJNAME=svx +TARGET=stbctrls +AUTOSEG=true + +# --- Settings ----------------------------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk +.INCLUDE : $(PRJ)$/util$/makefile.pmk + +.IF "$(GUI)" != "MAC" +CFLAGS+=-DDG_DLL +.ELSE +CFLAGS+=-D DG_DLL +.ENDIF + +# --- Files -------------------------------------------------------- + +.IF "$(header)" == "" + +CXXFILES = \ + insctrl.cxx \ + zoomctrl.cxx \ + pszctrl.cxx \ + selctrl.cxx \ + modctrl.cxx \ + $(PROJECTPCHSOURCE).cxx + +SRCFILES = \ + stbctrls.src + +SLOFILES= \ + $(SLO)$/insctrl.obj \ + $(SLO)$/zoomctrl.obj \ + $(SLO)$/pszctrl.obj \ + $(SLO)$/selctrl.obj \ + $(SLO)$/modctrl.obj + +.ENDIF + +HXX1TARGET=stbctrls +HXX1EXT= hxx +HXX1EXCL= -E:*include* +HXX1DEPN=\ + $(INC)$/insctrl.hxx \ + $(INC)$/zoomctrl.hxx \ + $(INC)$/pszctrl.hxx \ + $(INC)$/selctrl.hxx \ + $(INC)$/modctrl.hxx + +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx new file mode 100644 index 000000000000..69afca003702 --- /dev/null +++ b/svx/source/stbctrls/modctrl.cxx @@ -0,0 +1,134 @@ +/************************************************************************* + * + * $RCSfile: modctrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// include --------------------------------------------------------------- + +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _SFXENUMITEM_HXX +#include <svtools/eitem.hxx> +#endif +#ifndef _SFXAPP_HXX //autogen +#include <sfx2/app.hxx> +#endif +#pragma hdrstop + +#define _SVX_MODCTRL_CXX + +#include "dialogs.hrc" + +#include "modctrl.hxx" +#include "dialmgr.hxx" + +SFX_IMPL_STATUSBAR_CONTROL(SvxModifyControl, SfxBoolItem); + +// class SvxModifyControl ------------------------------------------------ + +SvxModifyControl::SvxModifyControl( USHORT nId, + StatusBar& rStb, SfxBindings& rBind ) : + + SfxStatusBarControl( nId, rStb, rBind ), + + bState( TRUE ) +{ +} + +// ----------------------------------------------------------------------- + +void SvxModifyControl::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + if ( SFX_ITEM_AVAILABLE != eState ) + GetStatusBar().SetItemText( GetId(), String() ); + else + { + DBG_ASSERT( pState->ISA( SfxBoolItem ), "invalid item type" ); + SfxBoolItem* pItem = (SfxBoolItem*)pState; + bState = pItem->GetValue(); + DrawItemText_Impl(); + } +} + +// ----------------------------------------------------------------------- + +void SvxModifyControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + DrawItemText_Impl(); +} + +// ----------------------------------------------------------------------- + +void SvxModifyControl::DrawItemText_Impl() +{ + String sMode; + + if ( bState ) + sMode = '*'; + GetStatusBar().SetItemText( GetId(), sMode ); +} + +ULONG SvxModifyControl::GetDefItemWidth(const StatusBar& rStb) +{ + return rStb.GetTextWidth(String::CreateFromAscii("XX")); +} + + diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx new file mode 100644 index 000000000000..fabb5dec0223 --- /dev/null +++ b/svx/source/stbctrls/pszctrl.cxx @@ -0,0 +1,486 @@ +/************************************************************************* + * + * $RCSfile: pszctrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// include --------------------------------------------------------------- + +#include <limits.h> + +#ifndef _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _MENU_HXX //autogen +#include <vcl/menu.hxx> +#endif +#ifndef _SV_IMAGE_HXX +#include <vcl/image.hxx> +#endif +#ifndef _SFXSTRITEM_HXX //autogen +#include <svtools/stritem.hxx> +#endif +#ifndef _SFXPTITEM_HXX //autogen +#include <svtools/ptitem.hxx> +#endif +#ifndef _SFXITEMPOOL_HXX +#include <svtools/itempool.hxx> +#endif +#ifndef _SFXAPP_HXX +#include <sfx2/app.hxx> +#endif +#ifndef _SFXMODULE_HXX +#include <sfx2/module.hxx> +#endif +#ifndef _SFX_SAVEOPT_HXX //autogen +#include <sfx2/saveopt.hxx> +#endif +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif +#ifndef _SFX_OBJSH_HXX //autogen +#include <sfx2/objsh.hxx> +#endif +#pragma hdrstop + +#define _SVX_PSZCTRL_CXX + +#include "pszctrl.hxx" + +#define PAINT_OFFSET 5 + +#define ITEMID_SIZE SID_ATTR_SIZE +#include "sizeitem.hxx" +#include "dialmgr.hxx" +#include "dlgutil.hxx" +#include "stbctrls.h" + +#include "dialogs.hrc" + +// ----------------------------------------------------------------------- + +/* [Beschreibung] + + Funktion, mit der ein metrischer Wert in textueller Darstellung + umgewandelt wird. + + nVal ist hier der metrische Wert in der Einheit eUnit. + + [Querverweise] + + <SvxPosSizeStatusBarControl::Paint(const UserDrawEvent&)> +*/ + +String GetMetricStr_Impl( long nVal, SfxMapUnit eUnit ) +{ + // Applikations-Metrik besorgen und setzen + FieldUnit eOutUnit = SFX_APP()->GetOptions().GetMetric(); + GET_MODULE_FIELDUNIT( eOutUnit ); + FieldUnit eInUnit = FUNIT_TWIP; + + if ( SFX_MAPUNIT_100TH_MM == eUnit ) + eInUnit = FUNIT_100TH_MM; + + String sMetric; + char cSep = GetpApp()->GetAppInternational().GetNumDecimalSep(); + long nConvVal = MetricField::ConvertValue( nVal * 100, 0L, 0, + eInUnit, eOutUnit ); + + if ( nConvVal < 0 && ( nConvVal / 100 == 0 ) ) + sMetric += '-'; + sMetric += String::CreateFromInt32( nConvVal / 100 ); + + if( FUNIT_NONE != eOutUnit ) + { + sMetric += cSep; + long nFract = nConvVal % 100; + + if ( nFract < 0 ) + nFract *= -1; + if ( nFract < 10 ) + sMetric += '0'; + sMetric += String::CreateFromInt32( nFract ); + } + + return sMetric; +} + +// ----------------------------------------------------------------------- + +SFX_IMPL_STATUSBAR_CONTROL(SvxPosSizeStatusBarControl, SvxSizeItem); + +// class FunctionPopup_Impl ---------------------------------------------- + +class FunctionPopup_Impl : public PopupMenu +{ +public: + FunctionPopup_Impl( USHORT nCheck ); + + USHORT GetSelected() const { return nSelected; } + +private: + USHORT nSelected; + + virtual void Select(); +}; + +// ----------------------------------------------------------------------- + +FunctionPopup_Impl::FunctionPopup_Impl( USHORT nCheck ) : + PopupMenu( ResId( RID_SVXMNU_PSZ_FUNC, DIALOG_MGR() ) ), + nSelected( 0 ) +{ + if (nCheck) + CheckItem( nCheck ); +} + +// ----------------------------------------------------------------------- + +void FunctionPopup_Impl::Select() +{ + nSelected = GetCurItemId(); +} + +// struct SvxPosSizeStatusBarControl_Impl -------------------------------- + +struct SvxPosSizeStatusBarControl_Impl + +/* [Beschreibung] + + Diese Implementations-Struktur der Klasse SvxPosSizeStatusBarControl + dient der Entkopplung von "Anderungen vom exportierten Interface sowie + der Verringerung von extern sichtbaren Symbolen. + + Eine Instanz exisitiert pro SvxPosSizeStatusBarControl-Instanz + f"ur deren Laufzeit. +*/ + +{ + Point aPos; // g"ultig, wenn eine Position angezeigt wird + Size aSize; // g"ultig, wenn eine Gr"o/se angezeigt wird + String aStr; // g"ultig, wenn ein Text angezeigt wird + BOOL bTime; // Zeit und Datum anzeigen? (nichts anzeigen (#65302#)) + BOOL bSize; // Gr"o/se anzeigen? + BOOL bTable; // Tabellenindex anzeigen? + BOOL bHasMenu; // StarCalc Popup-Menue anzeigen? + USHORT nFunction; // selektierte StarCalc Funktion + Image aPosImage; // Image f"ur die Positionsanzeige + Image aSizeImage; // Image f"ur die Gr"o/senanzeige +}; + +// class SvxPosSizeStatusBarControl ------------------------------------------ + +/* [Beschreibung] + + Ctor(): + Anlegen einer Impl-Klassen-Instanz, Default die Zeitanzeige enablen, + Images fu"r die Position und Gro"sse laden. +*/ + +SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( USHORT nId, + StatusBar& rStb, + SfxBindings& rBind ) : + SfxStatusBarControl( nId, rStb, rBind ), + + aPosForwarder( SID_ATTR_POSITION, *this ), + aTableForwarder( SID_TABLE_CELL, *this ), + aFuncForwarder( SID_PSZ_FUNCTION, *this ), + pImp( new SvxPosSizeStatusBarControl_Impl ) + +{ + pImp->bTime = TRUE; + pImp->bSize = FALSE; + pImp->bTable = FALSE; + pImp->bHasMenu = FALSE; + pImp->nFunction = 0; + pImp->aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); + pImp->aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); +} + +// ----------------------------------------------------------------------- + +/* [Beschreibung] + + Dtor(): + Pointer auf die Impl-Klasse lo"schen, damit der Timer gestoppt wird. +*/ + +SvxPosSizeStatusBarControl::~SvxPosSizeStatusBarControl() +{ + delete pImp; +} + +// ----------------------------------------------------------------------- + +/* [Beschreibung] + + SID_PSZ_FUNCTION aktiviert das Popup-Menue fuer Calc, ansonsten: + + Statusbenachrichtigung; + Je nach Item-Typ wird eine bestimmte Anzeige enabled, die anderen disabled. + + NULL/Void SfxPointItem SvxSizeItem SfxStringItem + ------------------------------------------------------------------------ + Zeit TRUE FALSE FALSE FALSE + Position FALSE FALSE + Gro"sse FALSE TRUE FALSE + Text FALSE FALSE TRUE + + Ein anderes Item bewirkt einen Assert, die Zeitanzeige wird enabled. +*/ + +void SvxPosSizeStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + // da Kombi-Controller, immer die aktuelle Id als HelpId setzen + // gecachten HelpText vorher l"oschen + GetStatusBar().SetHelpText( GetId(), String() ); + GetStatusBar().SetHelpId( GetId(), nSID ); + + if ( nSID == SID_PSZ_FUNCTION ) + { + if ( eState == SFX_ITEM_AVAILABLE ) + { + pImp->bHasMenu = TRUE; + if ( pState && pState->ISA(SfxUInt16Item) ) + pImp->nFunction = ((const SfxUInt16Item*)pState)->GetValue(); + } + else + pImp->bHasMenu = FALSE; + } + else if ( SFX_ITEM_AVAILABLE != eState ) + { + // Datum und Zeit anzeigen + pImp->bTime = TRUE; + pImp->bSize = FALSE; + pImp->bTable = FALSE; + } + else if ( pState->ISA( SfxPointItem ) ) + { + // Position anzeigen + pImp->aPos = ( (SfxPointItem*)pState )->GetValue(); + pImp->bTime = FALSE; + pImp->bTable = FALSE; + } + else if ( pState->ISA( SvxSizeItem ) ) + { + // Groesse anzeigen + pImp->aSize = ( (SvxSizeItem*)pState )->GetSize(); + pImp->bSize = TRUE; + pImp->bTime = FALSE; + pImp->bTable = FALSE; + } + else if ( pState->ISA( SfxStringItem ) ) + { + // String anzeigen (Tabellen-Zelle oder anderes) + pImp->aStr = ( (SfxStringItem*)pState )->GetValue(); + pImp->bTable = TRUE; + pImp->bTime = FALSE; + pImp->bSize = FALSE; + } + else + { + DBG_ERRORFILE( "invalid item type" ); + // trotzdem Datum und Zeit anzeigen + pImp->bTime = TRUE; + pImp->bSize = FALSE; + pImp->bTable = FALSE; + } + + if ( GetStatusBar().AreItemsVisible() ) + GetStatusBar().SetItemData( GetId(), 0 ); + + // nur Strings auch als Text an der StatusBar setzen, damit Tip-Hilfe + // funktioniert, wenn der Text zu lang ist. + String aText; + if ( pImp->bTable ) + aText = pImp->aStr; + GetStatusBar().SetItemText( GetId(), aText ); +} + +// ----------------------------------------------------------------------- + +/* [Beschreibung] + + Popup-Menue ausfuehren, wenn per Status enabled +*/ + +void SvxPosSizeStatusBarControl::Command( const CommandEvent& rCEvt ) +{ + if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && pImp->bHasMenu ) + { + USHORT nSelect = pImp->nFunction; + if (!nSelect) + nSelect = PSZ_FUNC_NONE; + FunctionPopup_Impl aMenu( nSelect ); + if ( aMenu.Execute( &GetStatusBar(), + GetStatusBar().OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ) ) + { + nSelect = aMenu.GetSelected(); + if (nSelect) + { + if (nSelect == PSZ_FUNC_NONE) + nSelect = 0; + + SfxUInt16Item aItem( SID_PSZ_FUNCTION, nSelect ); + GetBindings().GetDispatcher()->Execute( SID_PSZ_FUNCTION, SFX_CALLMODE_RECORD, &aItem, 0L ); + } + } + } + else + SfxStatusBarControl::Command( rCEvt ); +} + +// ----------------------------------------------------------------------- + +/* [Beschreibung] + + Je nach enableden Anzeigentyp, wird der Wert angezeigt. Vorher wird + das Rectangle u"bermalt (gelo"scht). +*/ + +void SvxPosSizeStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + OutputDevice* pDev = rUsrEvt.GetDevice(); + DBG_ASSERT( pDev, "no OutputDevice on UserDrawEvent" ); + const Rectangle& rRect = rUsrEvt.GetRect(); + StatusBar& rBar = GetStatusBar(); + Point aItemPos = rBar.GetItemTextPos( GetId() ); + Color aOldLineColor = pDev->GetLineColor(); + Color aOldFillColor = pDev->GetFillColor(); + pDev->SetLineColor(); + pDev->SetFillColor( pDev->GetBackground().GetColor() ); + + if ( pImp->bTime ) + { + // PB: Datum und Uhrzeit nicht mehr ausgeben (#65302#) + pDev->DrawRect( rRect ); + } + else if ( !pImp->bTable ) + { + // Position fuer Size-Anzeige berechnen + long nSizePosX = + rRect.Left() + rRect.GetWidth() / 2 + PAINT_OFFSET; + // Metric besorgen + SfxMapUnit eUnit = SFX_MAPUNIT_TWIP; + SfxObjectShell* pSh = SfxObjectShell::Current(); + if ( pSh ) + eUnit = pSh->GetPool().GetMetric( SID_ATTR_SIZE ); + + // Position zeichnen + Point aPnt = rRect.TopLeft(); + aPnt.Y() = aItemPos.Y(); + aPnt.X() += PAINT_OFFSET; + pDev->DrawImage( aPnt, pImp->aPosImage ); + aPnt.X() += pImp->aPosImage.GetSizePixel().Width(); + aPnt.X() += PAINT_OFFSET; + String aStr = GetMetricStr_Impl( pImp->aPos.X(), eUnit ); + aStr.AppendAscii(" / "); + aStr += GetMetricStr_Impl( pImp->aPos.Y(), eUnit ); + pDev->DrawRect( + Rectangle( aPnt, Point( nSizePosX, rRect.Bottom() ) ) ); + pDev->DrawText( aPnt, aStr ); + + // falls verf"ugbar, Gr"osse zeichnen + aPnt.X() = nSizePosX; + + if ( pImp->bSize ) + { + pDev->DrawImage( aPnt, pImp->aSizeImage ); + aPnt.X() += pImp->aSizeImage.GetSizePixel().Width(); + Point aDrwPnt = aPnt; + aPnt.X() += PAINT_OFFSET; + aStr = GetMetricStr_Impl( pImp->aSize.Width(), eUnit ); + aStr.AppendAscii(" x "); + aStr += GetMetricStr_Impl( pImp->aSize.Height(), eUnit ); + pDev->DrawRect( Rectangle( aDrwPnt, rRect.BottomRight() ) ); + pDev->DrawText( aPnt, aStr ); + } + else + pDev->DrawRect( Rectangle( aPnt, rRect.BottomRight() ) ); + } + else if ( pImp->bTable ) + { + pDev->DrawRect( rRect ); + pDev->DrawText( Point( + rRect.Left() + rRect.GetWidth() / 2 - pDev->GetTextWidth( pImp->aStr ) / 2, + aItemPos.Y() ), pImp->aStr ); + } + + pDev->SetLineColor( aOldLineColor ); + pDev->SetFillColor( aOldFillColor ); +} + +// ----------------------------------------------------------------------- + +ULONG SvxPosSizeStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +{ + Image aTmpPosImage( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) ); + Image aTmpSizeImage( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) ); + + ULONG nWidth=PAINT_OFFSET+aTmpPosImage.GetSizePixel().Width(); + nWidth+=PAINT_OFFSET+aTmpSizeImage.GetSizePixel().Width(); + nWidth+=2*(PAINT_OFFSET+rStb.GetTextWidth(String::CreateFromAscii("XXXX,XX / XXXX,XX"))); + + return nWidth; +} + + diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx new file mode 100644 index 000000000000..964a74e39e6f --- /dev/null +++ b/svx/source/stbctrls/selctrl.cxx @@ -0,0 +1,177 @@ +/************************************************************************* + * + * $RCSfile: selctrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +// include --------------------------------------------------------------- + +#ifndef _SHL_HXX +#include <tools/shl.hxx> +#endif +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _SFXINTITEM_HXX +#include <svtools/intitem.hxx> +#endif +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif +#pragma hdrstop + +#define _SVX_SELCTRL_CXX + +#include "selctrl.hxx" +#include "dialmgr.hxx" + +#include "dialogs.hrc" + +#define PAINT_OFFSET 5 + +SFX_IMPL_STATUSBAR_CONTROL(SvxSelectionModeControl, SfxUInt16Item); + +// class SvxSelectionModeControl ----------------------------------------- + +SvxSelectionModeControl::SvxSelectionModeControl( USHORT nId, + StatusBar& rStb, + SfxBindings& rBind ) : + SfxStatusBarControl( nId, rStb, rBind ), + + nState( 0 ) +{ +} + +// ----------------------------------------------------------------------- + +void SvxSelectionModeControl::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + if ( SFX_ITEM_AVAILABLE != eState ) + GetStatusBar().SetItemText( GetId(), String() ); + else + { + DBG_ASSERT( pState->ISA( SfxUInt16Item ), "invalid item type" ); + SfxUInt16Item* pItem = (SfxUInt16Item*)pState; + nState = pItem->GetValue(); + DrawItemText_Impl(); + } +} + +// ----------------------------------------------------------------------- + +void SvxSelectionModeControl::Click() +{ + if ( !GetStatusBar().GetItemText( GetId() ).Len() ) + return; + nState++; + if ( nState > 2 ) + nState = 0; + SfxUInt16Item aState( GetId(), nState ); + GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aState, 0L ); +} + +// ----------------------------------------------------------------------- + +void SvxSelectionModeControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + DrawItemText_Impl(); +} + +// ----------------------------------------------------------------------- + +void SvxSelectionModeControl::DrawItemText_Impl() +{ + String sTxt; + USHORT nId = 0; + + switch ( nState ) + { + case 0: + nId = RID_SVXSTR_SELMODE_STD; + break; + case 1: + nId = RID_SVXSTR_SELMODE_ER; + break; + case 2: + nId = RID_SVXSTR_SELMODE_ERG; + break; + default: DBG_ERROR( "invalid selection mode!" ); + } + + if ( nId ) + sTxt = SVX_RESSTR( nId ); + GetStatusBar().SetItemText( GetId(), sTxt ); +} + +ULONG SvxSelectionModeControl::GetDefItemWidth(const StatusBar& rStb) +{ + long nWidth1 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_STD)); + long nWidth2 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ER)); + long nWidth3 = rStb.GetTextWidth(SVX_RESSTR(RID_SVXSTR_SELMODE_ERG)); + + if(nWidth1<nWidth2) + nWidth1=nWidth2; + + if(nWidth1<nWidth3) + nWidth1=nWidth3; + + return nWidth1+PAINT_OFFSET; +} + + diff --git a/svx/source/stbctrls/stbctrls.h b/svx/source/stbctrls/stbctrls.h new file mode 100644 index 000000000000..c8f48b48823c --- /dev/null +++ b/svx/source/stbctrls/stbctrls.h @@ -0,0 +1,88 @@ +/************************************************************************* + * + * $RCSfile: stbctrls.h,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:23 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +#ifndef _SVX_STBCTRLS_H +#define _SVX_STBCTRLS_H + +// defines ------------------------------------------------------------------ + +#define ZOOM_200 1 +#define ZOOM_150 2 +#define ZOOM_100 3 +#define ZOOM_75 4 +#define ZOOM_50 5 + +#define ZOOM_OPTIMAL 6 +#define ZOOM_PAGE_WIDTH 7 +#define ZOOM_WHOLE_PAGE 8 + +// IDs wie SUBTOTAL_FUNC im Calc + +#define PSZ_FUNC_AVG 1 +#define PSZ_FUNC_COUNT2 3 +#define PSZ_FUNC_COUNT 2 +#define PSZ_FUNC_MAX 4 +#define PSZ_FUNC_MIN 5 +#define PSZ_FUNC_SUM 9 +#define PSZ_FUNC_NONE 16 + + +#endif + diff --git a/svx/source/stbctrls/stbctrls.src b/svx/source/stbctrls/stbctrls.src new file mode 100644 index 000000000000..acbb73c8f088 --- /dev/null +++ b/svx/source/stbctrls/stbctrls.src @@ -0,0 +1,565 @@ +/************************************************************************* + * + * $RCSfile: stbctrls.src,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + // include --------------------------------------------------------------- +#include "dialogs.hrc" +#include "helpid.hrc" +#include "stbctrls.h" + // pragma ---------------------------------------------------------------- + + // Strings --------------------------------------------------------------- +String RID_SVXSTR_INSERT_TEXT +{ + // 'Einf"ugen' bzw. 'Insert' abgek"urzt auf h"ochstens 5 Zeichen + Text = "EINFG" ; + Text [ English ] = "INSRT" ; + Text [ norwegian ] = "SETT INN INSRT" ; + Text [ italian ] = "INS" ; + Text [ portuguese_brazilian ] = "INSERIR" ; + Text [ portuguese ] = "INSER" ; + Text [ finnish ] = "LIS" ; + Text [ danish ] = "IND" ; + Text [ french ] = "INS" ; + Text [ swedish ] = "INFGA" ; + Text [ dutch ] = "INSRT" ; + Text [ spanish ] = "INSERT" ; + Text [ english_us ] = "INSRT" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "WSTAW"; + Text[ japanese ] = "}"; + Text[ chinese_traditional ] = "J"; + Text[ arabic ] = ""; + Text[ dutch ] = "INSRT"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "EKLE"; + Text[ language_user1 ] = " "; +}; +String RID_SVXSTR_OVERWRITE_TEXT +{ + // '"Uberschreiben' bzw. 'Overwrite' abgek"urzt auf h"ochstens 5 Zeichen + Text = "BER" ; + Text [ English ] = "OVER" ; + Text [ norwegian ] = "OVER" ; + Text [ italian ] = "SSC" ; + Text [ portuguese_brazilian ] = "SOBRE" ; + Text [ portuguese ] = "SUB" ; + Text [ finnish ] = "KORV" ; + Text [ danish ] = "OVR" ; + Text [ french ] = "RFP" ; + Text [ swedish ] = "VER" ; + Text [ dutch ] = "OVER" ; + Text [ spanish ] = "SOBRE" ; + Text [ english_us ] = "OVER" ; + Text[ chinese_simplified ] = "д"; + Text[ russian ] = ""; + Text[ polish ] = "NAD"; + Text[ japanese ] = "㏑"; + Text[ chinese_traditional ] = "мg"; + Text[ arabic ] = ""; + Text[ dutch ] = "OVER"; + Text[ chinese_simplified ] = "д"; + Text[ greek ] = ""; + Text[ korean ] = "ʰ"; + Text[ turkish ] = "ZR"; + Text[ language_user1 ] = " "; +}; +String RID_SVXSTR_SELMODE_STD +{ + // 'Standard' abgek"urzt auf h"ochstens 3 Zeichen + TEXT = "STD" ; + TEXT [ English ] = "STD" ; + Text [ portuguese ] = "PAD" ; + Text [ english_us ] = "STD" ; + Text [ portuguese_brazilian ] = "STD" ; + Text [ swedish ] = "STD" ; + Text [ danish ] = "STD" ; + Text [ italian ] = "STD" ; + Text [ spanish ] = "STD" ; + Text [ french ] = "STD" ; + Text [ dutch ] = "STD" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "STD"; + Text[ japanese ] = "W"; + Text[ chinese_traditional ] = "з"; + Text[ arabic ] = ""; + Text[ dutch ] = "STD"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ǥ"; + Text[ turkish ] = "STD"; + Text[ language_user1 ] = " "; +}; +String RID_SVXSTR_SELMODE_ER +{ + // 'Erweitert' bzw. 'Extended' abgek"urzt auf h"ochstens 3 Zeichen + TEXT = "ER" ; + TEXT [ English ] = "EXT" ; + TEXT [ norwegian ] = "G UT EXT" ; + TEXT [ italian ] = "EXT" ; + TEXT [ portuguese_brazilian ] = "EXT" ; + TEXT [ portuguese ] = "EXT" ; + TEXT [ finnish ] = "LAAJ" ; + TEXT [ danish ] = "UDV" ; + TEXT [ french ] = "EXT" ; + TEXT [ swedish ] = "UTV" ; + TEXT [ dutch ] = "EXT" ; + TEXT [ spanish ] = "EXT" ; + TEXT [ english_us ] = "EXT" ; + TEXT[ chinese_simplified ] = "չ"; + TEXT[ russian ] = ""; + TEXT[ polish ] = "ROZ"; + TEXT[ japanese ] = "g"; + TEXT[ chinese_traditional ] = "Xi"; + TEXT[ arabic ] = ""; + TEXT[ dutch ] = "EXT"; + TEXT[ chinese_simplified ] = "չ"; + TEXT[ greek ] = ""; + TEXT[ korean ] = "Ȯ"; + TEXT[ turkish ] = "UZN"; + TEXT[ language_user1 ] = " "; +}; +String RID_SVXSTR_SELMODE_ERG +{ + // 'Erg"anzend' bzw. 'Added' abgek"urzt auf h"ochstens 3 Zeichen + TEXT = "ERG" ; + TEXT [ English ] = "ADD" ; + TEXT [ norwegian ] = "LEGG TIL" ; + TEXT [ italian ] = "RIS" ; + TEXT [ portuguese_brazilian ] = "ACR" ; + TEXT [ portuguese ] = "ADI" ; + TEXT [ finnish ] = "LIS" ; + TEXT [ danish ] = "TLF" ; + TEXT [ french ] = "AJT" ; + TEXT [ swedish ] = "TLF" ; + TEXT [ dutch ] = "ADD" ; + TEXT [ spanish ] = "AGR" ; + TEXT [ english_us ] = "ADD" ; + TEXT[ chinese_simplified ] = ""; + TEXT[ russian ] = ""; + TEXT[ polish ] = "DODAJ"; + TEXT[ japanese ] = ""; + TEXT[ chinese_traditional ] = "ɥR"; + TEXT[ arabic ] = ""; + TEXT[ dutch ] = "ADD"; + TEXT[ chinese_simplified ] = ""; + TEXT[ greek ] = ""; + TEXT[ korean ] = ""; + TEXT[ turkish ] = "TAML"; + TEXT[ language_user1 ] = " "; +}; + // PopupMenu ------------------------------------------------------------- +Menu RID_SVXMNU_ZOOM +{ + ItemList = + { + MenuItem + { + Identifier = ZOOM_200 ; + HelpId = HID_MNU_ZOOM_200 ; + Text = "200%" ; + }; + MenuItem + { + Identifier = ZOOM_150 ; + HelpId = HID_MNU_ZOOM_150 ; + Text = "150%" ; + }; + MenuItem + { + Identifier = ZOOM_100 ; + HelpId = HID_MNU_ZOOM_100 ; + Text = "100%" ; + }; + MenuItem + { + Identifier = ZOOM_75 ; + HelpId = HID_MNU_ZOOM_75 ; + Text = "75%" ; + }; + MenuItem + { + Identifier = ZOOM_50 ; + HelpId = HID_MNU_ZOOM_50 ; + Text = "50%" ; + }; + MenuItem + { + Identifier = ZOOM_OPTIMAL ; + HelpId = HID_MNU_ZOOM_OPTIMAL ; + Text = "Optimal" ; + Text [ English ] = "Optimal" ; + text [ english_us ] = "Optimal" ; + Text [ portuguese ] = "Optimizado" ; + Text [ portuguese_brazilian ] = "Optimal" ; + Text [ swedish ] = "Optimal" ; + Text [ danish ] = "Optimal" ; + Text [ italian ] = "Ottimale" ; + Text [ spanish ] = "ptimo" ; + Text [ french ] = "Optimal" ; + Text [ dutch ] = "Optimaal" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Optymalny"; + Text[ japanese ] = "œK"; + Text[ chinese_traditional ] = "̨"; + Text[ arabic ] = ""; + Text[ dutch ] = "Optimaal"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Optimum"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = ZOOM_PAGE_WIDTH ; + HelpId = HID_MNU_ZOOM_PAGE_WIDTH ; + Text = "Seitenbreite" ; + Text [ ENGLISH ] = "Page width" ; + Text [ norwegian ] = "Sidebredde" ; + Text [ italian ] = "Larghezza pagina" ; + Text [ portuguese_brazilian ] = "Largura de pgina" ; + Text [ portuguese ] = "Larg. de pgina" ; + Text [ finnish ] = "Sivun leveys" ; + Text [ danish ] = "Sidebredde" ; + Text [ french ] = "Largeur de page" ; + Text [ swedish ] = "Sidbredd" ; + Text [ dutch ] = "Paginabreedte" ; + Text [ spanish ] = "Ancho de pgina" ; + Text [ english_us ] = "Page Width" ; + Text[ chinese_simplified ] = "ҳ"; + Text[ russian ] = " "; + Text[ polish ] = "Szeroko strony"; + Text[ japanese ] = "߰ޕ"; + Text[ chinese_traditional ] = "e"; + Text[ arabic ] = " "; + Text[ dutch ] = "Paginabreedte"; + Text[ chinese_simplified ] = "ҳ"; + Text[ greek ] = " "; + Text[ korean ] = " ʺ"; + Text[ turkish ] = "Sayfa genilii"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = ZOOM_WHOLE_PAGE ; + HelpId = HID_MNU_ZOOM_WHOLE_PAGE ; + Text = "Ganze Seite" ; + Text [ ENGLISH ] = "Whole page" ; + Text [ norwegian ] = "Hele siden" ; + Text [ italian ] = "Pagina intera" ; + Text [ portuguese_brazilian ] = "Pgina inteira" ; + Text [ portuguese ] = "Pgina inteira" ; + Text [ finnish ] = "Koko sivu" ; + Text [ danish ] = "Hele siden" ; + Text [ french ] = "Page entire" ; + Text [ swedish ] = "Hela sidan" ; + Text [ dutch ] = "Hele pagina" ; + Text [ spanish ] = "Toda la pgina" ; + Text [ english_us ] = "Entire Page" ; + Text[ chinese_simplified ] = "ҳ"; + Text[ russian ] = " "; + Text[ polish ] = "Caa strona"; + Text[ japanese ] = "߰ޑS"; + Text[ chinese_traditional ] = "㭶"; + Text[ arabic ] = " "; + Text[ dutch ] = "Hele pagina"; + Text[ chinese_simplified ] = "ҳ"; + Text[ greek ] = " "; + Text[ korean ] = " ü"; + Text[ turkish ] = "Tm sayfa"; + Text[ language_user1 ] = " "; + }; + }; +}; + // Funktionsauswahl auf dem SvxPosSizeStatusBarControl fuer Calc +Menu RID_SVXMNU_PSZ_FUNC +{ + ItemList = + { + MenuItem + { + Identifier = PSZ_FUNC_AVG ; + HelpId = HID_MNU_FUNC_AVG ; + Text = "Mittelwert" ; + Text [ ENGLISH ] = "Average" ; + Text [ english_us ] = "Average" ; + Text [ italian ] = "Valore medio" ; + Text [ spanish ] = "Promedio" ; + Text [ french ] = "Moyenne" ; + Text [ dutch ] = "Gemiddelde" ; + Text [ swedish ] = "Medelvrde" ; + Text [ danish ] = "Middel" ; + Text [ portuguese_brazilian ] = "Mittelwert" ; + Text [ portuguese ] = "Valor mdio" ; + Text[ chinese_simplified ] = "ƽֵ"; + Text[ russian ] = " "; + Text[ polish ] = "rednia warto"; + Text[ japanese ] = "ϒl"; + Text[ chinese_traditional ] = ""; + Text[ arabic ] = ""; + Text[ dutch ] = "Gemiddelde"; + Text[ chinese_simplified ] = "ƽֵ"; + Text[ greek ] = " "; + Text[ korean ] = "߰"; + Text[ turkish ] = "Ortalama"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_COUNT2 ; + HelpId = HID_MNU_FUNC_COUNT2 ; + Text = "Anzahl2" ; + Text [ ENGLISH ] = "Count2" ; + Text [ dutch ] = "Aantal2" ; + Text [ english_us ] = "CountA" ; + Text [ italian ] = "Numero2" ; + Text [ spanish ] = "Cantidad2" ; + Text [ french ] = "Nombre2" ; + Text [ swedish ] = "Antal2" ; + Text [ danish ] = "Tlv" ; + Text [ portuguese ] = "Contar" ; + Text [ portuguese_brazilian ] = "Anzahl2" ; + Text[ chinese_simplified ] = "Ŀ2"; + Text[ russian ] = "2"; + Text[ polish ] = "Liczba2"; + Text[ japanese ] = "2"; + Text[ chinese_traditional ] = "ƥ2"; + Text[ arabic ] = "2"; + Text[ dutch ] = "Aantal2"; + Text[ chinese_simplified ] = "Ŀ2"; + Text[ greek ] = "2"; + Text[ korean ] = "2"; + Text[ turkish ] = "Say2"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_COUNT ; + HelpId = HID_MNU_FUNC_COUNT ; + Text = "Anzahl" ; + Text [ ENGLISH ] = "Count" ; + Text [ dutch ] = "Aantal" ; + Text [ english_us ] = "Count" ; + Text [ italian ] = "Numero" ; + Text [ spanish ] = "Cantidad" ; + Text [ french ] = "Nombre" ; + Text [ swedish ] = "Antal" ; + Text [ danish ] = "Tl" ; + Text [ portuguese ] = "Quantidade" ; + Text [ portuguese_brazilian ] = "Anzahl" ; + Text[ chinese_simplified ] = "Ŀ"; + Text[ russian ] = ""; + Text[ polish ] = "Liczba"; + Text[ japanese ] = ""; + Text[ chinese_traditional ] = "ƥ"; + Text[ arabic ] = ""; + Text[ dutch ] = "Aantal"; + Text[ chinese_simplified ] = "Ŀ"; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Say"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_MAX ; + HelpId = HID_MNU_FUNC_MAX ; + Text = "Maximum" ; + Text [ ENGLISH ] = "Maximum" ; + Text [ dutch ] = "Maximum" ; + Text [ english_us ] = "Maximum" ; + Text [ italian ] = "Massimo" ; + Text [ spanish ] = "Mximo" ; + Text [ french ] = "Maximum" ; + Text [ swedish ] = "Maximum" ; + Text [ danish ] = "Maksimum" ; + Text [ portuguese ] = "Mximo" ; + Text [ portuguese_brazilian ] = "Maximum" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Maksimum"; + Text[ japanese ] = "ől"; + Text[ chinese_traditional ] = "̤j"; + Text[ arabic ] = " "; + Text[ dutch ] = "Maximum"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = "ִ"; + Text[ turkish ] = "Azami"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_MIN ; + HelpId = HID_MNU_FUNC_MIN ; + Text = "Minimum" ; + Text [ ENGLISH ] = "Minimum" ; + Text [ dutch ] = "Minimum" ; + Text [ english_us ] = "Minimum" ; + Text [ italian ] = "Minimo" ; + Text [ spanish ] = "Mnimo" ; + Text [ french ] = "Minimum" ; + Text [ swedish ] = "Minimum" ; + Text [ danish ] = "Minimum" ; + Text [ portuguese ] = "Mnimo" ; + Text [ portuguese_brazilian ] = "Minimum" ; + Text[ chinese_simplified ] = "С"; + Text[ russian ] = ""; + Text[ polish ] = "Minimum"; + Text[ japanese ] = "ŏ"; + Text[ chinese_traditional ] = "̤p"; + Text[ arabic ] = " "; + Text[ dutch ] = "Minimum"; + Text[ chinese_simplified ] = "С"; + Text[ greek ] = ""; + Text[ korean ] = "ּ"; + Text[ turkish ] = "Asgari"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_SUM ; + HelpId = HID_MNU_FUNC_SUM ; + Text = "Summe" ; + Text [ ENGLISH ] = "Sum" ; + Text [ dutch ] = "Som" ; + Text [ english_us ] = "Sum" ; + Text [ italian ] = "Somma" ; + Text [ spanish ] = "Suma" ; + Text [ french ] = "Somme" ; + Text [ swedish ] = "Summa" ; + Text [ danish ] = "Sum" ; + Text [ portuguese ] = "Soma" ; + Text [ portuguese_brazilian ] = "Summe" ; + Text[ chinese_simplified ] = "ܼ"; + Text[ russian ] = ""; + Text[ polish ] = "Suma"; + Text[ japanese ] = "v"; + Text[ chinese_traditional ] = "pp"; + Text[ arabic ] = ""; + Text[ dutch ] = "Som"; + Text[ chinese_simplified ] = "ܼ"; + Text[ greek ] = ""; + Text[ korean ] = "հ"; + Text[ turkish ] = "Toplam"; + Text[ language_user1 ] = " "; + }; + MenuItem + { + Identifier = PSZ_FUNC_NONE ; + HelpId = HID_MNU_FUNC_NONE ; + Text = "Keine" ; + Text [ ENGLISH ] = "None" ; + Text [ dutch ] = "Geen" ; + Text [ english_us ] = "None" ; + Text [ italian ] = "Senza" ; + Text [ spanish ] = "Ninguno" ; + Text [ french ] = "Aucun(e)" ; + Text [ swedish ] = "Inga" ; + Text [ danish ] = "Ingen" ; + Text [ portuguese ] = "Nenhuma" ; + Text [ portuguese_brazilian ] = "Keine" ; + Text[ chinese_simplified ] = ""; + Text[ russian ] = ""; + Text[ polish ] = "Brak"; + Text[ japanese ] = "Ȃ"; + Text[ chinese_traditional ] = "L"; + Text[ arabic ] = ""; + Text[ dutch ] = "Geen"; + Text[ chinese_simplified ] = ""; + Text[ greek ] = ""; + Text[ korean ] = ""; + Text[ turkish ] = "Yok"; + Text[ language_user1 ] = " "; + }; + }; +}; + // Images ---------------------------------------------------------------- +Image RID_SVXBMP_POSITION +{ + ImageBitmap = Bitmap + { + File = "sc10223.bmp" ; + }; + MaskColor = Color + { + Red = 0xC000 ; + Green = 0xC000 ; + Blue = 0xC000 ; + }; +}; +Image RID_SVXBMP_SIZE +{ + ImageBitmap = Bitmap + { + File = "sc10224.bmp" ; + }; + MaskColor = Color + { + Red = 0xC000 ; + Green = 0xC000 ; + Blue = 0xC000 ; + }; +}; diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx new file mode 100644 index 000000000000..f5cc87b14ddd --- /dev/null +++ b/svx/source/stbctrls/zoomctrl.cxx @@ -0,0 +1,257 @@ +/************************************************************************* + * + * $RCSfile: zoomctrl.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 17:01:24 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _SHL_HXX //autogen +#include <tools/shl.hxx> +#endif +#ifndef _STATUS_HXX //autogen +#include <vcl/status.hxx> +#endif +#ifndef _MENU_HXX //autogen +#include <vcl/menu.hxx> +#endif +#ifndef _SFXDISPATCH_HXX //autogen +#include <sfx2/dispatch.hxx> +#endif +#pragma hdrstop + +#include "dialogs.hrc" + +#include "zoomctrl.hxx" +#include "zoom.hxx" +#include "zoomitem.hxx" +#include "stbctrls.h" +#include "dialmgr.hxx" + +SFX_IMPL_STATUSBAR_CONTROL(SvxZoomStatusBarControl,SvxZoomItem); + +// class ZoomPopup_Impl -------------------------------------------------- + +class ZoomPopup_Impl : public PopupMenu +{ +public: + ZoomPopup_Impl( USHORT nZ, USHORT nValueSet ); + + USHORT GetZoom() const { return nZoom; } + USHORT GetCurId() const { return nCurId; } + +private: + USHORT nZoom; + USHORT nCurId; + + virtual void Select(); +}; + +// ----------------------------------------------------------------------- + +ZoomPopup_Impl::ZoomPopup_Impl( USHORT nZ, USHORT nValueSet ) + +: PopupMenu( ResId( RID_SVXMNU_ZOOM, DIALOG_MGR() ) ), + + nZoom( nZ ) +{ + static USHORT aTable[] = + { + SVX_ZOOM_ENABLE_50, ZOOM_50, + SVX_ZOOM_ENABLE_100, ZOOM_100, + SVX_ZOOM_ENABLE_150, ZOOM_150, + SVX_ZOOM_ENABLE_200, ZOOM_200, + SVX_ZOOM_ENABLE_OPTIMAL, ZOOM_OPTIMAL, + SVX_ZOOM_ENABLE_WHOLEPAGE, ZOOM_WHOLE_PAGE, + SVX_ZOOM_ENABLE_PAGEWIDTH, ZOOM_PAGE_WIDTH + }; + + for ( USHORT nPos = 0; nPos < sizeof(aTable) / sizeof(USHORT); nPos += 2 ) + if ( ( aTable[nPos] != ( aTable[nPos] & nValueSet ) ) ) + EnableItem( aTable[nPos+1], FALSE ); +} + +// ----------------------------------------------------------------------- + +void ZoomPopup_Impl::Select() +{ + nCurId = GetCurItemId(); + + switch ( nCurId ) + { + case ZOOM_200: nZoom = 200; break; + case ZOOM_150: nZoom = 150; break; + case ZOOM_100: nZoom = 100; break; + case ZOOM_75: nZoom = 75; break; + case ZOOM_50: nZoom = 50; break; + + case ZOOM_OPTIMAL: + case ZOOM_PAGE_WIDTH: + case ZOOM_WHOLE_PAGE: nZoom = 0; break; + + } +} + +// class SvxZoomStatusBarControl ------------------------------------------ + +SvxZoomStatusBarControl::SvxZoomStatusBarControl( USHORT nId, + StatusBar& rStb, + SfxBindings& rBind ) : + + SfxStatusBarControl( nId, rStb, rBind ), + + nZoom( 100 ), + + nValueSet( SVX_ZOOM_ENABLE_ALL ) + +{ +} + +// ----------------------------------------------------------------------- + +void SvxZoomStatusBarControl::StateChanged( USHORT nSID, SfxItemState eState, + const SfxPoolItem* pState ) +{ + if( SFX_ITEM_AVAILABLE != eState ) + { + GetStatusBar().SetItemText( GetId(), String() ); + nValueSet = 0; + } + else if ( pState->ISA( SfxUInt16Item) ) + { + const SfxUInt16Item* pItem = (const SfxUInt16Item*)pState; + nZoom = pItem->GetValue(); + String aStr( String::CreateFromInt32(nZoom) ); + aStr += '%'; + GetStatusBar().SetItemText( GetId(), aStr ); + + if ( pState->ISA(SvxZoomItem) ) + { + nValueSet = ((const SvxZoomItem*)pState)->GetValueSet(); + SvxZoomType eType = ((const SvxZoomItem*)pState)->GetType(); + +/*!!! + switch ( eType ) + { + case SVX_ZOOM_OPTIMAL: + GetStatusBar().SetItemText( GetId(), "Opt." ); + break; + case SVX_ZOOM_WHOLEPAGE: + GetStatusBar().SetItemText( GetId(), "Page" ); + break; + case SVX_ZOOM_PAGEWIDTH: + GetStatusBar().SetItemText( GetId(), "Width" ); + break; + } +*/ + } + else + { + DBG_WARNING( "use SfxZoomItem for SID_ATTR_ZOOM" ); + nValueSet = SVX_ZOOM_ENABLE_ALL; + } + } +} + +// ----------------------------------------------------------------------- + +void SvxZoomStatusBarControl::Paint( const UserDrawEvent& rUsrEvt ) +{ + String aStr( String::CreateFromInt32( nZoom )); + aStr += '%'; + GetStatusBar().SetItemText( GetId(), aStr ); +} + +// ----------------------------------------------------------------------- + +void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt ) +{ + if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && 0 != nValueSet ) + { + CaptureMouse(); + ZoomPopup_Impl aPop( nZoom, nValueSet ); + StatusBar& rStatusbar = GetStatusBar(); + + if ( aPop.Execute( &rStatusbar, rStatusbar.OutputToScreenPixel( rCEvt.GetMousePosPixel() ) ) && + ( nZoom != aPop.GetZoom() || !nZoom ) ) + { + nZoom = aPop.GetZoom(); + SvxZoomItem aZoom( SVX_ZOOM_PERCENT, nZoom, GetId() ); + + USHORT nId = aPop.GetCurId(); + + if ( ZOOM_OPTIMAL == nId ) + aZoom.SetType( SVX_ZOOM_OPTIMAL ); + else if ( ZOOM_PAGE_WIDTH == nId ) + aZoom.SetType( SVX_ZOOM_PAGEWIDTH ); + else if ( ZOOM_WHOLE_PAGE == nId ) + aZoom.SetType( SVX_ZOOM_WHOLEPAGE ); + + GetBindings().GetDispatcher()->Execute( GetId(), SFX_CALLMODE_RECORD, &aZoom, 0L ); + } + ReleaseMouse(); + } + else + SfxStatusBarControl::Command( rCEvt ); +} + +ULONG SvxZoomStatusBarControl::GetDefItemWidth(const StatusBar& rStb) +{ + long nWidth1 = rStb.GetTextWidth(String::CreateFromAscii("XXXXX%")); + return nWidth1; +} + + |