1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: score.cxx,v $
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_goodies.hxx"
34 #include "strings.hrc"
35 #include "invader.hxx"
37 ScoreWindow::ScoreWindow(Window
* Parent
, WinBits wBits
, ResMgr
* pP
) :
38 Window(Parent
, wBits
),
46 SetBackground(Wallpaper( Color( COL_GRAY
) ) );
49 ScoreWindow::~ScoreWindow()
53 void ScoreWindow::Paint(const Rectangle
&)
55 Font aFont
= GetFont();
56 aFont
.SetColor(COL_WHITE
);
57 aFont
.SetFillColor(COL_GRAY
);
60 SetFillColor(COL_GRAY
);
64 Push( PUSH_LINECOLOR
);
66 DrawRect(Rectangle(Point(0,0),GetOutputSizePixel()));
71 DrawText(Point(0,0),String(ResId(nHero
, *pRes
)));
73 DrawText(Point(180,0),String(ResId(STR_ROCKETS
, *pRes
)));
75 DrawText(Point(300,0),String(ResId(STR_FIGHTER
, *pRes
)));
76 DrawText(Point(370,0),String::CreateFromInt32(nLives
));
78 DrawText(Point(400,0),String(ResId(STR_LEVEL
, *pRes
)));
79 DrawText(Point(460,0),String::CreateFromInt32(nLevel
));
81 DrawText(Point(500,0),String(ResId(STR_SCORE
, *pRes
)));
82 String aString
= String::CreateFromInt32(nScore
);
83 if ( aString
.Len() < 7 )
85 for ( xub_StrLen i
= aString
.Len(); i
< 7; ++i
)
86 aString
.Insert( '0', 0 );
88 DrawText(Point(560,0),aString
);
90 for(long i
=0; i
<5;i
++)
94 SetLineColor(COL_GREEN
);
95 SetFillColor(COL_GREEN
);
99 SetLineColor(COL_RED
);
100 SetFillColor(COL_RED
);
103 DrawRect(Rectangle(Point(250+i
*8,5),Point(256+i
*8,12)));
105 SetBackground(Wallpaper( Color( COL_GRAY
) ) );
110 void ScoreWindow::SetHero(long nName
)
118 void ScoreWindow::SetRockets(long nWert
)
126 void ScoreWindow::SetLives(long nWert
)
134 void ScoreWindow::SetScore(long nWert
)
142 void ScoreWindow::SetLevel(long nWert
)
150 void ScoreWindow::ShowMe()