]>
Commit | Line | Data |
---|---|---|
7921cf2b JS |
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 | |
4b89c618 VZ |
13 | class MyServer; |
14 | class MyApp : public wxApp | |
7921cf2b | 15 | { |
4b89c618 VZ |
16 | public: |
17 | virtual bool OnInit(); | |
18 | virtual int OnExit(); | |
19 | ||
20 | private: | |
21 | MyServer *m_server; | |
7921cf2b JS |
22 | }; |
23 | ||
24 | DECLARE_APP(MyApp) | |
25 | ||
26 | // Define a new frame | |
4b89c618 | 27 | class MyFrame : public wxFrame |
7921cf2b | 28 | { |
4b89c618 VZ |
29 | public: |
30 | MyFrame(wxFrame *frame, const wxString& title); | |
7921cf2b | 31 | |
7921cf2b | 32 | void OnListBoxClick(wxCommandEvent& event); |
f6bcfd97 | 33 | void OnExit(wxCommandEvent& event); |
4b89c618 VZ |
34 | |
35 | private: | |
36 | wxPanel *panel; | |
37 | ||
38 | DECLARE_EVENT_TABLE() | |
7921cf2b JS |
39 | }; |
40 | ||
41 | class IPCDialogBox; | |
4b89c618 | 42 | class MyConnection : public wxConnection |
7921cf2b | 43 | { |
4b89c618 | 44 | public: |
f010ad48 | 45 | MyConnection(); |
4b89c618 | 46 | ~MyConnection(); |
7921cf2b | 47 | |
600683ca MB |
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); | |
4b89c618 | 51 | bool OnStartAdvise(const wxString& topic, const wxString& item); |
7921cf2b | 52 | |
4b89c618 | 53 | IPCDialogBox *dialog; |
7921cf2b JS |
54 | }; |
55 | ||
56 | class MyServer: public wxServer | |
57 | { | |
58 | public: | |
59 | wxConnectionBase *OnAcceptConnection(const wxString& topic); | |
60 | }; | |
61 | ||
62 | class IPCDialogBox: public wxDialog | |
63 | { | |
64 | public: | |
4b89c618 VZ |
65 | IPCDialogBox(wxWindow *parent, |
66 | const wxString& title, | |
67 | const wxPoint& pos, | |
68 | const wxSize& size, | |
69 | MyConnection *the_connection); | |
f010ad48 | 70 | ~IPCDialogBox( ); |
7921cf2b JS |
71 | |
72 | void OnQuit(wxCommandEvent& event); | |
73 | ||
4b89c618 VZ |
74 | MyConnection *m_connection; |
75 | ||
76 | DECLARE_EVENT_TABLE() | |
7921cf2b JS |
77 | }; |
78 | ||
f6bcfd97 | 79 | #define SERVER_EXIT wxID_EXIT |
7921cf2b JS |
80 | #define SERVER_LISTBOX 500 |
81 | #define SERVER_QUIT_BUTTON 501 |