]>
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 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "servlet.cpp"
14 #pragma interface "servlet.cpp"
17 // For compilers that support precompilation, includes "wx/wx.h".
18 #include "wx/wxprec.h"
31 #if defined(__WXGTK__) || defined(__WXMOTIF__)
32 #include "mondrian.xpm"
35 //----------------------------------------------------------------------------
37 //----------------------------------------------------------------------------
39 class MyOleControl
: public wxOleControl
45 void OnPaint( wxPaintEvent
&event
);
51 //----------------------------------------------------------------------------
53 //----------------------------------------------------------------------------
55 class MyOleServer
: public wxOleServer
59 MyOleServer() : wxOleServer( "servlet" ) { }
61 wxOleControl
*CreateOleControl() { return new MyOleControl(); }
64 //----------------------------------------------------------------------------
66 //----------------------------------------------------------------------------
68 class MyApp
: public wxApp
75 virtual bool OnInit();
77 wxOleServerEnv
*m_oleEnv
;
78 MyOleServer
*m_oleServer
;
81 //----------------------------------------------------------------------------
83 //----------------------------------------------------------------------------
87 //----------------------------------------------------------------------------
89 //----------------------------------------------------------------------------
105 m_oleEnv
= new wxOleServerEnv( "MyServer", "1.0" );
106 m_oleServer
= new MyOleServer();
108 /* how do we get outta here ? */
114 //----------------------------------------------------------------------------
116 //----------------------------------------------------------------------------
118 BEGIN_EVENT_TABLE(MyOleControl
, wxOleControl
)
119 EVT_PAINT(MyOleControl::OnPaint
)
122 MyOleControl::MyOleControl() :
125 (void)new wxButton( this, -1, "Ole, Ole", wxPoint(5,40), wxSize(120,-1) );
126 (void)new wxButton( this, -1, "Greetings", wxPoint(5,70), wxSize(120,-1) );
129 void MyOleControl::OnPaint( wxPaintEvent
&WXUNUSED(event
) )
132 dc
.SetFont( wxFont( 24, wxDECORATIVE
, wxNORMAL
, wxNORMAL
, FALSE
, "charter" ) );
133 dc
.DrawText( "wxWindows rules!", 5, 5 );