From 14d1ccd89decb9d84f394fb2218eddbfdba56baf Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 23 Jul 1998 14:39:46 +0000 Subject: [PATCH] Created new, simplified toolbar sample; removed other toolbar samples. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/makefile.g95 | 8 +- samples/makefile.nt | 12 +- samples/toolbar/bitmaps/copy.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/cut.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/help.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/new.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/open.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/page.bmp | Bin 0 -> 714 bytes samples/toolbar/bitmaps/paste.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/preview.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/print.bmp | Bin 0 -> 238 bytes samples/toolbar/bitmaps/save.bmp | Bin 0 -> 238 bytes samples/toolbar/makefile.b32 | 63 ++++++++ samples/toolbar/makefile.bcc | 75 +++++++++ samples/toolbar/makefile.dos | 87 +++++++++++ samples/toolbar/makefile.g95 | 40 +++++ samples/toolbar/makefile.nt | 62 ++++++++ samples/toolbar/makefile.sc | 42 +++++ samples/toolbar/makefile.unx | 80 ++++++++++ samples/toolbar/makefile.wat | 49 ++++++ samples/toolbar/test.cpp | 234 ++++++++++++++++++++++++++++ samples/toolbar/test.def | 8 + samples/toolbar/test.h | 53 +++++++ samples/toolbar/test.rc | 13 ++ 24 files changed, 810 insertions(+), 16 deletions(-) create mode 100644 samples/toolbar/bitmaps/copy.bmp create mode 100644 samples/toolbar/bitmaps/cut.bmp create mode 100644 samples/toolbar/bitmaps/help.bmp create mode 100644 samples/toolbar/bitmaps/new.bmp create mode 100644 samples/toolbar/bitmaps/open.bmp create mode 100644 samples/toolbar/bitmaps/page.bmp create mode 100644 samples/toolbar/bitmaps/paste.bmp create mode 100644 samples/toolbar/bitmaps/preview.bmp create mode 100644 samples/toolbar/bitmaps/print.bmp create mode 100644 samples/toolbar/bitmaps/save.bmp create mode 100644 samples/toolbar/makefile.b32 create mode 100644 samples/toolbar/makefile.bcc create mode 100644 samples/toolbar/makefile.dos create mode 100644 samples/toolbar/makefile.g95 create mode 100644 samples/toolbar/makefile.nt create mode 100644 samples/toolbar/makefile.sc create mode 100644 samples/toolbar/makefile.unx create mode 100644 samples/toolbar/makefile.wat create mode 100644 samples/toolbar/test.cpp create mode 100644 samples/toolbar/test.def create mode 100644 samples/toolbar/test.h create mode 100644 samples/toolbar/test.rc diff --git a/samples/makefile.g95 b/samples/makefile.g95 index 4156a79d2f..0bd2895579 100644 --- a/samples/makefile.g95 +++ b/samples/makefile.g95 @@ -26,9 +26,7 @@ all: cd $(WXDIR)/samples/minimal; make -f makefile.g95 cd $(WXDIR)/samples/layout; make -f makefile.g95 cd $(WXDIR)/samples/printing; make -f makefile.g95 - cd $(WXDIR)/samples/tbarsmpl; make -f makefile.g95 - cd $(WXDIR)/samples/tbar95; make -f makefile.g95 - cd $(WXDIR)/samples/tbarmsw; make -f makefile.g95 + cd $(WXDIR)/samples/toolbar; make -f makefile.g95 cd $(WXDIR)/samples/dialogs; make -f makefile.g95 cd $(WXDIR)/samples/docview; make -f makefile.g95 cd $(WXDIR)/samples/controls; make -f makefile.g95 @@ -48,9 +46,7 @@ clean: cd $(WXDIR)/samples/minimal; make -f makefile.g95 clean cd $(WXDIR)/samples/layout; make -f makefile.g95 clean cd $(WXDIR)/samples/printing; make -f makefile.g95 clean - cd $(WXDIR)/samples/tbarsmpl; make -f makefile.g95 clean - cd $(WXDIR)/samples/tbarmsw; make -f makefile.g95 clean - cd $(WXDIR)/samples/tbar95; make -f makefile.g95 clean + cd $(WXDIR)/samples/toolbar; make -f makefile.g95 clean cd $(WXDIR)/samples/dialogs; make -f makefile.g95 clean cd $(WXDIR)/samples/resource; make -f makefile.g95 clean cd $(WXDIR)/samples/listctrl; make -f makefile.g95 clean diff --git a/samples/makefile.nt b/samples/makefile.nt index 14cbb69ed3..3c90efb87d 100644 --- a/samples/makefile.nt +++ b/samples/makefile.nt @@ -42,11 +42,7 @@ all: nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) cd $(WXDIR)\samples\printing nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) - cd $(WXDIR)\samples\tbarsmpl - nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) - cd $(WXDIR)\samples\tbar95 - nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) - cd $(WXDIR)\samples\tbarmsw + cd $(WXDIR)\samples\toolbar nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) cd $(WXDIR)\samples\dialogs nmake -f makefile.nt DEBUG_FLAGS=$(DEBUG_FLAGS) LINK_DEBUG_FLAGS=$(LINK_DEBUG_FLAGS) @@ -106,11 +102,7 @@ clean: nmake -f makefile.nt clean cd $(WXDIR)\samples\printing nmake -f makefile.nt clean - cd $(WXDIR)\samples\tbarsmpl - nmake -f makefile.nt clean - cd $(WXDIR)\samples\tbarmsw - nmake -f makefile.nt clean - cd $(WXDIR)\samples\tbar95 + cd $(WXDIR)\samples\toolbar nmake -f makefile.nt clean cd $(WXDIR)\samples\dialogs nmake -f makefile.nt clean diff --git a/samples/toolbar/bitmaps/copy.bmp b/samples/toolbar/bitmaps/copy.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4551a06bfa79e0a42c1ffb7cdbb90fd4f699dce2 GIT binary patch literal 238 zcmZvVK?*`K3`9pLxU9$U91{2|@hV+>tjiv)Cz3AyzP{vxy7<$~OeTT!c7JQf6T89- z%?kmn<${;(P#uFN<0A#FuUo(qgT{&F@ekspii W=d@ZzPG(Cb=QBs}_=7thzxV(viB<;y literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/cut.bmp b/samples/toolbar/bitmaps/cut.bmp new file mode 100644 index 0000000000000000000000000000000000000000..15554338a01bc4d8f0a501c32237e84200e64583 GIT binary patch literal 238 zcmZvU!3}^Q5Cqr6gr}Ba8OD(CvKJo2^+{<|WDB@(K8*2TclNjo+kV075Ef~cCTYMZ z2hQ$)mH}PlY>+FWlp?l4?H9GSBqTFi~p=nI%+}YJ={H-mN0|?29BK#fUL#erbtT(lh^R?4vYy(d-6AGn1|j$rr}v KbDqI%Xjd+{i$y;G literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/new.bmp b/samples/toolbar/bitmaps/new.bmp new file mode 100644 index 0000000000000000000000000000000000000000..d66feb2384ad4c626a078c995c1a3e49af78ec3c GIT binary patch literal 238 zcmbu2yA6Oa5JQcGL>b0l4tjP;1(ew=nJ8j|<6WY3bU0`GK9aK^RUId`!4(ELX-1{H u>6c`QQqJ8_T9s0iQsQ8(Wab^@`3kuPA_p->w)Xt4Pkz>06 literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/open.bmp b/samples/toolbar/bitmaps/open.bmp new file mode 100644 index 0000000000000000000000000000000000000000..bbf93fe03364e63f3e18a3507a0e85ab8ea2f87d GIT binary patch literal 238 zcmXv{u@M3>3=;=;U&0ua+_3>YyQsonW~6N3OvKTr2(k@|B{{YeKb~(CUb3rr5zpcQ zCn>O}mP9XDa6kd~GO1FGG0<95V`X5i$V8neN$dxz4&8XX3!AZr-;ApY^eS-9oTLj~ Y^Hcc9z2|$wrXTtLH=Rc2n(WoWFRhqJ00000 literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/page.bmp b/samples/toolbar/bitmaps/page.bmp new file mode 100644 index 0000000000000000000000000000000000000000..3dbd4b05b4c2d1a4f046141d450caf34c1a3d470 GIT binary patch literal 714 zcmaJk)fu{chJ-2TT-iZmtVS?uc5roS;-EuD8k*^vaH9hj_d6X ziQgC358^U$kRpEdIqzx8X~Jz0i&xCtBKWwA%eHOw^mwIrw+KG&;&N&1L*Q{1Xmx8p zxBo0O*pac2@{B`!>-fgLdSDP(C2}M>_DcBv60g*0UKyHhy!Oc8UYD-XBeIyOWTry_ zTA4Yuua#Ixm?vFMcI3@F*>XSp02Lyo AJ^%m! literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/paste.bmp b/samples/toolbar/bitmaps/paste.bmp new file mode 100644 index 0000000000000000000000000000000000000000..564f514e0df7225f0a7adbe8457b41af537813bd GIT binary patch literal 238 zcmZvVF%Ci@5Jbns$83OZ*I;# co}I%%@f6>ra3+S=gC69}eM%GII+SAI4J;x>B>(^b literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/preview.bmp b/samples/toolbar/bitmaps/preview.bmp new file mode 100644 index 0000000000000000000000000000000000000000..da1f4dbc4be6c2dd8fb9d7cb71cc48a4a7c139ca GIT binary patch literal 238 zcmZvVu?@p83pv2yNo4mlT?N_pr2ISnd1NHDM5O^cFcMc59&^> z)PfrwsOeYM05)2ipmU4fJIss+o(=cdQCu+!%TlZiKDH!a!aP2;C|UGpLD9M;zmsLJ XIp;lzIUm!ckI6HO{IjaYcZ_-fA4^nl literal 0 HcmV?d00001 diff --git a/samples/toolbar/bitmaps/print.bmp b/samples/toolbar/bitmaps/print.bmp new file mode 100644 index 0000000000000000000000000000000000000000..00319b55bb23c3c69cc051144d80e5275747c53e GIT binary patch literal 238 zcmZur!3_d23^Ni^o@EUFY`~vgA|YX<`*bfpod|VizM>j+f}Fx~Q7! zgtHKM7yg3|DAD^Sp<0YF#C}+nSj(MC$5#Ss27*aN<{l9dYV3`7rsq)3!X>4ws(){6V0MX5FKAjcylGXqN-n#XsS=YhW0WogZT{L^_i_GT%*k@+ph E1NJ~MtpET3 literal 0 HcmV?d00001 diff --git a/samples/toolbar/makefile.b32 b/samples/toolbar/makefile.b32 new file mode 100644 index 0000000000..658649b453 --- /dev/null +++ b/samples/toolbar/makefile.b32 @@ -0,0 +1,63 @@ +# +# File: makefile.b32 +# Author: Patrick Halke +# Created: 1995 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile : Builds 32bit buttonbar 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=test + +!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 = test.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 {$< } + +test.obj: test.$(SRCSUFF) test.h + +$(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 + diff --git a/samples/toolbar/makefile.bcc b/samples/toolbar/makefile.bcc new file mode 100644 index 0000000000..e032e2d1b0 --- /dev/null +++ b/samples/toolbar/makefile.bcc @@ -0,0 +1,75 @@ +# +# File: makefile.bcc +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile : Builds wxButtonbar sample + +!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 + +# Change WXDIR to wherever wxWindows is found +WXDIR = $(WXWIN) +!include $(WXDIR)\src\makebcc.env + +WXLIB = $(WXDIR)\lib\wx.lib +WXINC = $(WXDIR)\include +CFG=$(WXDIR)\src\wxwin.cfg + +BUTTNBARDIR = $(WXDIR)\samples\toolbar +THISDIR = $(BUTTNBARDIR) + +INC= + +LIBS=$(WXLIB) mathwl cwl import + +!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) $(INC) @$(CFG) +CFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG) + +OBJECTS = test.obj + +all: test.exe + +.$(SRCSUFF).obj: + bcc $(CPPFLAGS) -c {$< } + +test.res : test.rc $(WXDIR)\include\msw\wx.rc + rc /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa -r test + +test.exe: test.obj test.def test.res + tlink $(LINKFLAGS) @&&! +c0wl.obj test.obj +test +nul +$(LIBS) +test.def +! + rc -K test.res + +clean: + -erase *.obj + -erase *.exe + + diff --git a/samples/toolbar/makefile.dos b/samples/toolbar/makefile.dos new file mode 100644 index 0000000000..98f93ab7bb --- /dev/null +++ b/samples/toolbar/makefile.dos @@ -0,0 +1,87 @@ +# +# File: makefile.dos +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile : Builds wxToolbar sample +# 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 + +BBARDIR = $(WXDIR)\samples\toolbar + +INC = /I$(WXDIR)\include\base /I$(WXDIR)\include\msw + +THISDIR = $(BBARDIR) + +!ifndef FINAL +FINAL=0 +!endif + +# Default is to output RTF for WinHelp +!ifndef WINHELP +WINHELP=-winhelp +!endif + +# Set this to nothing if using MS C++ 7 +ZOPTION=/Z7 + +!if "$(FINAL)" == "0" +CPPFLAGS=/AL /Gt8 /W3 /Zi $(ZOPTION) /G2sw /Od /YuWX_PREC.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch +CFLAGS=/AL /Gt8 /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) /Dwx_msw +LINKFLAGS=/NOD /CO /SEG:512 /ONERROR:NOEXE +!else +CPPFLAGS=/AL /Gt8 /W3 /G2sw /Os /YuWX_PREC.H $(INC) /Dwx_msw /Fp$(WXDIR)\src\msw\wx.pch +CFLAGS=/AL /Gt8 /W3 /Zi $(ZOPTION) /G2sw /Od $(INC) /Dwx_msw +LINKFLAGS=/NOD /SEG:512 /ONERROR:NOEXE +!endif + +OBJECTS = test.obj + +all: test.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) + +test.exe: $(WXDIR)\src\msw\dummy.obj $(WXLIB) test.obj test.def test.res + link $(LINKFLAGS) @<< +$(WXDIR)\src\msw\dummy.obj test.obj, +test, +NUL, +$(LIBS), +test.def +; +<< + rc -30 -K test.res + +test.obj: test.h test.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /c /Tp $*.$(SRCSUFF) +<< + +test.res : test.rc $(WXDIR)\include\msw\wx.rc + rc -r /dFAFA_LIB /i$(WXDIR)\contrib\fafa /i$(WXDIR)\include\msw test + +clean: + -erase *.obj + -erase *.exe + -erase *.res + -erase *.map + -erase *.sbr + -erase *.pdb + diff --git a/samples/toolbar/makefile.g95 b/samples/toolbar/makefile.g95 new file mode 100644 index 0000000000..a16ac0faec --- /dev/null +++ b/samples/toolbar/makefile.g95 @@ -0,0 +1,40 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile for Buttonbar example (UNIX). +# Change the WXDIR directory, and CPPFLAGS and LDFLAGS, for your system. + +WXDIR = ../.. + +# All common UNIX compiler flags and options are now in +# this central makefile. +include $(WXDIR)/src/makeg95.env + +TESTOBJECTS = $(OBJDIR)/test.$(OBJSUFF) $(OBJDIR)/test_resources.$(OBJSUFF) +TESTPROGRAM = test$(GUISUFFIX) + +all: $(OBJDIR) $(TESTPROGRAM) + +demo: $(TESTPROGRAM) + +$(OBJDIR): + mkdir $(OBJDIR) + +$(OBJDIR)/test.$(OBJSUFF): test.h test.$(SRCSUFF) + $(CC) -c $(CPPFLAGS) -o $@ test.$(SRCSUFF) + +$(TESTPROGRAM): $(TESTOBJECTS) $(WXLIB) + $(CC) $(LDFLAGS) -o test$(GUISUFFIX)$(EXESUFF) $(TESTOBJECTS) $(LDLIBS) + +$(OBJDIR)/test_resources.o: test.rc + $(RESCOMP) -i test.rc -o $(OBJDIR)/test_resources.o $(RESFLAGS) + +clean: + rm -f $(OBJECTS) test$(GUISUFFIX).exe $(TESTOBJECTS) core *.res *.rsc + diff --git a/samples/toolbar/makefile.nt b/samples/toolbar/makefile.nt new file mode 100644 index 0000000000..64f2260de2 --- /dev/null +++ b/samples/toolbar/makefile.nt @@ -0,0 +1,62 @@ +# +# File: makefile.nt +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile : Builds buttnbar 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\toolbar +PROGRAM=test + +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 + $(rc) -r /i$(WXDIR)\include -fo$@ $(PROGRAM).rc + + +clean: + -erase *.obj + -erase *.sbr + -erase *.exe + -erase *.res + -erase *.map + -erase *.pdb diff --git a/samples/toolbar/makefile.sc b/samples/toolbar/makefile.sc new file mode 100644 index 0000000000..97e6a2ad93 --- /dev/null +++ b/samples/toolbar/makefile.sc @@ -0,0 +1,42 @@ +# Symantec C++ makefile for the buttonbar library + +WXDIR = $(WXWIN) +!include $(WXDIR)\src\makesc.env + +WXLIB = $(WXDIR)\lib\wx.lib +INCDIR = $(WXDIR)\include +MSWINC = $(INCDIR)\msw +BASEINC = $(INCDIR)\base + +BUTTNBARDIR = $(WXDIR)\samples\buttnbar + +# Default is to output RTF for WinHelp +WINHELP=-winhelp + +CC=sc +RC=rc +CFLAGS = -o -ml -W -Dwx_msw +LDFLAGS = -ml -W + +INCLUDE=$(BASEINC);$(MSWINC) + +LIBS=$(WXLIB) libw.lib commdlg.lib shell.lib + +all: test.exe + +.$(SRCSUFF).obj: + *$(CC) -c $(CFLAGS) -I$(INCLUDE) $< + +.rc.res: + *$(RC) -r -I$(INCLUDE) $< + +test.exe: test.obj test.def test.res + *$(CC) $(LDFLAGS) -o$@ test.obj test.def $(LIBS) + *$(RC) -k test.res + +clean: + -del *.obj + -del *.exe + -del *.res + -del *.map + diff --git a/samples/toolbar/makefile.unx b/samples/toolbar/makefile.unx new file mode 100644 index 0000000000..b01a514e9b --- /dev/null +++ b/samples/toolbar/makefile.unx @@ -0,0 +1,80 @@ +# +# File: makefile.unx +# Author: Julian Smart +# Created: 1993 +# Updated: +# Copyright: (c) 1993, AIAI, University of Edinburgh +# +# "%W% %G%" +# +# Makefile for wxToolBar example (UNIX). +# Change the WXDIR directory, and CPPFLAGS and LDFLAGS, for your system. + +WXDIR = ../.. + +# All common UNIX compiler flags and options are now in +# this central makefile. +include $(WXDIR)/src/make.env + +TOOLBARDIR = $(WXDIR)/samples/toolbar + +OBJECTS = $(OBJDIR)/wx_bbar.$(OBJSUFF) +TESTOBJECTS = $(OBJDIR)/test.$(OBJSUFF) +TESTPROGRAM = $(TOOLBARDIR)/test$(GUISUFFIX) + +LDFLAGS = $(XLIB) -L$(WXDIR)/lib + +XVIEWLDLIBS = -lwx_ol -lxview -lolgx -lX11 -lm $(COMPLIBS) +MOTIFLDLIBS = -lwx_motif -lXm -lXt -lX11 -lm $(COMPLIBS) +HPLDLIBS = -lwx_hp -lXm -lXt -lX11 -lm $(HPCOMPLIBS) +# Default +LDLIBS=$(XVIEWLDLIBS) + +all: $(OBJDIR) $(TESTPROGRAM) + +demo: $(TESTPROGRAM) + +.SUFFIXES: + +wx: + cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx GUI=$(GUI) + +motif: + cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx motif OPT='$(OPT)' + $(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' XVIEW_LINK= + +demo_motif: + $(MAKE) -f makefile.unx all demo GUI=-Dwx_motif GUISUFFIX=_motif OPT='$(OPT)' LDLIBS='$(MOTIFLDLIBS)' XVIEW_LINK= + +xview: + cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview OPT='$(OPT)' + $(MAKE) -f makefile.unx GUI=-Dwx_xview OPT='$(OPT)' + +demo_ol: + $(MAKE) -f makefile.unx all demo GUI=-Dwx_xview OPT='$(OPT)' + +hp: + $(MAKE) -f makefile.unx GUI=-Dwx_motif GUISUFFIX=_hp CC=CC DEBUG='$(DEBUG)' OPT='' WARN='-w' \ + XINCLUDE='$(HPXINCLUDE)' XLIB='$(HPXLIB)' XVIEW_LINK='' CCLEX='cc' \ + LDLIBS='$(HPLDLIBS)' +$(OBJDIR): + mkdir $(OBJDIR) + +$(OBJDIR)/test.$(OBJSUFF): test.h test.$(SRCSUFF) + $(CC) -c $(CPPFLAGS) -o $@ test.$(SRCSUFF) + +$(TESTPROGRAM): $(OBJDIR)/test.$(OBJSUFF) $(WXLIB) + $(CC) $(LDFLAGS) -o test$(GUISUFFIX) $(OBJDIR)/test.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS) + +cleaneach: + rm -f $(OBJECTS) test$(GUISUFFIX) $(OBJDIR)/test.$(OBJSUFF) core + +clean_motif: + $(MAKE) -f makefile.unx GUISUFFIX=_motif cleaneach + +clean_ol: + $(MAKE) -f makefile.unx GUISUFFIX=_ol cleaneach + +clean_hp: + $(MAKE) -f makefile.unx GUISUFFIX=_hp cleaneach + diff --git a/samples/toolbar/makefile.wat b/samples/toolbar/makefile.wat new file mode 100644 index 0000000000..dcae6e26f3 --- /dev/null +++ b/samples/toolbar/makefile.wat @@ -0,0 +1,49 @@ +# +# 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 = test +LNK = $(name).lnk +OBJS = $(name).obj +THISDIR = $(WXDIR)\samples\buttnbar + +all: $(name).exe + +wx: .SYMBOLIC + cd $(WXDIR)\src\msw + wmake -f makefile.wat all + cd $(THISDIR) + +$(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 + +thing: .SYMBOLIC + echo $(WATLIBDIR) + +clean: .SYMBOLIC + -erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe *.rex + diff --git a/samples/toolbar/test.cpp b/samples/toolbar/test.cpp new file mode 100644 index 0000000000..80aaeff9c1 --- /dev/null +++ b/samples/toolbar/test.cpp @@ -0,0 +1,234 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: test.cpp +// Purpose: wxToolBar sample +// Author: Julian Smart +// Modified by: +// Created: 04/01/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// 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/toolbar.h" +#include "test.h" + +IMPLEMENT_APP(MyApp) + +#ifdef __X__ +// TODO: include XBM or XPM icons for X apps +#endif + +// The `main program' equivalent, creating the windows and returning the +// main frame +bool MyApp::OnInit(void) +{ + // Create the main frame window + MyFrame* frame = new MyFrame(NULL, -1, "wxToolBar Sample", wxPoint(100, 100), wxSize(450, 300)); + + // Give it a status line + frame->CreateStatusBar(); + + // Give it an icon +#ifdef __WXMSW__ + frame->SetIcon(wxIcon("mondrian")); +#endif +#ifdef __X__ + frame->SetIcon(wxIcon("mondrian.xbm")); +#endif + + // Make a menubar + wxMenu *fileMenu = new wxMenu; + fileMenu->Append(TEST_QUIT, "E&xit"); + + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(TEST_ABOUT, "&About"); + + wxMenuBar* menuBar = new wxMenuBar; + + menuBar->Append(fileMenu, "&File"); + menuBar->Append(helpMenu, "&Help"); + + // Associate the menu bar with the frame + frame->SetMenuBar(menuBar); + + // Create the toolbar + TestToolBar* toolRibbon = new TestToolBar(frame, -1, wxPoint(0, 0), wxSize(100, 30), + wxNO_BORDER|wxTB_FLAT, wxVERTICAL, 1); + toolRibbon->SetMargins(5, 5); + + // Tell the frame about it + frame->SetToolBar(toolRibbon); + + // Force a resize, just in case. + frame->OnSize(wxSizeEvent(wxSize(-1, -1), frame->GetId())); + frame->Show(TRUE); + + frame->SetStatusText("Hello, wxWindows"); + + SetTopWindow(frame); + + return TRUE; +} + +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(TEST_QUIT, MyFrame::OnQuit) + EVT_MENU(TEST_ABOUT, MyFrame::OnAbout) + EVT_MENU_HIGHLIGHT_ALL(MyFrame::OnMenuHighlight) + EVT_CLOSE(MyFrame::OnCloseWindow) +END_EVENT_TABLE() + +// Define my frame constructor +MyFrame::MyFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, + const wxSize& size, long style): + wxFrame(parent, id, title, pos, size, style) +{ + m_textWindow = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE); +} + +void MyFrame::OnQuit(wxCommandEvent& event) +{ + Close(TRUE); +} + +void MyFrame::OnAbout(wxCommandEvent& event) +{ + (void)wxMessageBox("wxWindows wxToolBar demo\n", "About wxToolBar"); +} + +// Intercept menu item selection - only has an effect in Windows +void MyFrame::OnMenuHighlight(wxMenuEvent& event) +{ + char *msg = NULL; + switch (event.GetMenuId()) + { + case TEST_QUIT: + msg = "Quit program"; + break; + case -1: + msg = ""; + break; + } + if (msg) + SetStatusText(msg); +} + +// Define the behaviour for the frame closing +// - must delete all frames except for the main one. +void MyFrame::OnCloseWindow(wxCloseEvent& event) +{ + Destroy(); +} + +BEGIN_EVENT_TABLE(TestToolBar, wxToolBar95) + EVT_PAINT(TestToolBar::OnPaint) +END_EVENT_TABLE() + +TestToolBar::TestToolBar(wxFrame* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, + long style, int direction, int RowsOrColumns): + wxToolBar(parent, id, pos, size, style, direction, RowsOrColumns) +{ + // Set up toolbar + wxBitmap* toolBarBitmaps[8]; + +#ifdef __WXMSW__ + toolBarBitmaps[0] = new wxBitmap("icon1"); + toolBarBitmaps[1] = new wxBitmap("icon2"); + toolBarBitmaps[2] = new wxBitmap("icon3"); + toolBarBitmaps[3] = new wxBitmap("icon4"); + toolBarBitmaps[4] = new wxBitmap("icon5"); + toolBarBitmaps[5] = new wxBitmap("icon6"); + toolBarBitmaps[6] = new wxBitmap("icon7"); + toolBarBitmaps[7] = new wxBitmap("icon8"); +#endif +#ifdef __X__ + // TODO + toolBarBitmaps[0] = new wxBitmap(...); + toolBarBitmaps[1] = new wxBitmap(...); + toolBarBitmaps[2] = new wxBitmap(...); + toolBarBitmaps[3] = new wxBitmap(...); + toolBarBitmaps[4] = new wxBitmap(...); + toolBarBitmaps[5] = new wxBitmap(...); + toolBarBitmaps[6] = new wxBitmap(...); + toolBarBitmaps[7] = new wxBitmap(...); + +#endif + +#ifdef __WXMSW__ + int width = 24; +#else + int width = 16; +#endif + int offX = 5; + int currentX = 5; + + AddTool(0, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "New file"); + currentX += width + 5; + AddTool(1, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Open file"); + currentX += width + 5; + AddTool(2, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Save file"); + currentX += width + 5; + AddSeparator(); + AddTool(3, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Copy"); + currentX += width + 5; + AddTool(4, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Cut"); + currentX += width + 5; + AddTool(5, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Paste"); + currentX += width + 5; + AddSeparator(); + AddTool(6, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Print"); + currentX += width + 5; + AddSeparator(); + AddTool(7, *(toolBarBitmaps[7]), wxNullBitmap, TRUE, currentX, -1, NULL, "Help"); + + CreateTools(); + + // Can delete the bitmaps since they're reference counted + int i; + for (i = 0; i < 8; i++) + delete toolBarBitmaps[i]; +} + +bool TestToolBar::OnLeftClick(int toolIndex, bool toggled) +{ + char buf[200]; + sprintf(buf, "Clicked on tool %d", toolIndex); + ((wxFrame*) GetParent())->SetStatusText(buf); + return TRUE; +} + +void TestToolBar::OnMouseEnter(int toolIndex) +{ + char buf[200]; + if (toolIndex > -1) + { + sprintf(buf, "This is tool number %d", toolIndex); + ((wxFrame*)GetParent())->SetStatusText(buf); + } + else ((wxFrame*)GetParent())->SetStatusText(""); +} + +void TestToolBar::OnPaint(wxPaintEvent& event) +{ + wxToolBar::OnPaint(event); + + wxPaintDC dc(this); + + int w, h; + GetSize(&w, &h); + dc.SetPen(wxBLACK_PEN); + dc.SetBrush(wxTRANSPARENT_BRUSH); + dc.DrawLine(0, h-1, w, h-1); +} + + diff --git a/samples/toolbar/test.def b/samples/toolbar/test.def new file mode 100644 index 0000000000..897b9dacbb --- /dev/null +++ b/samples/toolbar/test.def @@ -0,0 +1,8 @@ +NAME ToolTest +DESCRIPTION 'wxToolBar Sample' +EXETYPE WINDOWS +STUB 'WINSTUB.EXE' +CODE PRELOAD MOVEABLE DISCARDABLE +DATA PRELOAD MOVEABLE MULTIPLE +HEAPSIZE 1024 +STACKSIZE 8192 diff --git a/samples/toolbar/test.h b/samples/toolbar/test.h new file mode 100644 index 0000000000..1c680a819d --- /dev/null +++ b/samples/toolbar/test.h @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: test.h +// Purpose: wxToolBar sample +// Author: Julian Smart +// Modified by: +// Created: 23/07/98 +// RCS-ID: $Id$ +// Copyright: (c) Julian Smart +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// Define a new application +class MyApp: public wxApp +{ + public: + bool OnInit(void); +}; + +// Define a new frame +class MyFrame: public wxFrame +{ +public: + MyFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = "wxToolBar Sample", + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE); + + void OnCloseWindow(wxCloseEvent& event); + void OnMenuHighlight(wxMenuEvent& event); + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + +private: + wxTextCtrl* m_textWindow; + +DECLARE_EVENT_TABLE() +}; + +class TestToolBar: public wxToolBar +{ + public: + TestToolBar(wxFrame *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxNO_BORDER, int direction = wxVERTICAL, int RowsOrColumns = 2); + bool OnLeftClick(int toolIndex, bool toggled); + void OnMouseEnter(int toolIndex); + void OnPaint(wxPaintEvent& event); + + DECLARE_EVENT_TABLE() +}; + +#define TEST_QUIT 100 +#define TEST_ABOUT 101 + diff --git a/samples/toolbar/test.rc b/samples/toolbar/test.rc new file mode 100644 index 0000000000..6c9086d0c6 --- /dev/null +++ b/samples/toolbar/test.rc @@ -0,0 +1,13 @@ +mondrian ICON "mondrian.ico" +#include "wx/msw/wx.rc" + +icon1 BITMAP "bitmaps/new.bmp" +icon2 BITMAP "bitmaps/open.bmp" +icon3 BITMAP "bitmaps/save.bmp" +icon4 BITMAP "bitmaps/copy.bmp" +icon5 BITMAP "bitmaps/cut.bmp" +icon6 BITMAP "bitmaps/paste.bmp" +icon7 BITMAP "bitmaps/print.bmp" + +icon8 BITMAP "bitmaps/help.bmp" +