xref: /AOO41X/main/toolkit/source/awt/vclxbutton.cxx (revision b0724fc6948542b2496e16ea247f985ee5987cfe)
1*b0724fc6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*b0724fc6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*b0724fc6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*b0724fc6SAndrew Rist  * distributed with this work for additional information
6*b0724fc6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*b0724fc6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*b0724fc6SAndrew Rist  * "License"); you may not use this file except in compliance
9*b0724fc6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*b0724fc6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*b0724fc6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*b0724fc6SAndrew Rist  * software distributed under the License is distributed on an
15*b0724fc6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b0724fc6SAndrew Rist  * KIND, either express or implied.  See the License for the
17*b0724fc6SAndrew Rist  * specific language governing permissions and limitations
18*b0724fc6SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*b0724fc6SAndrew Rist  *************************************************************/
21*b0724fc6SAndrew Rist 
22*b0724fc6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "vclxbutton.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <layout/core/helper.hxx>
27cdf0e10cSrcweir #include <com/sun/star/awt/ImagePosition.hpp>
28cdf0e10cSrcweir #include <vcl/button.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir namespace css = com::sun::star;
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace layoutimpl
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 
VCLXIconButton(Window * p,rtl::OUString aDefaultLabel,char const * pGraphName)35cdf0e10cSrcweir VCLXIconButton::VCLXIconButton( Window *p, rtl::OUString aDefaultLabel, char const *pGraphName )
36cdf0e10cSrcweir     : VCLXButton()
37cdf0e10cSrcweir {
38cdf0e10cSrcweir     /* FIXME: before Window is set, setLabel, setProperty->setImage
39cdf0e10cSrcweir      * are silent no-ops.  */
40cdf0e10cSrcweir     p->SetComponentInterface( this );
41cdf0e10cSrcweir 
42cdf0e10cSrcweir     setLabel( aDefaultLabel );
43cdf0e10cSrcweir     setProperty( rtl::OUString::createFromAscii( "Graphic" ),
44cdf0e10cSrcweir                  css::uno::Any( layoutimpl::loadGraphic( pGraphName ) ) );
45cdf0e10cSrcweir     setProperty( rtl::OUString::createFromAscii( "ImagePosition" ),
46cdf0e10cSrcweir                  css::uno::Any( css::awt::ImagePosition::LeftCenter ) );
47cdf0e10cSrcweir     setProperty( rtl::OUString::createFromAscii( "Align" ),
48cdf0e10cSrcweir                  css::uno::Any( (sal_Int16) 1 /* magic - center */ ) );
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir // FIXME: l10n/i18n of Reset & Apply
52cdf0e10cSrcweir 
VCLXOKButton(Window * p)53cdf0e10cSrcweir VCLXOKButton::VCLXOKButton( Window *p )
54cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_OK ),
55cdf0e10cSrcweir                          "res/commandimagelist/sc_ok.png" )
56cdf0e10cSrcweir {
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
VCLXCancelButton(Window * p)59cdf0e10cSrcweir VCLXCancelButton::VCLXCancelButton( Window *p )
60cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_CANCEL ),
61cdf0e10cSrcweir //    : VCLXIconButton( xButton, rtl::OUString::createFromAscii( "~Cancel " ),
62cdf0e10cSrcweir                          "res/commandimagelist/sc_cancel.png" )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir }
65cdf0e10cSrcweir 
VCLXYesButton(Window * p)66cdf0e10cSrcweir VCLXYesButton::VCLXYesButton( Window *p )
67cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_YES ),
68cdf0e10cSrcweir                   "res/commandimagelist/sc_yes.png" )
69cdf0e10cSrcweir {
70cdf0e10cSrcweir }
71cdf0e10cSrcweir 
VCLXNoButton(Window * p)72cdf0e10cSrcweir VCLXNoButton::VCLXNoButton( Window *p )
73cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_NO ),
74cdf0e10cSrcweir                   "res/commandimagelist/sc_no.png" )
75cdf0e10cSrcweir {
76cdf0e10cSrcweir }
77cdf0e10cSrcweir 
VCLXRetryButton(Window * p)78cdf0e10cSrcweir VCLXRetryButton::VCLXRetryButton( Window *p )
79cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_RETRY ),
80cdf0e10cSrcweir                   "res/commandimagelist/sc_retry.png" )
81cdf0e10cSrcweir {
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
VCLXIgnoreButton(Window * p)84cdf0e10cSrcweir VCLXIgnoreButton::VCLXIgnoreButton( Window *p )
85cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_IGNORE ),
86cdf0e10cSrcweir                   "res/commandimagelist/sc_ignore.png" )
87cdf0e10cSrcweir {
88cdf0e10cSrcweir }
89cdf0e10cSrcweir 
VCLXResetButton(Window * p)90cdf0e10cSrcweir VCLXResetButton::VCLXResetButton( Window *p )
91cdf0e10cSrcweir     : VCLXIconButton( p, rtl::OUString::createFromAscii( "~Reset " ),
92cdf0e10cSrcweir                   "res/commandimagelist/sc_reset.png" )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
VCLXApplyButton(Window * p)96cdf0e10cSrcweir VCLXApplyButton::VCLXApplyButton( Window *p )
97cdf0e10cSrcweir     : VCLXIconButton( p, rtl::OUString::createFromAscii( "Apply" ),
98cdf0e10cSrcweir                   "res/commandimagelist/sc_apply.png" )
99cdf0e10cSrcweir {
100cdf0e10cSrcweir }
101cdf0e10cSrcweir 
VCLXHelpButton(Window * p)102cdf0e10cSrcweir VCLXHelpButton::VCLXHelpButton( Window *p )
103cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_HELP ),
104cdf0e10cSrcweir                   "res/commandimagelist/sc_help.png" )
105cdf0e10cSrcweir {
106cdf0e10cSrcweir }
107cdf0e10cSrcweir 
VCLXMoreButton(Window * p)108cdf0e10cSrcweir VCLXMoreButton::VCLXMoreButton( Window *p )
109cdf0e10cSrcweir     : VCLXIconButton( p, Button::GetStandardText( BUTTON_MORE ),
110cdf0e10cSrcweir //    : VCLXIconButton( p, rtl::OUString::createFromAscii( "More " ),
111cdf0e10cSrcweir                   "res/commandimagelist/sc_more.png" )
112cdf0e10cSrcweir {
113cdf0e10cSrcweir }
114cdf0e10cSrcweir 
VCLXAdvancedButton(Window * p)115cdf0e10cSrcweir VCLXAdvancedButton::VCLXAdvancedButton( Window *p )
116cdf0e10cSrcweir //    : VCLXIconButton( p, Button::GetStandardText( BUTTON_ADVANCED ),
117cdf0e10cSrcweir     : VCLXIconButton( p, rtl::OUString::createFromAscii( "Advanced " ),
118cdf0e10cSrcweir                   "res/commandimagelist/sc_advanced.png" )
119cdf0e10cSrcweir {
120cdf0e10cSrcweir }
121cdf0e10cSrcweir 
122cdf0e10cSrcweir } // namespace layoutimpl
123