summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-03-06 10:39:43 +0000
committerKurt Zenker <kz@openoffice.org>2008-03-06 10:39:43 +0000
commit5257600b115746f0b4dad90374ed1143b5b1596d (patch)
tree90411c4b6efc9882b15e5056694e68da1d7f24c7 /toolkit
parent91685dfbc3bd528968a6c0f4fece90581bcefb89 (diff)
INTEGRATION: CWS layout_DEV300 (1.1.2); FILE ADDED
2008/02/18 15:24:45 jcn 1.1.2.2: Cleanup: do not use namespace in header, remove dead code. 2008/02/08 18:44:42 jcn 1.1.2.1: Initial toolkit import from ee9a2fcc29d7e2f01cc80ef7c13bf7bc7d55ae7e. layout/source/awt -> toolkit/source/awt layout/source/core -> toolkit/source/layout layout/source/wrapper -> toolkit/source/vclcompat layout/inc/layout -> toolkit/inc/layout layout/source/inc -> toolkit/inc/layout layout/workben -> toolkit/workben/layout That's ooo-build trunk r11539 @ ooh680-m5/src680-m245.
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxbutton.cxx130
-rw-r--r--toolkit/source/awt/vclxbutton.hxx69
2 files changed, 199 insertions, 0 deletions
diff --git a/toolkit/source/awt/vclxbutton.cxx b/toolkit/source/awt/vclxbutton.cxx
new file mode 100644
index 000000000000..01a08e480407
--- /dev/null
+++ b/toolkit/source/awt/vclxbutton.cxx
@@ -0,0 +1,130 @@
+#include "vclxbutton.hxx"
+
+#include "layoutcore.hxx"
+#include <com/sun/star/awt/ImagePosition.hpp>
+#include <vcl/button.hxx>
+
+namespace css = com::sun::star;
+
+IconButton::IconButton( css::uno::Reference< css::uno::XInterface > xButton,
+ rtl::OUString aDefaultLabel, const char *pGraphName )
+ : VCLXProxy( xButton )
+{
+ setLabel( aDefaultLabel );
+ setProperty( rtl::OUString::createFromAscii( "Graphic" ),
+ css::uno::Any( layoutimpl::loadGraphic( pGraphName ) ) );
+ setProperty( rtl::OUString::createFromAscii( "ImagePosition" ),
+ css::uno::Any( css::awt::ImagePosition::LeftCenter ) );
+ setProperty( rtl::OUString::createFromAscii( "Align" ),
+ css::uno::Any( (sal_Int16) 1 /* magic - center */ ) );
+}
+
+// FIXME: l10n/i18n of Reset & Apply
+
+VCLXOKButton::VCLXOKButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_OK ),
+ "res/commandimagelist/sc_ok.png" )
+{
+}
+
+VCLXCancelButton::VCLXCancelButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_CANCEL ),
+// : IconButton( xButton, rtl::OUString::createFromAscii( "~Cancel " ),
+ "res/commandimagelist/sc_cancel.png" )
+{
+}
+
+VCLXYesButton::VCLXYesButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_YES ),
+ "res/commandimagelist/sc_yes.png" )
+{
+}
+
+VCLXNoButton::VCLXNoButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_NO ),
+ "res/commandimagelist/sc_no.png" )
+{
+}
+
+VCLXRetryButton::VCLXRetryButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_RETRY ),
+ "res/commandimagelist/sc_retry.png" )
+{
+}
+
+VCLXIgnoreButton::VCLXIgnoreButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_IGNORE ),
+ "res/commandimagelist/sc_ignore.png" )
+{
+}
+
+VCLXResetButton::VCLXResetButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, rtl::OUString::createFromAscii( "~Reset " ),
+ "res/commandimagelist/sc_reset.png" )
+{
+}
+
+VCLXApplyButton::VCLXApplyButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, rtl::OUString::createFromAscii( "Apply" ),
+ "res/commandimagelist/sc_apply.png" )
+{
+}
+
+VCLXHelpButton::VCLXHelpButton( css::uno::Reference< css::uno::XInterface > xButton )
+ : IconButton( xButton, Button::GetStandardText( BUTTON_HELP ),
+ "res/commandimagelist/sc_help.png" )
+{
+}
+
+namespace layoutimpl
+{
+css::uno::Reference< css::awt::XLayoutConstrains >
+createInternalWidget( css::uno::Reference< css::awt::XToolkit > xToolkit,
+ css::uno::Reference< css::uno::XInterface > xParent,
+ const rtl::OUString &rName, long nProps )
+{
+ css::uno::Reference< css::awt::XLayoutConstrains > xRef, xWrapped;
+ bool bOK = false;
+ bool bCancel = false;
+ bool bYes = false;
+ bool bNo = false;
+ bool bRetry = false;
+ bool bIgnore = false;
+ bool bReset = false;
+ bool bApply = false;
+ bool bHelp = false;
+ if ( ( bOK = rName.equalsAscii( "okbutton" ) )
+ || ( bCancel = rName.equalsAscii( "cancelbutton" ) )
+ || ( bYes = rName.equalsAscii( "yesbutton" ) )
+ || ( bNo = rName.equalsAscii( "nobutton" ) )
+ || ( bRetry = rName.equalsAscii( "retrybutton" ) )
+ || ( bIgnore = rName.equalsAscii( "ignorebutton" ) )
+ || ( bReset = rName.equalsAscii( "resetbutton" ) )
+ || ( bApply = rName.equalsAscii( "applybutton" ) )
+ || ( bHelp = rName.equalsAscii( "helpbutton" ) ) )
+ {
+ xWrapped = createWidget( xToolkit, xParent,
+ rtl::OUString::createFromAscii( "pushbutton" ),
+ nProps );
+ if ( bOK )
+ xRef = new VCLXOKButton( xWrapped );
+ if ( bCancel )
+ xRef = new VCLXCancelButton( xWrapped );
+ if ( bYes )
+ xRef = new VCLXYesButton( xWrapped );
+ if ( bNo )
+ xRef = new VCLXNoButton( xWrapped );
+ if ( bRetry )
+ xRef = new VCLXRetryButton( xWrapped );
+ if ( bIgnore )
+ xRef = new VCLXIgnoreButton( xWrapped );
+ if ( bReset )
+ xRef = new VCLXResetButton( xWrapped );
+ if ( bApply )
+ xRef = new VCLXApplyButton( xWrapped );
+ if ( bHelp )
+ xRef = new VCLXHelpButton( xWrapped );
+ }
+ return xRef;
+}
+};
diff --git a/toolkit/source/awt/vclxbutton.hxx b/toolkit/source/awt/vclxbutton.hxx
new file mode 100644
index 000000000000..8e6846a87668
--- /dev/null
+++ b/toolkit/source/awt/vclxbutton.hxx
@@ -0,0 +1,69 @@
+#ifndef LAYOUT_AWT_VCLXBUTTON_HXX
+#define LAYOUT_AWT_VCLXBUTTON_HXX
+
+#include "vclxproxy.hxx"
+
+/* Replacements for broken toolkit/ impls. of ok, cancel, help button, etc. */
+
+class IconButton : public VCLXProxy
+{
+protected:
+ IconButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton,
+ rtl::OUString aDefaultLabel, const char *pGraphName );
+};
+
+class VCLXOKButton : public IconButton
+{
+public:
+ VCLXOKButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXCancelButton : public IconButton
+{
+public:
+ VCLXCancelButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXYesButton : public IconButton
+{
+public:
+ VCLXYesButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXNoButton : public IconButton
+{
+public:
+ VCLXNoButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXRetryButton : public IconButton
+{
+public:
+ VCLXRetryButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXIgnoreButton : public IconButton
+{
+public:
+ VCLXIgnoreButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXResetButton : public IconButton
+{
+public:
+ VCLXResetButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXApplyButton : public IconButton
+{
+public:
+ VCLXApplyButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+class VCLXHelpButton : public IconButton
+{
+public:
+ VCLXHelpButton( com::sun::star::uno::Reference< com::sun::star::uno::XInterface > xButton );
+};
+
+#endif // LAYOUT_AWT_VCLXBUTTON_HXX