Update ooo320-m1
[ooovba.git] / toolkit / source / awt / vclxbutton.cxx
blobab5a259b09158d50d0e1bfa285447f3c391858d8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vclxbutton.cxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #include "vclxbutton.hxx"
34 #include <layout/core/helper.hxx>
35 #include <com/sun/star/awt/ImagePosition.hpp>
36 #include <vcl/button.hxx>
38 namespace css = com::sun::star;
40 namespace layoutimpl
43 VCLXIconButton::VCLXIconButton( Window *p, rtl::OUString aDefaultLabel, char const *pGraphName )
44 : VCLXButton()
46 /* FIXME: before Window is set, setLabel, setProperty->setImage
47 * are silent no-ops. */
48 p->SetComponentInterface( this );
50 setLabel( aDefaultLabel );
51 setProperty( rtl::OUString::createFromAscii( "Graphic" ),
52 css::uno::Any( layoutimpl::loadGraphic( pGraphName ) ) );
53 setProperty( rtl::OUString::createFromAscii( "ImagePosition" ),
54 css::uno::Any( css::awt::ImagePosition::LeftCenter ) );
55 setProperty( rtl::OUString::createFromAscii( "Align" ),
56 css::uno::Any( (sal_Int16) 1 /* magic - center */ ) );
59 // FIXME: l10n/i18n of Reset & Apply
61 VCLXOKButton::VCLXOKButton( Window *p )
62 : VCLXIconButton( p, Button::GetStandardText( BUTTON_OK ),
63 "res/commandimagelist/sc_ok.png" )
67 VCLXCancelButton::VCLXCancelButton( Window *p )
68 : VCLXIconButton( p, Button::GetStandardText( BUTTON_CANCEL ),
69 // : VCLXIconButton( xButton, rtl::OUString::createFromAscii( "~Cancel " ),
70 "res/commandimagelist/sc_cancel.png" )
74 VCLXYesButton::VCLXYesButton( Window *p )
75 : VCLXIconButton( p, Button::GetStandardText( BUTTON_YES ),
76 "res/commandimagelist/sc_yes.png" )
80 VCLXNoButton::VCLXNoButton( Window *p )
81 : VCLXIconButton( p, Button::GetStandardText( BUTTON_NO ),
82 "res/commandimagelist/sc_no.png" )
86 VCLXRetryButton::VCLXRetryButton( Window *p )
87 : VCLXIconButton( p, Button::GetStandardText( BUTTON_RETRY ),
88 "res/commandimagelist/sc_retry.png" )
92 VCLXIgnoreButton::VCLXIgnoreButton( Window *p )
93 : VCLXIconButton( p, Button::GetStandardText( BUTTON_IGNORE ),
94 "res/commandimagelist/sc_ignore.png" )
98 VCLXResetButton::VCLXResetButton( Window *p )
99 : VCLXIconButton( p, rtl::OUString::createFromAscii( "~Reset " ),
100 "res/commandimagelist/sc_reset.png" )
104 VCLXApplyButton::VCLXApplyButton( Window *p )
105 : VCLXIconButton( p, rtl::OUString::createFromAscii( "Apply" ),
106 "res/commandimagelist/sc_apply.png" )
110 VCLXHelpButton::VCLXHelpButton( Window *p )
111 : VCLXIconButton( p, Button::GetStandardText( BUTTON_HELP ),
112 "res/commandimagelist/sc_help.png" )
116 VCLXMoreButton::VCLXMoreButton( Window *p )
117 : VCLXIconButton( p, Button::GetStandardText( BUTTON_MORE ),
118 // : VCLXIconButton( p, rtl::OUString::createFromAscii( "More " ),
119 "res/commandimagelist/sc_more.png" )
123 VCLXAdvancedButton::VCLXAdvancedButton( Window *p )
124 // : VCLXIconButton( p, Button::GetStandardText( BUTTON_ADVANCED ),
125 : VCLXIconButton( p, rtl::OUString::createFromAscii( "Advanced " ),
126 "res/commandimagelist/sc_advanced.png" )
130 } // namespace layoutimpl