Kaydet (Commit) 0dc97fce authored tarafından Daniel Boelzle's avatar Daniel Boelzle

further impl and bugfixing

üst 04ad018a
<?xml version="1.0" encoding="UTF-8"?>
<!--
$Id: dialog.dtd,v 1.2 2001-02-27 16:17:31 dbo Exp $
$Id: dialog.dtd,v 1.3 2001-02-28 18:22:06 dbo Exp $
The Contents of this file are made available subject to the terms of
either of the following licenses
......@@ -62,12 +62,14 @@
<!ENTITY % pos "dialog:left %numeric; #REQUIRED dialog:top %numeric; #REQUIRED">
<!ENTITY % size "dialog:width %numeric; #REQUIRED dialog:height %numeric; #REQUIRED">
<!ENTITY % default-attributes "dialog:id CDATA #REQUIRED
dialog:style-id CDATA #IMPLIED
<!ENTITY % default-attributes "dialog:style-id CDATA #IMPLIED
dialog:id CDATA #REQUIRED
dialog:class-id CDATA #IMPLIED
dialog:tab-index %numeric; #IMPLIED
dialog:disabled %boolean; #IMPLIED
%pos;
%size;
dialog:printable %boolean; #IMPLIED
dialog:disabled %boolean; #IMPLIED
">
<!ENTITY % control "(dialog:bulletinboard|dialog:button|dialog:checkbox|dialog:menulist|dialog:radiogroup|dialog:titledbox|dialog:textfield|dialog:text|dialog:currencyfield|dialog:filecontrol|dialog:img|dialog:datefield|dialog:numericfield|dialog:patternfield)">
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_imexp.hxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -77,7 +77,7 @@ namespace xmlscript
#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog"
#define XMLNS_DIALOGS_UID 1
#define XMLNS_DIALOGS_PREFIX "dlg"
#define XMLNS_DIALOGS_PREFIX "dialog"
//==================================================================================================
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: imp_share.hxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -332,7 +332,7 @@ public:
vector< Reference< xml::sax2::XExtendedAttributes > > const * getEvents() throw ()
{ return &_events; }
inline ControlElement(
ControlElement(
OUString const & rLocalName,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes,
ElementBase * pParent, DialogImport * pImport )
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_expmodels.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: dbo $ $Date: 2001-02-21 20:49:26 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -333,33 +333,7 @@ void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles )
}
// collect elements
// defaults \ tabstop
sal_Bool bEnabled;
if (_xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Enabled") ) ) >>= bEnabled)
{
if (! bEnabled)
{
addAttr( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":disabled") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) );
}
}
else
{
OSL_ENSURE( 0, "unexpected property type for \"Enabled\": not bool!" );
}
readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Printable") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":printable") ) );
// readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
// OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":left") ) );
readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionY") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":top") ) );
readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":width") ) );
readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ),
OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":height") ) );
readDefaults();
OUString aTitle;
if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle)
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_impmodels.cxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -760,28 +760,7 @@ void TitledBoxElement::endElement()
pStyle->importFontStyle( xControlModel );
}
xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionX") ),
makeAny( _nBasePosX ) );
xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("PositionY") ),
makeAny( _nBasePosY ) );
if (!ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("width") ),
_xAttributes ) ||
!ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Height") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("height") ),
_xAttributes ))
{
throw xml::sax::SAXException(
OUString( RTL_CONSTASCII_USTRINGPARAM("missing titlebox size attribute(s)!") ),
Reference< XInterface >(), Any() );
}
ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Enabled") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("default") ),
_xAttributes );
ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Printable") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("printable") ),
_xAttributes );
ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement
if (_label.getLength())
{
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: xmldlg_import.cxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:16 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -61,7 +61,6 @@
#include "imp_share.hxx"
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
......@@ -82,7 +81,6 @@
#include <com/sun/star/script/ScriptEventDescriptor.hpp>
using namespace ::osl;
namespace xmlscript
{
......@@ -818,6 +816,17 @@ void ControlImportContext::importDefaults(
sal_Int32 nBaseX, sal_Int32 nBaseY,
Reference< xml::sax2::XExtendedAttributes > const & xAttributes )
{
_xControlModel->setPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ),
makeAny( _aId ) );
importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ClassId") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("class-id") ),
xAttributes );
importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("TabIndex") ),
OUString( RTL_CONSTASCII_USTRINGPARAM("tab-index") ),
xAttributes );
sal_Bool bDisable;
if (getBoolAttr( &bDisable, OUString( RTL_CONSTASCII_USTRINGPARAM("disabled") ), xAttributes ) &&
bDisable)
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: imexp.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: dbo $ $Date: 2001-02-27 12:45:17 $
* last change: $Author: dbo $ $Date: 2001-02-28 18:22:08 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -190,6 +190,18 @@ Reference< lang::XMultiServiceFactory > createApplicationServiceManager()
aDllName = OUString::createFromAscii( "libsvt" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
aDllName, Reference< registry::XSimpleRegistry > () );
#ifdef SAL_W32
aDllName = OUString::createFromAscii( "int" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( "mi.dll" );
#else
aDllName = OUString::createFromAscii( "libint" );
aDllName += OUString::valueOf( (sal_Int32)SUPD );
aDllName += OUString::createFromAscii( ".so" );
#endif
xReg->registerImplementation(
OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
......@@ -283,15 +295,6 @@ void MyApp::Main()
OString aParam1( OUStringToOString( OUString( GetCommandLineParam( 0 ) ), RTL_TEXTENCODING_ASCII_US ) );
Sequence< Reference< container::XNameContainer > > models( importFile( aParam1.getStr() ) );
if (GetCommandLineParamCount() == 2)
{
// write and read again dialogs
OString aParam2( OUStringToOString( OUString( GetCommandLineParam( 1 ) ), RTL_TEXTENCODING_ASCII_US ) );
exportToFile( aParam2.getStr(), models );
// re-import
models = importFile( aParam2.getStr() );
}
Reference< container::XNameContainer > const * pModels = models.getConstArray();
for ( sal_Int32 nPos = 0; nPos < models.getLength(); ++nPos )
{
......@@ -302,6 +305,13 @@ void MyApp::Main()
Reference< awt::XDialog > xD( xDlg, UNO_QUERY );
xD->execute();
}
if (GetCommandLineParamCount() == 2)
{
// write modified dialogs
OString aParam2( OUStringToOString( OUString( GetCommandLineParam( 1 ) ), RTL_TEXTENCODING_ASCII_US ) );
exportToFile( aParam2.getStr(), models );
}
}
catch (uno::Exception & rExc)
{
......
......@@ -4,11 +4,10 @@
<dialogs xmlns="http://openoffice.org/2000/dialog">
<window xmlns:dlg="http://openoffice.org/2000/dialog"
label="Test-Dialog" height="800" width="800">
label="Test-Dialog" height="700" width="700">
<dlg:styles>
<dlg:style style-id="bla" background-color="0xffffff" dlg:text-color="255"/>
<dlg:style style-id="bla2" background-color="0xff00ff" dlg:text-color="255193873"/>
<dlg:style style-id="bla3" background-color="0" dlg:text-color="0xffffff" font-name="Arial" font-height="24"/>
<dlg:style style-id="no_border" border="none"/>
</dlg:styles>
......@@ -48,23 +47,24 @@
</menupopup>
</combobox>
<radiogroup>
<radio id="radio1" value="radio1" left="50" top="250" width="100" height="20"/>
<radio id="radio1" value="default radio" left="50" top="250" width="100" height="20"/>
<radio id="radio2" value="checked" left="50" top="270" width="100" height="20" checked="true"/>
<radio id="radio3" value="unchecked" left="50" top="290" width="100" height="20" checked="false"/>
<radio id="radio4" value="dont know" left="50" top="310" width="100" height="20" tristate="true"/>
</radiogroup>
<titledbox id="groupbox1" left="250" top="250" width="120" height="100">
<title value="grouped"/>
<radio id="radio4" value="default radio" left="5" top="15" width="100" height="20"/>
<radio id="radio5" value="dontknow" left="5" top="35" width="100" height="20" tristate="true"/>
<radio id="radio6" value="tristate_checked" left="5" top="55" width="100" height="20" tristate="true" checked="true"/>
<radio id="radio7" value="checked" left="5" top="75" width="100" height="20" checked="true"/>
<radio id="radio5" value="default radio" left="5" top="15" width="100" height="20"/>
<radio id="radio6" value="dont know" left="5" top="35" width="100" height="20" tristate="true"/>
<radio id="radio7" value="tristate checked" left="5" top="55" width="100" height="20" tristate="true" checked="true"/>
<radio id="radio8" value="checked" left="5" top="75" width="100" height="20" checked="true"/>
</titledbox>
<text id="fixed1" left="50" top="520" width="180" height="20" value="fixed text is here..." multiline="true" align="center"/>
<textfield id="field1" left="250" top="520" width="50" height="40" value="edit text here..." readonly="true" vscroll="true" multiline="true" align="right" style-id="no_border"/>
<textfield id="field1" left="250" top="520" width="50" height="40" value="edit no text here..." readonly="true" vscroll="true" multiline="true" align="right" style-id="no_border"/>
<textfield id="field2" left="320" top="520" width="50" height="40" value="hidden text" hscroll="true" echochar="*" align="left"/>
<img id="image1" left="50" top="600" width="80" height="50" src="../../test/w3c.jpg"/>
<filecontrol id="file1" left="150" top="600" width="100" height="100" value="f:\script\xmlscript\test\w3c.jpg"/>
<currencyfield id="currency1" left="250" top="600" width="100" height="20" value="5.6075" value-min="0.5" value-max="10.0" value-step="0.1" spin="true" thousands-separator="true" currency-symbol="$"/>
<!-- <currencyfield id="currency1" left="250" top="600" width="100" height="20" value="5.6075" value-min="0.5" value-max="10.0" value-step="0.1" spin="true" thousands-separator="true" currency-symbol="$"/> -->
<numericfield id="numeric1" left="400" top="100" width="100" height="20" value="5.6075" value-min="0.5" value-max="10.0" value-step="0.1" thousands-separator="true"/>
</dlg:bulletinboard>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment