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

View File

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

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

38
samples/splitter/aiai.xbm Normal file
View File

@@ -0,0 +1,38 @@
#define aiai_width 64
#define aiai_height 64
static char aiai_bits[] = {
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
0x44,0x44,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0x11,0x11,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
0x44,0x44,0x44,0x44,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0x11,0x11,0x11,0x11,0x44,0x44,0x44,0x42,0x44,0x44,0x44,0x44,0x44,0x44,
0x44,0x47,0x44,0x44,0x44,0x44,0x11,0x11,0x11,0x17,0x11,0x11,0x11,0x11,0x11,
0x11,0x91,0x1f,0x11,0x11,0x11,0x11,0x44,0x44,0xc4,0x4f,0x44,0x44,0x44,0x44,
0x44,0x44,0xc4,0x5f,0x44,0xf4,0x45,0x44,0x11,0x11,0xf1,0x1f,0x11,0xf9,0x13,
0x11,0x11,0x11,0xf1,0x3f,0x11,0xfd,0x13,0x11,0x44,0x44,0xf4,0x7f,0x44,0xfc,
0x47,0x44,0x44,0x44,0xf4,0x7f,0x44,0xfc,0x47,0x44,0x11,0x11,0xf9,0x7f,0x11,
0xf9,0x13,0x11,0x11,0x11,0xfd,0xff,0x11,0xf1,0x11,0x11,0x44,0x44,0xfc,0xff,
0x44,0x44,0x44,0x44,0x44,0x44,0xfe,0xff,0x45,0x44,0x44,0x44,0x11,0x11,0xff,
0xff,0x11,0xfd,0x13,0x11,0x11,0x11,0xff,0xff,0x13,0xfd,0x13,0x11,0x44,0xc4,
0xff,0xff,0x07,0xfc,0x43,0x44,0x44,0xff,0xff,0xf9,0xff,0xfd,0xfb,0xff,0x11,
0xc0,0xff,0x00,0x00,0xfc,0x03,0x00,0x11,0xc0,0x7f,0x00,0x00,0xfc,0x03,0x00,
0x04,0xe0,0x7f,0x00,0x00,0xfc,0x03,0x00,0xf4,0xf7,0xbf,0xff,0xff,0xfd,0xfb,
0x7f,0x01,0xf0,0x1f,0x00,0x00,0xfc,0x03,0x00,0x01,0xf8,0x1f,0x00,0x00,0xfc,
0x03,0x00,0x00,0xfc,0x0f,0x00,0x00,0xfc,0x03,0x40,0xfe,0xfd,0xef,0xff,0xff,
0xfd,0xfb,0x4f,0x00,0xfe,0x07,0x00,0x00,0xfc,0x03,0x10,0x00,0xfe,0x03,0x00,
0x00,0xfc,0x03,0x10,0x00,0xff,0x03,0x00,0x00,0xfc,0x03,0x44,0x7f,0xff,0x01,
0x00,0x00,0xfc,0xfb,0x44,0x91,0xff,0xff,0xff,0xff,0xff,0x13,0x11,0xd1,0xff,
0xff,0xff,0xff,0xff,0x13,0x11,0xe4,0xff,0xff,0xff,0xff,0xff,0x47,0x44,0xe4,
0xff,0xff,0xff,0xff,0xff,0x47,0x44,0xf1,0xff,0xff,0xff,0xff,0xff,0x13,0x11,
0xf1,0xff,0xff,0xff,0xff,0xff,0x13,0x11,0xfc,0xff,0xff,0xff,0xff,0xff,0x47,
0x44,0xfc,0xff,0xff,0xff,0xff,0xff,0x47,0x44,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x11,0x44,0x44,0xc4,0x44,0x44,
0xc4,0x44,0x44,0x44,0x4e,0xc4,0x44,0x4e,0xc4,0x44,0x44,0x11,0x1f,0xd1,0x11,
0x1f,0xd1,0x11,0x11,0x91,0x31,0xd1,0x91,0x31,0xd1,0x11,0x11,0xc4,0x64,0xcc,
0xcc,0x64,0xcc,0x44,0x44,0x64,0xc4,0xcc,0x6c,0xc4,0xcc,0x44,0x44,0xf1,0xff,
0xd1,0xf1,0xff,0xd1,0x11,0x11,0xf9,0xff,0xd3,0xf9,0xff,0xd3,0x11,0x11,0x4c,
0x44,0xc6,0x4c,0x44,0xc6,0x44,0x44,0x4c,0x44,0xc6,0x4c,0x44,0xc6,0x44,0x44,
0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,
0x11,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,0x44,
0x44,0x44};

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 splitter example (DOS).
# 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
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

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 splitter example (UNIX).
WXDIR = ../..
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/makeg95.env
OBJECTS = $(OBJDIR)/test.$(OBJSUFF)
all: $(OBJDIR) test$(GUISUFFIX)$(EXESUFF)
wx:
$(OBJDIR):
mkdir $(OBJDIR)
test$(GUISUFFIX)$(EXESUFF): $(OBJDIR)/test.$(OBJSUFF) test.res $(WXLIB)
$(CC) $(LDFLAGS) -o test$(GUISUFFIX)$(EXESUFF) $(OBJDIR)/test.$(OBJSUFF) $(XVIEW_LINK) $(LDLIBS)
$(RSRC) test.$(RESSUFF) test.exe
$(OBJDIR)/test.$(OBJSUFF): test.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ test.$(SRCSUFF)
test.res: test.rc
clean:
rm -f $(OBJECTS) test$(GUISUFFIX).exe core *.rsc *.res

