]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxOLE/samples/servlet/servlet.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Minimal wxWindows OLE server sample
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
26 #if defined(__WXGTK__) || defined(__WXMOTIF__)
27 #include "mondrian.xpm"
30 //----------------------------------------------------------------------------
32 //----------------------------------------------------------------------------
34 class MyOleControl
: public wxOleControl
40 void OnPaint( wxPaintEvent
&event
);
46 //----------------------------------------------------------------------------
48 //----------------------------------------------------------------------------
50 class MyOleServer
: public wxOleServer
54 MyOleServer() : wxOleServer( "servlet" ) { }
56 wxOleControl
*CreateOleControl() { return new MyOleControl(); }
59 //----------------------------------------------------------------------------
61 //----------------------------------------------------------------------------
63 class MyApp
: public wxApp
70 virtual bool OnInit();
72 wxOleServerEnv
*m_oleEnv
;
73 MyOleServer
*m_oleServer
;
76 //----------------------------------------------------------------------------
78 //----------------------------------------------------------------------------
82 //----------------------------------------------------------------------------
84 //----------------------------------------------------------------------------
100 m_oleEnv
= new wxOleServerEnv( "MyServer", "1.0" );
101 m_oleServer
= new MyOleServer();
103 /* how do we get outta here ? */
109 //----------------------------------------------------------------------------
111 //----------------------------------------------------------------------------
113 BEGIN_EVENT_TABLE(MyOleControl
, wxOleControl
)
114 EVT_PAINT(MyOleControl::OnPaint
)
117 MyOleControl::MyOleControl() :
120 (void)new wxButton( this, -1, "Ole, Ole", wxPoint(5,40), wxSize(120,-1) );
121 (void)new wxButton( this, -1, "Greetings", wxPoint(5,70), wxSize(120,-1) );
124 void MyOleControl::OnPaint( wxPaintEvent
&WXUNUSED(event
) )
127 dc
.SetFont( wxFont( 24, wxDECORATIVE
, wxNORMAL
, wxNORMAL
, FALSE
, "charter" ) );
128 dc
.DrawText( "wxWidgets rules!", 5, 5 );