Lots of wxMotif fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1304 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -79,9 +79,9 @@ BombsFrameClass::BombsFrameClass(wxFrame *parent, const wxString& title, const w
|
||||
wxMenu *menu2 = new wxMenu;
|
||||
menu2->Append(IDM_RESTART, "&Restart"); // , "Clear the play field");
|
||||
menu2->AppendSeparator();
|
||||
menu2->Append(IDM_EASY, "&Easy", (char*)NULL, TRUE); // "10x10 play field", TRUE);
|
||||
menu2->Append(IDM_MEDIUM, "&Medium", (char*)NULL, TRUE); // "15x15 play field", TRUE);
|
||||
menu2->Append(IDM_DIFFICULT, "&Difficult", (char*)NULL, TRUE); // "25x20 play field", TRUE);
|
||||
menu2->Append(IDM_EASY, "&Easy", wxEmptyString, TRUE); // "10x10 play field", TRUE);
|
||||
menu2->Append(IDM_MEDIUM, "&Medium", wxEmptyString, TRUE); // "15x15 play field", TRUE);
|
||||
menu2->Append(IDM_DIFFICULT, "&Difficult", wxEmptyString, TRUE); // "25x20 play field", TRUE);
|
||||
menuBar1->Append(menu2, "&Game");
|
||||
SetMenuBar(menuBar1);
|
||||
menuBar=menuBar1;
|
||||
|
@@ -1,64 +1,16 @@
|
||||
#
|
||||
# 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 docvwmdi example (UNIX).
|
||||
|
||||
WXDIR = ../..
|
||||
PROGRAM=docview
|
||||
|
||||
# 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
|
||||
|
||||
OBJECTS = $(OBJDIR)/docview.$(OBJSUFF) $(OBJDIR)/view.$(OBJSUFF) $(OBJDIR)/doc.$(OBJSUFF)
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
all: $(OBJDIR) wx$(GUISUFFIX) docview$(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='$(DEBUG)' WARN='-w' \
|
||||
XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' LDLIBS='$(HPLDLIBS)'
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
docview$(GUISUFFIX): $(OBJECTS) $(WXLIB)
|
||||
$(CC) $(LDFLAGS) -o docview$(GUISUFFIX) $(OBJECTS) $(XVIEW_LINK) $(LDLIBS)
|
||||
|
||||
$(OBJDIR)/docview.$(OBJSUFF): docview.$(SRCSUFF) docview.h doc.h view.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ docview.$(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)
|
||||
|
||||
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) docview$(GUISUFFIX) core
|
||||
include ../../src/makeprog.env
|
||||
|
@@ -54,7 +54,7 @@ bool DrawingView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
|
||||
// X seems to require a forced resize
|
||||
int x, y;
|
||||
frame->GetSize(&x, &y);
|
||||
frame->SetSize(x, y);
|
||||
frame->SetSize(-1, -1, x, y);
|
||||
#endif
|
||||
frame->Show(TRUE);
|
||||
|
||||
@@ -146,7 +146,7 @@ bool TextEditView::OnCreate(wxDocument *doc, long WXUNUSED(flags) )
|
||||
// X seems to require a forced resize
|
||||
int x, y;
|
||||
frame->GetSize(&x, &y);
|
||||
frame->SetSize(x, y);
|
||||
frame->SetSize(-1, -1, x, y);
|
||||
#endif
|
||||
|
||||
frame->Show(TRUE);
|
||||
|
@@ -29,7 +29,7 @@
|
||||
#include "wx/file.h"
|
||||
#include "wx/log.h"
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "mondrian.xpm"
|
||||
#endif
|
||||
|
||||
@@ -95,14 +95,10 @@ bool MyApp::OnInit(void)
|
||||
m_locale.AddCatalog("fileutils"); // 3) and another just for testing
|
||||
|
||||
// Create the main frame window
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, _("Minimal wxWindows App"), 50, 50, 150, 40);
|
||||
MyFrame *frame = new MyFrame((wxFrame *) NULL, _("International wxWindows App"), 50, 50, 150, 40);
|
||||
|
||||
// Give it an icon
|
||||
#ifdef __WXMSW__
|
||||
frame->SetIcon(wxIcon("mondrian"));
|
||||
#else
|
||||
frame->SetIcon(wxIcon(mondrian_xpm));
|
||||
#endif
|
||||
frame->SetIcon(wxICON(mondrian));
|
||||
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
17
samples/proplist/makefile.unx
Normal file
17
samples/proplist/makefile.unx
Normal file
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# Author: Julian Smart
|
||||
# Created: 1998
|
||||
# Updated:
|
||||
# Copyright: (c) 1998 Julian Smart
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for proplist example (UNIX).
|
||||
|
||||
PROGRAM=test
|
||||
|
||||
OBJECTS=$(PROGRAM).o
|
||||
|
||||
include ../../src/makeprog.env
|
||||
|
@@ -179,19 +179,19 @@ bool MyFrame::OnClose(void)
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
||||
EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk)
|
||||
EVT_BUTTON(RESOURCE_CANCEL, MyDialog::OnCancel)
|
||||
// EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk)
|
||||
EVT_BUTTON(ID_BUTTON109, MyDialog::OnCancel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
void MyDialog::OnOk(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
EndModal(RESOURCE_OK);
|
||||
// EndModal(RESOURCE_OK);
|
||||
}
|
||||
|
||||
void MyDialog::OnCancel(wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
EndModal(RESOURCE_CANCEL);
|
||||
EndModal(ID_BUTTON109);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -55,5 +55,7 @@ class MyDialog : public wxDialog
|
||||
#define RESOURCE_QUIT 4
|
||||
#define RESOURCE_TEST1 2
|
||||
|
||||
/*
|
||||
#define RESOURCE_OK 1
|
||||
#define RESOURCE_CANCEL 2
|
||||
*/
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
#include "typetest.h"
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "mondrian.xpm"
|
||||
#endif
|
||||
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "wxpoem.h"
|
||||
|
||||
#ifdef __WXGTK__
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "corner1.xpm"
|
||||
#include "corner2.xpm"
|
||||
#include "corner3.xpm"
|
||||
@@ -159,6 +159,14 @@ MainWindow::MainWindow(wxFrame *frame, wxWindowID id, const wxString& title,
|
||||
{
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
// Note: this must be done before the main window/canvas are destroyed
|
||||
// or we get an error (no parent window for menu item button)
|
||||
delete popupMenu;
|
||||
popupMenu = NULL;
|
||||
}
|
||||
|
||||
// Read the poetry buffer, either for finding the size
|
||||
// or for writing to a bitmap (not to the window directly,
|
||||
// since that displays messily)
|
||||
@@ -639,7 +647,7 @@ bool MyApp::OnInit()
|
||||
Corner3 = new wxIcon("icon_3");
|
||||
Corner4 = new wxIcon("icon_4");
|
||||
#endif
|
||||
#ifdef __WXGTK__
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
Corner1 = new wxIcon( corner1_xpm );
|
||||
Corner2 = new wxIcon( corner2_xpm );
|
||||
Corner3 = new wxIcon( corner3_xpm );
|
||||
@@ -658,17 +666,14 @@ int MyApp::OnExit()
|
||||
if (backingBitmap)
|
||||
delete backingBitmap;
|
||||
delete HelpController;
|
||||
delete popupMenu;
|
||||
delete GreyPen;
|
||||
delete DarkGreyPen;
|
||||
delete WhitePen;
|
||||
|
||||
//#ifdef __WXMSW__
|
||||
delete Corner1;
|
||||
delete Corner2;
|
||||
delete Corner3;
|
||||
delete Corner4;
|
||||
//#endif
|
||||
|
||||
delete NormalFont;
|
||||
delete BoldFont;
|
||||
@@ -1070,7 +1075,7 @@ bool Compile(void)
|
||||
|
||||
void PopupFunction(wxMenu& /*menu*/, wxCommandEvent& event)
|
||||
{
|
||||
switch (event.m_commandInt)
|
||||
switch (event.GetId())
|
||||
{
|
||||
case POEM_NEXT:
|
||||
// Another poem/page
|
||||
|
@@ -47,6 +47,7 @@ class MainWindow: public wxFrame
|
||||
public:
|
||||
MyCanvas *canvas;
|
||||
MainWindow(wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style);
|
||||
~MainWindow();
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
Reference in New Issue
Block a user