]> git.saurik.com Git - wxWidgets.git/blob - contrib/samples/applet/monitorapplet.h
Fixes for wxUSE_STATUSBAR.
[wxWidgets.git] / contrib / samples / applet / monitorapplet.h
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: Header file for the MonitorApplet class
26 *
27 ****************************************************************************/
28
29 #ifndef __WX_MONITORAPPLET_H
30 #define __WX_MONITORAPPLET_H
31
32 #include "wx/applet/applet.h"
33 #include "combobox.h"
34 #include "dialogs_wdr.h"
35
36 /*--------------------------- Class Definitions ---------------------------*/
37
38 /****************************************************************************
39 REMARKS:
40 Structure defining the simple monitor database records.
41 ****************************************************************************/
42 struct MonitorEntry {
43 char m_Mfr[60];
44 char m_Model[60];
45 };
46
47 /****************************************************************************
48 REMARKS:
49 Defines our wxMonitorData cookie object that is stored to maintain state
50 information for this MonitorApplet.
51 ****************************************************************************/
52 class MonitorData : public wxObject {
53 public:
54 MonitorEntry m_Monitor;
55 };
56
57 // Name used to track the monitor data cookie
58 #define MONITOR_COOKIE_NAME "MonitorData"
59
60 /****************************************************************************
61 REMARKS:
62 Defines our wxMonitor applet class
63 ****************************************************************************/
64 class MonitorApplet : public wxApplet {
65 private:
66 DECLARE_DYNAMIC_CLASS(MonitorApplet);
67 DECLARE_EVENT_TABLE();
68
69 protected:
70 ComboBox *m_Mfr;
71 ComboBox *m_Model;
72 MonitorData *m_Data;
73 static MonitorEntry m_Monitors[];
74
75 // Flush the current state to a cookie
76 void SaveCurrentState();
77
78 public:
79 // Constructor (called during dynamic creation)
80 MonitorApplet();
81
82 // Psuedo virtual constructor
83 virtual bool Create(
84 wxHtmlAppletWindow *parent,
85 const wxSize& size,
86 long style);
87
88 // Virtual destructor
89 virtual ~MonitorApplet();
90
91 // Handle HTML navigation to a new URL
92 virtual void OnLinkClicked(const wxHtmlLinkInfo& link);
93
94 // Handle HTML navigation forward command in applet
95 virtual void OnHistoryForward();
96
97 // Handle HTML navigation back command in applet
98 virtual void OnHistoryBack();
99
100 // Handle messages from the wxAppletManager and other applets
101 virtual void OnMessage(wxEvent& msg);
102
103 // Update the model and menufacturer lists
104 void ReadMfrList();
105 void ReadModelList(bool selectCurrent);
106
107 // Event handlers
108 void OnChange(wxCommandEvent &event);
109 };
110
111 #endif // __WX_MONITORAPPLET_H
112