OGL fixes for wxMotif; added Set/GetClientData to wxMenu in wxMSW/wxMotif/wxStubs.

Sorry, I may be overwriting changes Robert made due to a file copying error.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-11-08 22:35:18 +00:00
parent d18ed59a36
commit 3dd4e4e05c
36 changed files with 192 additions and 233 deletions

View File

@@ -1,79 +1,20 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1993
# Created: 1998
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
# Copyright: (c) 1998 Julian Smart
#
# "%W% %G%"
#
# Makefile for docview example (UNIX).
# Makefile for OGLEdit example (UNIX).
WXDIR = ../../../..
PROGRAM=ogledit
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/make.env
OBJECTS=$(PROGRAM).o doc.o view.o palette.o
OGLDIR = $(WXDIR)/utils/ogl
OGLINC = $(OGLDIR)/src
OGLLIB = $(OGLDIR)/lib/libogl$(GUISUFFIX).a
EXTRACPPFLAGS=-I$(WXDIR)/utils/ogl/src
EXTRALDLIBS=-logl$(GUISUFFIX)
OBJECTS = $(OBJDIR)/ogledit.$(OBJSUFF) $(OBJDIR)/view.$(OBJSUFF) $(OBJDIR)/doc.$(OBJSUFF) $(OBJDIR)/palette.$(OBJSUFF)
include ../../../../src/makeprog.env
LDFLAGS = $(XLIB) -L$(WXDIR)/lib -L$(OGLDIR)/lib -L$(MFDIR)/lib
XVIEWLDLIBS = -logl_ol -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS)
MOTIFLDLIBS = -logl_motif -lwx_motif -lXm -lXt -lX11 -lm $(COMPLIBS)
HPLDLIBS = -logl_motif -lwx_hp -lXm -lXt -lX11 -lm $(COMPLIBS)
CPPFLAGS = -I$(OGLINC) -I$(PROLOGINC) -I$(MFINC) $(XINCLUDE) $(INC) $(GUI) -DDEBUG='$(DEBUG)' $(DEBUGFLAGS) $(WARN) $(OPTIONS) -DPROLOGIO
.SUFFIXES:
all: $(OBJDIR) ogledit$(GUISUFFIX)
wx_motif:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif
wx_ol:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
motif:
$(MAKE) -f makefile.unx GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
xview:
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)'
hp:
$(MAKE) -f makefile,unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='' WARN='-w' \
XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)'
$(OBJDIR):
mkdir $(OBJDIR)
ogledit$(GUISUFFIX): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o ogledit$(GUISUFFIX) $(OBJECTS) $(XVIEW_LINK) $(LDLIBS)
$(OBJDIR)/ogledit.$(OBJSUFF): ogledit.$(SRCSUFF) ogledit.h doc.h view.h palette.h
$(CC) -c $(CPPFLAGS) -o $@ ogledit.$(SRCSUFF)
$(OBJDIR)/doc.$(OBJSUFF): doc.$(SRCSUFF) doc.h
$(CC) -c $(CPPFLAGS) -o $@ doc.$(SRCSUFF)
$(OBJDIR)/view.$(OBJSUFF): view.$(SRCSUFF) view.h
$(CC) -c $(CPPFLAGS) -o $@ view.$(SRCSUFF)
$(OBJDIR)/palette.$(OBJSUFF): palette.$(SRCSUFF) palette.h
$(CC) -c $(CPPFLAGS) -o $@ palette.$(SRCSUFF)
clean_motif:
$(MAKE) -f makefile.unx GUISUFFIX=_motif cleanany
clean_ol:
$(MAKE) -f makefile.unx GUISUFFIX=_ol cleanany
clean_hp:
$(MAKE) -f makefile.unx GUISUFFIX=_hp cleanany
cleanany:
rm -f $(OBJECTS) ogledit(GUISUFFIX) core

View File

@@ -33,6 +33,10 @@
#include "doc.h"
#include "view.h"
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "ogl.xpm"
#endif
// A macro needed for some compilers (AIX) that need 'main' to be defined
// in the application itself.
IMPLEMENT_APP(MyApp)
@@ -63,12 +67,7 @@ bool MyApp::OnInit(void)
frame = new MyFrame(myDocManager, NULL, "OGLEdit Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE);
//// Give it an icon
#ifdef __WXMSW__
frame->SetIcon(wxIcon("ogl_icn"));
#endif
#ifdef __X__
frame->SetIcon(wxIcon("ogl.xbm"));
#endif
frame->SetIcon(wxICON(ogl));
//// Make a menubar
wxMenu *file_menu = new wxMenu;

View File

@@ -1,4 +1,4 @@
ogl_icn ICON ogl.ico
ogl ICON ogl.ico
TOOL1 BITMAP "bitmaps/tool1.bmp"
TOOL2 BITMAP "bitmaps/tool2.bmp"

View File

@@ -24,7 +24,7 @@
#include <wx/wx.h>
#endif
#include <wx/tbar95.h>
#include <wx/toolbar.h>
#include <ctype.h>
#include <stdlib.h>
@@ -35,6 +35,15 @@
#include "ogledit.h"
#include "palette.h"
// Include pixmaps
#if defined(__WXGTK__) || defined(__WXMOTIF__)
#include "bitmaps/arrow.xpm"
#include "bitmaps/tool1.xpm"
#include "bitmaps/tool2.xpm"
#include "bitmaps/tool3.xpm"
#include "bitmaps/tool4.xpm"
#endif
/*
* Object editor tool palette
*
@@ -82,13 +91,12 @@ EditorToolPalette *MyApp::CreatePalette(wxFrame *parent)
wxBitmap PaletteTool3("TOOL3");
wxBitmap PaletteTool4("TOOL4");
wxBitmap PaletteArrow("ARROWTOOL");
#endif
#ifdef __X__
wxBitmap PaletteTool1(tool1_bits, tool1_width, tool1_height);
wxBitmap PaletteTool2(tool2_bits, tool2_width, tool2_height);
wxBitmap PaletteTool3(tool3_bits, tool3_width, tool3_height);
wxBitmap PaletteTool4(tool4_bits, tool4_width, tool4_height);
wxBitmap PaletteArrow(arrow_bits, arrow_width, arrow_height);
#elif defined(__WXGTK__) || defined(__WXMOTIF__)
wxBitmap PaletteTool1(tool1_xpm);
wxBitmap PaletteTool2(tool2_xpm);
wxBitmap PaletteTool3(tool3_xpm);
wxBitmap PaletteTool4(tool4_xpm);
wxBitmap PaletteArrow(arrow_xpm);
#endif
EditorToolPalette *palette = new EditorToolPalette(parent, wxPoint(0, 0), wxSize(-1, -1), wxTB_HORIZONTAL);

View File

@@ -77,7 +77,7 @@ void DiagramView::OnDraw(wxDC *dc)
/* You might use THIS code if you were scaling
* graphics of known size to fit on the page.
*/
float w, h;
int w, h;
// We need to adjust for the graphic size, a formula will be added
float maxX = 900;