Initial revision

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1998-05-20 14:01:55 +00:00
parent 1b66e7e5ab
commit c801d85f15
779 changed files with 172138 additions and 0 deletions

1
samples/tab/Makefile Normal file
View File

@@ -0,0 +1 @@
include ../../src/gtk/setup/general/makeapp

26
samples/tab/Makefile.in Normal file
View File

@@ -0,0 +1,26 @@
# WXXT base directory
WXBASEDIR=@WXBASEDIR@
# set the OS type for compilation
OS=@OS@
# compile a library only
RULE=bin
# define library name
BIN_TARGET=test
# define library sources
BIN_SRC=\
test.cpp
#define library objects
BIN_OBJ=\
test.o
# additional things needed to link
BIN_LINK=
# additional things needed to compile
ADD_COMPILE=
# include the definitions now
include ../../../template.mak

64
samples/tab/makefile.b32 Normal file
View File

@@ -0,0 +1,64 @@
#
# File: makefile.bcc
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tab example
# WXWIN and BCCDIR are set by parent make
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makeb32.env
WXLIBDIR = $(WXDIR)\lib
WXINC = $(WXDIR)\include\msw
WXLIB = $(WXLIBDIR)\wx32.lib
LIBS=$(WXLIB) cw32 import32 ole2w32
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)
$(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

73
samples/tab/makefile.bcc Normal file
View File

@@ -0,0 +1,73 @@
#
# File: makefile.bcc
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds minimal 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)
!include $(WXDIR)\src\makebcc.env
THISDIR = $(WXDIR)\samples\minimal
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)
OBJECTS = minimal.obj
minimal: minimal.exe
all: minimal.exe
minimal.exe: $(WXLIB) minimal.obj minimal.def minimal.res
tlink $(LINKFLAGS) @&&!
c0wl.obj minimal.obj
minimal
nul
$(LIBS)
minimal.def
!
rc -31 -K minimal.res
.$(SRCSUFF).obj:
bcc $(CPPFLAGS) -c {$< }
minimal.obj: minimal.$(SRCSUFF)
minimal.res : minimal.rc $(WXDIR)\include\msw\wx.rc
rc -r /i$(BCCDIR)\include /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa minimal
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.rws

65
samples/tab/makefile.dos Normal file
View File

@@ -0,0 +1,65 @@
#
# File: makefile.dos
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tab example (DOS).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makemsc.env
THISDIR = $(WXDIR)\samples\tab
!ifndef FINAL
FINAL=0
!endif
HEADERS =
SOURCES = test.$(SRCSUFF)
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) @<<
test.obj $(WXDIR)\src\msw\dummy.obj,
test,
NUL,
$(LIBS),
test.def
;
<<
rc -K test.res
test.obj: test.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /c /Tp $*.$(SRCSUFF)
<<
test.res : test.rc $(WXDIR)\include\wx\msw\wx.rc
rc -r /i$(WXDIR)\include test
clean:
-erase *.obj
-erase *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb

37
samples/tab/makefile.g95 Normal file
View File

@@ -0,0 +1,37 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile for tab example
WXDIR = ../..
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/makeg95.env
OBJECTS = $(OBJDIR)/test.$(OBJSUFF) $(OBJDIR)/test_resources.$(OBJSUFF)
all: $(OBJDIR) test$(GUISUFFIX)$(EXESUFF)
wx:
$(OBJDIR):
mkdir $(OBJDIR)
test$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o test$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
$(OBJDIR)/test.$(OBJSUFF): test.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ test.$(SRCSUFF)
$(OBJDIR)/test_resources.o: test.rc
$(RESCOMP) -i test.rc -o $(OBJDIR)/test_resources.o $(RESFLAGS)
clean:
rm -f $(OBJECTS) test$(GUISUFFIX).exe core *.rsc *.res

64
samples/tab/makefile.nt Normal file
View File

