From 84e1e67f01c12359c06b8de940f0626fb681be3f Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 11 Jun 2013 18:24:51 +0000 Subject: [PATCH] The dllwidget no longer exists so get rid of this old crusty demo code. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- demo/dllwidget/Makefile | 16 ------- demo/dllwidget/makefile.vc | 32 -------------- demo/dllwidget/test_dll.cpp | 54 ------------------------ demo/dllwidget/test_prog.py | 84 ------------------------------------- 4 files changed, 186 deletions(-) delete mode 100644 demo/dllwidget/Makefile delete mode 100644 demo/dllwidget/makefile.vc delete mode 100644 demo/dllwidget/test_dll.cpp delete mode 100644 demo/dllwidget/test_prog.py diff --git a/demo/dllwidget/Makefile b/demo/dllwidget/Makefile deleted file mode 100644 index bcf3a564..00000000 --- a/demo/dllwidget/Makefile +++ /dev/null @@ -1,16 +0,0 @@ - -CXX = c++ -CXXFLAGS = `wx-config --cxxflags` -fPIC -I. -LDFLAGS = `wx-config --libs` - - -all: test_dll.so - -test_dll.so: test_dll.o - $(CXX) $(LDFLAGS) -shared -o $@ $< - -%.o : %.cpp - $(CXX) -c $(CXXFLAGS) -o $@ $< - -clean: - rm -f *.o *.so diff --git a/demo/dllwidget/makefile.vc b/demo/dllwidget/makefile.vc deleted file mode 100644 index e12c0d34..00000000 --- a/demo/dllwidget/makefile.vc +++ /dev/null @@ -1,32 +0,0 @@ - -WXDIR = $(WXWIN) -WXUSINGDLL = 1 - -PROGRAM = test_dll -OBJECTS = test_dll.obj - -!include $(WXDIR)\src\makevc.env - - -$(PROGRAM).dll : $(OBJECTS) - $(link) @<< --out:$(PROGRAM).dll --dll $(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) -$(OBJECTS) -$(WXLIB) -<< - - -clean: - del $(OBJECTS) - del $(PROGRAM).dll - del $(PROGRAM).exp - del $(PROGRAM).lib - del $(PROGRAM).pdb - -test: - @echo -out:$(PROGRAM).dll - @echo -dll $(LINK_DEBUG_FLAGS) $(WINLINKFLAGS) - @echo $(OBJECTS) - @echo $(WXLIB) - diff --git a/demo/dllwidget/test_dll.cpp b/demo/dllwidget/test_dll.cpp deleted file mode 100644 index 4790351d..00000000 --- a/demo/dllwidget/test_dll.cpp +++ /dev/null @@ -1,54 +0,0 @@ - -#include -#include -#include - -#include "../../contrib/dllwidget/dllwidget.h" - -class TestWindow : public wxWindow -{ -public: - TestWindow(wxWindow *parent, long style) - : wxWindow(parent, wxID_ANY) - { - SetBackgroundColour(wxColour("white")); - } - - int HandleCommand(int cmd, const wxString& param) - { - if (cmd == 1) - { - SetBackgroundColour(wxColour("red")); - Refresh(); - } - - if (cmd == 2) - { - SetBackgroundColour(wxColour(param)); - Refresh(); - } - - else if (cmd == 3) - { - wxMessageBox("Message from embedded widget:\n\n" + param); - } - - return 0; - } -private: - DECLARE_ABSTRACT_CLASS(TestWindow) -}; - -IMPLEMENT_ABSTRACT_CLASS(TestWindow, wxWindow) - - -//DECLARE_DLL_WIDGET(TestWindow) -static int SendCommandToTestWindow(wxWindow *wnd, int cmd, const wxString& param) -{ - return wxStaticCast(wnd, TestWindow)->HandleCommand(cmd, param); -} - - -BEGIN_WIDGET_LIBRARY() - REGISTER_WIDGET(TestWindow) -END_WIDGET_LIBRARY() diff --git a/demo/dllwidget/test_prog.py b/demo/dllwidget/test_prog.py deleted file mode 100644 index bd54f16c..00000000 --- a/demo/dllwidget/test_prog.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python - -from wxPython.wx import * -from wxPython.dllwidget import wxDllWidget, wxDllWidget_GetDllExt - -#---------------------------------------------------------------------- - -class TestFrame(wxFrame): - def __init__(self): - wxFrame.__init__(self, None, -1, "Test wxDllWidget") - - menu = wxMenu() - menu.Append(101, "Send command &1") - menu.Append(102, "Send command &2") - menu.Append(103, "Send command &3") - menu.AppendSeparator() - menu.Append(110, "E&xit") - - mb = wxMenuBar() - mb.Append(menu, "&Test") - self.SetMenuBar(mb) - - EVT_MENU_RANGE(self, 101, 109, self.OnSendCommand) - EVT_MENU(self, 110, self.OnExit) - - panel = wxPanel(self, -1) - panel.SetFont(wxFont(12, wxSWISS, wxNORMAL, wxBOLD)) - - st = wxStaticText(panel, -1, - "The widget below was dynamically imported from\n" - "test_dll.dll or test_dll.so with no prior knowledge\n" - "of it's contents or structure by wxPython.") - - self.dw = dw = wxDllWidget(panel, -1, - "test_dll" + wxDllWidget_GetDllExt(), - "TestWindow", - size=(250, 150)) - - if dw.Ok(): - # The embedded window is the one exported from the DLL - print dw.GetWidgetWindow().GetClassName() - - # This shows that we can give it a child from this side of things. - # You can also call any wxWindow methods on it too. - wxStaticText(dw.GetWidgetWindow(), -1, - "Loaded from test_dll...", pos=(10,10)) - else: - wxStaticText(dw, -1, "ERROR!!!!", pos=(20,20)) - - sizer = wxBoxSizer(wxVERTICAL) - sizer.Add(wxStaticLine(panel, -1), 0, wxGROW) - sizer.Add(st, 0, wxGROW|wxALL, 5) - sizer.Add(dw, 1, wxGROW|wxALL, 5) - - panel.SetSizer(sizer) - panel.SetAutoLayout(true) - sizer.Fit(self) - sizer.SetSizeHints(self) - - - def OnExit(self, evt): - self.Close() - - - def OnSendCommand(self, evt): - ID = evt.GetId() - 100 # use the menu ID as the command - param = "" - if ID == 2: - dlg = wxTextEntryDialog(self, "Enter a colour name to pass to the embedded widget:") - if dlg.ShowModal() == wxID_OK: - param = dlg.GetValue() - dlg.Destroy() - self.dw.SendCommand(ID, param) - - - -#---------------------------------------------------------------------- - - -if __name__ == "__main__": - app = wxPySimpleApp() - frame = TestFrame() - frame.Show(true) - app.MainLoop()