File: Frame.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 (66 lines) | stat: -rw-r--r-- 2,150 bytes parent folder | download | duplicates (4)
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
///////////////////////////////////////////////////////////////////////////////
// $Id: Frame.cxx,v 1.1 1995/01/08 06:51:02 bmott Exp $
///////////////////////////////////////////////////////////////////////////////
//
// Frame.cxx - Frame widget
//
//
// Bradford W. Mott
// Copyright (C) 1994
// December 12,1994
//
///////////////////////////////////////////////////////////////////////////////
// $Log: Frame.cxx,v $
// Revision 1.1  1995/01/08  06:51:02  bmott
// Initial revision
//
///////////////////////////////////////////////////////////////////////////////

#include "Frame.hxx"
#include "UIApplication.hxx"

///////////////////////////////////////////////////////////////////////////////
// Constructor
///////////////////////////////////////////////////////////////////////////////
Frame::Frame(ContainerWidget *const parent, const char *const widgetName,
    int x, int y, int width, int height, BorderStyle borderStyle)
    : ContainerWidget(parent, widgetName, x, y, width, height),
      myBorderStyle(borderStyle)
{
  // Create window for widget
  myWindow = XCreateSimpleWindow(application->display(), myParent->window(),
      x, y, width, height,
      0, 0, 0);

  // Non-Flat frames have to respond to Exposure events
  if(borderStyle != Flat)
    XSelectInput(application->display(), myWindow, ExposureMask);
}

///////////////////////////////////////////////////////////////////////////////
// Destructor
///////////////////////////////////////////////////////////////////////////////
Frame::~Frame()
{
}

///////////////////////////////////////////////////////////////////////////////
// Update the graphical view of myself
///////////////////////////////////////////////////////////////////////////////
void Frame::updateView()
{
  Draw3DBorder(this, 3, myBorderStyle);
}

///////////////////////////////////////////////////////////////////////////////
// Called whenever an event arrives for me (I override the default)
///////////////////////////////////////////////////////////////////////////////
void Frame::handleEvent(XEvent* event)
{
  // Handle the event
  if (event->type == Expose)
  {
    updateView();
  }
}