@@ -0,0 +1,64 @@
#
# File: makefile.nt
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile : Builds tab example (MS VC++).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
# Set WXDIR for your system
WXDIR = $(WXWIN)
WXUSINGDLL=0
!include $(WXDIR)\src\ntwxwin.mak
THISDIR = $(WXDIR)\samples\tab
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).$(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 *.exe
-erase *.res
-erase *.map
-erase *.sbr
-erase *.pdb

35
samples/tab/makefile.sc Normal file
View File

@@ -0,0 +1,35 @@
# Symantec C++ makefile for minimal example
# NOTE that peripheral libraries are now dealt in main wxWindows makefile.
WXDIR = $(WXWIN)
!include $(WXDIR)\src\makesc.env
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
.$(SRCSUFF).obj:
*$(CC) -c $(CFLAGS) -I$(INCLUDE) $<
.rc.res:
*$(RC) -r -I$(INCLUDE) $<
minimal.exe: minimal.obj minimal.def minimal.res
*$(CC) $(LDFLAGS) -o$@ $** $(LIBS)
clean:
-del *.obj
-del *.exe
-del *.res
-del *.map
-del *.rws

58
samples/tab/makefile.unx Normal file
View File

@@ -0,0 +1,58 @@
#
# File: makefile.unx
# Author: Julian Smart
# Created: 1993
# Updated:
# Copyright: (c) 1993, AIAI, University of Edinburgh
#
# "%W% %G%"
#
# Makefile for minimal example (UNIX).
WXDIR = ../..
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/make.env
OBJECTS = $(OBJDIR)/minimal.$(OBJSUFF)
.SUFFIXES:
all: $(OBJDIR) minimal$(GUISUFFIX)
wx:
motif:
$(MAKE) -f makefile.unx 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:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx xview
$(MAKE) -f makefile.unx GUI=-Dwx_xview GUISUFFIX=_ol CC=$(CC) OPTIONS='$(OPTIONS)' DEBUG='$(DEBUG)' WARN='$(WARN)' XLIB='$(XLIB)' XINCLUDE='$(XINCLUDE)'
hp:
cd $(WXDIR)/src/x; $(MAKE) -f makefile.unx 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)
minimal$(GUISUFFIX): $(OBJDIR)/minimal.$(OBJSUFF) $(WXLIB)
$(CC) $(LDFLAGS) -o minimal$(GUISUFFIX) $(OBJDIR)/minimal.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
$(OBJDIR)/minimal.$(OBJSUFF): minimal.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ minimal.$(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) minimal$(GUISUFFIX) core

38
samples/tab/makefile.vms Normal file
View File

@@ -0,0 +1,38 @@
#************************************************************************
# Makefile for MINIMAL 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 = minimal
# Object modules of the application.
OBJS = minimal.obj
OBJLIST =minimal.obj
.include [--.src]makevms.env
# main dependency
$(MAIN).exe : $(OBJS)
$(LINK) $(LINKFLAGS) /exec=$(MAIN).exe $(OBJLIST),$(WXLIB)/lib,$(OPTSFILE)/option
- purge *.exe
#************************************************************************
# Header file depedencies following
#************************************************************************

43
samples/tab/makefile.wat Normal file
View File

@@ -0,0 +1,43 @@
#
# 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 = minimal
LNK = $(name).lnk
OBJS = $(name).obj
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
thing: .SYMBOLIC
echo $(WATLIBDIR)
clean: .SYMBOLIC
-erase *.obj *.bak *.err *.pch *.lib *.lnk *.res *.exe

BIN
samples/tab/mondrian.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

147
samples/tab/test.cpp Normal file
View File

