*** empty log message ***
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
BIN
samples/resource/aiai.ico
Normal file
BIN
samples/resource/aiai.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
27
samples/resource/dialog1.wxr
Normal file
27
samples/resource/dialog1.wxr
Normal file
@@ -0,0 +1,27 @@
|
||||
static char *dialog1 = "dialog(name = 'dialog1',\
|
||||
style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',\
|
||||
title = 'Test dialog box',\
|
||||
x = 312, y = 234, width = 400, height = 300,\
|
||||
modal = 0,\
|
||||
label_font = [10, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
|
||||
button_font = [10, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
|
||||
control = [wxGroupBox, 'Groupbox', '0', 'group6', 5, 4, 380, 262,\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [wxRadioBox, 'Radiobox', 'wxHSCROLL | wxVERTICAL | wxVERTICAL_LABEL', 'radiobox2', 24, 23, 111, 63, ['One', 'Two', 'Three', 'Four'], 2,\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [wxMultiText, 'Multitext', 'wxVERTICAL_LABEL', 'multitext3', 156, 126, 200, 70, 'wxWindows is a multi-platform, GUI toolkit.',\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [wxListBox, 'Listbox', 'wxVERTICAL_LABEL', 'listbox4', 156, 26, 200, 80, ['Apples', 'Pears', 'Bananas'], 'wxSINGLE',\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0],\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [1, wxButton, 'Press me', '0', 'button7', 33, 130, 84, 34,\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [2, wxButton, 'Cancel', '0', 'button8', 34, 181, 84, 34,\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [wxCheckBox, 'Checkbox', '0', 'checkbox9', 154, 220, 68, 14, 0,\
|
||||
[11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL', 0]],\
|
||||
control = [wxMessage, 'My message', '0', 'message10', 257, 218, 76, 13,\
|
||||
[11, 'wxSWISS', 'wxITALIC', 'wxBOLD', 0]]).";
|
||||
|
64
samples/resource/makefile.b32
Normal file
64
samples/resource/makefile.b32
Normal file
@@ -0,0 +1,64 @@
|
||||
#
|
||||
# File: makefile.b32
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds 32bit resource example.
|
||||
|
||||
# WXWIN and BCCDIR are set by parent make
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
!include $(WXDIR)\src\makeb32.env
|
||||
|
||||
WXLIBDIR = $(WXDIR)\lib
|
||||
WXLIB = $(WXLIBDIR)\wx32.lib
|
||||
LIBS=$(WXLIB) cw32 import32
|
||||
|
||||
TARGET=resource
|
||||
|
||||
!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)
|
||||
|
||||
OBJECTS = resource.obj
|
||||
|
||||
$(TARGET).exe: $(OBJECTS) $(TARGET).def $(TARGET).res
|
||||
tlink32 $(LINKFLAGS) @&&!
|
||||
c0w32.obj $(OBJECTS)
|
||||
$(TARGET)
|
||||
nul
|
||||
$(LIBS)
|
||||
$(TARGET).def
|
||||
!
|
||||
brc32 -K $(TARGET).res
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc32 $(CPPFLAGS) -c {$< }
|
||||
|
||||
.c.obj:
|
||||
bcc32 $(CPPFLAGS) -P- -c {$< }
|
||||
|
||||
resource.obj: resource.$(SRCSUFF) resource.h dialog1.wxr
|
||||
|
||||
$(TARGET).res : $(TARGET).rc $(WXDIR)\include\wx\msw\wx.rc
|
||||
brc32 -r /i$(BCCDIR)\include /i$(WXDIR)\include $(TARGET)
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.rws
|
||||
|
||||
|
74
samples/resource/makefile.bcc
Normal file
74
samples/resource/makefile.bcc
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# File: makefile.bcc
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds resource example (DOS).
|
||||
|
||||
!if "$(BCCDIR)" == ""
|
||||
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||
!endif
|
||||
|
||||
!if "$(WXWIN)" == ""
|
||||
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||
!endif
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
THISDIR = $(WXDIR)\samples\resource
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
|
||||
LIBS=$(WXLIB) mathwl cwl import
|
||||
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||
CFG=$(WXDIR)\src\wxwin.cfg
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v
|
||||
!else
|
||||
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS =
|
||||
!endif
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
HEADERS = resource.h
|
||||
SOURCES = resource.cc
|
||||
OBJECTS = resource.obj
|
||||
|
||||
resource: resource.exe
|
||||
|
||||
all: resource.exe
|
||||
|
||||
resource.exe: $(WXLIB) resource.obj resource.def resource.res
|
||||
tlink $(LINKFLAGS) @&&!
|
||||
c0wl.obj resource.obj
|
||||
resource
|
||||
nul
|
||||
$(LIBS)
|
||||
resource.def
|
||||
!
|
||||
rc -30 -K resource.res
|
||||
|
||||
.cc.obj:
|
||||
bcc $(CPPFLAGS) -c {$< }
|
||||
|
||||
resource.obj: resource.cc
|
||||
|
||||
resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
|
||||
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.rws
|
86
samples/resource/makefile.dos
Normal file
86
samples/resource/makefile.dos
Normal file
@@ -0,0 +1,86 @@
|
||||
#
|
||||
# File: makefile.dos
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds resource example (DOS).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info.
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\makemsc.env
|
||||
|
||||
THISDIR = $(WXDIR)\samples\resource
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
LIBS=$(WXLIB) oldnames libw llibcew commdlg ddeml shell mmsystem
|
||||
INC=-I$(WXDIR)\include\base -I$(WXDIR)\include\msw
|
||||
DUMMY=$(WXDIR)\src\msw\dummy.obj
|
||||
|
||||
# Set this to nothing if using MS C++ 7
|
||||
ZOPTION=/Z7
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
PRECOMP = /YuWX_PREC.H /Fp$(WXDIR)\src\msw\wx.pch
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
CPPFLAGS=/AL /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) $(PRECOMP) /Dwx_msw
|
||||
LINKFLAGS=/NOD /CO /ONERROR:NOEXE /SEG:256
|
||||
!else
|
||||
CPPFLAGS=/AL /W3 /G2sw $(INC) /Ox $(PRECOMP) /Dwx_msw
|
||||
LINKFLAGS=/NOD /ONERROR:NOEXE /SEG:256
|
||||
!endif
|
||||
|
||||
HEADERS = resource.h
|
||||
SOURCES = resource.$(SRCSUFF)
|
||||
OBJECTS = resource.obj
|
||||
|
||||
resource: resource.exe
|
||||
|
||||
all: wx resource.exe
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.dos FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
wxclean:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.dos clean
|
||||
cd $(THISDIR)
|
||||
|
||||
|
||||
resource.exe: $(DUMMY) $(WXLIB) resource.obj resource.def resource.res
|
||||
link $(LINKFLAGS) @<<
|
||||
$(DUMMY) resource.obj,
|
||||
resource,
|
||||
NUL,
|
||||
$(LIBS),
|
||||
resource.def
|
||||
;
|
||||
<<
|
||||
rc -31 -K resource.res
|
||||
|
||||
resource.obj: resource.h resource.$(SRCSUFF) dialog1.wxr $(DUMMY)
|
||||
cl @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
resource.res : resource.rc $(WXDIR)\include\msw\wx.rc
|
||||
rc -r /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa resource
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.sbr
|
||||
-erase *.pdb
|
36
samples/resource/makefile.g95
Normal file
36
samples/resource/makefile.g95
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# File: makefile.g95
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for resource example (UNIX).
|
||||
|
||||
WXDIR = ../..
|
||||
|
||||
# All common UNIX compiler flags and options are now in
|
||||
# this central makefile.
|
||||
include $(WXDIR)/src/makeg95.env
|
||||
|
||||
OBJECTS=$(OBJDIR)/resource.$(OBJSUFF) $(OBJDIR)/resource_resources.$(OBJSUFF)
|
||||
|
||||
all: $(OBJDIR) resource.exe
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/resource.$(OBJSUFF): resource.$(SRCSUFF) resource.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ resource.$(SRCSUFF)
|
||||
|
||||
resource.exe: $(OBJECTS) $(WXLIB)
|
||||
$(CC) $(LDFLAGS) -o resource$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
|
||||
|
||||
$(OBJDIR)/resource_resources.o: resource.rc
|
||||
$(RESCOMP) -i resource.rc -o $(OBJDIR)/resource_resources.o $(RESFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) resource$(GUISUFFIX).exe core *.rsc *.res
|
||||
|
63
samples/resource/makefile.nt
Normal file
63
samples/resource/makefile.nt
Normal file
@@ -0,0 +1,63 @@
|
||||
#
|
||||
# File: makefile.nt
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds resource example (MS VC++).
|
||||
# Use FINAL=1 argument to nmake to build final version with no debugging
|
||||
# info
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\ntwxwin.mak
|
||||
|
||||
THISDIR = $(WXDIR)\samples\resource
|
||||
PROGRAM=resource
|
||||
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
$(PROGRAM): $(PROGRAM).exe
|
||||
|
||||
all: wx $(PROGRAM).exe
|
||||
|
||||
wx:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt FINAL=$(FINAL)
|
||||
cd $(THISDIR)
|
||||
|
||||
wxclean:
|
||||
cd $(WXDIR)\src\msw
|
||||
nmake -f makefile.nt clean
|
||||
cd $(THISDIR)
|
||||
|
||||
$(PROGRAM).exe: $(DUMMYOBJ) $(WXLIB) $(OBJECTS) $(PROGRAM).res
|
||||
$(link) @<<
|
||||
-out:$(PROGRAM).exe
|
||||
$(LINKFLAGS)
|
||||
$(DUMMYOBJ) $(OBJECTS) $(PROGRAM).res
|
||||
$(LIBS)
|
||||
<<
|
||||
|
||||
|
||||
$(PROGRAM).obj: $(PROGRAM).h $(PROGRAM).$(SRCSUFF) $(DUMMYOBJ)
|
||||
$(cc) @<<
|
||||
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
|
||||
<<
|
||||
|
||||
$(PROGRAM).res : $(PROGRAM).rc $(WXDIR)\include\wx\msw\wx.rc dialog1.wxr menu1.wxr
|
||||
$(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc
|
||||
|
||||
|
||||
clean:
|
||||
-erase *.obj
|
||||
-erase *.sbr
|
||||
-erase *.exe
|
||||
-erase *.res
|
||||
-erase *.map
|
||||
-erase *.pdb
|
||||
|
35
samples/resource/makefile.sc
Normal file
35
samples/resource/makefile.sc
Normal file
@@ -0,0 +1,35 @@
|
||||
# Symantec C++ makefile for hello example
|
||||
# NOTE that peripheral libraries are now dealt in main wxWindows makefile.
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
INCDIR = $(WXDIR)\include
|
||||
MSWINC = $(INCDIR)\msw
|
||||
BASEINC = $(INCDIR)\base
|
||||
|
||||
CC=sc
|
||||
RC=rc
|
||||
CFLAGS = -o -ml -W -Dwx_msw
|
||||
LDFLAGS = -ml -W
|
||||
|
||||
INCLUDE=$(BASEINC);$(MSWINC)
|
||||
|
||||
LIBS=$(WXLIB) libw.lib commdlg.lib shell.lib
|
||||
|
||||
.cc.obj:
|
||||
*$(CC) -c $(CFLAGS) -I$(INCLUDE) $<
|
||||
|
||||
.rc.res:
|
||||
*$(RC) -r -I$(INCLUDE) $<
|
||||
|
||||
hello.exe: hello.obj hello.def hello.res
|
||||
*$(CC) $(LDFLAGS) -o$@ hello.obj hello.def $(LIBS)
|
||||
*$(RC) -k hello.res
|
||||
|
||||
clean:
|
||||
-del *.obj
|
||||
-del *.exe
|
||||
-del *.res
|
||||
-del *.map
|
||||
-del *.rws
|
||||
|
76
samples/resource/makefile.unx
Normal file
76
samples/resource/makefile.unx
Normal file
@@ -0,0 +1,76 @@
|
||||
#
|
||||
# File: makefile.unx
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile for resource example (UNIX).
|
||||
|
||||
WXDIR = ../..
|
||||
|
||||
# All common UNIX compiler flags and options are now in
|
||||
# this central makefile.
|
||||
include $(WXDIR)/src/make.env
|
||||
|
||||
OBJECTS=$(OBJDIR)/resource.$(OBJSUFF)
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
all: $(OBJDIR) resource$(GUISUFFIX)
|
||||
|
||||
wxmotif:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif
|
||||
|
||||
wxxview:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
|
||||
|
||||
wxhp:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx hp
|
||||
|
||||
# For SGI, include -lPW on your LDLIBS
|
||||
motif: wxmotif
|
||||
$(MAKE) -f makefile.unx all GUISUFFIX=_motif GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' WXLIB=$(WXDIR)/lib/libwx_motif.a OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' XVIEW_LINK=
|
||||
|
||||
xview: wxxview
|
||||
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)' LDLIBS='$(XVIEWLDLIBS)'
|
||||
|
||||
hp: wxhp
|
||||
$(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC OPT='' DEBUG='$(DEBUG)' WARN='-w' \
|
||||
XINCLUDE='$(HPXINCLUDE)' \
|
||||
XLIB='$(HPXLIB)' \
|
||||
XVIEW_LINK='' \
|
||||
LDLIBS='$(HPLDLIBS)'
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
resource$(GUISUFFIX): $(OBJDIR)/resource.$(OBJSUFF) $(WXLIB)
|
||||
$(CC) $(LDFLAGS) -o resource$(GUISUFFIX) $(OBJDIR)/resource.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
|
||||
|
||||
$(OBJDIR)/resource.$(OBJSUFF): resource.$(SRCSUFF) resource.h
|
||||
$(CC) -c $(CPPFLAGS) -o $@ resource.$(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) resource$(GUISUFFIX) core
|
||||
|
||||
wxclean_ol:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_ol
|
||||
|
||||
wxclean_motif:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_motif
|
||||
|
||||
wxclean_hp:
|
||||
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx clean_hp
|
||||
|
38
samples/resource/makefile.vms
Normal file
38
samples/resource/makefile.vms
Normal file
@@ -0,0 +1,38 @@
|
||||
#************************************************************************
|
||||
# Makefile for HELLO under VMS
|
||||
# by Stefan Hammes
|
||||
# (incomplete) update history:
|
||||
# 11.04.95
|
||||
#************************************************************************
|
||||
|
||||
#************************************************************************
|
||||
# Definition section
|
||||
# (cave: definitions and includes must begin with ',')
|
||||
#************************************************************************
|
||||
|
||||
APPOPTS =
|
||||
APPDEFS =
|
||||
APPINCS =
|
||||
|
||||
#************************************************************************
|
||||
# Module section
|
||||
#************************************************************************
|
||||
|
||||
# Name of main module
|
||||
MAIN = hello
|
||||
|
||||
# Object modules of the application.
|
||||
OBJS = hello.obj
|
||||
|
||||
.include [--.src]makevms.env
|
||||
|
||||
# main dependency
|
||||
$(MAIN).exe : $(MAIN).$(OBJ)
|
||||
$(LINK) $(LINKFLAGS) /exec=$(MAIN).exe $(MAIN).$(OBJ),$(WXLIB)/lib,$(OPTSFILE)/option
|
||||
- purge *.exe
|
||||
|
||||
#************************************************************************
|
||||
# Header file depedencies following
|
||||
#************************************************************************
|
||||
hello.obj : hello.cc hello.h
|
||||
|
42
samples/resource/makefile.wat
Normal file
42
samples/resource/makefile.wat
Normal file
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# Makefile for WATCOM
|
||||
#
|
||||
# Created by D.Chubraev, chubraev@iem.ee.ethz.ch
|
||||
# 8 Nov 1994
|
||||
#
|
||||
|
||||
WXDIR = ..\..
|
||||
|
||||
!include $(WXDIR)\src\makewat.env
|
||||
|
||||
WXLIB = $(WXDIR)\lib
|
||||
NAME = hello
|
||||
LNK = $(name).lnk
|
||||
OBJS = $(name).obj
|
||||
|
||||
PRECOMP=
|
||||
|
||||
all: $(name).exe
|
||||
|
||||
$(name).exe : $(OBJS) $(name).res $(LNK) $(WXLIB)\wx$(LEVEL).lib
|
||||
wlink @$(LNK)
|
||||
$(BINDCOMMAND) $(name).res
|
||||
|
||||
$(name).res : $(name).rc $(WXDIR)\include\msw\wx.rc
|
||||
$(RC) $(RESFLAGS1) $(name).rc
|
||||
|
||||
$(LNK) : makefile.wat
|
||||
%create $(LNK)
|
||||
@%append $(LNK) debug all
|
||||
@%append $(LNK) system $(LINKOPTION)
|
||||
@%append $(LNK) $(MINDATA)
|
||||
@%append $(LNK) $(MAXDATA)
|
||||
@%append $(LNK) $(STACK)
|
||||
@%append $(LNK) name $(name)
|
||||
@%append $(LNK) file $(WXLIB)\wx$(LEVEL).lib
|
||||
@for %i in ($(EXTRALIBS)) do @%append $(LNK) file %i
|
||||
@for %i in ($(OBJS)) do @%append $(LNK) file %i
|
||||
|
||||
clean: .SYMBOLIC
|
||||
-erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe *.rex
|
||||
|
13
samples/resource/menu1.wxr
Normal file
13
samples/resource/menu1.wxr
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
static char *menu1 = "menu(name = 'menu1',\
|
||||
menu = \
|
||||
[\
|
||||
['&File', 1, '', \
|
||||
['&Dialog box test', 2, ''],\
|
||||
[],\
|
||||
['&Exit', 4, '']\
|
||||
],\
|
||||
['&Help', 5, '', \
|
||||
['&About', 6, '']\
|
||||
]\
|
||||
]).";
|
174
samples/resource/resource.cpp
Normal file
174
samples/resource/resource.cpp
Normal file
@@ -0,0 +1,174 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: resource.cpp
|
||||
// Purpose: Dialog resource sample
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
// #pragma implementation
|
||||
#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
|
||||
|
||||
#include "wx/resource.h"
|
||||
|
||||
#include <ctype.h>
|
||||
#include "resource.h"
|
||||
|
||||
// If we wanted to demonstrate total platform independence,
|
||||
// then we'd use the dynamic file loading form for all platforms.
|
||||
// But this shows how to embed the wxWindows resources
|
||||
// in the program code/executable for UNIX and Windows
|
||||
// platforms.
|
||||
|
||||
// If you have a Windows compiler that can cope with long strings,
|
||||
// then you can always use the #include form for simplicity.
|
||||
|
||||
// NOTE: Borland's brc32.exe resource compiler doesn't recognize
|
||||
// the TEXT resource, for some reason, so either run-time file loading
|
||||
// or file inclusion should be used.
|
||||
|
||||
#if defined(__WINDOWS__) && !defined(__BORLANDC__) && !defined(__GNUWIN32__)
|
||||
// Under Windows, some compilers can't include
|
||||
// a whole .wxr file. So we use a .rc user-defined resource
|
||||
// instead. dialog1 will point to the whole .wxr 'file'.
|
||||
static char *dialog1 = NULL;
|
||||
static char *menu1 = NULL;
|
||||
#else
|
||||
// Other platforms should have sensible compilers that
|
||||
// cope with long strings.
|
||||
#include "dialog1.wxr"
|
||||
#include "menu1.wxr"
|
||||
#endif
|
||||
|
||||
// Declare two frames
|
||||
MyFrame *frame = NULL;
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
// Testing of ressources
|
||||
MyApp::MyApp()
|
||||
{
|
||||
}
|
||||
|
||||
// The `main program' equivalent, creating the windows and returning the
|
||||
// main frame
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
#if defined(__WINDOWS__) && !defined(__BORLANDC__)
|
||||
// Load the .wxr 'file' from a .rc resource, under Windows.
|
||||
dialog1 = wxLoadUserResource("dialog1");
|
||||
menu1 = wxLoadUserResource("menu1");
|
||||
// All resources in the file (only one in this case) get parsed
|
||||
// by this call.
|
||||
wxResourceParseString(dialog1);
|
||||
wxResourceParseString(menu1);
|
||||
#else
|
||||
// Simply parse the data pointed to by the variable dialog1.
|
||||
// If there were several resources, there would be several
|
||||
// variables, and this would need to be called several times.
|
||||
wxResourceParseData(dialog1);
|
||||
wxResourceParseData(menu1);
|
||||
#endif
|
||||
|
||||
// Create the main frame window
|
||||
frame = new MyFrame(NULL, -1, "wxWindows Resource Sample", wxPoint(0, 0), wxSize(300, 250));
|
||||
|
||||
// Give it a status line
|
||||
frame->CreateStatusBar(2);
|
||||
|
||||
/*
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
|
||||
file_menu->Append(RESOURCE_TEST1, "&Dialog box test", "Test dialog box resource");
|
||||
file_menu->Append(RESOURCE_QUIT, "E&xit", "Quit program");
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
||||
menu_bar->Append(file_menu, "&File");
|
||||
*/
|
||||
|
||||
wxMenuBar *menu_bar = wxResourceCreateMenuBar("menu1");
|
||||
|
||||
// Associate the menu bar with the frame
|
||||
frame->SetMenuBar(menu_bar);
|
||||
|
||||
// Make a panel
|
||||
frame->panel = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(400, 400), 0, "MyMainFrame");
|
||||
frame->Show(TRUE);
|
||||
|
||||
SetTopWindow(frame);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(RESOURCE_QUIT, MyFrame::OnQuit)
|
||||
EVT_MENU(RESOURCE_TEST1, MyFrame::OnTest1)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Define my frame constructor
|
||||
MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size):
|
||||
wxFrame(parent, id, title, pos, size)
|
||||
{
|
||||
panel = NULL;
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnTest1(wxCommandEvent& event)
|
||||
{
|
||||
MyDialog *dialog = new MyDialog;
|
||||
if (dialog->LoadFromResource(this, "dialog1"))
|
||||
{
|
||||
wxTextCtrl *text = (wxTextCtrl *)wxFindWindowByName("multitext3", dialog);
|
||||
if (text)
|
||||
text->SetValue("wxWindows resource demo");
|
||||
dialog->SetModal(TRUE);
|
||||
dialog->ShowModal();
|
||||
}
|
||||
dialog->Close(TRUE);
|
||||
}
|
||||
|
||||
bool MyFrame::OnClose(void)
|
||||
{
|
||||
Show(FALSE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyDialog, wxDialog)
|
||||
EVT_BUTTON(RESOURCE_OK, MyDialog::OnOk)
|
||||
EVT_BUTTON(RESOURCE_CANCEL, MyDialog::OnCancel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
void MyDialog::OnOk(wxCommandEvent& event)
|
||||
{
|
||||
EndModal(RESOURCE_OK);
|
||||
}
|
||||
|
||||
void MyDialog::OnCancel(wxCommandEvent& event)
|
||||
{
|
||||
EndModal(RESOURCE_CANCEL);
|
||||
}
|
||||
|
||||
|
9
samples/resource/resource.def
Normal file
9
samples/resource/resource.def
Normal file
@@ -0,0 +1,9 @@
|
||||
NAME Resource
|
||||
DESCRIPTION 'Resource'
|
||||
EXETYPE WINDOWS
|
||||
STUB 'WINSTUB.EXE'
|
||||
CODE PRELOAD MOVEABLE DISCARDABLE
|
||||
DATA PRELOAD MOVEABLE MULTIPLE
|
||||
HEAPSIZE 1024
|
||||
STACKSIZE 16192
|
||||
|
49
samples/resource/resource.h
Normal file
49
samples/resource/resource.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: resource.h
|
||||
// Purpose: Dialog resource sample
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
// #pragma interface
|
||||
#endif
|
||||
|
||||
// Define a new application
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp(void) ;
|
||||
bool OnInit(void);
|
||||
};
|
||||
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
wxWindow *panel;
|
||||
MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size);
|
||||
bool OnClose(void);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnTest1(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class MyDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
void OnOk(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#define RESOURCE_QUIT 4
|
||||
#define RESOURCE_TEST1 2
|
||||
|
||||
#define RESOURCE_OK 1
|
||||
#define RESOURCE_CANCEL 2
|
7
samples/resource/resource.rc
Normal file
7
samples/resource/resource.rc
Normal file
@@ -0,0 +1,7 @@
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
/* Comment out these lines for Borland C++ or GNU-WIN32 */
|
||||
dialog1 TEXT "dialog1.wxr"
|
||||
menu1 TEXT "menu1.wxr"
|
||||
|
||||
|
Reference in New Issue
Block a user