First public contribution.
1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 //could you useful for visual checking
22 CTWindow * CTWindow::NewL(RWsSession & aWs, CTWindowTreeNode& aGroup, CWindowGc& aGc)
24 CTWindow * self = new (ELeave) CTWindow(aGc);
25 CleanupStack::PushL(self);
26 self->ConstructL(aWs, aGroup);
27 CleanupStack::Pop(self);
31 CTWindow::CTWindow(CWindowGc& aGc) :
36 void CTWindow::ConstructL(RWsSession & aWs, CTWindowTreeNode& aGroup)
38 iWin = new (ELeave) RWindow(aWs);
39 Window()->Construct(*aGroup.WindowTreeNode(), TUint32(this));
40 Window()->SetRequiredDisplayMode(EColor16MAP);
41 Window()->SetShadowHeight(0);
42 Window()->SetShadowDisabled(ETrue);
51 void CTWindow::Event(TWsEvent & /*aEvent*/)
55 void CTWindow::Redraw(TWsRedrawEvent & /*aEvent*/)
57 Window()->BeginRedraw();
58 iGc.Activate(*Window());
61 Window()->EndRedraw();
67 TSize size = Window()->Size();
69 TInt l = size.iWidth / 3;
70 TInt r = size.iWidth * 2 / 3;
71 TInt t = size.iHeight / 3;
72 TInt b = size.iHeight * 2 / 3;
74 iGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
75 iGc.SetBrushColor(KRgbRed);
76 iGc.SetPenStyle(CGraphicsContext::ESolidPen);
77 iGc.SetPenColor(KRgbBlue);
78 iGc.DrawLine(TPoint(-400, -400), TPoint(size.iWidth + 400, size.iHeight + 400));
79 iGc.DrawLine(TPoint(-400, size.iHeight + 400), TPoint(size.iWidth + 400, -400));
80 iGc.SetPenColor(KRgbGreen);
81 iGc.DrawRect(TRect(TPoint(l,0), TPoint(r, size.iHeight)));
82 iGc.DrawRect(TRect(TPoint(0,t), TPoint(size.iWidth, b)));
86 CTWindowGroup * CTWindowGroup::NewL(RWsSession & aWs, CWsScreenDevice* aScreenDevice)
88 CTWindowGroup * self = new (ELeave) CTWindowGroup;
89 CleanupStack::PushL(self);
90 self->ConstructL(aWs, aScreenDevice);
91 CleanupStack::Pop(self);
95 CTWindowGroup::CTWindowGroup()
99 void CTWindowGroup::ConstructL(RWsSession & aWs, CWsScreenDevice* aScreenDevice)
101 iWin = new (ELeave) RWindowGroup(aWs);
102 WindowGroup()->Construct(TUint32(this), aScreenDevice);
105 CTWindowGroup::~CTWindowGroup()
111 void CTWindowGroup::Event(TWsEvent & /*aEvent*/)
115 void CTWindowGroup::Redraw(TWsRedrawEvent & /*aEvent*/)