@@ -0,0 +1,147 @@
/////////////////////////////////////////////////////////////////////////////
// Name: test.cpp
// Purpose: Tab demo
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/tab.h"
#include "test.h"
// Declare two frames
MyDialog *dialog = NULL;
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
// Create the main frame window
dialog = new MyDialog(NULL, -1, "Tabbed Dialog", wxPoint(-1, -1), wxSize(365, 390), wxDIALOG_MODAL|wxDEFAULT_DIALOG_STYLE);
dialog->ShowModal();
// Quit immediately the dialog has been dismissed
return FALSE;
}
BEGIN_EVENT_TABLE(MyDialog, wxTabbedDialog)
EVT_BUTTON(wxID_OK, MyDialog::OnOK)
EVT_BUTTON(wxID_CANCEL, MyDialog::OnOK)
// EVT_MENU(TEST_ABOUT, MyDialog::OnAbout)
END_EVENT_TABLE()
MyDialog::MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long windowStyle):
wxTabbedDialog(parent, id, title, pos, size, windowStyle)
{
Init();
}
void MyDialog::OnOK(wxCommandEvent& event)
{
EndModal(wxID_OK);
}
void MyDialog::OnCloseWindow(wxCloseEvent& event)
{
EndModal(wxID_CANCEL);
}
void MyDialog::Init(void)
{
int dialogWidth = 365;
int dialogHeight = 390;
wxButton *okButton = new wxButton(this, wxID_OK, "Close", wxPoint(100, 330), wxSize(80, 25));
wxButton *cancelButton = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(185, 330), wxSize(80, 25));
wxButton *HelpButton = new wxButton(this, wxID_HELP, "Help", wxPoint(270, 330), wxSize(80, 25));
okButton->SetDefault();
// Note, omit the wxTAB_STYLE_COLOUR_INTERIOR, so we will guarantee a match
// with the panel background, and save a bit of time.
wxPanelTabView *view = new wxPanelTabView((wxPanel*)this, wxTAB_STYLE_DRAW_BOX);
wxRectangle rect;
rect.x = 5;
rect.y = 70;
// Could calculate the view width from the tab width and spacing,
// as below, but let's assume we have a fixed view width.
// rect.width = view->GetTabWidth()*4 + 3*view->GetHorizontalTabSpacing();
rect.width = 326;
rect.height = 250;
view->SetViewRect(rect);
// Calculate the tab width for 4 tabs, based on a view width of 326 and
// the current horizontal spacing. Adjust the view width to exactly fit
// the tabs.
view->CalculateTabWidth(4, TRUE);
if (!view->AddTab(TEST_TAB_CAT, wxString("Cat")))
return;
if (!view->AddTab(TEST_TAB_DOG, wxString("Dog")))
return;
if (!view->AddTab(TEST_TAB_GUINEAPIG, wxString("Guinea Pig")))
return;
if (!view->AddTab(TEST_TAB_GOAT, wxString("Goat")))
return;
if (!view->AddTab(TEST_TAB_ANTEATER, wxString("Ant-eater")))
return;
if (!view->AddTab(TEST_TAB_SHEEP, wxString("Sheep")))
return;
if (!view->AddTab(TEST_TAB_COW, wxString("Cow")))
return;
if (!view->AddTab(TEST_TAB_HORSE, wxString("Horse")))
return;
if (!view->AddTab(TEST_TAB_PIG, wxString("Pig")))
return;
if (!view->AddTab(TEST_TAB_OSTRICH, wxString("Ostrich")))
return;
if (!view->AddTab(TEST_TAB_AARDVARK, wxString("Aardvark")))
return;
if (!view->AddTab(TEST_TAB_HUMMINGBIRD,wxString("Hummingbird")))
return;
// Add some panels
wxPanel *panel1 = new wxPanel(this, -1, wxPoint(rect.x + 20, rect.y + 10), wxSize(290, 220), wxTAB_TRAVERSAL);
(void)new wxButton(panel1, -1, "Press me", wxPoint(10, 10));
(void)new wxTextCtrl(panel1, -1, "1234", wxPoint(10, 40), wxSize(120, 150));
view->AddTabWindow(TEST_TAB_CAT, panel1);
wxPanel *panel2 = new wxPanel(this, -1, wxPoint(rect.x + 20, rect.y + 10), wxSize(290, 220));
wxString animals[] = { "Fox", "Hare", "Rabbit", "Sabre-toothed tiger", "T Rex" };
(void)new wxListBox(panel2, -1, wxPoint(5, 5), wxSize(170, 80), 5, animals);
(void)new wxTextCtrl(panel2, -1, "Some notes about the animals in this house", wxPoint(5, 100), wxSize(170, 100)),
wxTE_MULTILINE;
view->AddTabWindow(TEST_TAB_DOG, panel2);
// Don't know why this is necessary under Motif...
#ifdef wx_motif
this->SetSize(dialogWidth, dialogHeight-20);
#endif
view->SetTabSelection(TEST_TAB_CAT);
this->Centre(wxBOTH);
}

8
samples/tab/test.def Normal file
View File

@@ -0,0 +1,8 @@
NAME Test
DESCRIPTION 'Tab test'
EXETYPE WINDOWS
STUB 'WINSTUB.EXE'
CODE PRELOAD MOVEABLE DISCARDABLE
DATA PRELOAD MOVEABLE MULTIPLE
HEAPSIZE 1024
STACKSIZE 16192

49
samples/tab/test.h Normal file
View File

@@ -0,0 +1,49 @@
/////////////////////////////////////////////////////////////////////////////
// Name: test.h
// Purpose: Tab demo
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Define a new application
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
class MyDialog: public wxTabbedDialog
{
public:
MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_DIALOG_STYLE);
void OnOK(wxCommandEvent& event);
void OnCloseWindow(wxCloseEvent& event);
// void OnAbout(wxCommandEvent& event);
void Init(void);
DECLARE_EVENT_TABLE()
};
// File ids
#define TEST_ABOUT 2
// Tab ids
#define TEST_TAB_DOG 1
#define TEST_TAB_CAT 2
#define TEST_TAB_GOAT 3
#define TEST_TAB_GUINEAPIG 4
#define TEST_TAB_ANTEATER 5
#define TEST_TAB_HUMMINGBIRD 6
#define TEST_TAB_SHEEP 7
#define TEST_TAB_COW 8
#define TEST_TAB_HORSE 9
#define TEST_TAB_PIG 10
#define TEST_TAB_OSTRICH 11
#define TEST_TAB_AARDVARK 12

3
samples/tab/test.rc Normal file
View File

@@ -0,0 +1,3 @@
mondrian_icon ICON "mondrian.ico"
#include "wx/msw/wx.rc"