diff options
Diffstat (limited to 'toolkit/workben/layout')
45 files changed, 3107 insertions, 430 deletions
diff --git a/toolkit/workben/layout/.gitignore b/toolkit/workben/layout/.gitignore new file mode 100644 index 000000000000..142ba57c1444 --- /dev/null +++ b/toolkit/workben/layout/.gitignore @@ -0,0 +1,4 @@ +/de +/en-US +/nl +/ja
\ No newline at end of file diff --git a/toolkit/workben/layout/README b/toolkit/workben/layout/README new file mode 100644 index 000000000000..3b83bbfc00cd --- /dev/null +++ b/toolkit/workben/layout/README @@ -0,0 +1,43 @@ +Testing workbench and editor for Layout engine. + +* Configure using --enable-layout. + +* [d]make all + +* export OOO_INSTALL_PREFIX=$(pwd)/ooo-layout + +* [d]make install DESTDIR=$OOO_INSTALL_PREFIX + +* Compile test program in toolkit/workben/layout + + cd toolkit/workben/layout && dmake all + +* FIXME: New three layer install/rpath feature needs these workarounds +| +| test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX +| cp -f ../..$INPATH/lib/libtkx.so $OOO_PREFIX/openoffice.org/basis3.0/program +| export LD_LIBRARY_PATH=$OOO_PREFIX_BRAND/basis-link/program:$OOO_PREFIX_BRAND/basis-link/ure-link/lib +| +| (see source/layout/helper.cxx) + +* Run it on any .xml file + + ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] zoom.xml + +* Run it for specific dialogs, see test.cxx + + ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test zoom + ../../$INPATH/bin/test [--inst $OOO_INSTALL_PREFIX] --test wordcount + +* Or source refresh in workben/layout, do something like + + cd toolkit/workben/layout && . ./refresh [--inst $OOO_INSTALL_PREFIX] + +Integration into OOo: + +* After instaling, run + + cd ooo-cvs/program + ./soffice.bin + + Start a [Writer] document and choose View/Zoom or Extra/Word count. diff --git a/toolkit/workben/layout/TEST b/toolkit/workben/layout/TEST new file mode 100755 index 000000000000..8a04a6628da8 --- /dev/null +++ b/toolkit/workben/layout/TEST @@ -0,0 +1,11 @@ +#! /bin/sh +for d in $(cd ../../../../.. && pwd)/ooo-svn /usr/lib/ooo3/; do + if test -d $d; then + export OOO_INSTALL_PREFIX=$d + break + fi +done +export SAL_ALLOW_LINKOO_SYMLINKS=1 +test -d $OOO_INSTALL_PREFIX/openoffice.org3 && export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX/openoffice.org3 || export OOO_PREFIX_BRAND=$OOO_INSTALL_PREFIX +export LD_LIBRARY_PATH="$OOO_PREFIX_BRAND/basis-link/program:$OOO_PREFIX_BRAND/basis-link/ure-link/lib" +../../unx*.pro/bin/test "$@" diff --git a/toolkit/workben/layout/align-test.xml b/toolkit/workben/layout/align-test.xml new file mode 100644 index 000000000000..60c34b4655a5 --- /dev/null +++ b/toolkit/workben/layout/align-test.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated xml files are generated from this template by + transex3/layout/tralay. !--> + +<dialog xmlns="http://openoffice.org/2007/layout" + xmlns:cnt="http://openoffice.org/2007/layout/container" + title="Align Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> + <vbox spacing="5" border="5"> + <fixedline/> + <hbox spacing="0" border="0"> + <vbox spacing="5" border="5"> + <fixedline _text="X" cnt:expand="false"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + <pushbutton label="foo"/> + </vbox> + <vbox spacing="5" border="5"> + <fixedline _text="X" cnt:expand="false"/> + <pushbutton label="bar"/> + </vbox> + </hbox> + <fixedline/> + <min-size cnt:spacing="0" min-width="200"/> + </vbox> +</dialog> diff --git a/toolkit/workben/layout/boxtest.xml b/toolkit/workben/layout/boxtest.xml index 60b714d7d894..24ead837c057 100644 --- a/toolkit/workben/layout/boxtest.xml +++ b/toolkit/workben/layout/boxtest.xml @@ -4,6 +4,8 @@ xmlns:cnt="http://openoffice.org/2007/layout/container" title="Box Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> <vbox> + <table> + <vbox> <hbox cnt:expand="false" cnt:fill="false"> <pushbutton label="XML Left" cnt:expand="false" cnt:fill="false"/> @@ -28,5 +30,7 @@ <pushbutton label="XML Right" cnt:expand="true" cnt:fill="true"/> </hbox> + </vbox> + </table> </vbox> </dialog> diff --git a/toolkit/workben/layout/editor.cxx b/toolkit/workben/layout/editor.cxx index 0ef31560b69f..dd218de40da7 100644 --- a/toolkit/workben/layout/editor.cxx +++ b/toolkit/workben/layout/editor.cxx @@ -32,43 +32,41 @@ #include "editor.hxx" #undef NDEBUG + +/* #include <assert.h> #include <stdio.h> #include <string.h> +*/ -#include <vector> +#include <cassert> +#include <cstdio> +#include <cstring> #include <list> -#include <rtl/strbuf.hxx> -#include <rtl/ustrbuf.hxx> - -using namespace layout::css; - -using rtl::OUString; +#include <vector> -#include <com/sun/star/awt/XWindow.hpp> -#include <com/sun/star/awt/XWindowPeer.hpp> -#include <com/sun/star/awt/XVclWindowPeer.hpp> +#include <com/sun/star/awt/WindowAttribute.hpp> #include <com/sun/star/awt/XLayoutConstrains.hpp> #include <com/sun/star/awt/XLayoutContainer.hpp> -#include <com/sun/star/awt/WindowAttribute.hpp> - #include <com/sun/star/awt/XToolkit.hpp> +#include <com/sun/star/awt/XVclWindowPeer.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/awt/XWindowPeer.hpp> +#include <rtl/strbuf.hxx> +#include <rtl/ustrbuf.hxx> #include <toolkit/helper/property.hxx> - #include <vcl/lstbox.h> -// FIXME: -//#define FILEDLG +using namespace layout::css; -// somewhat of a hack unfortunately ... -#include "layout/layoutcore.hxx" -#include "root.hxx" -#include "helper.hxx" +using rtl::OUString; -//** Utilities +// FIXME: +//#define FILEDLG -#define OUSTRING_CSTR( str ) \ - rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ).getStr() +#include <layout/core/helper.hxx> +#include <layout/core/root.hxx> +#include <layout/core/helper.hxx> // TODO: automatically generated struct WidgetSpec { @@ -94,19 +92,6 @@ static const WidgetSpec WIDGETS_SPECS[] = { }; const int WIDGETS_SPECS_LEN = sizeof (WIDGETS_SPECS) / sizeof (WidgetSpec); -// TEMP: from helper -namespace layoutimpl { - - typedef std::list< std::pair< rtl::OUString, rtl::OUString > > PropList; - - css::uno::Reference< css::awt::XLayoutConstrains > - createWidget( css::uno::Reference< css::awt::XToolkit > xToolkit, - css::uno::Reference< css::uno::XInterface > xParent, - const rtl::OUString &rName, long nProps, bool bToplevel ); - - uno::Any anyFromString (const rtl::OUString &value, const uno::Type &type); -} - using namespace layout; using namespace layoutimpl; namespace css = ::com::sun::star; @@ -136,9 +121,9 @@ static rtl::OUString anyToString (uno::Any value) bool val = value.get<sal_Bool>(); return rtl::OUString( val ? "1" : "0", 1, RTL_TEXTENCODING_ASCII_US ); /* if ( val ) - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ); - else - return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );*/ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "true" ) ); + else + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "false" ) );*/ } default: break; @@ -155,8 +140,9 @@ static inline double anyToDecimal (uno::Any value) /* XLayoutContainer/XLayoutConstrains are a bit of a hasle to work with. Let's wrap them. */ -class Widget : public layoutimpl::LayoutWidget { -friend class EditorRoot; +class Widget : public layoutimpl::LayoutWidget +{ + friend class EditorRoot; Widget *mpParent; std::vector< Widget *> maChildren; @@ -173,7 +159,7 @@ public: // to be used to wrap the root Widget( uno::Reference< awt::XLayoutConstrains > xImport, const char *label ) - : mpParent( 0 ), mbForeign( true ) + : mpParent( 0 ), mbForeign( true ) { mxWidget = xImport; mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY ); @@ -197,17 +183,17 @@ public: Widget( rtl::OUString id, uno::Reference< awt::XToolkit > xToolkit, uno::Reference< awt::XLayoutContainer > xParent, rtl::OUString unoName, long nAttrbs ) - : mpParent( 0 ), mbForeign( false ), mrId( id ), - mnOriAttrbs( nAttrbs ) + : mpParent( 0 ), mbForeign( false ), mrId( id ), + mnOriAttrbs( nAttrbs ) { - while ( xParent.is() && !uno::Reference< awt::XWindow >( xParent, uno::UNO_QUERY ).is() ) - { - uno::Reference< awt::XLayoutContainer > xContainer( xParent, uno::UNO_QUERY ); - assert( xContainer.is() ); - xParent = uno::Reference< awt::XLayoutContainer >( xContainer->getParent(), uno::UNO_QUERY ); - } + while ( xParent.is() && !uno::Reference< awt::XWindow >( xParent, uno::UNO_QUERY ).is() ) + { + uno::Reference< awt::XLayoutContainer > xContainer( xParent, uno::UNO_QUERY ); + assert( xContainer.is() ); + xParent = uno::Reference< awt::XLayoutContainer >( xContainer->getParent(), uno::UNO_QUERY ); + } - mxWidget = layoutimpl::createWidget( xToolkit, xParent, unoName, nAttrbs ); + mxWidget = WidgetFactory::createWidget( xToolkit, xParent, unoName, nAttrbs ); assert( mxWidget.is() ); mxContainer = uno::Reference< awt::XLayoutContainer >( mxWidget, uno::UNO_QUERY ); @@ -225,14 +211,14 @@ public: // TODO: disable editing of text fields, check boxes selected, etc... #if 0 uno::Reference< awt::XVclWindowPeer> xVclPeer( mxWidget, uno::UNO_QUERY ) - if ( xVclPeer.is() ) // XVclWindowPeer ignores missing / incorrect properties + if ( xVclPeer.is() ) // XVclWindowPeer ignores missing / incorrect properties //FIXME: it looks odd on widgets like NumericField seeing text which is deleted // when you interact with it... We can avoid it for those widgets, by doing a getProp // of "Text" and check if it is empty or not. - xVclPeer->setProperty( rtl::OUString::createFromAscii( "Text" ), - uno::makeAny( rtl::OUString::createFromAscii( "new widget" ) ) ); + xVclPeer->setProperty( rtl::OUString::createFromAscii( "Text" ), + uno::makeAny( rtl::OUString::createFromAscii( "new widget" ) ) ); #endif // store original properties @@ -365,9 +351,14 @@ public: { beans::Property prop = it.next(); rtl::OUString name( prop.Name ); - rtl::OUString value( pChild->getProperty( name, CONTAINER_PROPERTY ) ); - std::pair< rtl::OUString, rtl::OUString > pair( name, value ); - pChild->maOriChildProps.push_back( pair ); + try { + rtl::OUString value( pChild->getProperty( name, CONTAINER_PROPERTY ) ); + std::pair< rtl::OUString, rtl::OUString > pair( name, value ); + pChild->maOriChildProps.push_back( pair ); + } catch ( beans::UnknownPropertyException &rEx ) { + fprintf (stderr, "ERROR: widget reports that it has a property it cannot return: '%s' this normally means that someone screwed up their PROPERTY_SET_INFO macro usage.\n", + rtl::OUStringToOString (rEx.Message, RTL_TEXTENCODING_UTF8).getStr()); + } } } @@ -402,7 +393,7 @@ public: std::vector< Widget *> aChildChildren = pChild->maChildren; for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin(); - it != aChildChildren.end(); it++ ) + it != aChildChildren.end(); it++ ) pChild->removeChild( *it ); for ( std::vector< Widget *>::const_iterator it = aChildChildren.begin(); @@ -410,10 +401,10 @@ public: if ( !addChild( *it ) ) { // failure for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin(); - jt != it; jt++ ) + jt != it; jt++ ) removeChild( *jt ); for ( std::vector< Widget *>::const_iterator jt = aChildChildren.begin(); - jt != aChildChildren.end(); jt++ ) + jt != aChildChildren.end(); jt++ ) pChild->addChild( *jt ); return false; } @@ -433,7 +424,7 @@ public: { int i = 0; for ( std::vector< Widget *>::const_iterator it = maChildren.begin(); - it != maChildren.end(); it++, i++ ) + it != maChildren.end(); it++, i++ ) if ( *it == pChild ) break; return i; @@ -507,7 +498,7 @@ public: case CONTAINER_PROPERTY: if ( mpParent ) rValue = anyToString( layoutimpl::prophlp::getProperty( - mpParent->mxContainer->getChildProperties( mxWidget ), rPropName ) ); + mpParent->mxContainer->getChildProperties( mxWidget ), rPropName ) ); break; case WINBITS_PROPERTY: // TODO @@ -554,7 +545,7 @@ public: int nPropIt; PropertyIterator( Widget *pWidget, PropertyKind rKind ) - : mrKind( rKind ), nPropIt( 0 ) + : mrKind( rKind ), nPropIt( 0 ) { switch ( rKind ) { @@ -596,10 +587,10 @@ public: beans::Property next() { /* rtl::OUString propName, propValue; - propName = maProps[ nPropIt ]; - propValue = getProperty( propName, mrKind, false); - nPropIt++; - return std::pair< rtl::OUString, rtl::OUString > propPair( propName, propValue );*/ + propName = maProps[ nPropIt ]; + propValue = getProperty( propName, mrKind, false); + nPropIt++; + return std::pair< rtl::OUString, rtl::OUString > propPair( propName, propValue );*/ return maProps[ nPropIt++ ]; } }; @@ -611,13 +602,13 @@ class EditorRoot : public layoutimpl::LayoutRoot { public: EditorRoot( const uno::Reference< lang::XMultiServiceFactory >& xFactory, Widget *pParent ) - : layoutimpl::LayoutRoot( xFactory ), mpParent( pParent ) + : layoutimpl::LayoutRoot( xFactory ), mpParent( pParent ) { } // generation virtual layoutimpl::LayoutWidget *create( rtl::OUString id, const rtl::OUString unoName, - long attrbs, uno::Reference< awt::XLayoutContainer > xParent ) + long attrbs, uno::Reference< awt::XLayoutContainer > xParent ) { if ( unoName.compareToAscii( "dialog" ) == 0 ) return mpParent; @@ -637,126 +628,126 @@ public: /* Working with the layout in 1D, as if it was a flat list. */ namespace FlatLayout { - Widget *next( Widget *pWidget ) - { - Widget *pNext; - pNext = pWidget->down(); - if ( pNext ) return pNext; - pNext = pWidget->next(); - if ( pNext ) return pNext; - for ( Widget *pUp = pWidget->up(); pUp != NULL; pUp = pUp->up() ) - if ( (pNext = pUp->next()) != NULL ) - return pNext; - return NULL; - } +Widget *next( Widget *pWidget ) +{ + Widget *pNext; + pNext = pWidget->down(); + if ( pNext ) return pNext; + pNext = pWidget->next(); + if ( pNext ) return pNext; + for ( Widget *pUp = pWidget->up(); pUp != NULL; pUp = pUp->up() ) + if ( (pNext = pUp->next()) != NULL ) + return pNext; + return NULL; +} /* - Widget *prev( Widget *pWidget ) - { - Widget *pPrev; - pPrev = pWidget->prev(); - if ( !pPrev ) - return pWidget->up(); - - Widget *pBottom = pPrev->down(); - if ( pBottom ) - { - while ( pBottom->down() || pBottom->next() ) - { - for ( Widget *pNext = pBottom->next(); pNext; pNext = pNext->next() ) - pBottom = pNext; - Widget *pDown = pBottom->down(); - if ( pDown ) - pBottom = pDown; - } - return pBottom; - } - return pPrev; - } + Widget *prev( Widget *pWidget ) + { + Widget *pPrev; + pPrev = pWidget->prev(); + if ( !pPrev ) + return pWidget->up(); + + Widget *pBottom = pPrev->down(); + if ( pBottom ) + { + while ( pBottom->down() || pBottom->next() ) + { + for ( Widget *pNext = pBottom->next(); pNext; pNext = pNext->next() ) + pBottom = pNext; + Widget *pDown = pBottom->down(); + if ( pDown ) + pBottom = pDown; + } + return pBottom; + } + return pPrev; + } */ - bool moveWidget( Widget *pWidget, bool up /*or down*/ ) - { - // Keep child parent&pos for in case of failure - Widget *pOriContainer = pWidget->up(); - unsigned int oriChildPos = pOriContainer->getChildPos( pWidget ); - - // Get parent&sibling before removing it, since relations get cut - Widget *pSibling = up ? pWidget->prev() : pWidget->next(); - Widget *pContainer = pWidget->up(); - if ( !pContainer ) - return false; +bool moveWidget( Widget *pWidget, bool up /*or down*/ ) +{ + // Keep child parent&pos for in case of failure + Widget *pOriContainer = pWidget->up(); + unsigned int oriChildPos = pOriContainer->getChildPos( pWidget ); + + // Get parent&sibling before removing it, since relations get cut + Widget *pSibling = up ? pWidget->prev() : pWidget->next(); + Widget *pContainer = pWidget->up(); + if ( !pContainer ) + return false; - // try to swap with parent or child - // We need to allow for this at least for the root node... - if ( !pSibling ) + // try to swap with parent or child + // We need to allow for this at least for the root node... + if ( !pSibling ) + { + if ( up ) + { + if ( pContainer->swapWithChild( pWidget ) ) + return true; + } + else { - if ( up ) - { - if ( pContainer->swapWithChild( pWidget ) ) - return true; - } - else - { // TODO: this is a nice feature, but we probably want to do it explicitely... #if 0 - if ( pWidget->down() && pWidget->swapWithChild( pWidget->down() ) ) - return true; + if ( pWidget->down() && pWidget->swapWithChild( pWidget->down() ) ) + return true; #endif - } } + } - pContainer->removeChild( pWidget ); - - // if has up sibling -- append to it, else swap with it - if ( pSibling ) - { - if ( pSibling->addChild( pWidget, up ? 0xffff : 0 ) ) - return true; + pContainer->removeChild( pWidget ); - unsigned int childPos = pContainer->getChildPos( pSibling ); - if ( pContainer->addChild( pWidget, childPos + (up ? 0 : 1) ) ) - return true; // should always be succesful - } - // go through parents -- try to get prepended to them - else - { - for ( ; pContainer && pContainer->up(); pContainer = pContainer->up() ) - { - unsigned int childPos = pContainer->up()->getChildPos( pContainer ); - if ( pContainer->up()->addChild( pWidget, childPos + (up ? 0 : 1) ) ) - return true; - } - } + // if has up sibling -- append to it, else swap with it + if ( pSibling ) + { + if ( pSibling->addChild( pWidget, up ? 0xffff : 0 ) ) + return true; - // failed -- try to get it to its old position - if ( !pOriContainer->addChild( pWidget, oriChildPos ) ) + unsigned int childPos = pContainer->getChildPos( pSibling ); + if ( pContainer->addChild( pWidget, childPos + (up ? 0 : 1) ) ) + return true; // should always be succesful + } + // go through parents -- try to get prepended to them + else + { + for ( ; pContainer && pContainer->up(); pContainer = pContainer->up() ) { - // a parent should never reject a child back. but if it ever - // happens, just kill it, we don't run an orphanate here ;P - delete pWidget; - return true; + unsigned int childPos = pContainer->up()->getChildPos( pContainer ); + if ( pContainer->up()->addChild( pWidget, childPos + (up ? 0 : 1) ) ) + return true; } - return false; } - // NOTE: root is considered to be number -1 - Widget *get( Widget *pRoot, int nb ) + // failed -- try to get it to its old position + if ( !pOriContainer->addChild( pWidget, oriChildPos ) ) { - Widget *it; - for ( it = pRoot; it != NULL && nb >= 0; it = next( it ) ) - nb--; - return it; + // a parent should never reject a child back. but if it ever + // happens, just kill it, we don't run an orphanate here ;P + delete pWidget; + return true; } + return false; +} - int get( Widget *pRoot, Widget *pWidget ) - { - int nRet = -1; - Widget *it; - for ( it = pRoot; it != NULL && it != pWidget; it = next( it ) ) - nRet++; - return nRet; - } +// NOTE: root is considered to be number -1 +Widget *get( Widget *pRoot, int nb ) +{ + Widget *it; + for ( it = pRoot; it != NULL && nb >= 0; it = next( it ) ) + nb--; + return it; +} + +int get( Widget *pRoot, Widget *pWidget ) +{ + int nRet = -1; + Widget *it; + for ( it = pRoot; it != NULL && it != pWidget; it = next( it ) ) + nRet++; + return nRet; +} } //** PropertiesList widget @@ -774,7 +765,7 @@ class PropertiesList : public layout::Table DECL_LINK( FlagToggledHdl, layout::CheckBox* ); AnyWidget( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind ) - : mpWidget( pWidget ), maPropName( aPropName ), maPropKind( aPropKind ) + : mpWidget( pWidget ), maPropName( aPropName ), maPropKind( aPropKind ) { mpFlag = 0; mbBlockFlagCallback = false; @@ -852,7 +843,7 @@ class PropertiesList : public layout::Table AnyEdit( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, layout::Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::HBox( 0, false ), mpWinParent( pWinParent ) + : AnyWidget( pWidget, aPropName, aPropKind ), layout::HBox( 0, false ), mpWinParent( pWinParent ) { mpEdit = NULL; mpExpand = new layout::PushButton( pWinParent, WB_TOGGLE ); @@ -880,7 +871,7 @@ class PropertiesList : public layout::Table if ( mpEdit ) { text = mpEdit->GetText(); -printf("Remove mpEdit and expand\n"); + printf("Remove mpEdit and expand\n"); Remove( mpEdit ); Remove( mpExpand ); delete mpEdit; @@ -974,7 +965,7 @@ printf("Remove mpEdit and expand\n"); { AnyInteger( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), NumericField( pWinParent, WB_SPIN|WB_BORDER ) + : AnyWidget( pWidget, aPropName, aPropKind ), NumericField( pWinParent, WB_SPIN|WB_BORDER ) { load(); SetModifyHdl( LINK( this, AnyInteger, ApplyPropertyHdl ) ); @@ -1003,7 +994,7 @@ printf("Remove mpEdit and expand\n"); { AnyFloat( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyInteger( pWidget, aPropName, aPropKind, pWinParent ) + : AnyInteger( pWidget, aPropName, aPropKind, pWinParent ) {} virtual void store() @@ -1016,7 +1007,7 @@ printf("Remove mpEdit and expand\n"); { AnyCheckBox( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, layout::Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::CheckBox( pWinParent ) + : AnyWidget( pWidget, aPropName, aPropKind ), layout::CheckBox( pWinParent ) { // adding some whitespaces to make the hit area larger // SetText( String::CreateFromAscii( "" ) ); @@ -1060,7 +1051,7 @@ printf("Remove mpEdit and expand\n"); { AnyListBox( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::ListBox( pWinParent, WB_DROPDOWN ) + : AnyWidget( pWidget, aPropName, aPropKind ), layout::ListBox( pWinParent, WB_DROPDOWN ) { SetSelectHdl( LINK( this, AnyWidget, ApplyPropertyHdl ) ); } @@ -1084,7 +1075,7 @@ printf("Remove mpEdit and expand\n"); { AnyAlign( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyListBox( pWidget, aPropName, aPropKind, pWinParent ) + : AnyListBox( pWidget, aPropName, aPropKind, pWinParent ) { InsertEntry( XubString::CreateFromAscii( "Left" ) ); InsertEntry( XubString::CreateFromAscii( "Center" ) ); @@ -1100,7 +1091,7 @@ printf("Remove mpEdit and expand\n"); { AnyComboBox( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyWidget( pWidget, aPropName, aPropKind ), layout::ComboBox( pWinParent, WB_DROPDOWN ) + : AnyWidget( pWidget, aPropName, aPropKind ), layout::ComboBox( pWinParent, WB_DROPDOWN ) { SetModifyHdl( LINK( this, AnyComboBox, ApplyPropertyHdl ) ); } @@ -1124,7 +1115,7 @@ printf("Remove mpEdit and expand\n"); { AnyFontStyle( Widget *pWidget, rtl::OUString aPropName, Widget::PropertyKind aPropKind, Window *pWinParent ) - : AnyComboBox( pWidget, aPropName, aPropKind, pWinParent ) + : AnyComboBox( pWidget, aPropName, aPropKind, pWinParent ) { InsertEntry( XubString::CreateFromAscii( "Bold" ) ); InsertEntry( XubString::CreateFromAscii( "Italic" ) ); @@ -1138,71 +1129,71 @@ printf("Remove mpEdit and expand\n"); layout::CheckBox *mpFlag; AnyWidget *mpValue; - public: - PropertyEntry( layout::Window *pWinParent, AnyWidget *pAnyWidget ) + public: + PropertyEntry( layout::Window *pWinParent, AnyWidget *pAnyWidget ) + { + mpLabel = new layout::FixedText( pWinParent ); { - mpLabel = new layout::FixedText( pWinParent ); - { - // append ':' to aPropName - rtl::OUStringBuffer buf( pAnyWidget->maPropName ); - buf.append( sal_Unicode (':') ); - mpLabel->SetText( buf.makeStringAndClear() ); - } - mpValue = pAnyWidget; - mpFlag = new layout::CheckBox( pWinParent ); - mpFlag->SetToggleHdl( LINK( mpValue, AnyWidget, FlagToggledHdl ) ); - mpValue->mpFlag = mpFlag; + // append ':' to aPropName + rtl::OUStringBuffer buf( pAnyWidget->maPropName ); + buf.append( sal_Unicode (':') ); + mpLabel->SetText( buf.makeStringAndClear() ); } + mpValue = pAnyWidget; + mpFlag = new layout::CheckBox( pWinParent ); + mpFlag->SetToggleHdl( LINK( mpValue, AnyWidget, FlagToggledHdl ) ); + mpValue->mpFlag = mpFlag; + } - ~PropertyEntry() - { + ~PropertyEntry() + { #if DEBUG_PRINT fprintf(stderr, "REMOVING label, flag and value\n"); #endif - delete mpLabel; - delete mpFlag; - delete mpValue; - } + delete mpLabel; + delete mpFlag; + delete mpValue; + } - // Use this factory rather than the constructor -- check for NULL - static PropertyEntry *construct( Widget *pWidget, rtl::OUString aPropName, - Widget::PropertyKind aPropKind, sal_uInt16 nType, - layout::Window *pWinParent ) - { - AnyWidget *pAnyWidget; - switch (nType) { - case uno::TypeClass_STRING: - if ( aPropName.compareToAscii( "FontStyleName" ) == 0 ) - { - pAnyWidget = new AnyFontStyle( pWidget, aPropName, aPropKind, pWinParent ); - break; - } - pAnyWidget = new AnyEdit( pWidget, aPropName, aPropKind, pWinParent ); - break; - case uno::TypeClass_SHORT: - if ( aPropName.compareToAscii( "Align" ) == 0 ) - { - pAnyWidget = new AnyAlign( pWidget, aPropName, aPropKind, pWinParent ); - break; - } - // otherwise, treat as any other number... - case uno::TypeClass_LONG: - case uno::TypeClass_UNSIGNED_LONG: - pAnyWidget = new AnyInteger( pWidget, aPropName, aPropKind, pWinParent ); - break; - case uno::TypeClass_FLOAT: - case uno::TypeClass_DOUBLE: - pAnyWidget = new AnyFloat( pWidget, aPropName, aPropKind, pWinParent ); + // Use this factory rather than the constructor -- check for NULL + static PropertyEntry *construct( Widget *pWidget, rtl::OUString aPropName, + Widget::PropertyKind aPropKind, sal_uInt16 nType, + layout::Window *pWinParent ) + { + AnyWidget *pAnyWidget; + switch (nType) { + case uno::TypeClass_STRING: + if ( aPropName.compareToAscii( "FontStyleName" ) == 0 ) + { + pAnyWidget = new AnyFontStyle( pWidget, aPropName, aPropKind, pWinParent ); break; - case uno::TypeClass_BOOLEAN: - pAnyWidget = new AnyCheckBox( pWidget, aPropName, aPropKind, pWinParent ); + } + pAnyWidget = new AnyEdit( pWidget, aPropName, aPropKind, pWinParent ); + break; + case uno::TypeClass_SHORT: + if ( aPropName.compareToAscii( "Align" ) == 0 ) + { + pAnyWidget = new AnyAlign( pWidget, aPropName, aPropKind, pWinParent ); break; - default: - return NULL; - } - return new PropertyEntry( pWinParent, pAnyWidget ); + } + // otherwise, treat as any other number... + case uno::TypeClass_LONG: + case uno::TypeClass_UNSIGNED_LONG: + pAnyWidget = new AnyInteger( pWidget, aPropName, aPropKind, pWinParent ); + break; + case uno::TypeClass_FLOAT: + case uno::TypeClass_DOUBLE: + pAnyWidget = new AnyFloat( pWidget, aPropName, aPropKind, pWinParent ); + break; + case uno::TypeClass_BOOLEAN: + pAnyWidget = new AnyCheckBox( pWidget, aPropName, aPropKind, pWinParent ); + break; + default: + return NULL; } - }; + return new PropertyEntry( pWinParent, pAnyWidget ); + } + }; layout::Window *mpParentWindow; @@ -1249,12 +1240,12 @@ printf("Remove mpEdit and expand\n"); return true; } while ( min <= max ); return false; - } + } public: PropertiesList( layout::Dialog *dialog ) - : layout::Table( dialog, "properties-box" ) - , mpParentWindow( dialog ), mpSeparator( 0 ) + : layout::Table( dialog, "properties-box" ) + , mpParentWindow( dialog ), mpSeparator( 0 ) { } @@ -1318,7 +1309,7 @@ public: Container::Clear(); for ( std::list< PropertyEntry* >::iterator it = maPropertiesList.begin(); - it != maPropertiesList.end(); it++) + it != maPropertiesList.end(); it++) delete *it; maPropertiesList.clear(); @@ -1378,14 +1369,14 @@ IMPL_LINK( PropertiesList::PropertyEntry::AnyEdit, ExpandEditHdl, layout::PushBu class SortListBox { // For a manual sort ListBox; asks for a ListBox and Up/Down/Remove // buttons to wrap -DECL_LINK( ItemSelectedHdl, layout::ListBox* ); -DECL_LINK( UpPressedHdl, layout::Button* ); -DECL_LINK( DownPressedHdl, layout::Button* ); -DECL_LINK( RemovePressedHdl, layout::Button* ); -layout::PushButton *mpUpButton, *mpDownButton, *mpRemoveButton; + DECL_LINK( ItemSelectedHdl, layout::ListBox* ); + DECL_LINK( UpPressedHdl, layout::Button* ); + DECL_LINK( DownPressedHdl, layout::Button* ); + DECL_LINK( RemovePressedHdl, layout::Button* ); + layout::PushButton *mpUpButton, *mpDownButton, *mpRemoveButton; protected: -layout::ListBox *mpListBox; + layout::ListBox *mpListBox; virtual void upPressed( USHORT nPos ) { @@ -1431,8 +1422,8 @@ layout::ListBox *mpListBox; public: SortListBox( layout::ListBox *pListBox, layout::PushButton *pUpButton, layout::PushButton *pDownButton, layout::PushButton *pRemoveButton ) - : mpUpButton( pUpButton), mpDownButton( pDownButton), mpRemoveButton( pRemoveButton ), - mpListBox( pListBox ) + : mpUpButton( pUpButton), mpDownButton( pDownButton), mpRemoveButton( pRemoveButton ), + mpListBox( pListBox ) { mpListBox->SetSelectHdl( LINK( this, SortListBox, ItemSelectedHdl ) ); @@ -1516,10 +1507,10 @@ public: Widget *mpRootWidget; LayoutTree( layout::Dialog *dialog ) - : SortListBox( new layout::ListBox( dialog, "layout-tree" ), - new layout::PushButton( dialog, "layout-up-button" ), - new layout::PushButton( dialog, "layout-down-button" ), - new layout::PushButton( dialog, "layout-remove-button" ) ) + : SortListBox( new layout::ListBox( dialog, "layout-tree" ), + new layout::PushButton( dialog, "layout-up-button" ), + new layout::PushButton( dialog, "layout-down-button" ), + new layout::PushButton( dialog, "layout-remove-button" ) ) { layout::PeerHandle handle = dialog->GetPeerHandle( "preview-box" ); uno::Reference< awt::XLayoutConstrains > xWidget( handle, uno::UNO_QUERY ); @@ -1617,7 +1608,7 @@ public: for ( int kind = 0; kind < 2; kind++ ) { Widget::PropertyKind wKind = kind == 0 ? Widget::WINDOW_PROPERTY - : Widget::CONTAINER_PROPERTY; + : Widget::CONTAINER_PROPERTY; Widget::PropertyIterator it( i, wKind ); while ( it.hasNext() ) { @@ -1629,16 +1620,16 @@ public: if ( prop.Type.getTypeClass() == uno::TypeClass_BOOLEAN ) { if ( value.compareToAscii( "0" ) ) - value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("false") ); + value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("false") ); else - value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("true") ); + value = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("true") ); } if ( value.getLength() > 0 ) printf("%s%s=\"%s\" ", - kind == 0 ? "" : "cnt:", - OUSTRING_CSTR( toXMLNaming( prop.Name ) ), OUSTRING_CSTR( value ) - ); + kind == 0 ? "" : "cnt:", + OUSTRING_CSTR( toXMLNaming( prop.Name ) ), OUSTRING_CSTR( value ) + ); } } @@ -1719,7 +1710,7 @@ class EditorImpl : public LayoutTree::Listener public: EditorImpl( layout::Dialog *dialog, - // we should probable open this channel (or whatever its called) ourselves + // we should probable open this channel (or whatever its called) ourselves uno::Reference< lang::XMultiServiceFactory > xMSF ); virtual ~EditorImpl(); @@ -1754,7 +1745,7 @@ EditorImpl::EditorImpl( layout::Dialog *dialog, mpLayoutTree->setListener( this ); /* if ( xImport.is() ) - mpLayoutTree->getWidget( -1 )->addChild( new Widget( xImport, "import" ) );*/ + mpLayoutTree->getWidget( -1 )->addChild( new Widget( xImport, "import" ) );*/ // create buttons layout::Container aWidgets( dialog, "create-widget" ); @@ -1797,7 +1788,7 @@ EditorImpl::~EditorImpl() delete mpPropertiesList; delete mpLayoutTree; for ( std::list< layout::PushButton * >::const_iterator i = maCreateButtons.begin(); - i != maCreateButtons.end(); i++) + i != maCreateButtons.end(); i++) delete *i; delete pImportButton; delete pExportButton; @@ -1808,14 +1799,14 @@ EditorImpl::~EditorImpl() void EditorImpl::loadFile( const rtl::OUString &aTestFile ) { -fprintf( stderr, "TEST: layout instance\n" ); + fprintf( stderr, "TEST: layout instance\n" ); uno::Reference< awt::XLayoutRoot > xRoot ( new EditorRoot( mxFactory, mpLayoutTree->mpRootWidget ) ); /* -mxMSF->createInstance - ( ::rtl::OUString::createFromAscii( "com.sun.star.awt.Layout" ) ), - uno::UNO_QUERY ); + mxMSF->createInstance + ( ::rtl::OUString::createFromAscii( "com.sun.star.awt.Layout" ) ), + uno::UNO_QUERY ); */ if ( !xRoot.is() ) { @@ -1877,13 +1868,13 @@ void EditorImpl::widgetSelected( Widget *pWidget ) if ( !pWidget || pWidget->isContainer() ) { for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); it++) + it != maCreateButtons.end(); it++) (*it)->Enable(); } else { for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); it++) + it != maCreateButtons.end(); it++) (*it)->Disable(); } @@ -1894,7 +1885,7 @@ IMPL_LINK( EditorImpl, CreateWidgetHdl, layout::Button *, pBtn ) { int i = 0; for ( std::list< layout::PushButton *>::const_iterator it = maCreateButtons.begin(); - it != maCreateButtons.end(); it++, i++ ) + it != maCreateButtons.end(); it++, i++ ) { if ( pBtn == *it ) break; diff --git a/toolkit/workben/layout/empty.xml b/toolkit/workben/layout/empty.xml new file mode 100644 index 000000000000..a8408e55719e --- /dev/null +++ b/toolkit/workben/layout/empty.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated xml files are generated from this template by + transex3/layout/tralay. !--> + +<dialog xmlns="http://openoffice.org/2007/layout" + xmlns:cnt="http://openoffice.org/2007/layout/container" + title="Empty Test" optimumsize="true" has_border="true" sizeable="true" moveable="true"> + <vbox spacing="1" border="10"> + <min-size min-width="200"/> + <fixedline height="1"/> + <vbox spacing="10"> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + <vbox show="false"/> + </vbox> + <fixedline height="1"/> + </vbox> +</dialog> diff --git a/toolkit/workben/layout/insert-sheet.xml b/toolkit/workben/layout/insert-sheet.xml new file mode 100644 index 000000000000..2350da9aec77 --- /dev/null +++ b/toolkit/workben/layout/insert-sheet.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<modaldialog sizeable="true" closeable="true" moveable="true" output-size="true" id="RID_SCDLG_INSERT_TABLE" sv-look="true" _title="Insert Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> + <vbox spacing="5" border="5"> + <fixedline id="FL_POSITION" _text="Position"/> + <hbox> + <vbox cnt:padding="13" spacing="5"> + <radiobutton radiogroup="insert-sheet-position" id="RB_BEFORE" tabstop="true" _label="B~efore current sheet"/> + <radiobutton radiogroup="insert-sheet-position" id="RB_BEHIND" tabstop="true" _label="~After current sheet"/> + </vbox> + </hbox> + <fixedline id="FL_TABLE" _text="Sheet"/> + <hbox> + <vbox cnt:padding="13" spacing="5"> + <radiobutton radiogroup="insert-sheet-source" id="RB_NEW" _label="~New sheet"/> + <hbox> + <vbox cnt:padding="13" spacing="5" cnt:fill="false" cnt:expand="false"> + <fixedtext id="FT_COUNT" _label="N~o. of sheets"/> + <fixedtext id="FT_NAME" _label="Na~me"/> + </vbox> + <vbox> + <hbox> + <numericfield has_border="true" maximum="256" minimum="1" repeat="true" id="NF_COUNT" spin="true" spin-size="1" tabstop="true" value="1" cnt:fill="true" cnt:expand="false"/> + </hbox> + <edit has_border="true" id="ED_TABNAME" cnt:fill="true" cnt:expand="true"/> + </vbox> + </hbox> + </vbox> + </hbox> + <hbox> + <vbox cnt:padding="13" spacing="5"> + <radiobutton radiogroup="insert-sheet-source" id="RB_FROMFILE" _label="~From file"/> + <hbox> + <vbox cnt:padding="13" spacing="5"> + <hbox> + <multilistbox auto-hscroll="true" has_border="true" id="LB_TABLES" simple-mode="true" string-item-list=" : : : : " cnt:fill="true" cnt:expand="true"/> + <vbox cnt:fill="false" cnt:expand="false" spacing="5"> + <pushbutton id="BTN_BROWSE" _label="~Browse..." cnt:expand="false"/> + <checkbox id="CB_LINK" _label="Lin~k" cnt:expand="false"/> + <flow/> + </vbox> + </hbox> + <fixedtext id="FT_PATH" label="FT-PATH"/> + </vbox> + </hbox> + </vbox> + </hbox> + <dialogbuttonhbox border="5" spacing="5"> + <okbutton defbutton="true" id="BTN_OK"/> + <cancelbutton id="BTN_CANCEL"/> + <helpbutton id="BTN_HELP"/> + </dialogbuttonhbox> + </vbox> +</modaldialog> diff --git a/toolkit/workben/layout/makefile.mk b/toolkit/workben/layout/makefile.mk index a7f1a8dfcb97..0741a210d2e3 100644 --- a/toolkit/workben/layout/makefile.mk +++ b/toolkit/workben/layout/makefile.mk @@ -40,21 +40,18 @@ ENABLE_EXCEPTIONS=TRUE .IF "$(ENABLE_LAYOUT)" == "TRUE" -CFLAGS += -I$(PRJ)/source/layout - # Allow zoom and wordcount to be built without depending on svx,sv,sfx2 -CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc +CFLAGS += -I../$(PRJ)/svx/inc -I../$(PRJ)/svtools/inc -I../$(PRJ)/sfx2/inc -I../$(PRJ)/sc/inc -I../$(PRJ)/sc/source/ui/inc -I../$(PRJ)/sw/inc .INCLUDE : $(PRJ)$/util$/makefile.pmk -CFLAGS += -DENABLE_LAYOUT=1 -DTEST_LAYOUT=1 - .IF "$(COMNAME)" == "gcc3" CFLAGS+=-Wall -Wno-non-virtual-dtor .ENDIF CXXFILES=\ editor.cxx \ + plugin.cxx \ recover.cxx \ wordcountdialog.cxx \ test.cxx \ @@ -62,8 +59,11 @@ CXXFILES=\ OBJFILES=\ $(OBJ)$/editor.obj \ + $(OBJ)$/plugin.obj \ $(OBJ)$/recover.obj \ $(OBJ)$/test.obj \ + $(OBJ)$/tpsort.obj \ + $(OBJ)$/sortdlg.obj \ $(OBJ)$/wordcountdialog.obj \ $(OBJ)$/zoom.obj @@ -77,28 +77,39 @@ APP1STDLIBS= \ $(CPPUHELPERLIB) \ $(SALLIB) \ $(XMLSCRIPTLIB) \ - $(TKLIB) + $(TKLIB) \ + $(SVXLIB) \ + $(ISCLIB) \ +# svtools = $(INCCOM)/svtools -all: $(svtools) ALLTAR +default: ALLTAR -.INCLUDE : target.mk +.INCLUDE : target.mk XML_FILES=\ + insert-sheet.xml\ + message-box.xml\ + move-copy-sheet.xml\ recover.xml\ + sort-options.xml\ + string-input.xml\ + tab-dialog.xml\ wordcount.xml\ zoom.xml\ TRALAY=$(AUGMENT_LIBRARY_PATH) tralay XML_LANGS=$(alllangiso) -#ALL_XMLS=$(foreach,i,$(XML_LANGS) $(foreach,j,$(XML_FILES) $i/$j)) -ALLTAR: $(foreach,i,$(XML_FILES) en-US/$i) +ALLTAR: localize.sdf $(BIN)/testrc $(svtools) $(foreach,i,$(XML_FILES) en-US/$i) $(XML_LANGS:f:t"/%.xml ")/%.xml: %.xml $(TRALAY) -m localize.sdf -o . -l $(XML_LANGS:f:t" -l ") $< rm -rf en-US +$(BIN)/%: %.in + cp $< $@ + $(svtools): # FIXME: there's a bug in svtools layout or usage # Include files are in svtools/inc, but are referenced as <svtools/..> @@ -109,14 +120,35 @@ $(svtools): ln -sf ..$/$(PRJ)$/svtools$/inc $(INCCOM)$/svtools dist .PHONY : + cp -pv message-box.xml $(PRJ)/uiconfig/layout + cp -pv tab-dialog.xml $(PRJ)/uiconfig/layout $(SHELL) ./un-test.sh zoom.cxx > ../$(PRJ)/svx/source/dialog/zoom.cxx $(SHELL) ./un-test.sh zoom.hxx > ../$(PRJ)/svx/source/dialog/zoom.hxx touch ../$(PRJ)/svx/source/dialog/dlgfact.cxx + cp -pv zoom.xml ../$(PRJ)/svx/uiconfig/layout $(SHELL) ./un-test.sh wordcountdialog.cxx > ../$(PRJ)/sw/source/ui/dialog/wordcountdialog.cxx $(SHELL) ./un-test.sh wordcountdialog.hxx > ../$(PRJ)/sw/source/ui/inc/wordcountdialog.hxx touch ../$(PRJ)/sw/source/ui/dialog/swdlgfact.cxx -# FIXME: broken setup + cp -pv wordcount.xml ../$(PRJ)/sw/uiconfig/layout + # FIXME: broken setup ln -sf ../inc/wordcountdialog.hxx ../$(PRJ)/sw/source/ui/dialog/wordcountdialog.hxx + $(SHELL) ./un-test.sh tpsort.cxx > ../$(PRJ)/sc/source/ui/dbgui/tpsort.cxx + $(SHELL) ./un-test.sh tpsort.hxx > ../$(PRJ)/sc/source/ui/inc/tpsort.hxx + $(SHELL) ./un-test.sh sortdlg.cxx > ../$(PRJ)/sc/source/ui/dbgui/sortdlg.cxx + $(SHELL) ./un-test.sh sortdlg.hxx > ../$(PRJ)/sc/source/ui/inc/sortdlg.hxx + touch ../$(PRJ)/sc/source/ui/attrdlg/scdlgfact.cxx + touch ../$(PRJ)/sc/source/ui/view/cellsh2.cxx + cp -pv insert-sheet.xml ../$(PRJ)/sc/uiconfig/layout + cp -pv move-copy-sheet.xml ../$(PRJ)/sc/uiconfig/layout + cp -pv sort-options.xml ../$(PRJ)/sc/uiconfig/layout + cp -pv string-input.xml ../$(PRJ)/sc/uiconfig/layout + +localize.sdf: $(PRJ)/../svx/source/dialog/localize.sdf $(PRJ)/../sw/source/ui/dialog/localize.sdf $(PRJ)/../sc/source/ui/src/localize.sdf + grep sortdlg.src $(PRJ)/../sc/source/ui/src/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "sc\\uiconfig\\layout\\sort-options.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tRID_SCDLG_SORT_title/' > sort-options-$@ + grep wordcountdialog.src $(PRJ)/../sw/source/ui/dialog/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "sw\\uiconfig\\layout\\wordcount.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tDLG_WORDCOUNT_title/' > wordcount-$@ + grep zoom.src $(PRJ)/source/dialog/localize.sdf | awk -F'\t' '{{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "layout", "svx\\uiconfig\\layout\\zoom.xml", $$3, "layout", $$6 "_label", "", "", $$8, "0", $$10, $$11, $$12, "", $$14, $$15}}' | sed -e 's/\(\(FL\|STR\)_[^\t]*\)_label/\1_text/' -e 's/\t_label/\tRID_SVXDLG_ZOOM_title/' > zoom-$@ + echo '#empty' | cat - sort-options-$@ wordcount-$@ zoom-$@ > $@ + rm -f *-$@ .ELSE # ENABLE_LAYOUT != TRUE all .PHONY: diff --git a/toolkit/workben/layout/message-box.xml b/toolkit/workben/layout/message-box.xml new file mode 100644 index 000000000000..61305e443fa3 --- /dev/null +++ b/toolkit/workben/layout/message-box.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated xml files are generated from this template by + transex3/layout/tralay. !--> + +<modaldialog xmlns="http://openoffice.org/2007/layout" + xmlns:cnt="http://openoffice.org/2007/layout/container" + id="message-box" _title="" optimumsize="true" + has_border="true" sizeable="true" moveable="true" closeable="true"> + <vbox border="5" spacing="5"> + <hbox border="5" spacing="20"> + <align cnt:expand="false" cnt:fill="true"> + <fixedimage id="FI_ERROR" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="res/commandimagelist/msgbox-error.png" /> + </align> + <align cnt:expand="false" cnt:fill="true"> + <fixedimage id="FI_INFO" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="res/commandimagelist/msgbox-info.png" /> + </align> + <align cnt:expand="false" cnt:fill="true"> + <fixedimage id="FI_QUERY" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="res/commandimagelist/msgbox-query.png" /> + </align> + <align cnt:expand="false" cnt:fill="true"> + <fixedimage id="FI_WARNING" cnt:expand="false" cnt:v-align="0.5" cnt:v-fill="0" graphic="res/commandimagelist/msgbox-warning.png" /> + </align> + <align cnt:expand="false" cnt:fill="true"> + <fixedtext id="FT_MESSAGE" _label="FT-LABEL" cnt:v-align="0.5" cnt:v-fill="0" /> + </align> + <flow/> + </hbox> + <dialogbuttonhbox border="0" spacing="5"> + <flow/> + <!-- deprecoted vcl/MsgBox compatibility !--> + <retrybutton id="BTN_RETRY" /> + <ignorebutton id="BTN_IGNORE" /> + + <yesbutton id="BTN_YES"/> + <cancelbutton id="BTN_CANCEL"/> + <helpbutton id="BTN_HELP"/> + <nobutton id="BTN_NO" xlabel="~Alternate"/> + </dialogbuttonhbox> + </vbox> +</modaldialog> diff --git a/toolkit/workben/layout/move-copy-sheet.xml b/toolkit/workben/layout/move-copy-sheet.xml new file mode 100644 index 000000000000..3d26db1aa73d --- /dev/null +++ b/toolkit/workben/layout/move-copy-sheet.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<modaldialog sizeable="true" closeable="true" help-id="FID_TAB_MOVE" moveable="true" output-size="true" id="RID_SCDLG_MOVETAB" sv-look="true" _title="Move/Copy Sheet" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> + <vbox spacing="5" border="5"> + <string id="STR_NEWDOC" _text="- new document -"/> + <fixedtext id="FT_DEST" _label="To ~document"/> + <listbox has_border="true" dropdown="true" id="LB_DEST" tabstop="true"/> + <fixedtext id="FT_INSERT" _label="~Insert before"/> + <listbox has_border="true" id="LB_INSERT" tabstop="true" string-item-list=" : : : : " /> + <checkbox id="BTN_COPY" tabstop="true" _label="~Copy"/> + <dialogbuttonhbox border="5" spacing="5"> + <flow/> + <cancelbutton id="BTN_CANCEL" tabstop="true"/> + <helpbutton id="BTN_HELP" tabstop="true"/> + <okbutton defbutton="true" id="BTN_OK" tabstop="true"/> + </dialogbuttonhbox> + </vbox> +</modaldialog> diff --git a/toolkit/workben/layout/number-format.xml b/toolkit/workben/layout/number-format.xml new file mode 100644 index 000000000000..6f4c61d01b3e --- /dev/null +++ b/toolkit/workben/layout/number-format.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<tabpage help-id="HID_NUMBERFORMAT" show="false" id="RID_SVXPAGE_NUMBERFORMAT" _title="Number Format" _text="Number Format" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" sizeable="true"> + <!-- + <imagelist prefix="nu" id="IL_ICON"> + <maskcolor blue="0xFFFF" green="0x0000" red="0xFFFF" type="Color"/> + <idlist none="IID_INFO"/> + <idcount none="3"/> + </imagelist> + <imagelist prefix="nuh" id="IL_ICON_HC"> + <maskcolor blue="0xFFFF" green="0x0000" red="0xFFFF" type="Color"/> + <idlist none="IID_INFO"/> + <idcount none="3"/> + </imagelist> + !--> + <vbox spacing="5" border="5"> + <string id="STR_EUROPE" _text="Europe"/> + <string id="STR_AUTO_ENTRY" _text="Automatic"/> + <hbox spacing="5"> + <vbox spacing="5" cnt:fill="true" cnt:expand="true"> + <fixedtext id="FT_CATEGORY" _label="~Category"/> + <listbox line-count="8" auto-hscroll="true" has_border="true" id="LB_CATEGORY" _string-item-list="All:User-defined:Number:Percent:Currency:Date:Time:Scientific:Fraction:Boolean Value:Text"/> + <flow/> + </vbox> + <vbox spacing="5" cnt:fill="true" cnt:expand="true"> + <fixedtext id="FT_FORMAT" _label="F~ormat"/> + <listbox has_border="true" line-count="7" dropdown="true" id="LB_CURRENCY" tabstop="true" _string-item-list="Automatically" cnt:expand="false" cnt:fill="false"/> + <svxfontlistbox line-count="7" dropdown="false" has_border="true" help-id="HID_NUMBERFORMAT_LB_FORMAT" id="LB_FORMAT" tabstop="true" string-item-list=" : : : : : : : : : : : : : : : "/> + </vbox> + <vbox spacing="5" cnt:fill="true" cnt:expand="true"> + <fixedtext id="FT_LANGUAGE" _label="~Language" cnt:expand="false" cnt:fill="false"/> + <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" string-item-list="Dutch:" cnt:expand="false" cnt:fill="false"/> + <checkbox id="CB_SOURCEFORMAT" show="false" _label="So~urce format" cnt:expand="false" cnt:fill="false"/> + <flow cnt:expand="true" cnt:fill="true"/> + <window has_border="true" help-id="HID_NUMBERFORMAT_WND_NUMBER_PREVIEW" id="WND_NUMBER_PREVIEW" sv-look="true"/> + </vbox> + </hbox> + <fixedline id="FL_OPTIONS" _text="Options"/> + <hbox> + <vbox cnt:padding="13" spacing="5"> + <hbox spacing="5"> + <vbox spacing="5" cnt:fill="false" cnt:expand="false"> + <fixedtext id="FT_DECIMALS" _label="~Decimal places"/> + <fixedtext id="FT_LEADZEROES" _label="Leading ~zeroes"/> + </vbox> + <vbox spacing="5" cnt:fill="false" cnt:expand="false"> + <numericfield has_border="true" first="0" last="15" minimum="0" value="2" maximum="20" repeat="true" id="ED_DECIMALS" spin="true" spin-size="1" strict-format="true" cnt:expand="false"/> + <numericfield has_border="true" first="0" last="15" minimum="0" value="1" maximum="20" repeat="true" id="ED_LEADZEROES" spin="true" spin-size="1" strict-format="true" cnt:fill="false"/> + </vbox> + <vbox spacing="5" cnt:fill="false" cnt:expand="false"> + <checkbox id="BTN_NEGRED" _label="~Negative numbers red"/> + <checkbox id="BTN_THOUSAND" _label="~Thousands separator"/> + </vbox> + </hbox> + </vbox> + </hbox> + <fixedtext id="FT_EDFORMAT" _label="~Format code"/> + <hbox spacing="5" cnt:expand="false"> + <edit has_border="true" id="ED_FORMAT"/> + <imagebutton cnt:expand="false" cnt:fill="false" help-id="HID_NUMBERFORMAT_TBI_ADD" quick-help-text="Add" id="IB_ADD" sv-look="true" graphic="svx/res/nu01.png"/> + <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_INFO" quick-help-text="Edit Comment" id="IB_INFO" sv-look="true" graphic="svx/res/nu03.png"/> + <imagebutton cnt:expand="false" help-id="HID_NUMBERFORMAT_TBI_REMOVE" quick-help-text="Remove" id="IB_REMOVE" sv-look="true" graphic="svx/res/nu02.png"/> + </hbox> + <fixedtext no-label="true" show="false" id="FT_COMMENT" word-break="true" cnt:expand="false"/> + <edit has_border="true" show="false" id="ED_COMMENT" cnt:expand="false"/> + </vbox> +</tabpage> diff --git a/toolkit/workben/layout/plugin.cxx b/toolkit/workben/layout/plugin.cxx new file mode 100644 index 000000000000..28dafc2bba78 --- /dev/null +++ b/toolkit/workben/layout/plugin.cxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile$ + * + * $Revision$ + * + * last change: $Author$ $Date$ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 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 + * + ************************************************************************/ + +#define _LAYOUT_PLUGIN_CXX + +#include "plugin.hxx" + +#include <com/sun/star/awt/XDialog2.hpp> +#include <dialcontrol.hxx> +#include <toolkit/awt/vclxwindow.hxx> + +#include <layout/layout-pre.hxx> + +using namespace com::sun::star; + +#define LAYOUT_RES(x) #x + +#undef ModalDialog +#define ModalDialog( parent, id ) Dialog( parent, "plugin.xml", id ) + +PluginDialog::PluginDialog( Window* pParent ) + : ModalDialog( pParent, LAYOUT_RES( RID_DLG_PLUGIN ) ) + , aHeaderImage( this, LAYOUT_RES( FI_HEADER ) ) + , aHeaderText( this, LAYOUT_RES( FT_HEADER ) ) + , aHeaderLine( this, LAYOUT_RES( FL_HEADER ) ) + , aPlugin( this, LAYOUT_RES( PL_DIAL ), +// FIXME: width=, height=, are not recognized as properties. +// new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 0, 0 ), 0 ) ) + new svx::DialControl( LAYOUT_DIALOG_PARENT, Size( 80, 80 ), 0 ) ) + //, aDialControl( static_cast<svx::DialControl&> ( aPlugin.GetPlugin() ) ) + , aDialControl( static_cast<svx::DialControl&> ( *aPlugin.mpPlugin ) ) + , aOKBtn( this, LAYOUT_RES( BTN_OK ) ) + , aCancelBtn( this, LAYOUT_RES( BTN_CANCEL ) ) + , aHelpBtn( this, LAYOUT_RES( BTN_HELP ) ) +{ + aDialControl.SetRotation( 425 ); +} + +PluginDialog::~PluginDialog() +{ +} diff --git a/toolkit/workben/layout/plugin.hxx b/toolkit/workben/layout/plugin.hxx new file mode 100644 index 000000000000..4fe8edf36dc9 --- /dev/null +++ b/toolkit/workben/layout/plugin.hxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile$ + * + * $Revision$ + * + * last change: $Author$ $Date$ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 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 + * + ************************************************************************/ +#ifndef _LAYOUT_PLUGIN_HXX +#define _LAYOUT_PLUGIN_HXX + +#include <layout/layout.hxx> +#include <layout/layout-pre.hxx> + +namespace svx { +class DialControl; +} + +class PluginDialog : public ModalDialog +{ +private: + FixedImage aHeaderImage; + FixedText aHeaderText; + FixedLine aHeaderLine; + Plugin aPlugin; + svx::DialControl& aDialControl; + OKButton aOKBtn; + CancelButton aCancelBtn; + HelpButton aHelpBtn; + +public: + PluginDialog( Window* pParent ); + ~PluginDialog(); +}; + +#include <layout/layout-post.hxx> + +#endif /* _LAYOUT_PLUGIN_HXX */ + diff --git a/toolkit/workben/layout/plugin.xml b/toolkit/workben/layout/plugin.xml new file mode 100644 index 000000000000..c5f1b2abe040 --- /dev/null +++ b/toolkit/workben/layout/plugin.xml @@ -0,0 +1,29 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated xml files are generated from this template by + transex3/layout/tralay. !--> + +<modaldialog xmlns="http://openoffice.org/2007/layout" + xmlns:cnt="http://openoffice.org/2007/layout/container" + id="RID_DLG_PLUGIN" _title="Plugin Test" optimumsize="true" + help-id="SID_ATTR_PLUGIN" + has_border="true" sizeable="true" moveable="true"> + <vbox spacing="5" border="5"> + <hbox spacing="5" cnt:expand="false"> + <fixedimage id="FI_HEADER" cnt:expand="false" graphic="res/commandimagelist/sc_apply.png" /> + <fixedtext id="FT_HEADER" _label="Plugin Test"/> + </hbox> + <fixedline id="FL_HEADER"/> + <hbox> + <flow cnt:padding="80"/> + <plugin id="PL_DIAL" width="80" height="80"/> + </hbox> + <dialogbuttonhbox border="5" spacing="5"> + <flow/> + <okbutton defbutton="true" id="BTN_OK"/> + <cancelbutton id="BTN_CANCEL" /> + <helpbutton id="BTN_HELP"/> + </dialogbuttonhbox> + </vbox> +</modaldialog> + diff --git a/toolkit/workben/layout/recover.cxx b/toolkit/workben/layout/recover.cxx index d5bd542b36ac..c9a826688dc9 100644 --- a/toolkit/workben/layout/recover.cxx +++ b/toolkit/workben/layout/recover.cxx @@ -55,6 +55,13 @@ using namespace com::sun::star; #include <layout/layout-pre.hxx> +#if ENABLE_LAYOUT +#undef SVX_RES +#define SVX_RES(x) #x +#undef SfxModalDialog +#define SfxModalDialog( parent, id ) Dialog( parent, "recover.xml", id ) +#endif /* ENABLE_LAYOUT */ + #if TEST_LAYOUT SvxRecoverDialog::SvxRecoverDialog( Window* pParent ) #else /* !TEST_LAYOUT */ diff --git a/toolkit/workben/layout/recover.hxx b/toolkit/workben/layout/recover.hxx index dabaa863e511..0d0eee278e6b 100644 --- a/toolkit/workben/layout/recover.hxx +++ b/toolkit/workben/layout/recover.hxx @@ -35,7 +35,7 @@ #include <vcl/button.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> -#include <box.hxx> +#include <layout/core/box.hxx> #include <layout/layout-pre.hxx> class SvxRecoverDialog : public SfxModalDialog diff --git a/toolkit/workben/layout/recover.xml b/toolkit/workben/layout/recover.xml index a065c7d9243b..b7387b687de2 100644 --- a/toolkit/workben/layout/recover.xml +++ b/toolkit/workben/layout/recover.xml @@ -58,7 +58,7 @@ LINE TEST"/> <checkbox id="CH_LOGFILE" _label="Open additional text document to display the restore logfile"/> <dialogbuttonhbox border="5" spacing="5"> <flow/> - <okbutton id="BTN_OK" _label="Restore"/> + <okbutton defbutton="true" id="BTN_OK" _label="Restore"/> <cancelbutton id="BTN_CANCEL" /> <helpbutton id="BTN_HELP"/> </dialogbuttonhbox> diff --git a/toolkit/workben/layout/refresh b/toolkit/workben/layout/refresh index de2652ce2810..796999549c36 100644 --- a/toolkit/workben/layout/refresh +++ b/toolkit/workben/layout/refresh @@ -1,3 +1,7 @@ echo "source me ..." test -n "${INPATH}" && rm -Rf ../../${INPATH} -build debug=true && cp ../../${INPATH}/lib/*.so ../../../solver/680/${INPATH}/lib && dmake debug=true && ../../${INPATH}/bin/test "$@" +build debug=true\ + && cp ../../${INPATH}/lib/*.so ../../../solver/300/${INPATH}/lib \ + && cp -f ../..$INPATH/lib/libtkx.so $OOO_INSTALL_PREFIX/openoffice.org/basis3.0/program \ + && dmake debug=true \ + && ../../${INPATH}/bin/test "$@" diff --git a/toolkit/workben/layout/simple-paragraph.cxx b/toolkit/workben/layout/simple-paragraph.cxx index a7e60f83d3fa..c3f54a35f963 100644 --- a/toolkit/workben/layout/simple-paragraph.cxx +++ b/toolkit/workben/layout/simple-paragraph.cxx @@ -37,12 +37,12 @@ // include --------------------------------------------------------------- -#include <stdio.h> +#include <cstdio> #include <tools/shl.hxx> #include <sfx2/objsh.hxx> #include <vcl/msgbox.hxx> -#include <stdio.h> +#include <cstdio> namespace SVX { #include <svx/paraprev.hxx> // Preview diff --git a/toolkit/workben/layout/sort-options.xml b/toolkit/workben/layout/sort-options.xml new file mode 100644 index 000000000000..a409ac2d530a --- /dev/null +++ b/toolkit/workben/layout/sort-options.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<tabpage help-id="HID_SCPAGE_SORT_OPTIONS" + id="RID_SCPAGE_SORT_OPTIONS" + sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" + optimumsize="true" + sizeable="true" moveable="true"> + <vbox spacing="4" border="5"> + <string id="STR_COL_LABEL" _text="Range contains column la~bels"/> + <string id="STR_ROW_LABEL" _text="Range contains ~row labels"/> + <string id="SCSTR_UNDEFINED" _text="- undefined -"/> + <vbox spacing="4" border="5"> + <checkbox id="BTN_CASESENSITIVE" tabstop="true" _label="Case ~sensitive"/> + <checkbox id="BTN_LABEL" tabstop="true"/> + <checkbox id="BTN_FORMATS" tabstop="true" _label="Include ~formats"/> + <checkbox id="BTN_NATURALSORT" tabstop="true" _label="Enable ~natural sort"/> + <checkbox id="BTN_COPYRESULT" tabstop="true" _label="~Copy sort results to:"/> + <hbox> + <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/> + <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/> + </hbox> + <checkbox id="BTN_SORT_USER" tabstop="true" _label="Custom sort ~order"/> + <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/> + <hbox> + <fixedtext id="FT_LANGUAGE" _label="~Language"/> + <fixedtext id="FT_ALGORITHM" _label="O~ptions"/> + </hbox> + <hbox> + <svxlanguagebox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true" _string-item-list="Default"/> + <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/> + </hbox> + <fixedline id="FL_DIRECTION" _text="Direction"/> + <radiobutton id="BTN_TOP_DOWN" radiogroup="sort-options" tabstop="true" _label="~Top to bottom (sort rows)"/> + <radiobutton id="BTN_LEFT_RIGHT" radiogroup="sort-options" tabstop="true" _label="L~eft to right (sort columns)"/> + </vbox> + </vbox> +</tabpage> diff --git a/toolkit/workben/layout/sortdlg.cxx b/toolkit/workben/layout/sortdlg.cxx new file mode 100644 index 000000000000..9666e5a39124 --- /dev/null +++ b/toolkit/workben/layout/sortdlg.cxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sortdlg.cxx,v $ + * $Revision: 1.6 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#if !TEST_LAYOUT +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" +#endif /*! TEST_LAYOUT */ + +#undef SC_DLLIMPLEMENTATION + + + +#include "tpsort.hxx" +#include "sortdlg.hxx" +#include "scresid.hxx" +#include "sortdlg.hrc" + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <layout/layout-pre.hxx> +#endif + +ScSortDlg::ScSortDlg( Window* pParent, + const SfxItemSet* pArgSet ) : + SfxTabDialog( pParent, + ScResId( RID_SCDLG_SORT ), + pArgSet ), + bIsHeaders ( FALSE ), + bIsByRows ( FALSE ) + +{ +#if LAYOUT_SFX_TABDIALOG_BROKEN + AddTabPage( TP_FIELDS, ScTabPageSortFields::Create, 0 ); + AddTabPage( TP_OPTIONS, ScTabPageSortOptions::Create, 0 ); +#else /* !LAYOUT_SFX_TABDIALOG_BROKEN */ + String fields = rtl::OUString::createFromAscii ("fields"); + AddTabPage( TP_FIELDS, fields, ScTabPageSortFields::Create, 0, FALSE, TAB_APPEND); + String options = rtl::OUString::createFromAscii ("options"); + AddTabPage( TP_OPTIONS, options, ScTabPageSortOptions::Create, 0, FALSE, TAB_APPEND); +#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ + FreeResource(); +} + +__EXPORT ScSortDlg::~ScSortDlg() +{ +} + diff --git a/toolkit/workben/layout/sortdlg.hrc b/toolkit/workben/layout/sortdlg.hrc new file mode 100644 index 000000000000..4bf07ad3f59a --- /dev/null +++ b/toolkit/workben/layout/sortdlg.hrc @@ -0,0 +1,91 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sortdlg.hrc,v $ + * + * $Revision: 1.4 $ + * + * last change: $Author: rt $ $Date: 2005/09/08 21:51:32 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 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 + * + ************************************************************************/ + + +#include "sc.hrc" // -> RID_SCDLG_SORT + // -> RID_SCPAGE_SORT_FIELDS + // -> RID_SCPAGE_SORT_OPTIONS + // -> SCSTR_NONAME + // -> SCSTR_UNDEFINED + // -> SCSTR_FIELD + +/* +#define RID_SCDLG_SORT 256 +#define RID_SCPAGE_SORT_FIELDS 257 +#define RID_SCPAGE_SORT_OPTIONS 258 +*/ + +#define TP_FIELDS 1 +#define TP_OPTIONS 2 + +// TP_SORT_FIELDS: +#define FL_SORT1 1 +#define FL_SORT2 2 +#define FL_SORT3 3 +#define LB_SORT1 4 +#define LB_SORT2 5 +#define LB_SORT3 6 +#define BTN_UP1 7 +#define BTN_UP2 8 +#define BTN_UP3 9 +#define BTN_DOWN1 10 +#define BTN_DOWN2 11 +#define BTN_DOWN3 12 + +// TP_SORT_OPTIONS: +#define FL_DIRECTION 1 +#define LB_SORT_USER 2 +#define LB_OUTAREA 3 +#define ED_OUTAREA 4 +//#define FT_AREA_LABEL 5 +//#define FT_AREA 6 +#define BTN_SORT_USER 7 +#define BTN_CASESENSITIVE 8 +#define BTN_LABEL 9 +#define BTN_FORMATS 10 +#define BTN_COPYRESULT 11 +#define BTN_TOP_DOWN 12 +#define BTN_LEFT_RIGHT 13 +#define STR_COL_LABEL 14 +#define STR_ROW_LABEL 15 +#define FT_LANGUAGE 16 +#define LB_LANGUAGE 17 +#define FT_ALGORITHM 18 +#define LB_ALGORITHM 19 +#define BTN_NATURALSORT 20 + + + + diff --git a/toolkit/workben/layout/sortdlg.hxx b/toolkit/workben/layout/sortdlg.hxx new file mode 100644 index 000000000000..2be123f091ab --- /dev/null +++ b/toolkit/workben/layout/sortdlg.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sortdlg.hxx,v $ + * $Revision: 1.3 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_SORTDLG_HXX +#define SC_SORTDLG_HXX + +#include <sfx2/tabdlg.hxx> + +#if TEST_LAYOUT +#define LAYOUT_SFX_TABDIALOG_BROKEN 0 +#else /* !TEST_LAYOUT */ +#ifndef LAYOUT_SFX_TABDIALOG_BROKEN +#define LAYOUT_SFX_TABDIALOG_BROKEN 1 +#endif /* !LAYOUT_SFX_TABDIALOG_BROKEN */ +#endif /* !TEST_LAYOUT */ + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <sfx2/layout.hxx> +#include <layout/layout-pre.hxx> +#endif + +class ScSortDlg : public SfxTabDialog +{ +public: + ScSortDlg( Window* pParent, + const SfxItemSet* pArgSet ); + ~ScSortDlg(); + + void SetHeaders( BOOL bHeaders ); + void SetByRows ( BOOL bByRows ); + BOOL GetHeaders() const; + BOOL GetByRows () const; + + +private: + BOOL bIsHeaders; + BOOL bIsByRows; +}; + +inline void ScSortDlg::SetHeaders( BOOL bHeaders ) { bIsHeaders = bHeaders; } +inline void ScSortDlg::SetByRows ( BOOL bByRows ) { bIsByRows = bByRows; } +inline BOOL ScSortDlg::GetHeaders() const { return bIsHeaders; } +inline BOOL ScSortDlg::GetByRows () const { return bIsByRows; } + +#if !LAYOUT_SFX_TABDIALOG_BROKEN +#include <layout/layout-post.hxx> +#endif + +#endif // SC_SORTDLG_HXX diff --git a/toolkit/workben/layout/sortdlg.src b/toolkit/workben/layout/sortdlg.src new file mode 100644 index 000000000000..06453e54fd29 --- /dev/null +++ b/toolkit/workben/layout/sortdlg.src @@ -0,0 +1,325 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: sortdlg.src,v $ + * + * $Revision: 1.41 $ + * + * last change: $Author: ihi $ $Date: 2007/04/19 16:48:19 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 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 + * + ************************************************************************/ +#include "sortdlg.hrc" +TabPage RID_SCPAGE_SORT_FIELDS +{ + Hide = TRUE ; + SVLook = TRUE ; + HelpId = HID_SCPAGE_SORT_FIELDS ; + Size = MAP_APPFONT ( 260 , 185 ) ; + ListBox LB_SORT1 + { + Border = TRUE ; + Pos = MAP_APPFONT ( 12 , 19 ) ; + Size = MAP_APPFONT ( 154 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + RadioButton BTN_UP1 + { + Pos = MAP_APPFONT ( 172 , 14 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "~Ascending" ; + TabStop = TRUE ; + }; + RadioButton BTN_DOWN1 + { + Pos = MAP_APPFONT ( 172 , 28 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "~Descending" ; + TabStop = TRUE ; + }; + FixedLine FL_SORT1 + { + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Sort ~by" ; + }; + ListBox LB_SORT2 + { + Border = TRUE ; + Pos = MAP_APPFONT ( 12 , 60 ) ; + Size = MAP_APPFONT ( 154 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + RadioButton BTN_UP2 + { + Pos = MAP_APPFONT ( 172 , 55 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "A~scending" ; + TabStop = TRUE ; + }; + RadioButton BTN_DOWN2 + { + Pos = MAP_APPFONT ( 172 , 69 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "D~escending" ; + TabStop = TRUE ; + }; + FixedLine FL_SORT2 + { + Pos = MAP_APPFONT ( 6 , 44 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Then b~y" ; + }; + ListBox LB_SORT3 + { + Border = TRUE ; + Pos = MAP_APPFONT ( 12 , 101 ) ; + Size = MAP_APPFONT ( 154 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + RadioButton BTN_UP3 + { + Pos = MAP_APPFONT ( 172 , 96 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "As~cending" ; + TabStop = TRUE ; + }; + RadioButton BTN_DOWN3 + { + Pos = MAP_APPFONT ( 172 , 110 ) ; + Size = MAP_APPFONT ( 79 , 10 ) ; + Text [ en-US ] = "Desce~nding" ; + TabStop = TRUE ; + }; + FixedLine FL_SORT3 + { + Pos = MAP_APPFONT ( 6 , 85 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "T~hen by" ; + }; +}; +TabPage RID_SCPAGE_SORT_OPTIONS +{ + Hide = TRUE ; + SVLook = TRUE ; + HelpId = HID_SCPAGE_SORT_OPTIONS ; + Pos = MAP_APPFONT ( 0 , 0 ) ; + Size = MAP_APPFONT ( 260 , 185 ) ; + CheckBox BTN_CASESENSITIVE + { + Pos = MAP_APPFONT ( 12 , 6 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "Case ~sensitive" ; + TabStop = TRUE ; + }; + CheckBox BTN_LABEL + { + Pos = MAP_APPFONT ( 12 , 20 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + TabStop = TRUE ; + }; + String STR_COL_LABEL + { + Text [ en-US ] = "Range contains column la~bels" ; + }; + String STR_ROW_LABEL + { + Text [ en-US ] = "Range contains ~row labels" ; + }; + CheckBox BTN_FORMATS + { + Pos = MAP_APPFONT ( 12 , 34 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "Include ~formats" ; + TabStop = TRUE ; + }; + CheckBox BTN_NATURALSORT + { + Pos = MAP_APPFONT ( 12 , 48 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ de ] = "Enable ~natural sort" ; + Text [ en-US ] = "Enable ~natural sort" ; + Text [ cs ] = "Aktivovat přirozené třídění" ; + Text [ sk ] = "Aktivovať prirodzené triedenie" ; + TabStop = TRUE ; + Text [ x-comment ] = " " ; + }; + CheckBox BTN_COPYRESULT + { + Pos = MAP_APPFONT ( 12 , 62 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "~Copy sort results to:" ; + TabStop = TRUE ; + }; + ListBox LB_OUTAREA + { + Border = TRUE ; + Pos = MAP_APPFONT ( 20 , 73 ) ; + Size = MAP_APPFONT ( 93 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + Edit ED_OUTAREA + { + Disable = TRUE ; + Border = TRUE ; + Pos = MAP_APPFONT ( 119 , 73 ) ; + Size = MAP_APPFONT ( 132 , 12 ) ; + TabStop = TRUE ; + }; + CheckBox BTN_SORT_USER + { + Pos = MAP_APPFONT ( 12 , 89 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "Custom sort ~order" ; + TabStop = TRUE ; + }; + ListBox LB_SORT_USER + { + Disable = TRUE ; + Border = TRUE ; + Pos = MAP_APPFONT ( 20 , 100 ) ; + Size = MAP_APPFONT ( 231 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + FixedText FT_LANGUAGE + { + Pos = MAP_APPFONT ( 12 , 118 ) ; + Size = MAP_APPFONT ( 101 , 8 ) ; + Text [ en-US ] = "~Language"; + }; + ListBox LB_LANGUAGE + { + Border = TRUE ; + Pos = MAP_APPFONT ( 12 , 129 ) ; + Size = MAP_APPFONT ( 101 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + Sort = TRUE ; + }; + FixedText FT_ALGORITHM + { + Pos = MAP_APPFONT ( 119 , 118 ) ; + Size = MAP_APPFONT ( 132 , 8 ) ; + Text [ en-US ] = "O~ptions"; + }; + ListBox LB_ALGORITHM + { + Border = TRUE ; + Pos = MAP_APPFONT ( 119 , 129 ) ; + Size = MAP_APPFONT ( 132 , 90 ) ; + TabStop = TRUE ; + DropDown = TRUE ; + }; + FixedLine FL_DIRECTION + { + Pos = MAP_APPFONT ( 6 , 147 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Direction" ; + }; + RadioButton BTN_TOP_DOWN + { + Pos = MAP_APPFONT ( 12 , 158 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "~Top to bottom (sort rows)" ; + TabStop = TRUE ; + }; + RadioButton BTN_LEFT_RIGHT + { + Pos = MAP_APPFONT ( 12 , 172 ) ; + Size = MAP_APPFONT ( 242 , 10 ) ; + Text [ en-US ] = "L~eft to right (sort columns)" ; + TabStop = TRUE ; + }; +/* + FixedText FT_AREA_LABEL + { + Pos = MAP_APPFONT ( 6 , 171 ) ; + Size = MAP_APPFONT ( 248 , 8 ) ; + Text [ en-US ] = "Data area:" ; + }; +*/ +}; +TabDialog RID_SCDLG_SORT +{ + OutputSize = TRUE ; + SVLook = TRUE ; + Size = MAP_APPFONT ( 220 , 175 ) ; + Text [ en-US ] = "Sort" ; + Moveable = TRUE ; + Closeable = FALSE ; + TabControl 1 + { + OutputSize = TRUE ; + Pos = MAP_APPFONT ( 0 , 0 ) ; + Size = MAP_APPFONT ( 210 , 170 ) ; + PageList = + { + PageItem + { + Identifier = TP_FIELDS ; + PageResID = TP_FIELDS ; + Text [ en-US ] = "Sort Criteria" ; + }; + PageItem + { + Identifier = TP_OPTIONS ; + PageResID = TP_OPTIONS ; + Text [ en-US ] = "Options" ; + }; + }; + }; + OKButton 1 + { + Pos = MAP_APPFONT ( 3 , 157 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + }; + CancelButton 1 + { + Pos = MAP_APPFONT ( 49 , 157 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + }; + PushButton 1 + { + Pos = MAP_APPFONT ( 137 , 157 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + }; + HelpButton 1 + { + Pos = MAP_APPFONT ( 94 , 157 ) ; + Size = MAP_APPFONT ( 40 , 12 ) ; + TabStop = TRUE ; + }; +}; + + diff --git a/toolkit/workben/layout/sortdlg.xml b/toolkit/workben/layout/sortdlg.xml new file mode 100644 index 000000000000..ce45a60ff1ee --- /dev/null +++ b/toolkit/workben/layout/sortdlg.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<tabpage help-id="HID_SCPAGE_SORT_FIELDS" hide="true" id="RID_SCPAGE_SORT_FIELDS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> + <vbox> + <fixedline id="FL_SORT1" text="Sort ~by"/> + <radiobutton id="BTN_UP1" tabstop="true" label="~Ascending"/> + <listbox has_border="true" dropdown="true" id="LB_SORT1" tabstop="true"/> + <radiobutton id="BTN_DOWN1" tabstop="true" label="~Descending"/> + <fixedline id="FL_SORT2" text="Then b~y"/> + <radiobutton id="BTN_UP2" tabstop="true" label="A~scending"/> + <listbox has_border="true" dropdown="true" id="LB_SORT2" tabstop="true"/> + <radiobutton id="BTN_DOWN2" tabstop="true" label="D~escending"/> + <fixedline id="FL_SORT3" text="T~hen by"/> + <radiobutton id="BTN_UP3" tabstop="true" label="As~cending"/> + <listbox has_border="true" dropdown="true" id="LB_SORT3" tabstop="true"/> + <radiobutton id="BTN_DOWN3" tabstop="true" label="Desce~nding"/> + </vbox> +</tabpage> +<tabpage help-id="HID_SCPAGE_SORT_OPTIONS" hide="true" id="RID_SCPAGE_SORT_OPTIONS" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> + <string id="STR_COL_LABEL" text="Range contains column la~bels"/> + <string id="STR_ROW_LABEL" text="Range contains ~row labels"/> + <vbox> + <checkbox id="BTN_CASESENSITIVE" tabstop="true" label="Case ~sensitive"/> + <checkbox id="BTN_LABEL" tabstop="true"/> + <checkbox id="BTN_FORMATS" tabstop="true" label="Include ~formats"/> + <checkbox id="BTN_NATURALSORT" tabstop="true" label=" "/> + <checkbox id="BTN_COPYRESULT" tabstop="true" label="~Copy sort results to:"/> + <hbox> + <listbox has_border="true" dropdown="true" id="LB_OUTAREA" tabstop="true"/> + <edit has_border="true" disable="true" id="ED_OUTAREA" tabstop="true"/> + </hbox> + <checkbox id="BTN_SORT_USER" tabstop="true" label="Custom sort ~order"/> + <listbox has_border="true" disable="true" dropdown="true" id="LB_SORT_USER" tabstop="true"/> + <hbox> + <fixedtext id="FT_LANGUAGE" label="~Language"/> + <fixedtext id="FT_ALGORITHM" label="O~ptions"/> + </hbox> + <hbox> + <listbox has_border="true" dropdown="true" id="LB_LANGUAGE" sort="true" tabstop="true"/> + <listbox has_border="true" dropdown="true" id="LB_ALGORITHM" tabstop="true"/> + </hbox> + <fixedline id="FL_DIRECTION" text="Direction"/> + <radiobutton id="BTN_TOP_DOWN" tabstop="true" label="~Top to bottom (sort rows)"/> + <radiobutton id="BTN_LEFT_RIGHT" tabstop="true" label="L~eft to right (sort columns)"/> + </vbox> +</tabpage> +<tabdialog closeable="false" moveable="true" output-size="true" id="RID_SCDLG_SORT" sv-look="true" text="Sort" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> + <vbox> + <tabcontrol output-size="true" id="1"> + <pagelist> + <pageitem identifier="TP_FIELDS" page-res-id="TP_FIELDS" text="Sort Criteria"/> + <pageitem identifier="TP_OPTIONS" page-res-id="TP_OPTIONS" text="Options"/> + </pagelist> + </tabcontrol> + <hbox> + <okbutton defbutton="true" id="1" tabstop="true"/> + <cancelbutton id="1" tabstop="true"/> + <helpbutton id="1" tabstop="true"/> + <pushbutton id="1" tabstop="true"/> + </hbox> + </vbox> +</tabdialog> diff --git a/toolkit/workben/layout/string-input.xml b/toolkit/workben/layout/string-input.xml new file mode 100644 index 000000000000..b1aed5197c17 --- /dev/null +++ b/toolkit/workben/layout/string-input.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This is a template. i18n translation is not performed in-place; + i18n translated XML files are generated from this template by + transex3/layout/tralay. !--> + +<modaldialog sizeable="true" closeable="false" moveable="true" output-size="true" id="RID_SCDLG_STRINPUT" sv-look="true" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container" title="Insert String"> + <vbox spacing="5" border="5"> + <fixedtext id="FT_LABEL" label="FT-LABEL"/> + <edit has_border="true" id="ED_INPUT" tabstop="true"/> + <dialogbuttonhbox border="5" spacing="5"> + <okbutton defbutton="true" id="BTN_OK" tabstop="true"/> + <cancelbutton id="BTN_CANCEL" tabstop="true"/> + <helpbutton id="BTN_HELP" tabstop="true"/> + </dialogbuttonhbox> + </vbox> +</modaldialog> diff --git a/toolkit/workben/layout/tab-dialog.xml b/toolkit/workben/layout/tab-dialog.xml new file mode 100644 index 000000000000..da75f03e9df5 --- /dev/null +++ b/toolkit/workben/layout/tab-dialog.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<dialog xmlns="http://openoffice.org/2007/layout" + xmlns:cnt="http://openoffice.org/2007/layout/container" + _title="layout::TabDialog" optimumsize="true" + id="tab-dialog" + has_border="true" sizeable="true" moveable="true"> + <vbox spacing="5" border="5"> + <tabcontrol id="ID_TABCONTROL"/> + <dialogbuttonhbox border="5" spacing="5" cnt:expand="false"> + <flow/> + <okbutton defbutton="true" id="BTN_OK" show="false"/> + <pushbutton id="BTN_USER" _label="<User>" show="false"/> + <cancelbutton id="BTN_CANCEL" show="false"/> + <helpbutton id="BTN_HELP" show="false"/> + <resetbutton id="BTN_RESET" show="false"/> + <pushbutton id="BTN_BASEFMT" _label="<Base Format>" show="false"/> + </dialogbuttonhbox> + </vbox> +</dialog> diff --git a/toolkit/workben/layout/tabcontrol.xml b/toolkit/workben/layout/tabcontrol.xml index 106489a457a9..2986f1f9e0d9 100644 --- a/toolkit/workben/layout/tabcontrol.xml +++ b/toolkit/workben/layout/tabcontrol.xml @@ -1,18 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> <dialog xmlns="http://openoffice.org/2007/layout" - xmlns:cnt="http://openoffice.org/2007/layout/container" - title="TabControl Test" optimumsize="true" - has_border="true" sizeable="true" moveable="true"> + xmlns:cnt="http://openoffice.org/2007/layout/container" + title="TabControl Test" optimumsize="true" + has_border="true" sizeable="true" moveable="true"> <vbox> - <tabcontrol> - <pushbutton label="Child 1" cnt:title="Page 1" /> - <edit has_border="true" text="Child 2" cnt:title="Page 2" /> - <vbox cnt:title="Page 3"> - <pushbutton label="Child 3"/> - <edit has_border="true" text="Child 4" /> - </vbox> - </tabcontrol> - <okbutton cnt:expand="false" /> + <tabcontrol> + <pushbutton label="Child 1" cnt:title="Page 1" /> + <edit has_border="true" text="Child 2" cnt:title="Page 2" /> + <vbox cnt:title="Page 3"> + <pushbutton label="Child 3"/> + <edit has_border="true" text="Child 4" /> + </vbox> + </tabcontrol> + <okbutton cnt:expand="false" /> </vbox> </dialog> diff --git a/toolkit/workben/layout/test.cxx b/toolkit/workben/layout/test.cxx index b98eaff2fc80..1bd9603fc5ac 100644 --- a/toolkit/workben/layout/test.cxx +++ b/toolkit/workben/layout/test.cxx @@ -30,7 +30,6 @@ ************************************************************************/ #include <vcl/svapp.hxx> -//#include <transex3/vosapp.hxx> // This works and was used before for standalone test, not sure why // we'd want it. @@ -38,29 +37,41 @@ #include "uno.hxx" #include <cstdio> -#include <osl/file.h> +#include <cstdlib> +#include <sys/stat.h> -#include <rtl/ustring.hxx> +#include <com/sun/star/xml/sax/SAXException.hpp> +#include <comphelper/processfactory.hxx> #include <cppuhelper/bootstrap.hxx> - -#include <ucbhelper/contentbroker.hxx> +#include <rtl/ustring.hxx> #include <ucbhelper/configurationkeys.hxx> +#include <ucbhelper/contentbroker.hxx> -#include <comphelper/processfactory.hxx> -#include <com/sun/star/xml/sax/SAXException.hpp> +#define SORT_DLG 1 /* requires sfx2, svx to be compiled */ +#if SORT_DLG +#include "scitems.hxx" +#include "uiitems.hxx" +#endif /* SORT_DLG */ #include "editor.hxx" -#include "wordcountdialog.hxx" +#include "plugin.hxx" #undef _LAYOUT_POST_HXX -#include "zoom.hxx" +#include "recover.hxx" #undef _LAYOUT_POST_HXX -#include "recover.hxx" +#if SORT_DLG +#include "sortdlg.hxx" +#undef _LAYOUT_POST_HXX +#endif /* SORT_DLG */ + +#include "wordcountdialog.hxx" +#undef _LAYOUT_POST_HXX + +#include "zoom.hxx" #undef _LAYOUT_POST_HXX -//#undef SW_WORDCOUNTDIALOG_HXX #include <layout/layout-pre.hxx> using namespace ::rtl; @@ -68,38 +79,6 @@ using namespace ::cppu; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; -Reference< XComponentContext > createInitialComponentContext( - OUString const & inst_dir ) -{ - Reference< XComponentContext > xContext; - - try - { - OUString file_url; - oslFileError rc = osl_getFileURLFromSystemPath( - inst_dir.pData, &file_url.pData ); - OSL_ASSERT( osl_File_E_None == rc ); - (void) rc; // quiet warning - - OUString unorc = file_url + OUString( - OUString::createFromAscii( "/program/" SAL_CONFIGFILE( "uno" )) ); - - return defaultBootstrap_InitialComponentContext( unorc ); - } - - catch( Exception& rExc ) - { - OString aStr( OUStringToOString( rExc.Message, - RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, aStr.getStr() ); - } - - return xContext; -} - - -// ----------------------------------------------------------------------- - class LayoutTest : public Application { Reference< XComponentContext > mxContext; @@ -115,7 +94,7 @@ public: void RunEditor(); void RunFiles(); void ExceptionalMain(); - void IInit(); + void Init(); void InitUCB(); void LoadFile( OUString const &aName ); void Main(); @@ -124,18 +103,29 @@ public: static void usage() { - fprintf (stderr, "usage: test [--inst inst_dir] [DIALOG.XML]... | --test [DIALOG.XML]\n" ); + fprintf (stderr, "usage: test [--inst OOO_INSTALL_PREFIX] [DIALOG.XML]... | --test [DIALOG.XML]\n" ); exit( 2 ); } +static uno::Reference< lang::XSingleServiceFactory > get_factory( char const *service ) +{ + uno::Reference< lang::XSingleServiceFactory > xFactory( + comphelper::createProcessComponent( + rtl::OUString::createFromAscii( service ) ), uno::UNO_QUERY ); + + if ( !xFactory.is() ) + fprintf( stderr, "error loading: %s\n", service ); + return xFactory; +} + +#define GET_FACTORY(x) get_factory( #x ) + void LayoutTest::LoadFile( const OUString &aTestFile ) { fprintf( stderr, "TEST: layout instance\n" ); - uno::Reference< lang::XSingleServiceFactory > xFactory( - comphelper::createProcessComponent( - rtl::OUString::createFromAscii( "com.sun.star.awt.Layout" ) ), - uno::UNO_QUERY ); + uno::Reference< lang::XSingleServiceFactory > xFactory + = GET_FACTORY( com.sun.star.awt.Layout ); if ( !xFactory.is() ) { fprintf( stderr, "Layout engine not installed\n" ); @@ -155,40 +145,51 @@ void LayoutTest::LoadFile( const OUString &aTestFile ) fprintf( stderr, "TEST: file loaded\n" ); } -// Nurgh ... void LayoutTest::InitUCB() { OUString aEmpty; - Sequence< Any > aArgs(6); + Sequence< Any > aArgs( 6 ); aArgs[0] - <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY1_LOCAL); + <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ); aArgs[1] - <<= OUString::createFromAscii(UCB_CONFIGURATION_KEY2_OFFICE); + <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ); aArgs[2] <<= OUString::createFromAscii( "PIPE" ); aArgs[3] <<= aEmpty; aArgs[4] <<= OUString::createFromAscii( "PORTAL" ); aArgs[5] <<= aEmpty; - if (! ::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) ) + if ( !::ucbhelper::ContentBroker::initialize( mxMSF, aArgs ) ) + { fprintf( stderr, "Failed to init content broker\n" ); + fprintf( stderr, "arg[0]: %s\n", UCB_CONFIGURATION_KEY1_LOCAL ); + fprintf( stderr, "arg[1]: %s\n", UCB_CONFIGURATION_KEY2_OFFICE ); + } +} + +static void support_upstream_brand_prefix () +{ + if ( char const* inst = getenv( "OOO_INSTALL_PREFIX" ) ) + { + char const *brand_prefix = "/openoffice.org3"; + OUString brand_dir = OUString::createFromAscii( inst ) + + OUString::createFromAscii( brand_prefix ); + struct stat stat_info; + if ( !stat ( OUSTRING_CSTR( brand_dir ), &stat_info ) ) + { + OSL_TRACE( "Appending %s to OOO_INSTALL_PREFIX", brand_prefix ); + setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( brand_dir ), 1 ); + } + } } -#define INIT_ENV_VOODOO( installDir ) \ - /* Unless you do this, obviously you don't deserve to have anything work */ \ - OString aCfg = "CFG_INIFILE=file://" \ - + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ) \ - + "/program/configmgrrc"; \ - putenv( (char *)aCfg.getStr() ); \ - /* Unless you do this, obviously you don't want your paths to be correct & \ - hence no images.zip location is possible. */ \ - OString aBaseInst = "BaseInstallation=file://" \ - + OUStringToOString( installDir, RTL_TEXTENCODING_UTF8 ); \ - putenv( (char *)aBaseInst.getStr() ); \ - -void LayoutTest::IInit() +void LayoutTest::Init() { - INIT_ENV_VOODOO( mInstallDir ); - mxContext = createInitialComponentContext( mInstallDir ); + ParseCommandLine(); + setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 0 ); + support_upstream_brand_prefix (); + OSL_TRACE( "OOO_INSTALL_PREFIX=%s", getenv( "OOO_INSTALL_PREFIX" ) ); + + mxContext = defaultBootstrap_InitialComponentContext(); mxMSF = new UnoBootstrapLayout( Reference< lang::XMultiServiceFactory >( mxContext->getServiceManager(), UNO_QUERY ) ); ::comphelper::setProcessServiceFactory( mxMSF ); InitUCB(); @@ -196,6 +197,7 @@ void LayoutTest::IInit() void LayoutTest::ParseCommandLine() { + printf ("%s\n", __PRETTY_FUNCTION__); for ( sal_uInt16 i = 0; i < GetCommandLineParamCount(); i++ ) { OUString aParam = OUString( GetCommandLineParam( i ) ); @@ -206,6 +208,7 @@ void LayoutTest::ParseCommandLine() if ( i >= GetCommandLineParamCount() - 1) usage(); mInstallDir = GetCommandLineParam( ++i ); + setenv( "OOO_INSTALL_PREFIX", OUSTRING_CSTR( mInstallDir ), 1 ); } else if ( aParam.equalsAscii( "--test" ) ) { @@ -234,32 +237,77 @@ void LayoutTest::RunEditor() editor.Execute(); } -void RunDialog( layout::Dialog& dialog ) +short RunDialog( Dialog& dialog ) { dialog.Show(); - dialog.Execute(); - fprintf( stderr, "1st execute exited" ); - dialog.Execute(); - fprintf( stderr, "2nd execute exited" ); + short result = dialog.Execute(); + fprintf( stderr, "Done: dialog execute exited:%d\n", result); + return result; } +#undef Dialog +short RunDialog( ::Dialog& dialog ) +{ + dialog.Show(); + short result = dialog.Execute(); + fprintf( stderr, "Done: dialog execute exited:%d\n", result); + return result; +} + +#if SORT_DLG +static void LoadSC() +{ + get_factory( "com.sun.star.comp.sfx2.DocumentTemplates" ); + get_factory( "com.sun.star.comp.Calc.SpreadsheetDocument" ); + GET_FACTORY( com.sun.star.i18n.Transliteration.l10n ); +} +#endif /* SORT_DLG */ + void TestDialog( OUString const& name ) { - if ( name.equalsAscii( "zoom" ) ) + if ( 0 ) + ; + else if ( name.equalsAscii( "plugin" ) ) { - SvxZoomDialog zoom( 0 ); - RunDialog( zoom ); + PluginDialog plugin ( 0 ); + RunDialog( plugin ); } - else if ( name.equalsAscii( "wordcount" ) ) + else if ( name.equalsAscii( "query" ) ) { - SwWordCountDialog words ( 0 ); - RunDialog( words ); + QueryBox query ( 0, "Do you want to do?", "do"); + RunDialog( query ); + } + else if ( name.equalsAscii( "query-compat" ) ) + { + QueryBox query ( 0, + WinBits( WB_YES_NO | WB_DEF_YES ), +// WinBits( WB_ABORT_RETRY_IGNORE ), + OUString::createFromAscii ("Do you want to do?")); + RunDialog( query ); } else if ( name.equalsAscii( "recover" ) ) { SvxRecoverDialog recover ( 0 ); RunDialog( recover ); } +#if SORT_DLG + else if ( name.equalsAscii( "sort" ) ) + { + LoadSC(); + ScSortDlg sort (0, 0); + RunDialog( sort ); + } +#endif /* SORT_DLG */ + else if ( name.equalsAscii( "wordcount" ) ) + { + SwWordCountDialog words ( 0 ); + RunDialog( words ); + } + else if ( name.equalsAscii( "zoom" ) ) + { + SvxZoomDialog zoom( 0 ); + RunDialog( zoom ); + } } void LayoutTest::RunFiles() @@ -274,10 +322,6 @@ void LayoutTest::RunFiles() void LayoutTest::ExceptionalMain() { - ParseCommandLine(); - IInit(); - INIT_ENV_VOODOO( mInstallDir ); - if ( mTestDialog.getLength() ) TestDialog( mTestDialog ); else if ( mEditMode ) @@ -323,4 +367,4 @@ LayoutTest::LayoutTest( char const* installDir ) { } -LayoutTest lt( "/usr/local/lib/ooo" ); +LayoutTest layout_test( "/usr/local/lib/ooo" ); diff --git a/toolkit/workben/layout/testrc.in b/toolkit/workben/layout/testrc.in new file mode 100644 index 000000000000..00ae5eb3cd5e --- /dev/null +++ b/toolkit/workben/layout/testrc.in @@ -0,0 +1,12 @@ +OOO_INSTALL_PREFIX_URL=file://${OOO_INSTALL_PREFIX} +OOO_BASIS_URL=${OOO_INSTALL_PREFIX_URL}/basis-link +OOO_BASIS_BIN_URL=${OOO_BASIS_URL}/program +OOO_URE_URL=${OOO_BASIS_URL}/ure-link +# +#CFG_INIFILE=${OOO_BASIS_BIN_URL}/configmgrrc +#BaseInstallation=${OOO_BASIS_URL} +BRAND_BASE_DIR=${OOO_INSTALL_PREFIX_URL} +OOO_BASE_DIR=${OOO_BASIS_URL} +# +UNO_TYPES=${OOO_URE_URL}/share/misc/types.rdb ${OOO_BASIS_BIN_URL}/offapi.rdb +UNO_SERVICES=${OOO_URE_URL}/share/misc/services.rdb ${OOO_BASIS_BIN_URL}/services.rdb diff --git a/toolkit/workben/layout/tpsort.cxx b/toolkit/workben/layout/tpsort.cxx new file mode 100644 index 000000000000..3463eff4efab --- /dev/null +++ b/toolkit/workben/layout/tpsort.cxx @@ -0,0 +1,1108 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tpsort.cxx,v $ + * $Revision: 1.14 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#if !TEST_LAYOUT +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" +#endif /* !TEST_LAYOUT */ + +#undef SC_DLLIMPLEMENTATION + + + +#include <vcl/msgbox.hxx> +#include <i18npool/mslangid.hxx> +#include <svtools/collatorres.hxx> +#include <unotools/collatorwrapper.hxx> +#include <unotools/localedatawrapper.hxx> +#include <comphelper/processfactory.hxx> + +#include "scitems.hxx" +#include "uiitems.hxx" +#include "viewdata.hxx" +#include "document.hxx" +#include "global.hxx" +#include "dbcolect.hxx" +#include "userlist.hxx" +#include "rangeutl.hxx" +#include "scresid.hxx" +#include "sc.hrc" // -> Slot IDs +#include "globstr.hrc" + +#include "sortdlg.hxx" +#include "sortdlg.hrc" + +#define _TPSORT_CXX +#include "tpsort.hxx" +#undef _TPSORT_CXX + +using namespace com::sun::star; + +// STATIC DATA ----------------------------------------------------------- + +static USHORT pSortRanges[] = +{ + SID_SORT, + SID_SORT, + 0 +}; + +// ----------------------------------------------------------------------- + +/* + * Da sich Einstellungen auf der zweiten TabPage (Optionen) auf + * die erste TabPage auswirken, muss es die Moeglichkeit geben, + * dies der jeweils anderen Seite mitzuteilen. + * + * Im Moment wird dieses Problem ueber zwei Datenmember des TabDialoges + * geloest. Wird eine Seite Aktiviert/Deaktiviert, so gleicht sie diese + * Datenmember mit dem eigenen Zustand ab (->Activate()/Deactivate()). + * + * 31.01.95: + * Die Klasse SfxTabPage bietet mittlerweile ein Verfahren an: + * + * virtual BOOL HasExchangeSupport() const; -> return TRUE; + * virtual void ActivatePage(const SfxItemSet &); + * virtual int DeactivatePage(SfxItemSet * = 0); + * + * muss noch geaendert werden! + */ + +//======================================================================== +//======================================================================== +// Sortierkriterien-Tabpage: + +ScTabPageSortFields::ScTabPageSortFields( Window* pParent, + const SfxItemSet& rArgSet ) + + : SfxTabPage ( pParent, + ScResId( RID_SCPAGE_SORT_FIELDS ), + rArgSet ), + // + aFlSort1 ( this, ScResId( FL_SORT1 ) ), + aLbSort1 ( this, ScResId( LB_SORT1 ) ), + aBtnUp1 ( this, ScResId( BTN_UP1 ) ), + aBtnDown1 ( this, ScResId( BTN_DOWN1 ) ), + // + aFlSort2 ( this, ScResId( FL_SORT2 ) ), + aLbSort2 ( this, ScResId( LB_SORT2 ) ), + aBtnUp2 ( this, ScResId( BTN_UP2 ) ), + aBtnDown2 ( this, ScResId( BTN_DOWN2 ) ), + // + aFlSort3 ( this, ScResId( FL_SORT3 ) ), + aLbSort3 ( this, ScResId( LB_SORT3 ) ), + aBtnUp3 ( this, ScResId( BTN_UP3 ) ), + aBtnDown3 ( this, ScResId( BTN_DOWN3 ) ), + + aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), + aStrColumn ( ScResId( SCSTR_COLUMN ) ), + aStrRow ( ScResId( SCSTR_ROW ) ), + // +#if !TEST_LAYOUT + nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), +#else /* TEST_LAYOUT */ + nWhichSort ( 0 ), +#endif /* TEST_LAYOUT */ + pDlg ( (ScSortDlg*)(GetParent()->GetParent()) ), + pViewData ( NULL ), +#if !TEST_LAYOUT + rSortData ( ((const ScSortItem&) + rArgSet.Get( nWhichSort )). + GetSortData() ), +#else /* TEST_LAYOUT */ + rSortData ( *new ScSortParam() ), +#endif /* TEST_LAYOUT */ + nFieldCount ( 0 ), + bHasHeader ( FALSE ), + bSortByRows ( FALSE ) +{ + Init(); + FreeResource(); + SetExchangeSupport(); +} + +// ----------------------------------------------------------------------- + +__EXPORT ScTabPageSortFields::~ScTabPageSortFields() +{ +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortFields::Init() +{ +#if !TEST_LAYOUT + const ScSortItem& rSortItem = (const ScSortItem&) + GetItemSet().Get( nWhichSort ); + + pViewData = rSortItem.GetViewData(); + + DBG_ASSERT( pViewData, "ViewData not found!" ); +#endif /* !TEST_LAYOUT */ + + nFieldArr[0] = 0; + nFirstCol = 0; + nFirstRow = 0; + + aLbSort1.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); + aLbSort2.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); + aLbSort3.SetSelectHdl( LINK( this, ScTabPageSortFields, SelectHdl ) ); + aLbSort1.Clear(); + aLbSort2.Clear(); + aLbSort3.Clear(); + + aSortLbArr[0] = &aLbSort1; + aSortLbArr[1] = &aLbSort2; + aSortLbArr[2] = &aLbSort3; + aDirBtnArr[0][0] = &aBtnUp1; + aDirBtnArr[0][1] = &aBtnDown1; + aDirBtnArr[1][0] = &aBtnUp2; + aDirBtnArr[1][1] = &aBtnDown2; + aDirBtnArr[2][0] = &aBtnUp3; + aDirBtnArr[2][1] = &aBtnDown3; + aFlArr[0] = &aFlSort1; + aFlArr[1] = &aFlSort2; + aFlArr[2] = &aFlSort3; +} + +//------------------------------------------------------------------------ + +USHORT* __EXPORT ScTabPageSortFields::GetRanges() +{ + return pSortRanges; +} + +// ----------------------------------------------------------------------- + +SfxTabPage* __EXPORT ScTabPageSortFields::Create( Window* pParent, + const SfxItemSet& rArgSet ) +{ + return ( new ScTabPageSortFields( pParent, rArgSet ) ); +} + +// ----------------------------------------------------------------------- + +void __EXPORT ScTabPageSortFields::Reset( const SfxItemSet& /* rArgSet */ ) +{ + bSortByRows = rSortData.bByRow; + bHasHeader = rSortData.bHasHeader; + + if ( aLbSort1.GetEntryCount() == 0 ) + FillFieldLists(); + + // Selektieren der ListBoxen: + + if ( rSortData.bDoSort[0] ) + { + for ( USHORT i=0; i<3; i++ ) + { + if ( rSortData.bDoSort[i] ) + { + aSortLbArr[i]->SelectEntryPos( + GetFieldSelPos( rSortData.nField[i] ) ); + + (rSortData.bAscending[i]) + ? aDirBtnArr[i][0]->Check() // Up + : aDirBtnArr[i][1]->Check(); // Down + } + else + { + aSortLbArr[i]->SelectEntryPos( 0 ); // "keiner" selektieren + aDirBtnArr[i][0]->Check(); // Up + } + } + + EnableField( 1 ); + EnableField( 2 ); + EnableField( 3 ); + if ( aLbSort1.GetSelectEntryPos() == 0 ) + DisableField( 2 ); + if ( aLbSort2.GetSelectEntryPos() == 0 ) + DisableField( 3 ); + } + else + { + aLbSort1.SelectEntryPos( 1 ); + aLbSort2.SelectEntryPos( 0 ); + aLbSort3.SelectEntryPos( 0 ); + aBtnUp1.Check(); + aBtnUp2.Check(); + aBtnUp3.Check(); + EnableField ( 1 ); + EnableField ( 2 ); + DisableField( 3 ); + } + + if ( pDlg ) + { + pDlg->SetByRows ( bSortByRows ); + pDlg->SetHeaders( bHasHeader ); + } +} + +// ----------------------------------------------------------------------- + +BOOL __EXPORT ScTabPageSortFields::FillItemSet( SfxItemSet& rArgSet ) +{ + ScSortParam theSortData = rSortData; + if (pDlg) + { + const SfxItemSet* pExample = pDlg->GetExampleSet(); + const SfxPoolItem* pItem; + if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) + theSortData = ((const ScSortItem*)pItem)->GetSortData(); + } + + USHORT nSort1Pos = aLbSort1.GetSelectEntryPos(); + USHORT nSort2Pos = aLbSort2.GetSelectEntryPos(); + USHORT nSort3Pos = aLbSort3.GetSelectEntryPos(); + + DBG_ASSERT( (nSort1Pos <= SC_MAXFIELDS) + && (nSort2Pos <= SC_MAXFIELDS) + && (nSort3Pos <= SC_MAXFIELDS), + "Array-Range Fehler!" ); + + if ( nSort1Pos == LISTBOX_ENTRY_NOTFOUND ) nSort1Pos = 0; + if ( nSort2Pos == LISTBOX_ENTRY_NOTFOUND ) nSort2Pos = 0; + if ( nSort3Pos == LISTBOX_ENTRY_NOTFOUND ) nSort3Pos = 0; + + if ( nSort1Pos > 0 ) + { + theSortData.bDoSort[0] = (nSort1Pos > 0); + theSortData.bDoSort[1] = (nSort2Pos > 0); + theSortData.bDoSort[2] = (nSort3Pos > 0); + + // wenn auf Optionen-Seite "OK" gewaehlt wurde und + // dabei die Sortierrichtung umgestellt wurde, so + // wird das erste Feld der jeweiligen Richtung als + // Sortierkriterium gewaehlt (steht in nFieldArr[0]): + if ( bSortByRows != pDlg->GetByRows() ) + { + theSortData.nField[0] = + theSortData.nField[1] = + theSortData.nField[2] = ( bSortByRows ? + static_cast<SCCOLROW>(nFirstRow) : + static_cast<SCCOLROW>(nFirstCol) ); + } + else + { + theSortData.nField[0] = nFieldArr[nSort1Pos]; + theSortData.nField[1] = nFieldArr[nSort2Pos]; + theSortData.nField[2] = nFieldArr[nSort3Pos]; + } + + theSortData.bAscending[0] = aBtnUp1.IsChecked(); + theSortData.bAscending[1] = aBtnUp2.IsChecked(); + theSortData.bAscending[2] = aBtnUp3.IsChecked(); + // bHasHeader ist in ScTabPageSortOptions::FillItemSet, wo es hingehoert + } + else + { + theSortData.bDoSort[0] = + theSortData.bDoSort[1] = + theSortData.bDoSort[2] = FALSE; + } + + rArgSet.Put( ScSortItem( SCITEM_SORTDATA, NULL, &theSortData ) ); + + return TRUE; +} + +// ----------------------------------------------------------------------- + +// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !) +// void ScTabPageSortFields::ActivatePage( const SfxItemSet& rSet ) + +void __EXPORT ScTabPageSortFields::ActivatePage() +{ + if ( pDlg ) + { + if ( bHasHeader != pDlg->GetHeaders() + || bSortByRows != pDlg->GetByRows() ) + { + USHORT nCurSel1 = aLbSort1.GetSelectEntryPos(); + USHORT nCurSel2 = aLbSort2.GetSelectEntryPos(); + USHORT nCurSel3 = aLbSort3.GetSelectEntryPos(); + + bHasHeader = pDlg->GetHeaders(); + bSortByRows = pDlg->GetByRows(); + FillFieldLists(); + aLbSort1.SelectEntryPos( nCurSel1 ); + aLbSort2.SelectEntryPos( nCurSel2 ); + aLbSort3.SelectEntryPos( nCurSel3 ); + } + } +} + +// ----------------------------------------------------------------------- + +int __EXPORT ScTabPageSortFields::DeactivatePage( SfxItemSet* pSetP ) +{ + if ( pDlg ) + { + if ( bHasHeader != pDlg->GetHeaders() ) + pDlg->SetHeaders( bHasHeader ); + + if ( bSortByRows != pDlg->GetByRows() ) + pDlg->SetByRows( bSortByRows ); + } + + if ( pSetP ) + FillItemSet( *pSetP ); + + return SfxTabPage::LEAVE_PAGE; +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortFields::DisableField( USHORT nField ) +{ + nField--; + + if ( nField<=2 ) + { + aSortLbArr[nField] ->Disable(); + aDirBtnArr[nField][0]->Disable(); + aDirBtnArr[nField][1]->Disable(); + aFlArr[nField] ->Disable(); + } +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortFields::EnableField( USHORT nField ) +{ + nField--; + + if ( nField<=2 ) + { + aSortLbArr[nField] ->Enable(); + aDirBtnArr[nField][0]->Enable(); + aDirBtnArr[nField][1]->Enable(); + aFlArr[nField] ->Enable(); + } +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortFields::FillFieldLists() +{ + if ( pViewData ) + { + ScDocument* pDoc = pViewData->GetDocument(); + + if ( pDoc ) + { + aLbSort1.Clear(); + aLbSort2.Clear(); + aLbSort3.Clear(); + aLbSort1.InsertEntry( aStrUndefined, 0 ); + aLbSort2.InsertEntry( aStrUndefined, 0 ); + aLbSort3.InsertEntry( aStrUndefined, 0 ); + + SCCOL nFirstSortCol = rSortData.nCol1; + SCROW nFirstSortRow = rSortData.nRow1; + SCTAB nTab = pViewData->GetTabNo(); + USHORT i = 1; + + if ( bSortByRows ) + { + String aFieldName; + SCCOL nMaxCol = rSortData.nCol2; + SCCOL col; + + for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ ) + { + pDoc->GetString( col, nFirstSortRow, nTab, aFieldName ); + if ( !bHasHeader || (aFieldName.Len() == 0) ) + { + aFieldName = aStrColumn; + aFieldName += ' '; + aFieldName += ColToAlpha( col ); + } + nFieldArr[i] = col; + aLbSort1.InsertEntry( aFieldName, i ); + aLbSort2.InsertEntry( aFieldName, i ); + aLbSort3.InsertEntry( aFieldName, i ); + i++; + } + } + else + { + String aFieldName; + SCROW nMaxRow = rSortData.nRow2; + SCROW row; + + for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ ) + { + pDoc->GetString( nFirstSortCol, row, nTab, aFieldName ); + if ( !bHasHeader || (aFieldName.Len() == 0) ) + { + aFieldName = aStrRow; + aFieldName += ' '; + aFieldName += String::CreateFromInt32( row+1 ); + } + nFieldArr[i] = row; + aLbSort1.InsertEntry( aFieldName, i ); + aLbSort2.InsertEntry( aFieldName, i ); + aLbSort3.InsertEntry( aFieldName, i ); + i++; + } + } + nFieldCount = i; + } + } +} + +//------------------------------------------------------------------------ + +USHORT ScTabPageSortFields::GetFieldSelPos( SCCOLROW nField ) +{ + USHORT nFieldPos = 0; + BOOL bFound = FALSE; + + for ( USHORT n=1; n<nFieldCount && !bFound; n++ ) + { + if ( nFieldArr[n] == nField ) + { + nFieldPos = n; + bFound = TRUE; + } + } + + return nFieldPos; +} + +// ----------------------------------------------------------------------- +// Handler: +//--------- + +IMPL_LINK( ScTabPageSortFields, SelectHdl, ListBox *, pLb ) +{ + String aSelEntry = pLb->GetSelectEntry(); + + if ( pLb == &aLbSort1 ) + { + if ( aSelEntry == aStrUndefined ) + { + aLbSort2.SelectEntryPos( 0 ); + aLbSort3.SelectEntryPos( 0 ); + + if ( aFlSort2.IsEnabled() ) + DisableField( 2 ); + + if ( aFlSort3.IsEnabled() ) + DisableField( 3 ); + } + else + { + if ( !aFlSort2.IsEnabled() ) + EnableField( 2 ); + } + } + else if ( pLb == &aLbSort2 ) + { + if ( aSelEntry == aStrUndefined ) + { + aLbSort3.SelectEntryPos( 0 ); + if ( aFlSort3.IsEnabled() ) + DisableField( 3 ); + } + else + { + if ( !aFlSort3.IsEnabled() ) + EnableField( 3 ); + } + } + return 0; +} + +//======================================================================== +// Sortieroptionen-Tabpage: +//======================================================================== + +#include <layout/layout-pre.hxx> + +#if ENABLE_LAYOUT +#undef ScResId +#define ScResId(x) #x +#undef SfxTabPage +#define SfxTabPage( parent, id, args ) SfxTabPage( parent, "sort-options.xml", id, &args ) +#endif /* ENABLE_LAYOUT */ + +ScTabPageSortOptions::ScTabPageSortOptions( Window* pParent, + const SfxItemSet& rArgSet ) + + : SfxTabPage ( pParent, + ScResId( RID_SCPAGE_SORT_OPTIONS ), + rArgSet ), + // + aBtnCase ( this, ScResId( BTN_CASESENSITIVE ) ), + aBtnHeader ( this, ScResId( BTN_LABEL ) ), + aBtnFormats ( this, ScResId( BTN_FORMATS ) ), + aBtnCopyResult ( this, ScResId( BTN_COPYRESULT ) ), + aBtnNaturalSort ( this, ScResId( BTN_NATURALSORT ) ), + aLbOutPos ( this, ScResId( LB_OUTAREA ) ), + aEdOutPos ( this, ScResId( ED_OUTAREA ) ), + aBtnSortUser ( this, ScResId( BTN_SORT_USER ) ), + aLbSortUser ( this, ScResId( LB_SORT_USER ) ), + aFtLanguage ( this, ScResId( FT_LANGUAGE ) ), + aLbLanguage ( this, ScResId( LB_LANGUAGE ) ), + aFtAlgorithm ( this, ScResId( FT_ALGORITHM ) ), + aLbAlgorithm ( this, ScResId( LB_ALGORITHM ) ), + aLineDirection ( this, ScResId( FL_DIRECTION ) ), + aBtnTopDown ( this, ScResId( BTN_TOP_DOWN ) ), + aBtnLeftRight ( this, ScResId( BTN_LEFT_RIGHT ) ), +// aFtAreaLabel ( this, ScResId( FT_AREA_LABEL ) ), +// aFtArea ( this, ScResId( FT_AREA ) ), + // +#if ENABLE_LAYOUT +#undef this +#undef ScResId +#define ScResId(x) this, #x +#endif /* ENABLE_LAYOUT */ + aStrRowLabel ( ScResId( STR_ROW_LABEL ) ), + aStrColLabel ( ScResId( STR_COL_LABEL ) ), + aStrUndefined ( ScResId( SCSTR_UNDEFINED ) ), + aStrNoName ( ScGlobal::GetRscString(STR_DB_NONAME) ), + // +#if !TEST_LAYOUT + nWhichSort ( rArgSet.GetPool()->GetWhich( SID_SORT ) ), + rSortData ( ((const ScSortItem&) + rArgSet.Get( nWhichSort )).GetSortData() ), +#else /* TEST_LAYOUT */ + nWhichSort ( 0 ), + rSortData ( *new ScSortParam() ), +#endif /* TEST_LAYOUT */ + pViewData ( NULL ), + pDoc ( NULL ), + pDlg ( (ScSortDlg*)(GetParent() ? GetParent()->GetParent() : 0 ) ), + pColRes ( NULL ), + pColWrap ( NULL ) +{ +#if TEST_LAYOUT + (void) rArgSet; +#endif /* TEST_LAYOUT */ + Init(); + FreeResource(); + SetExchangeSupport(); +} + +// ----------------------------------------------------------------------- + +__EXPORT ScTabPageSortOptions::~ScTabPageSortOptions() +{ +#if !TEST_LAYOUT + USHORT nEntries = aLbOutPos.GetEntryCount(); + + for ( USHORT i=1; i<nEntries; i++ ) + delete (String*)aLbOutPos.GetEntryData( i ); +#endif /* !TEST_LAYOUT */ + + delete pColRes; + delete pColWrap; //! not if from document +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortOptions::Init() +{ +// aStrAreaLabel = aFtAreaLabel.GetText(); +// aStrAreaLabel.Append( (sal_Unicode) ' ' ); + + // CollatorRessource has user-visible names for sort algorithms + pColRes = new CollatorRessource(); + + //! use CollatorWrapper from document? + pColWrap = new CollatorWrapper( comphelper::getProcessServiceFactory() ); + +#if !TEST_LAYOUT + const ScSortItem& rSortItem = (const ScSortItem&) + GetItemSet().Get( nWhichSort ); +#endif /* !TEST_LAYOUT */ + + aLbOutPos.SetSelectHdl ( LINK( this, ScTabPageSortOptions, SelOutPosHdl ) ); + aBtnCopyResult.SetClickHdl( LINK( this, ScTabPageSortOptions, EnableHdl ) ); + aBtnSortUser.SetClickHdl ( LINK( this, ScTabPageSortOptions, EnableHdl ) ); + aBtnTopDown.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) ); + aBtnLeftRight.SetClickHdl ( LINK( this, ScTabPageSortOptions, SortDirHdl ) ); + aLbLanguage.SetSelectHdl ( LINK( this, ScTabPageSortOptions, FillAlgorHdl ) ); + +#if !TEST_LAYOUT + pViewData = rSortItem.GetViewData(); +#endif /* TEST_LAYOUT */ + pDoc = pViewData ? pViewData->GetDocument() : NULL; + + DBG_ASSERT( pViewData, "ViewData not found! :-/" ); + +#if !TEST_LAYOUT + if ( pViewData && pDoc ) + { + String theArea; + ScDBCollection* pDBColl = pDoc->GetDBCollection(); + String theDbArea; + String theDbName = aStrNoName; + const SCTAB nCurTab = pViewData->GetTabNo(); + const ScAddress::Convention eConv = pDoc->GetAddressConvention(); +#endif /* !TEST_LAYOUT */ + + aLbOutPos.Clear(); + aLbOutPos.InsertEntry( aStrUndefined, 0 ); + aLbOutPos.Disable(); + +#if !TEST_LAYOUT + ScAreaNameIterator aIter( pDoc ); + String aName; + ScRange aRange; + String aRefStr; + while ( aIter.Next( aName, aRange ) ) + { + USHORT nInsert = aLbOutPos.InsertEntry( aName ); + + aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc, eConv ); + aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); + } +#endif /* !TEST_LAYOUT */ + + aLbOutPos.SelectEntryPos( 0 ); + aEdOutPos.SetText( EMPTY_STRING ); + +#if !TEST_LAYOUT + /* + * Ueberpruefen, ob es sich bei dem uebergebenen + * Bereich um einen Datenbankbereich handelt: + */ + + ScAddress aScAddress( rSortData.nCol1, rSortData.nRow1, nCurTab ); + ScRange( aScAddress, + ScAddress( rSortData.nCol2, rSortData.nRow2, nCurTab ) + ).Format( theArea, SCR_ABS, pDoc, eConv ); + + if ( pDBColl ) + { + ScDBData* pDBData + = pDBColl->GetDBAtArea( nCurTab, + rSortData.nCol1, rSortData.nRow1, + rSortData.nCol2, rSortData.nRow2 ); + if ( pDBData ) + { + pDBData->GetName( theDbName ); + aBtnHeader.Check( pDBData->HasHeader() ); + } + } + + theArea.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" (")); + theArea += theDbName; + theArea += ')'; + + //aFtArea.SetText( theArea ); + //theArea.Insert( aStrAreaLabel, 0 ); + //aFtAreaLabel.SetText( theArea ); + + aBtnHeader.SetText( aStrColLabel ); + } +#endif /* TEST_LAYOUT */ + + FillUserSortListBox(); + + // get available languages + + aLbLanguage.SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, FALSE ); + aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM ); +} + +//------------------------------------------------------------------------ + +USHORT* __EXPORT ScTabPageSortOptions::GetRanges() +{ + return pSortRanges; +} + +// ----------------------------------------------------------------------- + +#if ENABLE_LAYOUT +#undef SfxTabPage +#endif /* ENABLE_LAYOUT */ +SfxTabPage* __EXPORT ScTabPageSortOptions::Create( + Window* pParent, + const SfxItemSet& rArgSet ) +{ + return ( new ScTabPageSortOptions( pParent, rArgSet ) ); +} + +// ----------------------------------------------------------------------- + +void __EXPORT ScTabPageSortOptions::Reset( const SfxItemSet& /* rArgSet */ ) +{ + if ( rSortData.bUserDef ) + { + aBtnSortUser.Check( TRUE ); + aLbSortUser.Enable(); + aLbSortUser.SelectEntryPos( rSortData.nUserIndex ); + } + else + { + aBtnSortUser.Check( FALSE ); + aLbSortUser.Disable(); + aLbSortUser.SelectEntryPos( 0 ); + } + + aBtnCase.Check ( rSortData.bCaseSens ); + aBtnFormats.Check ( rSortData.bIncludePattern ); + aBtnHeader.Check ( rSortData.bHasHeader ); + aBtnNaturalSort.Check ( rSortData.bNaturalSort ); + + if ( rSortData.bByRow ) + { + aBtnTopDown.Check(); + aBtnHeader.SetText( aStrColLabel ); + } + else + { + aBtnLeftRight.Check(); + aBtnHeader.SetText( aStrRowLabel ); + } + + LanguageType eLang = MsLangId::convertLocaleToLanguage( rSortData.aCollatorLocale ); + if ( eLang == LANGUAGE_DONTKNOW ) + eLang = LANGUAGE_SYSTEM; + aLbLanguage.SelectLanguage( eLang ); + FillAlgorHdl( &aLbLanguage ); // get algorithms, select default + if ( rSortData.aCollatorAlgorithm.Len() ) + aLbAlgorithm.SelectEntry( pColRes->GetTranslation( rSortData.aCollatorAlgorithm ) ); + + if ( pDoc && !rSortData.bInplace ) + { + String aStr; + USHORT nFormat = (rSortData.nDestTab != pViewData->GetTabNo()) + ? SCR_ABS_3D + : SCR_ABS; + + theOutPos.Set( rSortData.nDestCol, + rSortData.nDestRow, + rSortData.nDestTab ); + + theOutPos.Format( aStr, nFormat, pDoc, pDoc->GetAddressConvention() ); + aBtnCopyResult.Check(); + aLbOutPos.Enable(); + aEdOutPos.Enable(); + aEdOutPos.SetText( aStr ); + EdOutPosModHdl( &aEdOutPos ); + aEdOutPos.GrabFocus(); + aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) ); + } + else + { + aBtnCopyResult.Check( FALSE ); + aLbOutPos.Disable(); + aEdOutPos.Disable(); + aEdOutPos.SetText( EMPTY_STRING ); + } +} + +// ----------------------------------------------------------------------- + +BOOL __EXPORT ScTabPageSortOptions::FillItemSet( SfxItemSet& rArgSet ) +{ + ScSortParam theSortData = rSortData; + if (pDlg) + { + const SfxItemSet* pExample = pDlg->GetExampleSet(); + const SfxPoolItem* pItem; + if ( pExample && pExample->GetItemState( nWhichSort, TRUE, &pItem ) == SFX_ITEM_SET ) + theSortData = ((const ScSortItem*)pItem)->GetSortData(); + } + + theSortData.bByRow = aBtnTopDown.IsChecked(); + theSortData.bHasHeader = aBtnHeader.IsChecked(); + theSortData.bCaseSens = aBtnCase.IsChecked(); + theSortData.bNaturalSort = aBtnNaturalSort.IsChecked(); + theSortData.bIncludePattern = aBtnFormats.IsChecked(); + theSortData.bInplace = !aBtnCopyResult.IsChecked(); + theSortData.nDestCol = theOutPos.Col(); + theSortData.nDestRow = theOutPos.Row(); + theSortData.nDestTab = theOutPos.Tab(); + theSortData.bUserDef = aBtnSortUser.IsChecked(); + theSortData.nUserIndex = (aBtnSortUser.IsChecked()) + ? aLbSortUser.GetSelectEntryPos() + : 0; + + // get locale + LanguageType eLang = aLbLanguage.GetSelectLanguage(); + theSortData.aCollatorLocale = MsLangId::convertLanguageToLocale( eLang, false ); + + // get algorithm + String sAlg; + if ( eLang != LANGUAGE_SYSTEM ) + { + uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( + theSortData.aCollatorLocale ); + USHORT nSel = aLbAlgorithm.GetSelectEntryPos(); + if ( nSel < aAlgos.getLength() ) + sAlg = aAlgos[nSel]; + } + theSortData.aCollatorAlgorithm = sAlg; + +#if !TEST_LAYOUT + rArgSet.Put( ScSortItem( SCITEM_SORTDATA, &theSortData ) ); +#endif /* TEST_LAYOUT */ + return TRUE; +} + +// ----------------------------------------------------------------------- + +// fuer Datenaustausch ohne Dialog-Umweg: (! noch zu tun !) +// void ScTabPageSortOptions::ActivatePage( const SfxItemSet& rSet ) +void __EXPORT ScTabPageSortOptions::ActivatePage() +{ + if ( pDlg ) + { + if ( aBtnHeader.IsChecked() != pDlg->GetHeaders() ) + { + aBtnHeader.Check( pDlg->GetHeaders() ); + } + + if ( aBtnTopDown.IsChecked() != pDlg->GetByRows() ) + { + aBtnTopDown.Check( pDlg->GetByRows() ); + aBtnLeftRight.Check( !pDlg->GetByRows() ); + } + + aBtnHeader.SetText( (pDlg->GetByRows()) + ? aStrColLabel + : aStrRowLabel ); + } +} + +// ----------------------------------------------------------------------- + +int __EXPORT ScTabPageSortOptions::DeactivatePage( SfxItemSet* pSetP ) +{ + BOOL bPosInputOk = TRUE; + + if ( aBtnCopyResult.IsChecked() ) + { + String thePosStr = aEdOutPos.GetText(); + ScAddress thePos; + xub_StrLen nColonPos = thePosStr.Search( ':' ); + + if ( STRING_NOTFOUND != nColonPos ) + thePosStr.Erase( nColonPos ); + + if ( pViewData ) + { + // visible table is default for input without table + // must be changed to GetRefTabNo when sorting has RefInput! + thePos.SetTab( pViewData->GetTabNo() ); + } + + USHORT nResult = thePos.Parse( thePosStr, pDoc, pDoc->GetAddressConvention() ); + + bPosInputOk = ( SCA_VALID == (nResult & SCA_VALID) ); + + if ( !bPosInputOk ) + { +#if !ENABLE_LAYOUT + ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), + ScGlobal::GetRscString( STR_INVALID_TABREF ) + ).Execute(); +#endif /* ENABLE_LAYOUT */ + aEdOutPos.GrabFocus(); + aEdOutPos.SetSelection( Selection( 0, SELECTION_MAX ) ); + theOutPos.Set(0,0,0); + } + else + { + aEdOutPos.SetText( thePosStr ); + theOutPos = thePos; + } + } + + if ( pDlg && bPosInputOk ) + { + pDlg->SetHeaders( aBtnHeader.IsChecked() ); + pDlg->SetByRows ( aBtnTopDown.IsChecked() ); + } + + if ( pSetP && bPosInputOk ) + FillItemSet( *pSetP ); + + return bPosInputOk ? SfxTabPage::LEAVE_PAGE : SfxTabPage::KEEP_PAGE; +} + +// ----------------------------------------------------------------------- + +void ScTabPageSortOptions::FillUserSortListBox() +{ + ScUserList* pUserLists = ScGlobal::GetUserList(); + + aLbSortUser.Clear(); + if ( pUserLists ) + { + USHORT nCount = pUserLists->GetCount(); + if ( nCount > 0 ) + for ( USHORT i=0; i<nCount; i++ ) + aLbSortUser.InsertEntry( (*pUserLists)[i]->GetString() ); + } +} + +// ----------------------------------------------------------------------- +// Handler: + +IMPL_LINK( ScTabPageSortOptions, EnableHdl, CheckBox *, pBox ) +{ + if ( pBox == &aBtnCopyResult ) + { + if ( pBox->IsChecked() ) + { + aLbOutPos.Enable(); + aEdOutPos.Enable(); + aEdOutPos.GrabFocus(); + } + else + { + aLbOutPos.Disable(); + aEdOutPos.Disable(); + } + } + else if ( pBox == &aBtnSortUser ) + { + if ( pBox->IsChecked() ) + { + aLbSortUser.Enable(); + aLbSortUser.GrabFocus(); + } + else + aLbSortUser.Disable(); + } + return 0; +} + +// ----------------------------------------------------------------------- + +IMPL_LINK( ScTabPageSortOptions, SelOutPosHdl, ListBox *, pLb ) +{ + if ( pLb == &aLbOutPos ) + { + String aString; + USHORT nSelPos = aLbOutPos.GetSelectEntryPos(); + + if ( nSelPos > 0 ) + aString = *(String*)aLbOutPos.GetEntryData( nSelPos ); + + aEdOutPos.SetText( aString ); + } + return 0; +} + +// ----------------------------------------------------------------------- + +IMPL_LINK( ScTabPageSortOptions, SortDirHdl, RadioButton *, pBtn ) +{ + if ( pBtn == &aBtnTopDown ) + { + aBtnHeader.SetText( aStrColLabel ); + } + else if ( pBtn == &aBtnLeftRight ) + { + aBtnHeader.SetText( aStrRowLabel ); + } + return 0; +} + +// ----------------------------------------------------------------------- + +void __EXPORT ScTabPageSortOptions::EdOutPosModHdl( Edit* pEd ) +{ + if ( pEd == &aEdOutPos ) + { + String theCurPosStr = aEdOutPos.GetText(); + USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() ); + + if ( SCA_VALID == (nResult & SCA_VALID) ) + { + String* pStr = NULL; + BOOL bFound = FALSE; + USHORT i = 0; + USHORT nCount = aLbOutPos.GetEntryCount(); + + for ( i=2; i<nCount && !bFound; i++ ) + { + pStr = (String*)aLbOutPos.GetEntryData( i ); + bFound = (theCurPosStr == *pStr); + } + + if ( bFound ) + aLbOutPos.SelectEntryPos( --i ); + else + aLbOutPos.SelectEntryPos( 0 ); + } + } +} + +// ----------------------------------------------------------------------- + +IMPL_LINK( ScTabPageSortOptions, FillAlgorHdl, void *, EMPTYARG ) +{ + aLbAlgorithm.SetUpdateMode( FALSE ); + aLbAlgorithm.Clear(); + + LanguageType eLang = aLbLanguage.GetSelectLanguage(); + if ( eLang == LANGUAGE_SYSTEM ) + { + // for LANGUAGE_SYSTEM no algorithm can be selected because + // it wouldn't necessarily exist for other languages + // -> leave list box empty if LANGUAGE_SYSTEM is selected + aFtAlgorithm.Enable( FALSE ); // nothing to select + aLbAlgorithm.Enable( FALSE ); // nothing to select + } + else + { + lang::Locale aLocale( MsLangId::convertLanguageToLocale( eLang )); + uno::Sequence<rtl::OUString> aAlgos = pColWrap->listCollatorAlgorithms( aLocale ); + + long nCount = aAlgos.getLength(); + const rtl::OUString* pArray = aAlgos.getConstArray(); + for (long i=0; i<nCount; i++) + { + String sAlg = pArray[i]; + String sUser = pColRes->GetTranslation( sAlg ); + aLbAlgorithm.InsertEntry( sUser, LISTBOX_APPEND ); + } + aLbAlgorithm.SelectEntryPos( 0 ); // first entry is default + aFtAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice + aLbAlgorithm.Enable( nCount > 1 ); // enable only if there is a choice + } + + aLbAlgorithm.SetUpdateMode( TRUE ); + return 0; +} + + diff --git a/toolkit/workben/layout/tpsort.hxx b/toolkit/workben/layout/tpsort.hxx new file mode 100644 index 000000000000..bb8b30e396df --- /dev/null +++ b/toolkit/workben/layout/tpsort.hxx @@ -0,0 +1,220 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tpsort.hxx,v $ + * $Revision: 1.9 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org 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 version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_TPSORT_HXX +#define SC_TPSORT_HXX + + +#include <sfx2/tabdlg.hxx> +#include <vcl/edit.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> +#include <svtools/stdctrl.hxx> +#include <svx/langbox.hxx> + + +#include "global.hxx" +#include "address.hxx" + +//------------------------------------------------------------------------ + +// +1 because one field is reserved for the "- undefined -" entry +#define SC_MAXFIELDS MAXCOLCOUNT+1 + +class ScViewData; +class ScSortDlg; +struct ScSortParam; + +//======================================================================== +// Kriterien (Sort Criteria) + +class ScTabPageSortFields : public SfxTabPage +{ +public: + ScTabPageSortFields( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTabPageSortFields(); + + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + static USHORT* GetRanges (); + virtual BOOL FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); + +protected: +// fuer Datenaustausch (sollte noch umgestellt werden!) +// virtual void ActivatePage ( const SfxItemSet& rSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage (); + virtual int DeactivatePage ( SfxItemSet* pSet = 0); + +private: + FixedLine aFlSort1; + ListBox aLbSort1; + RadioButton aBtnUp1; + RadioButton aBtnDown1; + + FixedLine aFlSort2; + ListBox aLbSort2; + RadioButton aBtnUp2; + RadioButton aBtnDown2; + + FixedLine aFlSort3; + ListBox aLbSort3; + RadioButton aBtnUp3; + RadioButton aBtnDown3; + + String aStrUndefined; + String aStrColumn; + String aStrRow; + + const USHORT nWhichSort; + ScSortDlg* pDlg; + ScViewData* pViewData; + const ScSortParam& rSortData; + SCCOLROW nFieldArr[SC_MAXFIELDS]; + USHORT nFieldCount; + SCCOL nFirstCol; + SCROW nFirstRow; + BOOL bHasHeader; + BOOL bSortByRows; + + ListBox* aSortLbArr[3]; + RadioButton* aDirBtnArr[3][2]; + FixedLine* aFlArr[3]; + +#ifdef _TPSORT_CXX +private: + void Init (); + void DisableField ( USHORT nField ); + void EnableField ( USHORT nField ); + void FillFieldLists (); + USHORT GetFieldSelPos ( SCCOLROW nField ); + + // Handler ------------------------ + DECL_LINK( SelectHdl, ListBox * ); +#endif +}; + +//======================================================================== +// Sortieroptionen (Sort Options) + +class ScDocument; +class ScRangeData; +class CollatorRessource; +class CollatorWrapper; + +#include <sfx2/layout.hxx> +#include <layout/layout-pre.hxx> + +class ScTabPageSortOptions : public SfxTabPage +{ +public: + ScTabPageSortOptions( Window* pParent, + const SfxItemSet& rArgSet ); + ~ScTabPageSortOptions(); + +#undef SfxTabPage +#define SfxTabPage ::SfxTabPage + static SfxTabPage* Create ( Window* pParent, + const SfxItemSet& rArgSet ); + static USHORT* GetRanges (); + virtual BOOL FillItemSet ( SfxItemSet& rArgSet ); + virtual void Reset ( const SfxItemSet& rArgSet ); + +protected: +// fuer Datenaustausch (sollte noch umgestellt werden!) +// virtual void ActivatePage ( const SfxItemSet& rSet ); + using SfxTabPage::ActivatePage; + using SfxTabPage::DeactivatePage; + virtual void ActivatePage (); + virtual int DeactivatePage ( SfxItemSet* pSet = 0); + +private: + + CheckBox aBtnCase; + CheckBox aBtnHeader; + CheckBox aBtnFormats; + CheckBox aBtnCopyResult; + + CheckBox aBtnNaturalSort; + ListBox aLbOutPos; + Edit aEdOutPos; + + CheckBox aBtnSortUser; + ListBox aLbSortUser; + + FixedText aFtLanguage; + SvxLanguageBox aLbLanguage; + FixedText aFtAlgorithm; + ListBox aLbAlgorithm; + + FixedLine aLineDirection; + RadioButton aBtnTopDown; + RadioButton aBtnLeftRight; + +// FixedText aFtAreaLabel; +// FixedInfo aFtArea; + LocalizedString aStrRowLabel; + LocalizedString aStrColLabel; + LocalizedString aStrUndefined; + String aStrNoName; + String aStrAreaLabel; + + const USHORT nWhichSort; + const ScSortParam& rSortData; + ScViewData* pViewData; + ScDocument* pDoc; + ScSortDlg* pDlg; + ScAddress theOutPos; + + CollatorRessource* pColRes; + CollatorWrapper* pColWrap; + +#ifdef _TPSORT_CXX +private: + void Init (); + void FillUserSortListBox (); + void FillOutPosList (); + + // Handler ------------------------ + DECL_LINK( EnableHdl, CheckBox * ); + DECL_LINK( SelOutPosHdl, ListBox * ); + void EdOutPosModHdl ( Edit* pEd ); + DECL_LINK( SortDirHdl, RadioButton * ); + DECL_LINK( FillAlgorHdl, void * ); +#endif +}; + +#include <layout/layout-post.hxx> + +#endif // SC_TPSORT_HXX + diff --git a/toolkit/workben/layout/uno.hxx b/toolkit/workben/layout/uno.hxx index 890341deccdf..a449429338fc 100644 --- a/toolkit/workben/layout/uno.hxx +++ b/toolkit/workben/layout/uno.hxx @@ -32,13 +32,13 @@ #ifndef _LAYOUT_UNO_HXX #define _LAYOUT_UNO_HXX -#include <stdio.h> +#include <cstdio> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include "root.hxx" -#include "factory.hxx" +#include <layout/core/root.hxx> +#include <layout/core/factory.hxx> #if LAYOUT_WEAK #include <cppuhelper/implbase1.hxx> diff --git a/toolkit/workben/layout/wordcount-plain.xml b/toolkit/workben/layout/wordcount-plain.xml index cf31a7614840..a7c34fe5a16f 100644 --- a/toolkit/workben/layout/wordcount-plain.xml +++ b/toolkit/workben/layout/wordcount-plain.xml @@ -22,7 +22,7 @@ </hbox> <fixedline height="8" id="FL_BOTTOM" width="158" x="6" y="77"/> <hbox> - <okbutton def-button="true" height="14" id="PB_OK" width="50" x="61" y="88"/> + <okbutton defbutton="true" height="14" id="PB_OK" width="50" x="61" y="88"/> <helpbutton height="14" id="PB_HELP" width="50" x="114" y="88"/> </hbox> </vbox> diff --git a/toolkit/workben/layout/wordcount-tight.xml b/toolkit/workben/layout/wordcount-tight.xml index 009113f6cdcf..a9f6a7a09393 100644 --- a/toolkit/workben/layout/wordcount-tight.xml +++ b/toolkit/workben/layout/wordcount-tight.xml @@ -28,7 +28,7 @@ <fixedline cnt:padding="1" id="FL_BOTTOM"/> <hbox border="5"> <flow homogeneous="true"/> - <okbutton id="PB_OK" cnt:expand="false" default="true"/> + <okbutton id="PB_OK" cnt:expand="false" defbutton="true"/> <helpbutton id="PB_HELP" cnt:expand="false"/> </hbox> </vbox> diff --git a/toolkit/workben/layout/wordcount.xml b/toolkit/workben/layout/wordcount.xml index c8f8092e3698..fa9d44f896ad 100644 --- a/toolkit/workben/layout/wordcount.xml +++ b/toolkit/workben/layout/wordcount.xml @@ -7,12 +7,12 @@ xmlns:cnt="http://openoffice.org/2007/layout/container" help-id="HID_DLG_WORDCOUNT" id="DLG_WORDCOUNT" - sizeable="true" moveable="true" optimumsize="true" + sizeable="true" moveable="true" optimumsize="true" closeable="true" has_border="true" sv-look="true" _title="Word Count"> - <vbox border="5" spacing="5"> + <vbox border="12" spacing="6"> <fixedline id="FL_CURRENT" _text="Current selection"/> <hbox> - <vbox cnt:padding="13" spacing="5"> + <vbox cnt:padding="12" spacing="6"> <hbox> <fixedtext id="FT_CURRENTWORD" _label="Words:"/> <flow cnt:padding="60"/> @@ -25,11 +25,11 @@ </hbox> </vbox> </hbox> - <!-- if we could do cnt:cnt:padding="-13" here, we would not have to close - and reope the hbox/vbox thing !--> + <!-- if we could do cnt:cnt:padding="-12" here, we would not have to close + and reopen the hbox/vbox thing !--> <fixedline id="FL_DOC" _text="Whole document"/> <hbox> - <vbox cnt:padding="13" spacing="5"> + <vbox cnt:padding="12" spacing="6"> <hbox> <fixedtext id="FT_DOCWORD" _label="Words:"/> <fixedtext id="FI_DOCWORD" right="true" _label="000"/> @@ -41,9 +41,9 @@ </vbox> </hbox> <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <dialogbuttonhbox spacing="5"> + <dialogbuttonhbox spacing="12"> <flow/> - <okbutton id="PB_OK"/> + <okbutton defbutton="true" id="PB_OK"/> <helpbutton id="PB_HELP"/> </dialogbuttonhbox> </vbox> diff --git a/toolkit/workben/layout/wordcountdialog.cxx b/toolkit/workben/layout/wordcountdialog.cxx index 87bca710aabf..49aa2f9ae7a7 100644 --- a/toolkit/workben/layout/wordcountdialog.cxx +++ b/toolkit/workben/layout/wordcountdialog.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: wordcountdialog.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.10 $ * * This file is part of OpenOffice.org. * @@ -47,6 +47,15 @@ #include <wordcountdialog.hrc> #endif /* !TEST_LAYOUT */ +#if ENABLE_LAYOUT +#undef SW_RES +#define SW_RES(x) #x +#undef SfxModalDialog +#define SfxModalDialog( parent, id ) Dialog( parent, "wordcount.xml", id ) +#define SW_WORDCOUNTDIALOG_HRC +#include <helpid.h> +#endif /* ENABLE_LAYOUT */ + /*-- 06.04.2004 16:05:55--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -73,6 +82,9 @@ SwWordCountDialog::SwWordCountDialog(Window* pParent) : #pragma warning (default : 4355) #endif { +#if ENABLE_LAYOUT + SetHelpId (HID_DLG_WORDCOUNT); +#endif /* ENABLE_LAYOUT */ FreeResource(); } /*-- 06.04.2004 16:05:56--------------------------------------------------- @@ -84,17 +96,12 @@ SwWordCountDialog::~SwWordCountDialog() /*-- 06.04.2004 16:05:57--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwWordCountDialog::SetValues(const SwDocStat& -#if !TEST_LAYOUT - rCurrent, -#endif - , const SwDocStat& -#if !TEST_LAYOUT - rDoc -#endif - ) +void SwWordCountDialog::SetValues(const SwDocStat& rCurrent, const SwDocStat& rDoc) { -#if !TEST_LAYOUT +#if TEST_LAYOUT + (void) rCurrent; + (void) rDoc; +#else /* !TEST_LAYOUT */ aCurrentWordFI.SetText( String::CreateFromInt32(rCurrent.nWord )); aCurrentCharacterFI.SetText(String::CreateFromInt32(rCurrent.nChar )); aDocWordFI.SetText( String::CreateFromInt32(rDoc.nWord )); diff --git a/toolkit/workben/layout/wordcountdialog.hxx b/toolkit/workben/layout/wordcountdialog.hxx index 50c43459d12d..b19b3cca8c94 100644 --- a/toolkit/workben/layout/wordcountdialog.hxx +++ b/toolkit/workben/layout/wordcountdialog.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: wordcountdialog.hxx,v $ - * $Revision: 1.3 $ + * $Revision: 1.5 $ * * This file is part of OpenOffice.org. * diff --git a/toolkit/workben/layout/zoom-indent.xml b/toolkit/workben/layout/zoom-indent.xml index 7389780a3a9d..bd5853acdce4 100644 --- a/toolkit/workben/layout/zoom-indent.xml +++ b/toolkit/workben/layout/zoom-indent.xml @@ -33,7 +33,7 @@ </hbox> </vbox> <vbox border="6" spacing="4"> - <okbutton id="OkButton" cnt:expand="false" default="true"/> + <okbutton id="OkButton" cnt:expand="false" defbutton="true"/> <cancelbutton id="CancelButton" cnt:expand="false"/> <helpbutton id="HelpButton" cnt:expand="false"/> </vbox> diff --git a/toolkit/workben/layout/zoom-plain.xml b/toolkit/workben/layout/zoom-plain.xml index 30b72a3e564f..c8383b8767a7 100644 --- a/toolkit/workben/layout/zoom-plain.xml +++ b/toolkit/workben/layout/zoom-plain.xml @@ -3,7 +3,7 @@ <modaldialog sizeable="true" height="142" help-id="SID_ATTR_ZOOM" moveable="true" output-size="true" id="RID_SVXDLG_ZOOM" sv-look="true" text="Zoom" width="160" xmlns="http://openoffice.org/2007/layout" xmlns:cnt="http://openoffice.org/2007/layout/container"> <vbox> <fixedline height="8" id="FL_ZOOM" text="Zoom factor" width="92" x="6" y="3"/> - <okbutton def-button="true" height="14" id="BTN_ZOOM_OK" width="50" x="104" y="6"/> + <okbutton defbutton="true" height="14" id="BTN_ZOOM_OK" width="50" x="104" y="6"/> <radiobutton height="10" id="BTN_WHOLE_PAGE" width="80" x="12" y="14"/> <cancelbutton height="14" id="BTN_ZOOM_CANCEL" width="50" x="104" y="23"/> <radiobutton height="10" id="BTN_PAGE_WIDTH" width="80" x="12" y="27"/> diff --git a/toolkit/workben/layout/zoom.cxx b/toolkit/workben/layout/zoom.cxx index 6717f831b509..39fcb5e94401 100644 --- a/toolkit/workben/layout/zoom.cxx +++ b/toolkit/workben/layout/zoom.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: zoom.cxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.12 $ * * This file is part of OpenOffice.org. * @@ -51,9 +51,9 @@ #define _SVX_ZOOM_CXX #include <svx/dialogs.hrc> -#if !ENABLE_LAYOUT +#if !TEST_LAYOUT #include "zoom.hrc" -#endif /* !ENABLE_LAYOUT */ +#endif /* !TEST_LAYOUT */ #include "zoom.hxx" #if TEST_LAYOUT @@ -114,6 +114,13 @@ struct SvxViewLayoutItem : public LAYOUT_SfxPoolItem #include <layout/layout-pre.hxx> +#if ENABLE_LAYOUT +#undef SVX_RES +#define SVX_RES(x) #x +#undef SfxModalDialog +#define SfxModalDialog( parent, id ) Dialog( parent, "zoom.xml", id ) +#endif /* ENABLE_LAYOUT */ + // static ---------------------------------------------------------------- static USHORT pRanges[] = @@ -284,6 +291,9 @@ SvxZoomDialog::SvxZoomDialog( Window* pParent, const SfxItemSet& rCoreSet ) : bModified ( FALSE ) { +#if ENABLE_LAYOUT + SetHelpId (SID_ATTR_ZOOM); +#endif /* ENABLE_LAYOUT */ Link aLink = LINK( this, SvxZoomDialog, UserHdl ); a100Btn.SetClickHdl( aLink ); aOptimalBtn.SetClickHdl( aLink ); diff --git a/toolkit/workben/layout/zoom.hrc b/toolkit/workben/layout/zoom.hrc new file mode 100644 index 000000000000..3f0f979bd4ae --- /dev/null +++ b/toolkit/workben/layout/zoom.hrc @@ -0,0 +1,61 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: zoom.hrc,v $ + * + * $Revision: 1.4 $ + * + * last change: $Author: kz $ $Date: 2008/03/07 15:16:57 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 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 + * + ************************************************************************/ +#ifndef _SVX_ZOOM_HRC +#define _SVX_ZOOM_HRC + +// defines ------------------------------------------------------------------ + +#define FL_ZOOM 14 +#define BTN_OPTIMAL 15 +#define BTN_WHOLE_PAGE 16 +#define BTN_PAGE_WIDTH 17 +#define BTN_100 18 +#define BTN_USER 19 +#define ED_USER 20 + +#define FL_VIEWLAYOUT 21 +#define BTN_AUTOMATIC 22 +#define BTN_SINGLE 23 +#define BTN_COLUMNS 24 +#define ED_COLUMNS 25 +#define CHK_BOOK 26 + +#define FL_BOTTOM 27 +#define BTN_ZOOM_OK 28 +#define BTN_ZOOM_CANCEL 29 +#define BTN_ZOOM_HELP 30 + +#endif + diff --git a/toolkit/workben/layout/zoom.hxx b/toolkit/workben/layout/zoom.hxx index b865a9b8fc9e..f16e08d558aa 100644 --- a/toolkit/workben/layout/zoom.hxx +++ b/toolkit/workben/layout/zoom.hxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: zoom.hxx,v $ - * $Revision: 1.4 $ + * $Revision: 1.6 $ * * This file is part of OpenOffice.org. * diff --git a/toolkit/workben/layout/zoom.xml b/toolkit/workben/layout/zoom.xml index 78e30ee11dfd..5cc376168a27 100644 --- a/toolkit/workben/layout/zoom.xml +++ b/toolkit/workben/layout/zoom.xml @@ -7,20 +7,20 @@ xmlns:cnt="http://openoffice.org/2007/layout/container" id="RID_SVXDLG_ZOOM" _title="Zoom & View Layout" optimumsize="true" help-id="SID_ATTR_ZOOM" - has_border="true" sizeable="true" moveable="true"> - <vbox spacing="5" border="5"> + has_border="true" sizeable="true" moveable="true" closeable="true"> + <vbox spacing="0" border="12"> <hbox spacing="0" border="0"> - <vbox spacing="5" border="5"> - <fixedline id="FL_ZOOM" _text="Zoom factor" cnt:expand="true"/> - <radiobutton radiogroup="zoom" id="BTN_OPTIMAL" _label="Optimal"/> - <radiobutton radiogroup="zoom" id="BTN_WHOLE_PAGE" _label="Whole Page"/> - <radiobutton radiogroup="zoom" id="BTN_PAGE_WIDTH" _label="Page Width"/> - <radiobutton radiogroup="zoom" id="BTN_100" _label="100 %"/> + <vbox spacing="6" border="0"> + <fixedline id="FL_ZOOM" _text="Zoom factor" cnt:expand="false"/> + <radiobutton radiogroup="zoom-factor" id="BTN_OPTIMAL" _label="Optimal"/> + <radiobutton radiogroup="zoom-factor" id="BTN_WHOLE_PAGE" _label="Whole Page"/> + <radiobutton radiogroup="zoom-factor" id="BTN_PAGE_WIDTH" _label="Page Width"/> + <radiobutton radiogroup="zoom-factor" id="BTN_100" _label="100 %"/> <hbox cnt:expand="false" cnt:fill="true"> <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_USER" _label="Variable"/> + <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-factor" id="BTN_USER" _label="Variable"/> </align> - <flow cnt:padding="10" cnt:expand="false"/> + <flow cnt:padding="12" cnt:expand="false"/> <metricfield id="ED_USER" value-step="1" repeat="true" has_border="true" spin="true" _text="100%" unit="11" custom-unit-text="%" @@ -28,15 +28,16 @@ cnt:expand="false"/> </hbox> </vbox> - <vbox spacing="5" border="5"> - <fixedline id="FL_VIEWLAYOUT" _text="View layout" cnt:expand="true"/> - <radiobutton radiogroup="zoom" id="BTN_AUTOMATIC" _label="~Automatic"/> - <radiobutton radiogroup="zoom" id="BTN_SINGLE" _label="~Single page"/> + <flow/> + <vbox spacing="6" border="0"> + <fixedline id="FL_VIEWLAYOUT" _text="View layout" cnt:expand="false"/> + <radiobutton radiogroup="zoom-layout" id="BTN_AUTOMATIC" _label="~Automatic"/> + <radiobutton radiogroup="zoom-layout" id="BTN_SINGLE" _label="~Single page"/> <hbox cnt:expand="false" cnt:fill="true"> <align cnt:expand="false" cnt:fill="true"> - <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom" id="BTN_COLUMNS" _label="~Columns"/> + <radiobutton cnt:v-align="0.5" cnt:v-fill="0" radiogroup="zoom-layout" id="BTN_COLUMNS" _label="~Columns"/> </align> - <flow cnt:padding="10" cnt:expand="false"/> + <flow cnt:padding="12" cnt:expand="false"/> <metricfield id="ED_COLUMNS" value-step="1" repeat="true" has_border="true" spin="true" _text="100%" @@ -45,15 +46,15 @@ spin-value="1" cnt:expand="false"/> </hbox> - <hbox><flow cnt:expand="false" cnt:padding="10"/><checkbox id="CHK_BOOK" _label="~Book mode"/></hbox> + <hbox><flow cnt:expand="false" cnt:padding="12"/><checkbox id="CHK_BOOK" _label="~Book mode"/></hbox> </vbox> </hbox> - <fixedline cnt:padding="1" id="FL_BOTTOM"/> - <dialogbuttonhbox border="5" spacing="5"> + <fixedline cnt:padding="6" id="FL_BOTTOM"/> + <dialogbuttonhbox border="0" spacing="12"> <flow/> - <okbutton id="BTN_ZOOM_OK"/> + <okbutton defbutton="true" id="BTN_ZOOM_OK"/> <cancelbutton id="BTN_ZOOM_CANCEL"/> - <helpbutton id="BTN_ZOOM_HELP"/> + <helpbutton id="BTN_ZOOM_HELP"/> </dialogbuttonhbox> </vbox> </modaldialog> |