experimental OLE control (the reason for the

recent reshuffle)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-04-25 16:55:03 +00:00
parent 13393ab623
commit 10d5be9ad3
7 changed files with 667 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
Linux
linux-gnu
linux
servelt
test-coontainer
servlet.o
wxole.o

View File

@@ -0,0 +1,29 @@
#
# File: Makefile
# Author: Robert Roebling
# Created: 1999
# Updated:
# Copyright: (c) 1998 Robert Roebling
#
# Makefile for OLE demo (GTK version)
#
# This makefile requires wxWindows/GTK to be
# installed (possibly using "make install")
# on your system.
#
CC = g++
servlet: servlet.o wxole.o
$(CC) -o servlet servlet.o wxole.o \
`wx-config --libs` -lbonobo `gnome-config --libs gnorba` `gnome-config --libs gnomeui`
servlet.o: servlet.cpp
$(CC) `wx-config --cflags` `gtk-config --cflags` -I../../gtk -c servlet.cpp
wxole.o: ../../gtk/wxole.cpp
$(CC) `wx-config --cflags` `gtk-config --cflags` `gnome-config --cflags gnorba` \
-I../../gtk -c ../../gtk/wxole.cpp
clean:
rm -f *.o servlet

View File

@@ -0,0 +1,44 @@
/* XPM */
static char *mondrian_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 6 1",
" c Black",
". c Blue",
"X c #00bf00",
"o c Red",
"O c Yellow",
"+ c Gray100",
/* pixels */
" ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" oooooo +++++++++++++++++++++++ ",
" ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ .... ",
" ++++++ ++++++++++++++++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++++++++++++++++ ++++ ",
" ++++++ ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" ++++++ OOOOOOOOOOOO XXXXX ++++ ",
" "
};

View File

@@ -0,0 +1,135 @@
/////////////////////////////////////////////////////////////////////////////
// Name: servlet.cpp
// Purpose: Minimal wxWindows OLE server sample
// Author: Robert Roebling
// Modified by:
// Created: 20/04/99
// RCS-ID: $Id$
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "servlet.cpp"
#pragma interface "servlet.cpp"
#endif
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
// For OLE stuff
#include "wxole.h"
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "mondrian.xpm"
#endif
//----------------------------------------------------------------------------
// MyOleControl
//----------------------------------------------------------------------------
class MyOleControl : public wxOleControl
{
public:
MyOleControl();
void OnPaint( wxPaintEvent &event );
private:
DECLARE_EVENT_TABLE()
};
//----------------------------------------------------------------------------
// MyOleServer
//----------------------------------------------------------------------------
class MyOleServer : public wxOleServer
{
public:
MyOleServer() : wxOleServer( "servlet" ) { }
wxOleControl *CreateOleControl() { return new MyOleControl(); }
};
//----------------------------------------------------------------------------
// MyApp
//----------------------------------------------------------------------------
class MyApp : public wxApp
{
public:
MyApp();
~MyApp();
virtual bool OnInit();
wxOleServerEnv *m_oleEnv;
MyOleServer *m_oleServer;
};
//----------------------------------------------------------------------------
// main
//----------------------------------------------------------------------------
IMPLEMENT_APP(MyApp)
//----------------------------------------------------------------------------
// MyApp
//----------------------------------------------------------------------------
MyApp::MyApp()
{
}
MyApp::~MyApp()
{
delete m_oleEnv;
delete m_oleServer;
}
#include "gtk/gtk.h"
bool MyApp::OnInit()
{
m_oleEnv = new wxOleServerEnv( "MyServer", "1.0" );
m_oleServer = new MyOleServer();
/* how do we get outta here ? */
for (;;) wxYield();
return TRUE;
}
//----------------------------------------------------------------------------
// MyOleControl
//----------------------------------------------------------------------------
BEGIN_EVENT_TABLE(MyOleControl, wxOleControl)
EVT_PAINT(MyOleControl::OnPaint)
END_EVENT_TABLE()
MyOleControl::MyOleControl() :
wxOleControl( -1 )
{
(void)new wxButton( this, -1, "Ole, Ole", wxPoint(5,40), wxSize(120,-1) );
(void)new wxButton( this, -1, "Greetings", wxPoint(5,70), wxSize(120,-1) );
}
void MyOleControl::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
wxPaintDC dc(this);
dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, FALSE, "charter" ) );
dc.DrawText( "wxWindows rules!", 5, 5 );
}

View File

@@ -0,0 +1,13 @@
[component-factory:servlet]
type=exe
repo_id=IDL:GNOME/ComponentFactory:1.0 IDL:GNOME/GenericFactory:1.0
description=wxOLE test object server factory
location_info=servlet
[component:servlet]
type=factory
repo_id=IDL:Component/servlet:1.0 IDL:GNOME/Component:1.0
description=wxOLE Test server component
location_info=component-factory:servlet