1*d9e04f7dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*d9e04f7dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*d9e04f7dSAndrew Rist * or more contributor license agreements. See the NOTICE file
5*d9e04f7dSAndrew Rist * distributed with this work for additional information
6*d9e04f7dSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*d9e04f7dSAndrew Rist * to you under the Apache License, Version 2.0 (the
8*d9e04f7dSAndrew Rist * "License"); you may not use this file except in compliance
9*d9e04f7dSAndrew Rist * with the License. You may obtain a copy of the License at
10*d9e04f7dSAndrew Rist *
11*d9e04f7dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*d9e04f7dSAndrew Rist *
13*d9e04f7dSAndrew Rist * Unless required by applicable law or agreed to in writing,
14*d9e04f7dSAndrew Rist * software distributed under the License is distributed on an
15*d9e04f7dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d9e04f7dSAndrew Rist * KIND, either express or implied. See the License for the
17*d9e04f7dSAndrew Rist * specific language governing permissions and limitations
18*d9e04f7dSAndrew Rist * under the License.
19*d9e04f7dSAndrew Rist *
20*d9e04f7dSAndrew Rist *************************************************************/
21*d9e04f7dSAndrew Rist
22*d9e04f7dSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #include <soldep/graphwin.hxx>
25cdf0e10cSrcweir //#include "depapp.hxx"
26cdf0e10cSrcweir #include <soldep/soldep.hxx>
27cdf0e10cSrcweir
28cdf0e10cSrcweir
GraphWin(Window * pParent,void * pClass)29cdf0e10cSrcweir GraphWin::GraphWin( Window * pParent, void * pClass )
30cdf0e10cSrcweir : ScrollableWindow( pParent, 0L, SCRWIN_DEFAULT | SCRWIN_VCENTER | SCRWIN_HCENTER )
31cdf0e10cSrcweir , aBufferWindow( this )
32cdf0e10cSrcweir {
33cdf0e10cSrcweir mpClass = pClass;
34cdf0e10cSrcweir SetSizePixel( pParent->GetSizePixel());
35cdf0e10cSrcweir SetPosPixel( pParent->GetPosPixel());
36cdf0e10cSrcweir SetTotalSize( Size( 2000,2000 ));
37cdf0e10cSrcweir
38cdf0e10cSrcweir aBufferWindow.SetBackground( Wallpaper( Color( COL_WHITE )));
39cdf0e10cSrcweir aBufferWindow.SetPosSizePixel( PIXELS( 0, 0, 2000, 2000 ) );
40cdf0e10cSrcweir aBufferWindow.Show(); // Content
41cdf0e10cSrcweir Show(); // Window with Scrollbars
42cdf0e10cSrcweir }
43cdf0e10cSrcweir
EndScroll(long nDeltaX,long nDeltaY)44cdf0e10cSrcweir void GraphWin::EndScroll( long nDeltaX, long nDeltaY )
45cdf0e10cSrcweir {
46cdf0e10cSrcweir // get the visible area
47cdf0e10cSrcweir Rectangle aArea( GetVisibleArea());
48cdf0e10cSrcweir long nX = aArea.Right();
49cdf0e10cSrcweir long nY = aArea.Bottom();
50cdf0e10cSrcweir
51cdf0e10cSrcweir // set the new pos and size by using LogicToPixel (this is mandatory)
52cdf0e10cSrcweir aBufferWindow.SetPosSizePixel( LogicToPixel( Point( 0, 0 )),
53cdf0e10cSrcweir LogicToPixel( Size( nX, nY )));
54cdf0e10cSrcweir aBufferWindow.Invalidate();
55cdf0e10cSrcweir }
56cdf0e10cSrcweir
Resize()57cdf0e10cSrcweir void GraphWin::Resize()
58cdf0e10cSrcweir {
59cdf0e10cSrcweir // get the visible area
60cdf0e10cSrcweir ScrollableWindow::Resize();
61cdf0e10cSrcweir Rectangle aArea( GetVisibleArea());
62cdf0e10cSrcweir long nX = aArea.Right();
63cdf0e10cSrcweir long nY = aArea.Bottom();
64cdf0e10cSrcweir
65cdf0e10cSrcweir // set the new pos and size by using LogicToPixel (this is mandatory)
66cdf0e10cSrcweir aBufferWindow.SetPosSizePixel( LogicToPixel( Point( 0, 0 )),
67cdf0e10cSrcweir LogicToPixel( Size( nX, nY )));
68cdf0e10cSrcweir }
69cdf0e10cSrcweir
Command(const CommandEvent & rEvent)70cdf0e10cSrcweir void GraphWin::Command( const CommandEvent& rEvent)
71cdf0e10cSrcweir {
72cdf0e10cSrcweir ScrollableWindow::Command( rEvent );
73cdf0e10cSrcweir }
74