diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index aab6594db7..16d214d487 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -10,7 +10,9 @@ docs/todo.txt docs/licence.txt docs/symbols.txt docs/bugs.txt -docs/*.html +docs/*.htm +docs/html/*.htm +docs/html/*.gif src/*.inc src/mkdir @@ -638,3 +640,19 @@ samples/thread/*.png samples/thread/*.ico samples/thread/*.txt +samples/dde/*.cpp +samples/dde/*.h +samples/dde/makefile* +samples/dde/client.vc +samples/dde/server.vc +samples/dde/client.wat +samples/dde/server.wat +samples/dde/*.rc +samples/dde/*.def +samples/dde/*.bmp +samples/dde/*.xpm +samples/dde/*.xbm +samples/dde/*.png +samples/dde/*.ico +samples/dde/*.txt + diff --git a/docs/changes.txt b/docs/changes.txt index ef86b7df39..2de593966d 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -25,7 +25,8 @@ wxMotif: General: - wxBusyCursor class added. -- More doc improvements. +- Added samples/dde. +- More doc improvements, incl. expanding docs/html/index.htm. Beta 2, January 1999 -------------------- diff --git a/docs/html/index.htm b/docs/html/index.htm index f5c242aab4..493a111e02 100644 --- a/docs/html/index.htm +++ b/docs/html/index.htm @@ -24,11 +24,22 @@

-Welcome to wxWindows 2.0, the premiere cross-platform C++ framework. This is an index of +Welcome to wxWindows 2, the premiere cross-platform GUI C++ framework. This is an index of the plain text and HTML documentation. Documentation is also available in Acrobat (PDF) and Windows Help, from the wxWindows Web site.

-

Installation and release notes

+
+ +[Install] +[Manuals] +[3rd party tools] +[Samples] + +
+ +
+ +

Installation and release notes

-

wxWindows manuals

+
+ + +

wxWindows manuals

-

Third-party tools

+
+ +

Third-party tools

+
+ +

Samples

+ + + +
+ diff --git a/docs/index.htm b/docs/index.htm new file mode 100644 index 0000000000..7225bf9ba6 --- /dev/null +++ b/docs/index.htm @@ -0,0 +1,37 @@ + + + +Welcome to wxWindows 2 + + + + + + + + + + + + + +
+ +Welcome to wxWindows 2 + +
+ +

+ +Welcome to wxWindows 2, the premiere cross-platform GUI C++ framework.

+ +Please click on docs/html/index.htm to view the main document index.

+ +Have fun!

+ + + + + + + diff --git a/docs/motif/install.txt b/docs/motif/install.txt index f86f3cf0a9..f0fe889efe 100644 --- a/docs/motif/install.txt +++ b/docs/motif/install.txt @@ -23,14 +23,9 @@ COMPILING USING CONFIGURE in this directory): # Make wxMotif using the configure system - chmod a+x install/unix/config.sub - install/unix/setup/general/* \ - install/unix/config.guess install/unix/setup/shared/* - cd install/unix - autoconf && ./configure --with-shared --with-motif --with-debug_flag \ + chmod a+x configure config.sub setup/general/* config.guess setup/shared/* + ./configure --with-shared --with-motif --with-debug_flag \ --with-debug_info --without-threads - cd ../.. - make makefiles make COMPILING USING MAKEFILES diff --git a/docs/motif/makewx b/docs/motif/makewx index 97a114e343..82961e7433 100644 --- a/docs/motif/makewx +++ b/docs/motif/makewx @@ -1,7 +1,5 @@ # Make wxMotif using the configure system -chmod a+x install/unix/config.sub install/unix/setup/general/* install/unix/config.guess install/unix/setup/shared/* -cd install/unix -autoconf && ./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads -cd ../.. -make makefiles +chmod a+x configure config.sub setup/general/* config.guess setup/shared/* +./configure --with-shared --with-motif --with-debug_flag --with-debug_info --without-threads make + diff --git a/docs/readme.txt b/docs/readme.txt index 662d04dc24..aea251d13b 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -15,6 +15,9 @@ tree controls on Unix, they are emulated. A detailed 700-page reference manual is supplied in HTML, PDF and Windows Help form. +For a quick start, point your Web browser at docs/html/index.htm for a list of +important documents and samples. + Platforms supported ------------------- diff --git a/docs/todo.txt b/docs/todo.txt index ba884a2b0f..7af174dec8 100644 --- a/docs/todo.txt +++ b/docs/todo.txt @@ -16,7 +16,9 @@ Please see also: - Documentation: mention include files with each class. -- Document wxTime. +- Document/update wxTime. + +- Fix TCP/IP mode in dde sample (how to use; why does it crash). - Get Karsten to remove trashed CVS files: diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h index 4a8a878319..5e7ec5e9f9 100644 --- a/include/wx/msw/dde.h +++ b/include/wx/msw/dde.h @@ -149,14 +149,5 @@ class WXDLLEXPORT wxDDEClient: public wxClientBase void WXDLLEXPORT wxDDEInitialize(); void WXDLLEXPORT wxDDECleanUp(); -// Compatibility -#if WXWIN_COMPATIBILITY -#define wxServer wxDDEServer -#define wxClient wxDDEClient -#define wxConnection wxDDEConnection -#define wxIPCInitialize wxDDEInitialize -#define wxIPCCleanUp wxDDECleanUp -#endif - #endif // _WX_DDE_H_ diff --git a/samples/dde/Makefile b/samples/dde/Makefile new file mode 100644 index 0000000000..bccce53f76 --- /dev/null +++ b/samples/dde/Makefile @@ -0,0 +1 @@ +include ../../setup/general/makeapp diff --git a/samples/dde/Makefile.in b/samples/dde/Makefile.in new file mode 100644 index 0000000000..68ded4e305 --- /dev/null +++ b/samples/dde/Makefile.in @@ -0,0 +1,28 @@ +# WXXT base directory +WXBASEDIR=@WXBASEDIR@ + +# set the OS type for compilation +OS=@OS@ +# compile a library only +RULE=bin2 + +# define library name +BIN_TARGET=client +BIN2_TARGET=server +# define library sources +BIN_SRC= client.cpp +BIN2_SRC= server.cpp + +#define library objects +BIN_OBJ= client.o +BIN2_OBJ= server.o + +# additional things needed to link +BIN_LINK= +BIN2_LINK= + +# additional things needed to compile +ADD_COMPILE= + +# include the definitions now +include ../../../template.mak diff --git a/samples/dde/client.cpp b/samples/dde/client.cpp new file mode 100644 index 0000000000..01430071ab --- /dev/null +++ b/samples/dde/client.cpp @@ -0,0 +1,211 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: client.cpp +// Purpose: DDE sample: client +// Author: Julian Smart +// Modified by: +// Created: 25/01/99 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +// Settings common to both executables: determines whether +// we're using TCP/IP or real DDE. + +#include "ddesetup.h" + +#if defined(__WXGTK__) || defined(__WXMOTIF__) +#include "mondrian.xpm" +#endif + +#include "client.h" + +MyFrame *frame = NULL; + +IMPLEMENT_APP(MyApp) + +char ipc_buffer[4000]; +wxListBox *the_list = NULL; + +MyConnection *the_connection = NULL; +MyClient *my_client ; + +// The `main program' equivalent, creating the windows and returning the +// main frame +bool MyApp::OnInit() +{ + // Create the main frame window + frame = new MyFrame(NULL, "Client", wxPoint(400, 0), wxSize(400, 300)); + + // Give it an icon + frame->SetIcon(wxICON(mondrian)); + + // Make a menubar + wxMenu *file_menu = new wxMenu; + + file_menu->Append(CLIENT_EXECUTE, "Execute"); + file_menu->Append(CLIENT_REQUEST, "Request"); + file_menu->Append(CLIENT_POKE, "Poke"); + file_menu->Append(CLIENT_QUIT, "Quit"); + + wxMenuBar *menu_bar = new wxMenuBar; + + menu_bar->Append(file_menu, "File"); + + // Associate the menu bar with the frame + frame->SetMenuBar(menu_bar); + + // Make a panel + frame->panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 250)); + the_list = new wxListBox(frame->panel, CLIENT_LISTBOX, wxPoint(5, 5), wxSize(150, 120)); + the_list->Append("Apple"); + the_list->Append("Pear"); + the_list->Append("Orange"); + the_list->Append("Banana"); + the_list->Append("Fruit"); + + frame->panel->Fit(); + frame->Fit(); + + wxString server = "4242"; + wxString hostName; + wxGetHostName(hostName); + + if (argc > 1) + server = argv[1]; + if (argc > 2) + hostName = argv[2]; + + // Create a new client + my_client = new MyClient; + the_connection = (MyConnection *)my_client->MakeConnection(hostName, server, "IPC TEST"); + + if (!the_connection) + { + wxMessageBox("Failed to make connection to server", "Client Demo Error"); +#ifdef __WXMSW__ +// extern void wxPrintDDEError(); +// wxPrintDDEError(); +#endif + return FALSE; + } + the_connection->StartAdvise("Item"); + + frame->Show(TRUE); + + return TRUE; +} + +int MyApp::OnExit() +{ + if (my_client) + delete my_client ; + + return 0; +} + +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(CLIENT_QUIT, MyFrame::OnExit) + EVT_MENU(CLIENT_EXECUTE, MyFrame::OnExecute) + EVT_MENU(CLIENT_POKE, MyFrame::OnPoke) + EVT_MENU(CLIENT_REQUEST, MyFrame::OnRequest) + EVT_CLOSE(MyFrame::OnCloseWindow) +END_EVENT_TABLE() + +// Define my frame constructor +MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size): + wxFrame(frame, -1, title, pos, size) +{ + panel = NULL; +} + +void MyFrame::OnExecute(wxCommandEvent& event) +{ + if (the_connection) + the_connection->Execute("Hello from the client!"); +} + +void MyFrame::OnPoke(wxCommandEvent& event) +{ + if (the_connection) + the_connection->Poke("An item", "Some data to poke at the server!"); +} + +void MyFrame::OnRequest(wxCommandEvent& event) +{ + if (the_connection) + { + char *data = the_connection->Request("An item"); + if (data) + wxMessageBox(data, "Client: Request", wxOK); + } +} + +void MyFrame::OnExit(wxCommandEvent& event) +{ + if (the_connection) + the_connection->Disconnect(); + + this->Destroy(); +} + +// Define the behaviour for the frame closing +void MyFrame::OnCloseWindow(wxCloseEvent& event) +{ + if (the_connection) + { + the_connection->Disconnect(); + } + this->Destroy(); +} + +MyClient::MyClient(void) +{ +} + +wxConnectionBase *MyClient::OnMakeConnection(void) +{ + return new MyConnection; +} + +MyConnection::MyConnection(void):wxConnection(ipc_buffer, 3999) +{ +} + +MyConnection::~MyConnection(void) +{ + the_connection = NULL; +} + +bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format) +{ + if (the_list) + { + int n = the_list->FindString(data); + if (n > -1) + the_list->SetSelection(n); + } + return TRUE; +} + +bool MyConnection::OnDisconnect() +{ + frame->Destroy(); + + the_connection = NULL; + delete this; + + return TRUE; +} + diff --git a/samples/dde/client.def b/samples/dde/client.def new file mode 100644 index 0000000000..786b7d609a --- /dev/null +++ b/samples/dde/client.def @@ -0,0 +1,8 @@ +NAME Client +DESCRIPTION 'Client' +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 1024 +STACKSIZE 8192 diff --git a/samples/dde/client.h b/samples/dde/client.h new file mode 100644 index 0000000000..8017a29def --- /dev/null +++ b/samples/dde/client.h @@ -0,0 +1,55 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: client.h +// Purpose: DDE sample: client +// Author: Julian Smart +// Modified by: +// Created: 25/01/99 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// Define a new application +class MyApp: public wxApp +{ + public: + bool OnInit(); + int OnExit(); +}; + +// Define a new frame +class MyFrame: public wxFrame +{ + public: + wxPanel *panel; + + MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size); + void OnCloseWindow(wxCloseEvent& event); + void OnExit(wxCommandEvent& event); + void OnExecute(wxCommandEvent& event); + void OnPoke(wxCommandEvent& event); + void OnRequest(wxCommandEvent& event); +DECLARE_EVENT_TABLE() +}; + +class MyConnection: public wxConnection +{ + public: + MyConnection(); + ~MyConnection(); + bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format); + bool OnDisconnect(); +}; + +class MyClient: public wxClient +{ + public: + MyClient(); + wxConnectionBase *OnMakeConnection(); +}; + +#define CLIENT_QUIT wxID_EXIT +#define CLIENT_EXECUTE 2 +#define CLIENT_REQUEST 3 +#define CLIENT_POKE 4 +#define CLIENT_LISTBOX 200 diff --git a/samples/dde/client.rc b/samples/dde/client.rc new file mode 100644 index 0000000000..74b8e3f417 --- /dev/null +++ b/samples/dde/client.rc @@ -0,0 +1,2 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" diff --git a/samples/dde/client.vc b/samples/dde/client.vc new file mode 100644 index 0000000000..f52524060b --- /dev/null +++ b/samples/dde/client.vc @@ -0,0 +1,20 @@ +# +# File: makefile.vc +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart +# +# Makefile : Builds sample (VC++, WIN32) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +# Set WXDIR for your system +WXDIR = $(WXWIN) + +PROGRAM=client +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.vc + +client.obj: ddesetup.h + diff --git a/samples/dde/client.wat b/samples/dde/client.wat new file mode 100644 index 0000000000..789db64157 --- /dev/null +++ b/samples/dde/client.wat @@ -0,0 +1,15 @@ +# +# Makefile for WATCOM +# +# Created by Julian Smart, January 1999 +# +# + +WXDIR = $(%WXWIN) + +PROGRAM = client +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.wat + + diff --git a/samples/dde/ddesetup.h b/samples/dde/ddesetup.h new file mode 100644 index 0000000000..7b674ecf54 --- /dev/null +++ b/samples/dde/ddesetup.h @@ -0,0 +1,37 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: ddesetup.h +// Purpose: DDE sample settings +// Author: Julian Smart +// Modified by: +// Created: 25/01/99 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +/* + * Adjust this before compiling, to switch between real DDE and TCP/IP + * implementations. + */ + +// If 1, use real DDE. If 0, use TCP/IP +#define wxUSE_DDE_FOR_SAMPLE 1 + +#if wxUSE_DDE_FOR_SAMPLE + +#define wxConnection wxDDEConnection +#define wxServer wxDDEServer +#define wxClient wxDDEClient + +#include + +#else + +#define wxConnection wxTCPConnection +#define wxServer wxTCPServer +#define wxClient wxTCPClient + +#include + +#endif + diff --git a/samples/dde/makefile.b32 b/samples/dde/makefile.b32 new file mode 100644 index 0000000000..94a0ed2b5b --- /dev/null +++ b/samples/dde/makefile.b32 @@ -0,0 +1,82 @@ +# +# File: makefile.b32 +# Author: Guilhem Lavaux +# Created: 1998 +# Updated: +# Copyright: (c) Guilhem Lavaux +# +# "%W% %G%" +# +# Makefile : Builds 32-bit wxSocket sample under BC++ + +WXDIR = $(WXWIN) + +ZLIB = $(WXDIR)\lib\zlib.lib + +!include $(WXDIR)\src\makeb32.env + +WXLIBDIR = $(WXDIR)\lib +WXINC = $(WXDIR)\include\msw +WXLIB = $(WXLIBDIR)\wx32.lib +LIBS=$(WXLIB) $(ZLIB) cw32 import32 ole2w32 + +!if "$(FINAL)" == "0" +LINKFLAGS=/v /Tpe /L$(WXLIBDIR);$(BCCDIR)\lib +OPT = -Od +DEBUG_FLAGS= -v +!else +LINKFLAGS=/Tpe /L$(WXLIBDIR);$(BCCDIR)\lib +OPT = -Od +DEBUG_FLAGS = +!endif +CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG) + +.$(SRCSUFF).obj: + bcc32 $(CPPFLAGS) -c {$< } + +.c.obj: + bcc32 $(CPPFLAGS) -P- -c {$< } + +CLIENT_TARGET=client +SERVER_TARGET=server +CLIENT_OBJECTS=client.obj +SERVER_OBJECTS=server.obj + +all: $(CLIENT_TARGET).exe $(SERVER_TARGET).exe + +$(CLIENT_TARGET).exe: $(CLIENT_OBJECTS) $(CLIENT_TARGET).res + tlink32 $(LINKFLAGS) @&&! + c0w32.obj $(CLIENT_OBJECTS) + $(CLIENT_TARGET) + nul + $(LIBS) + $(CLIENT_TARGET).def + $(CLIENT_TARGET).res +! + +client.obj: client.cpp + +$(CLIENT_TARGET).res : $(CLIENT_TARGET).rc $(WXDIR)\include\wx\msw\wx.rc + brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(CLIENT_TARGET) + +$(SERVER_TARGET).exe: $(SERVER_OBJECTS) $(SERVER_TARGET).res + tlink32 $(LINKFLAGS) @&&! + c0w32.obj $(SERVER_OBJECTS) + $(SERVER_TARGET) + nul + $(LIBS) + $(SERVER_TARGET).def + $(SERVER_TARGET).res +! + +server.obj: server.cpp + +$(SERVER_TARGET).res: $(SERVER_TARGET).rc $(WXDIR)\include\wx\msw\wx.rc + brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(SERVER_TARGET) + +clean: + -erase *.obj + -erase *.exe + -erase *.res + -erase *.map + -erase *.rws diff --git a/samples/dde/makefile.dos b/samples/dde/makefile.dos new file mode 100644 index 0000000000..2a42833b60 --- /dev/null +++ b/samples/dde/makefile.dos @@ -0,0 +1,19 @@ +# +# File: makefile.dos +# Author: Julian Smart +# Created: 1998 +# Updated: +# +# Makefile : Builds 16-bit sample, VC++ 1.5 +# Use FINAL=1 argument to nmake to build final version with no debugging +# info + +WXDIR = $(WXWIN) + +TARGET=client +OBJECTS = $(TARGET).obj + +# TODO: server + +!include $(WXDIR)\src\makeprog.msc + diff --git a/samples/dde/makefile.g95 b/samples/dde/makefile.g95 new file mode 100644 index 0000000000..8139390064 --- /dev/null +++ b/samples/dde/makefile.g95 @@ -0,0 +1,46 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile for server/client example (UNIX). + +WXDIR = ../.. + +# All common UNIX compiler flags and options are now in +# this central makefile. +include $(WXDIR)/src/makeg95.env + +OBJECTS=$(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF)\ + $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF) + +all: $(OBJDIR) server$(GUISUFFIX) client$(GUISUFFIX) + + +$(OBJDIR): + mkdir $(OBJDIR) + +server$(GUISUFFIX): $(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF) $(WXLIB) + $(CC) $(LDFLAGS) -o server$(GUISUFFIX)$(EXESUFF) $(OBJDIR)/server.$(OBJSUFF) $(OBJDIR)/server_resources.$(OBJSUFF) $(LDLIBS) + +$(OBJDIR)/server.$(OBJSUFF): server.$(SRCSUFF) server.h + $(CC) -c $(CPPFLAGS) -o $@ server.$(SRCSUFF) + +client$(GUISUFFIX): $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF) $(WXLIB) + $(CC) $(LDFLAGS) -o client$(GUISUFFIX)$(EXESUFF) $(OBJDIR)/client.$(OBJSUFF) $(OBJDIR)/client_resources.$(OBJSUFF) $(LDLIBS) + +$(OBJDIR)/client.$(OBJSUFF): client.$(SRCSUFF) client.h + $(CC) -c $(CPPFLAGS) -o $@ client.$(SRCSUFF) + +$(OBJDIR)/server_resources.o: server.rc + $(RESCOMP) -i server.rc -o $(OBJDIR)/server_resources.o $(RESFLAGS) + +$(OBJDIR)/client_resources.o: client.rc + $(RESCOMP) -i client.rc -o $(OBJDIR)/client_resources.o $(RESFLAGS) + +clean: + rm -f $(OBJECTS) server$(GUISUFFIX).exe client$(GUISUFFIX).exe core *.rsc *.res diff --git a/samples/dde/makefile.vc b/samples/dde/makefile.vc new file mode 100644 index 0000000000..3864d7dd9d --- /dev/null +++ b/samples/dde/makefile.vc @@ -0,0 +1,20 @@ +# +# File: makefile.vc +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart +# +# Makefile : Builds sample (VC++, WIN32) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +!include $(WXWIN)/src/makevc.env + +all: + nmake -f server.vc FINAL=$(FINAL) + nmake -f client.vc FINAL=$(FINAL) + +clean: + nmake -f server.vc clean + nmake -f client.vc clean + diff --git a/samples/dde/mondrian.ico b/samples/dde/mondrian.ico new file mode 100644 index 0000000000..2310c5d275 Binary files /dev/null and b/samples/dde/mondrian.ico differ diff --git a/samples/dde/mondrian.xpm b/samples/dde/mondrian.xpm new file mode 100644 index 0000000000..409f27a843 --- /dev/null +++ b/samples/dde/mondrian.xpm @@ -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 ++++ ", +" " +}; diff --git a/samples/dde/server.cpp b/samples/dde/server.cpp new file mode 100644 index 0000000000..864c68afa7 --- /dev/null +++ b/samples/dde/server.cpp @@ -0,0 +1,196 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: server.cpp +// Purpose: DDE sample: server +// Author: Julian Smart +// Modified by: +// Created: 25/01/99 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +// Settings common to both executables: determines whether +// we're using TCP/IP or real DDE. + +#include "ddesetup.h" + +#if defined(__WXGTK__) || defined(__WXMOTIF__) +#include "mondrian.xpm" +#endif + +#include "server.h" + +MyFrame *frame = NULL; + +IMPLEMENT_APP(MyApp) + +char ipc_buffer[4000]; +MyConnection *the_connection = NULL; +MyServer *my_server ; + +bool MyApp::OnInit() +{ + // Create the main frame window + frame = new MyFrame(NULL, "Server", wxDefaultPosition, wxSize(400, 500)); + + frame->CreateStatusBar(); + + // Give it an icon + frame->SetIcon(wxICON(mondrian)); + + // Make a menubar + wxMenu *file_menu = new wxMenu; + + file_menu->Append(SERVER_QUIT, "&Exit"); + + wxMenuBar *menu_bar = new wxMenuBar; + + menu_bar->Append(file_menu, "&File"); + + // Associate the menu bar with the frame + frame->SetMenuBar(menu_bar); + + // Make a panel + frame->panel = new wxPanel(frame, 0, 0, 400, 250); + wxListBox *list = new wxListBox(frame->panel, SERVER_LISTBOX, + wxPoint(5, 5), wxSize(150, 120)); + list->Append("Apple"); + list->Append("Pear"); + list->Append("Orange"); + list->Append("Banana"); + list->Append("Fruit"); + + frame->panel->Fit(); + frame->Fit(); + + wxString server_name = "4242"; + if (argc > 1) + server_name = argv[1]; + + // Create a new server + my_server = new MyServer; + my_server->Create(server_name); + + frame->Show(TRUE); + + return TRUE; +} + +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(SERVER_QUIT, MyFrame::OnExit) + EVT_CLOSE(MyFrame::OnCloseWindow) + EVT_LISTBOX(SERVER_LISTBOX, MyFrame::OnListBoxClick) +END_EVENT_TABLE() + +// Define my frame constructor +MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size): + wxFrame(frame, -1, title, pos, size) +{ + panel = NULL; +} + +void MyFrame::OnExit(wxCommandEvent& event) +{ + if (my_server) + delete my_server; + this->Destroy(); +} + +// Set the client process's listbox to this item +void MyFrame::OnListBoxClick(wxCommandEvent& event) +{ + wxListBox* listBox = (wxListBox*) panel->FindWindow(SERVER_LISTBOX); + if (listBox) + { + wxString value = listBox->GetStringSelection(); + if (the_connection) + { + the_connection->Advise("Item", (char*) (const char*) value); + } + } +} + +void MyFrame::OnCloseWindow(wxCloseEvent& event) +{ + if (my_server) + delete my_server; + this->Destroy(); +} + +BEGIN_EVENT_TABLE(IPCDialogBox, wxDialog) + EVT_BUTTON(SERVER_QUIT_BUTTON, IPCDialogBox::OnQuit) +END_EVENT_TABLE() + +IPCDialogBox::IPCDialogBox(wxFrame *parent, const wxString& title, + const wxPoint& pos, const wxSize& size, MyConnection *the_connection): + wxDialog(parent, -1, title, pos, size) +{ + connection = the_connection; + (void)new wxButton(this, SERVER_QUIT_BUTTON, "Quit this connection", wxPoint(5, 5)); + Fit(); +} + +void IPCDialogBox::OnQuit(wxCommandEvent& event) +{ + connection->Disconnect(); + delete connection; +} + +wxConnectionBase *MyServer::OnAcceptConnection(const wxString& topic) +{ + if (strcmp(topic, "STDIO") != 0 && strcmp(topic, "IPC TEST") == 0) + return new MyConnection(ipc_buffer, 4000); + else + return NULL; +} + +MyConnection::MyConnection(char *buf, int size):wxConnection(buf, size) +{ + dialog = new IPCDialogBox(frame, "Connection", wxPoint(100, 100), wxSize(500, 500), this); + dialog->Show(TRUE); + the_connection = this; +} + +MyConnection::~MyConnection(void) +{ + dialog->Destroy(); + the_connection = NULL; +} + +bool MyConnection::OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format) +{ + char buf[300]; + sprintf(buf, "Execute command: %s", data); + frame->SetStatusText(buf); + return TRUE; +} + +bool MyConnection::OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format) +{ + char buf[300]; + sprintf(buf, "Poke command: %s", data); + frame->SetStatusText(buf); + return TRUE; +} + +char *MyConnection::OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format) +{ + return "Here, have your data, client!"; +} + +bool MyConnection::OnStartAdvise(const wxString& topic, const wxString& item) +{ + return TRUE; +} + diff --git a/samples/dde/server.def b/samples/dde/server.def new file mode 100644 index 0000000000..21027a5c01 --- /dev/null +++ b/samples/dde/server.def @@ -0,0 +1,8 @@ +NAME Server +DESCRIPTION 'Server' +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 4096 +STACKSIZE 8192 diff --git a/samples/dde/server.h b/samples/dde/server.h new file mode 100644 index 0000000000..81aa31697b --- /dev/null +++ b/samples/dde/server.h @@ -0,0 +1,70 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: server.h +// Purpose: DDE sample: server +// Author: Julian Smart +// Modified by: +// Created: 25/01/99 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// Define a new application +class MyApp: public wxApp +{ + public: + bool OnInit(); +}; + +DECLARE_APP(MyApp) + +// Define a new frame +class MyFrame: public wxFrame +{ + public: + wxPanel *panel; + + MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size); + + void OnCloseWindow(wxCloseEvent& event); + void OnExit(wxCommandEvent& event); + void OnListBoxClick(wxCommandEvent& event); +DECLARE_EVENT_TABLE() +}; + +class IPCDialogBox; +class MyConnection: public wxConnection +{ + public: + IPCDialogBox *dialog; + + MyConnection(char *buf, int size); + ~MyConnection(); + + bool OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format); + char *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format); + bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, wxIPCFormat format); + bool OnStartAdvise(const wxString& topic, const wxString& item); +}; + +class MyServer: public wxServer +{ +public: + wxConnectionBase *OnAcceptConnection(const wxString& topic); +}; + +class IPCDialogBox: public wxDialog +{ +public: + MyConnection *connection; + IPCDialogBox(wxFrame *parent, const wxString& title, + const wxPoint& pos, const wxSize& size, MyConnection *the_connection); + + void OnQuit(wxCommandEvent& event); + +DECLARE_EVENT_TABLE() +}; + +#define SERVER_QUIT wxID_EXIT +#define SERVER_LISTBOX 500 +#define SERVER_QUIT_BUTTON 501 diff --git a/samples/dde/server.rc b/samples/dde/server.rc new file mode 100644 index 0000000000..7655c62a4c --- /dev/null +++ b/samples/dde/server.rc @@ -0,0 +1,3 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + diff --git a/samples/dde/server.vc b/samples/dde/server.vc new file mode 100644 index 0000000000..6167edfb7d --- /dev/null +++ b/samples/dde/server.vc @@ -0,0 +1,20 @@ +# +# File: makefile.vc +# Author: Julian Smart +# Created: 1999 +# Updated: +# Copyright: (c) Julian Smart +# +# Makefile : Builds sample (VC++, WIN32) +# Use FINAL=1 argument to nmake to build final version with no debug info. + +# Set WXDIR for your system +WXDIR = $(WXWIN) + +PROGRAM=server +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.vc + +server.obj: ddesetup.h + diff --git a/samples/dde/server.wat b/samples/dde/server.wat new file mode 100644 index 0000000000..2acfdf1115 --- /dev/null +++ b/samples/dde/server.wat @@ -0,0 +1,15 @@ +# +# Makefile for WATCOM +# +# Created by Julian Smart, January 1999 +# +# + +WXDIR = $(%WXWIN) + +PROGRAM = server +OBJECTS = $(PROGRAM).obj + +!include $(WXDIR)\src\makeprog.wat + + diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 0003b97093..59511a065b 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -188,6 +188,10 @@ wxTCPConnection::wxTCPConnection (void) { } +wxTCPConnection::wxTCPConnection(char *buffer, int size) +{ +} + wxTCPConnection::~wxTCPConnection (void) { wxDELETE(m_sock); diff --git a/src/generic/helpxlp.cpp b/src/generic/helpxlp.cpp index 4fd7ed0a2f..13d43fbb63 100644 --- a/src/generic/helpxlp.cpp +++ b/src/generic/helpxlp.cpp @@ -97,7 +97,6 @@ bool wxXLPHelpController::Initialize(const wxString& filename, int server) helpFile = filename; helpServer = server; - wxIPCInitialize(); return TRUE; } diff --git a/src/makefile.vc b/src/makefile.vc index 5ad7dee96a..ca8985bf2e 100644 --- a/src/makefile.vc +++ b/src/makefile.vc @@ -20,16 +20,16 @@ THISDIR=$(WXWIN)\src all: cd msw - nmake -f makefile.nt + nmake -f makefile.vc cd $(THISDIR) clean: cd msw - nmake -f makefile.nt clean + nmake -f makefile.vc clean cd $(THISDIR) cleanall: cd msw - nmake -f makefile.nt cleanall + nmake -f makefile.vc cleanall cd $(THISDIR) diff --git a/src/makevc.env b/src/makevc.env index 01d08574fd..773d9ae719 100644 --- a/src/makevc.env +++ b/src/makevc.env @@ -36,7 +36,7 @@ WINLINKFLAGS=/INCREMENTAL:NO /NOLOGO -machine:$(CPU) -subsystem:windows,$(APPVER #WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib libc.lib oldnames.lib\ # comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib # libci.lib # libci.lib required for VC++ 4.2 WINLIBS=kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib oldnames.lib\ - comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib # libci.lib # libci.lib required for VC++ 4.2 + comctl32.lib ctl3d32.lib odbc32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib wsock32.lib # libci.lib # libci.lib required for VC++ 4.2 # Change this to your WXWIN directory WXDIR=$(WXWIN) diff --git a/src/png/makefile.vc b/src/png/makefile.vc index a4c8b19d4b..9094b9ee13 100644 --- a/src/png/makefile.vc +++ b/src/png/makefile.vc @@ -1,5 +1,5 @@ # -# File: makefile.nt +# File: makefile.vc # Author: Julian Smart # Created: 1993 # Updated: diff --git a/src/xpm/parse.c b/src/xpm/parse.c index 17f8ed27f6..74bb479fe9 100644 --- a/src/xpm/parse.c +++ b/src/xpm/parse.c @@ -47,6 +47,7 @@ #ifdef sun #ifdef SVR4 +#define __ORIGINAL_XORG_CODE #include /* bzero, bcopy */ #endif #endif diff --git a/utils/tex2rtf/src/makefile.vc b/utils/tex2rtf/src/makefile.vc index a3bf628330..fb16a0e098 100644 --- a/utils/tex2rtf/src/makefile.vc +++ b/utils/tex2rtf/src/makefile.vc @@ -23,7 +23,7 @@ all: tex2rtf.exe wx: cd $(WXDIR)\src\msw - nmake -f makefile.nt + nmake -f makefile.vc cd $(TEX2RTFDIR)\src $(PROGRAM).exe: $(WXLIB) $(OBJECTS) $(PROGRAM).res