View File

@@ -0,0 +1,63 @@
#
# File: makefile.nt
# Author: Julian Smart
# Created: 1997
# Updated:
# Copyright: (c) 1997, Julian Smart
#
# "%W% %G%"
#
# Makefile : Builds wxSplitterWindow sample MS VC++).
# Use FINAL=1 argument to nmake to build final version with no debugging
# info
# Set WXDIR for your system
WXDIR = $(WXWIN)
WXSPLITDIR = $(WXDIR)\samples\splitter
THISDIR = $(WXDIR)\samples\splitter
!include $(WXDIR)\src\ntwxwin.mak
PROGRAM=test
PROGOBJECTS = $(PROGRAM).obj
all: $(PROGRAM)
$(PROGRAM): $(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) $(PROGOBJECTS) $(PROGRAM).res
$(link) @<<
-out:$(PROGRAM).exe
$(LINKFLAGS)
$(DUMMYOBJ) $(PROGOBJECTS) $(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 *.sbr
-erase *.exe
-erase *.res
-erase *.map
-erase *.pdb

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

230
samples/splitter/test.cpp Normal file
View File

@@ -0,0 +1,230 @@
/////////////////////////////////////////////////////////////////////////////
// Name: splitter.cpp
// Purpose: wxSplitterWindow sample
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// 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/splitter.h"
class MyApp;
class MyFrame;
class MyCanvas;
class MyApp: public wxApp
{
public:
bool OnInit();
};
class MyFrame: public wxFrame
{
public:
MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size);
virtual ~MyFrame();
bool OnClose();
// Menu commands
void SplitHorizontal(wxCommandEvent& event);
void SplitVertical(wxCommandEvent& event);
void Unsplit(wxCommandEvent& event);
void Quit(wxCommandEvent& event);
// Menu command update functions
void UpdateUIHorizontal(wxUpdateUIEvent& event);
void UpdateUIVertical(wxUpdateUIEvent& event);
void UpdateUIUnsplit(wxUpdateUIEvent& event);
void OnIdle(wxIdleEvent& event);
private:
wxMenu* fileMenu;
wxMenuBar* menuBar;
MyCanvas* leftCanvas;
MyCanvas* rightCanvas;
wxSplitterWindow* splitter;
DECLARE_EVENT_TABLE()
};
class MyCanvas: public wxScrolledWindow
{
public:
MyCanvas(wxWindow* parent, int x, int y, int w, int h);
virtual ~MyCanvas();
virtual void OnDraw(wxDC& dc);
DECLARE_EVENT_TABLE()
};
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
END_EVENT_TABLE()
// ID for the menu quit command
#define SPLIT_QUIT 1
#define SPLIT_HORIZONTAL 2
#define SPLIT_VERTICAL 3
#define SPLIT_UNSPLIT 4
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
MyFrame* frame = new MyFrame(NULL, "wxSplitterWindow Example", wxPoint(50, 50), wxSize(400, 300));
// Show the frame
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(SPLIT_VERTICAL, MyFrame::SplitVertical)
EVT_MENU(SPLIT_HORIZONTAL, MyFrame::SplitHorizontal)
EVT_MENU(SPLIT_UNSPLIT, MyFrame::Unsplit)
EVT_MENU(SPLIT_QUIT, MyFrame::Quit)
EVT_UPDATE_UI(SPLIT_VERTICAL, MyFrame::UpdateUIVertical)
EVT_UPDATE_UI(SPLIT_HORIZONTAL, MyFrame::UpdateUIHorizontal)
EVT_UPDATE_UI(SPLIT_UNSPLIT, MyFrame::UpdateUIUnsplit)
EVT_IDLE(MyFrame::OnIdle)
END_EVENT_TABLE()
// My frame constructor
MyFrame::MyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos, const wxSize& size):
wxFrame(frame, -1, title, pos, size)
{
// set the icon
#ifdef __WINDOWS__
SetIcon(wxIcon("mondrian"));
#endif
#ifdef __X__
SetIcon(wxIcon("aiai.xbm"));
#endif
// Make a menubar
fileMenu = new wxMenu;
fileMenu->Append(SPLIT_VERTICAL, "Split &Vertically", "Split vertically");
fileMenu->Append(SPLIT_HORIZONTAL, "Split &Horizontally", "Split horizontally");
fileMenu->Append(SPLIT_UNSPLIT, "&Unsplit", "Unsplit");
fileMenu->Append(SPLIT_QUIT, "E&xit", "Exit");
menuBar = new wxMenuBar;
menuBar->Append(fileMenu, "&File");
SetMenuBar(menuBar);
splitter = new wxSplitterWindow(this, -1, wxPoint(0, 0), wxSize(400, 400),
// wxSP_BORDER);
wxSP_3D);
// wxSP_NOBORDER);
leftCanvas = new MyCanvas(splitter, 0, 0, 400, 400);
leftCanvas->SetBackgroundColour(*wxRED);
leftCanvas->SetScrollbars(20, 20, 50, 50);
rightCanvas = new MyCanvas(splitter, 0, 0, 400, 400);
rightCanvas->SetBackgroundColour(*wxCYAN);
rightCanvas->SetScrollbars(20, 20, 50, 50);
rightCanvas->Show(FALSE);
splitter->Initialize(leftCanvas);
// Set this to prevent unsplitting
// splitter->SetMinimumPaneSize(20);
CreateStatusBar();
}
MyFrame::~MyFrame()
{
}
bool MyFrame::OnClose()
{
return TRUE;
}
void MyFrame::Quit(wxCommandEvent& event)
{
Close(TRUE);
}
void MyFrame::SplitHorizontal(wxCommandEvent& event)
{
if ( splitter->IsSplit() )
splitter->Unsplit();
leftCanvas->Show(TRUE);
rightCanvas->Show(TRUE);
splitter->SplitHorizontally( leftCanvas, rightCanvas );
}
void MyFrame::SplitVertical(wxCommandEvent& event)
{
if ( splitter->IsSplit() )
splitter->Unsplit();
leftCanvas->Show(TRUE);
rightCanvas->Show(TRUE);
splitter->SplitVertically( leftCanvas, rightCanvas );
}
void MyFrame::Unsplit(wxCommandEvent& event)
{
if ( splitter->IsSplit() )
splitter->Unsplit();
}
void MyFrame::UpdateUIHorizontal(wxUpdateUIEvent& event)
{
event.Enable( ( (!splitter->IsSplit()) || (splitter->GetSplitMode() != wxSPLIT_HORIZONTAL) ) );
}
void MyFrame::UpdateUIVertical(wxUpdateUIEvent& event)
{
event.Enable( ( (!splitter->IsSplit()) || (splitter->GetSplitMode() != wxSPLIT_VERTICAL) ) );
}
void MyFrame::UpdateUIUnsplit(wxUpdateUIEvent& event)
{
event.Enable( splitter->IsSplit() );
}
void MyFrame::OnIdle(wxIdleEvent& event)
{
if ( GetStatusBar()->GetStatusText(0) != "Ready" )
SetStatusText("Ready");
}
MyCanvas::MyCanvas(wxWindow* parent, int x, int y, int w, int h) :
wxScrolledWindow(parent, -1, wxPoint(x, y), wxSize(w, h))
{
}
MyCanvas::~MyCanvas()
{
}
void MyCanvas::OnDraw(wxDC& dc)
{
dc.DrawLine(0, 0, 100, 100);
dc.SetBackgroundMode(wxTRANSPARENT);
dc.DrawText("Testing", 50, 50);
}

View File

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

4
samples/splitter/test.rc Normal file
View File

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