]> git.saurik.com Git - wxWidgets.git/blob - contrib/src/applet/applet.cpp
Fixed an OOR related bug that happened when a class has been renamed.
[wxWidgets.git] / contrib / src / applet / applet.cpp
1 /****************************************************************************
2 *
3 * wxWindows HTML Applet Package
4 *
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
6 * All rights reserved.
7 *
8 * ========================================================================
9 *
10 * The contents of this file are subject to the wxWindows License
11 * Version 3.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.wxwindows.org/licence3.txt
14 *
15 * Software distributed under the License is distributed on an
16 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
19 *
20 * ========================================================================
21 *
22 * Language: ANSI C++
23 * Environment: Any
24 *
25 * Description: Main wxApplet class implementation
26 *
27 ****************************************************************************/
28
29 // For compilers that support precompilation
30 #include "wx/wxprec.h"
31
32 // Include private headers
33 #include "wx/applet/applet.h"
34 #include "wx/applet/window.h"
35
36 /*------------------------- Implementation --------------------------------*/
37
38 // Empty event handler. We include this event handler simply so that
39 // sub-classes of wxApplet can reference wxApplet in the event tables
40 // that they create as necessary.
41 BEGIN_EVENT_TABLE(wxApplet, wxPanel)
42 EVT_ERASE_BACKGROUND(wxApplet::OnEraseBackground)
43 END_EVENT_TABLE()
44
45 // Implement the abstract class functions
46 IMPLEMENT_ABSTRACT_CLASS(wxApplet, wxPanel);
47
48 /****************************************************************************
49 REMARKS:
50 Psuedo virtual constructor for the wxApplet class.
51 ****************************************************************************/
52 bool wxApplet::Create(
53 wxHtmlAppletWindow *parent,
54 const wxHtmlTag& ,
55 const wxSize& size,
56 long style)
57 {
58 bool ret = wxPanel::Create(parent, -1, wxDefaultPosition, size, style);
59 if (ret) {
60 m_parent = parent;
61 }
62 return ret;
63 }
64
65 /****************************************************************************
66 REMARKS:
67 Destructor for the wxApplet class.
68 ****************************************************************************/
69 wxApplet::~wxApplet()
70 {
71 ((wxHtmlAppletWindow *) m_parent)->RemoveApplet(this);
72 }
73
74 /****************************************************************************
75 REMARKS:
76 Special handler for background erase messages. We do nothing in here which
77 causes the background to not be erased which is exactly what we want. All
78 the wxApplet classes display over an HTML window, so we want the HTML
79 background to show through.
80 ****************************************************************************/
81 void wxApplet::OnEraseBackground(wxEraseEvent&)
82 {
83 }
84