First public contribution.
1 // Copyright (c) 1996-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 the License "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.
14 // e32test\window\t_colour.cpp
25 void ModesAndText(TVideoMode aMode);
30 void ColorTest::ModesAndText(TVideoMode aMode)
33 TInt r=con.SetMode(aMode);
34 con.SetCursorPosAbs(TPoint(1,4));
37 con.Write(_L("Not supported."));
43 con.Write(_L("Normal text..."));
44 con.SetCursorPosAbs(TPoint(1,6));
45 con.SetTextAttribute(ETextAttributeBold);
46 con.Write(_L("Bold text..."));
47 con.SetCursorPosAbs(TPoint(1,8));
48 con.SetTextAttribute(ETextAttributeInverse);
49 con.Write(_L("Inverted text..."));
50 con.SetCursorPosAbs(TPoint(1,10));
51 con.SetTextAttribute(ETextAttributeHighlight);
52 con.Write(_L("Highlighted text..."));
56 con.SetTextAttribute(ETextAttributeNormal);
57 con.SetCursorPosAbs(TPoint(3,2));
60 void ColorTest::Colors()
65 col.Control(_L("-Vis"));
66 col.Init(_L("Colours"),TSize(18,18));
67 col.Control(_L("+Max"));
68 col.SetWindowPosAbs(TPoint(1,0));
69 col.Control(_L("+Vis -Cursor"));
70 for(TInt t=0;t<256;t++)
73 col.SetCursorPosAbs(TPoint(1,1+t/16));
74 col.SetTextColors(0,t);
82 GLDEF_C TInt E32Main()
86 TInt r = t.con.Init(_L("Colour Test"),TSize(28,12));
89 RDebug::Printf("Could not create text console: %d", r);
93 t.con.Control(_L("+Max"));
94 t.con.SetCursorPosAbs(TPoint(3,2));
95 t.con.Write(_L("Testing mode EMono:"));
96 t.ModesAndText(EMono);
97 t.con.Write(_L("Testing mode EGray4:"));
98 t.ModesAndText(EGray4);
99 t.con.Write(_L("Testing mode EGray16:"));
100 t.ModesAndText(EGray16);
101 t.con.Write(_L("Testing mode EColor256:"));
102 t.ModesAndText(EColor256);