File: About.cxx

package info (click to toggle)
oonsoo 1.2-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,604 kB
  • ctags: 422
  • sloc: cpp: 24,373; makefile: 82
file content (103 lines) | stat: -rw-r--r-- 3,549 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
///////////////////////////////////////////////////////////////////////////////
// $Id: About.cxx,v 1.3 2000/01/10 23:25:37 bwmott Exp $
///////////////////////////////////////////////////////////////////////////////
//
// About.cxx - About Oonsoo class
//
//
// Bradford W. Mott
// Copyright (C) 1994
// December 13,1994
//
///////////////////////////////////////////////////////////////////////////////
// $Log: About.cxx,v $
// Revision 1.3  2000/01/10 23:25:37  bwmott
// Updated information displayed in the dialog
//
// Revision 1.2  1996/01/03 20:10:47  bwmott
// Changed information displayed in the about dialog
//
// Revision 1.1  1995/01/08 06:42:42  bmott
// Initial revision
//
///////////////////////////////////////////////////////////////////////////////

#include "About.hxx"
#include "AboutOkOrCloseCommand.hxx"

#include "UIApplication.hxx"
#include "Frame.hxx"
#include "PushButton.hxx"
#include "DrawingArea.hxx"
#include "Text.hxx"
#include "Sprite.hxx"

///////////////////////////////////////////////////////////////////////////////
// Constructor 
///////////////////////////////////////////////////////////////////////////////
About::About(SpriteCollection* spriteCollection)
    : mySpriteCollection(spriteCollection)
{
  // Find the Oonsoo and B_Logo sprites
  Sprite* oonsoo = mySpriteCollection->getByName("Oonsoo");
  Sprite* b_logo = mySpriteCollection->getByName("B_Logo");

  // Determine width and height of the about window
  int height = 20+oonsoo->height()+20+55+10+b_logo->height()+10+115+10+30+20;
  int width = 125+oonsoo->width();

  // Build the about oonsoo window
  myToplevel = new TopLevel("Oonsoo: About", 200, 200, width, height,
      new AboutOkOrCloseCommand(this));
  myToplevel->background("Gray70");

    // Put a frame in the window to make it look neat!
    Frame* frame = new Frame(myToplevel, "frame", 0, 0,
        width, height, Raised);
    frame->background("Gray70");

    // Build drawing area for Oonsoo title
    DrawingArea* drawingArea = new DrawingArea(myToplevel, "oonsoo",
        (width - oonsoo->width()) / 2, 20, oonsoo->width(), oonsoo->height());
    drawingArea->background(oonsoo);

    // Build Text widget for programmer information
    Text* text = new Text(myToplevel, "information",
        10, 20 + oonsoo->height() + 20, width-20, 55,
        "A Bradford W. Mott Production\nin association with\nSeunghee Lee");
    text->background("Gray70");

    // Build drawing area for B_Logo
    drawingArea = new DrawingArea(myToplevel, "b_logo",
        (width - b_logo->width()) / 2, height-20-30-10-115-10-b_logo->height(), 
        b_logo->width(), b_logo->height());
    drawingArea->background(b_logo);

    // Build Text widget for copyright information
    text = new Text(myToplevel, "copyright",
        10, height-20-30-10-115, width-20, 115,
        "Version 1.2\nCopyright (C) 1994 - 2000\nby Bradford W. Mott\n"
        "bwmott@acm.org\n\n"
        "Released under the GNU Public License");

    text->background("Gray70");

    // Build ok push button
    PushButton* pushButton = new PushButton(myToplevel, "ok",
         (width - 64) / 2, height-20-30,
         64, 30, "Ok", new AboutOkOrCloseCommand(this));
    pushButton->background("Gray70");

  // Manage the about window
  myToplevel->manage();
}

///////////////////////////////////////////////////////////////////////////////
// Destructor 
///////////////////////////////////////////////////////////////////////////////
About::~About()
{
  // Destroy the toplevel widget
  delete myToplevel;
}