]> git.saurik.com Git - wxWidgets.git/blame_incremental - samples/ipc/server.h
Added version test
[wxWidgets.git] / samples / ipc / server.h
... / ...
CommitLineData
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
13class MyServer;
14class MyApp : public wxApp
15{
16public:
17 virtual bool OnInit();
18 virtual int OnExit();
19
20private:
21 MyServer *m_server;
22};
23
24DECLARE_APP(MyApp)
25
26// Define a new frame
27class MyFrame : public wxFrame
28{
29public:
30 MyFrame(wxFrame *frame, const wxString& title);
31
32 void OnListBoxClick(wxCommandEvent& event);
33 void OnExit(wxCommandEvent& event);
34
35private:
36 wxPanel *panel;
37
38 DECLARE_EVENT_TABLE()
39};
40
41class IPCDialogBox;
42class MyConnection : public wxConnection
43{
44public:
45 MyConnection();
46 ~MyConnection();
47
48 bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
49 wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
50 bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format);
51 bool OnStartAdvise(const wxString& topic, const wxString& item);
52
53 IPCDialogBox *dialog;
54};
55
56class MyServer: public wxServer
57{
58public:
59 wxConnectionBase *OnAcceptConnection(const wxString& topic);
60};
61
62class IPCDialogBox: public wxDialog
63{
64public:
65 IPCDialogBox(wxWindow *parent,
66 const wxString& title,
67 const wxPoint& pos,
68 const wxSize& size,
69 MyConnection *the_connection);
70 ~IPCDialogBox( );
71
72 void OnQuit(wxCommandEvent& event);
73
74 MyConnection *m_connection;
75
76 DECLARE_EVENT_TABLE()
77};
78
79#define SERVER_EXIT wxID_EXIT
80#define SERVER_LISTBOX 500
81#define SERVER_QUIT_BUTTON 501