Update ooo320-m1
[ooovba.git] / vcl / workben / svdem.cxx
blobfc99c103dc972f151698a84c132e465500fd3692
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: svdem.cxx,v $
10 * $Revision: 1.20 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_vcl.hxx"
34 #include <sal/main.h>
35 #include <tools/extendapplicationenvironment.hxx>
36 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <vcl/event.hxx>
39 #include <vcl/svapp.hxx>
40 #include <vcl/wrkwin.hxx>
41 #include <vcl/msgbox.hxx>
43 #include <comphelper/processfactory.hxx>
44 #include <cppuhelper/servicefactory.hxx>
45 #include <cppuhelper/bootstrap.hxx>
47 using namespace ::com::sun::star::uno;
48 using namespace ::com::sun::star::lang;
49 // -----------------------------------------------------------------------
51 // Forward declaration
52 void Main();
54 // -----------------------------------------------------------------------
56 SAL_IMPLEMENT_MAIN()
58 tools::extendApplicationEnvironment();
60 Reference< XMultiServiceFactory > xMS;
61 xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
63 InitVCL( xMS );
64 ::Main();
65 DeInitVCL();
67 return 0;
70 // -----------------------------------------------------------------------
72 class MyWin : public WorkWindow
74 public:
75 MyWin( Window* pParent, WinBits nWinStyle );
77 void MouseMove( const MouseEvent& rMEvt );
78 void MouseButtonDown( const MouseEvent& rMEvt );
79 void MouseButtonUp( const MouseEvent& rMEvt );
80 void KeyInput( const KeyEvent& rKEvt );
81 void KeyUp( const KeyEvent& rKEvt );
82 void Paint( const Rectangle& rRect );
83 void Resize();
86 // -----------------------------------------------------------------------
88 void Main()
90 MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
91 aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "VCL - Workbench" ) ) );
92 aMainWin.Show();
94 Application::Execute();
97 // -----------------------------------------------------------------------
99 MyWin::MyWin( Window* pParent, WinBits nWinStyle ) :
100 WorkWindow( pParent, nWinStyle )
104 // -----------------------------------------------------------------------
106 void MyWin::MouseMove( const MouseEvent& rMEvt )
108 WorkWindow::MouseMove( rMEvt );
111 // -----------------------------------------------------------------------
113 void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
115 WorkWindow::MouseButtonDown( rMEvt );
118 // -----------------------------------------------------------------------
120 void MyWin::MouseButtonUp( const MouseEvent& rMEvt )
122 WorkWindow::MouseButtonUp( rMEvt );
125 // -----------------------------------------------------------------------
127 void MyWin::KeyInput( const KeyEvent& rKEvt )
129 WorkWindow::KeyInput( rKEvt );
132 // -----------------------------------------------------------------------
134 void MyWin::KeyUp( const KeyEvent& rKEvt )
136 WorkWindow::KeyUp( rKEvt );
139 // -----------------------------------------------------------------------
141 void MyWin::Paint( const Rectangle& rRect )
143 WorkWindow::Paint( rRect );
146 // -----------------------------------------------------------------------
148 void MyWin::Resize()
150 WorkWindow::Resize();