]> git.saurik.com Git - wxWidgets.git/blob - samples/dde/server.h
modification to AXP hack
[wxWidgets.git] / samples / dde / server.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: server.h
3 // Purpose: DDE sample: server
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 25/01/99
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 // Define a new application
13 class MyApp: public wxApp
14 {
15 public:
16 bool OnInit();
17 };
18
19 DECLARE_APP(MyApp)
20
21 // Define a new frame
22 class MyFrame: public wxFrame
23 {
24 public:
25 wxPanel *panel;
26
27 MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
28
29 void OnCloseWindow(wxCloseEvent& event);
30 void OnExit(wxCommandEvent& event);
31 void OnListBoxClick(wxCommandEvent& event);
32 DECLARE_EVENT_TABLE()
33 };
34
35 class IPCDialogBox;
36 class MyConnection: public wxConnection
37 {
38 public:
39 IPCDialogBox *dialog;
40
41 MyConnection(char *buf, int size);
42 ~MyConnection();
43
44 bool OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format);
45 char *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
46 bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format);
47 bool OnStartAdvise(const wxString& topic, const wxString& item);
48 };
49
50 class MyServer: public wxServer
51 {
52 public:
53 wxConnectionBase *OnAcceptConnection(const wxString& topic);
54 };
55
56 class IPCDialogBox: public wxDialog
57 {
58 public:
59 MyConnection *connection;
60 IPCDialogBox(wxFrame *parent, const wxString& title,
61 const wxPoint& pos, const wxSize& size, MyConnection *the_connection);
62
63 void OnQuit(wxCommandEvent& event);
64
65 DECLARE_EVENT_TABLE()
66 };
67
68 #define SERVER_QUIT wxID_EXIT
69 #define SERVER_LISTBOX 500
70 #define SERVER_QUIT_BUTTON 501