Added gizmos hierarchy

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8116 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2000-08-17 11:53:48 +00:00
parent 08c6402af6
commit 58580a7e3c
46 changed files with 3417 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
# Purpose: makefile for multicell example (BC++ 32bit)
# Created 2000-07-28
WXDIR = $(WXWIN)
TARGET=mtest
OBJECTS = $(TARGET).obj
!include $(WXDIR)\src\makeprog.b32

View File

@@ -0,0 +1,15 @@
# Purpose: makefile for multicell example (BC++ 16bit)
# Created 2000-07-28
!if "$(WXWIN)" == ""
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
!endif
WXDIR = $(WXWIN)
TARGET=mtest
OBJECTS=$(TARGET).obj ..\src\multicell.obj
EXTRAINC=-I..\include
!include $(WXDIR)\src\makeprog.bcc

View File

@@ -0,0 +1,11 @@
# Purpose: makefile for multicell example (VC++ 1.5x)
# Created 2000-07-28
WXDIR = $(WXWIN)
TARGET=mtest
OBJECTS = $(TARGET).obj ..\src\multicell.obj
EXTRAINC=-I..\include
!include $(WXDIR)\src\makeprog.msc

View File

@@ -0,0 +1,11 @@
# Purpose: makefile for multicell example (Cygwin/Mingw32)
# Created 2000-07-28
WXDIR = ../../../..
TARGET=mtest
OBJECTS = $(TARGET).o
EXTRALIBS=$(WXDIR)/lib/libgizmos.lib
include $(WXDIR)/src/makeprog.g95

View File

@@ -0,0 +1,39 @@
# Purpose: makefile for multicell example (Symantec C++)
# Created 2000-07-28
WXDIR = $(WXWIN)
WXLIB = $(WXDIR)\lib\wx.lib
INCDIR = $(WXDIR)\include
INCLUDE=$(INCDIR)
TARGET=mtest
OBJECTS = $(TARGET).obj ..\src\multicell.obj
EXTRAINC=-I..\include
include $(WXDIR)\src\makesc.env
mtest.exe: $(OBJECTS) $(DEFFILE) mtest.res
*$(CC) $(LDFLAGS) -o$@ $** $(LIBS)
*$(RC) -k mtest.res
sc32.def:
echo EXETYPE NT > sc32.def
echo SUBSYSTEM WINDOWS >> sc32.def
sc16.def:
echo NAME $(TARGET) > sc16.def
echo EXETYPE WINDOWS >> sc16.def
echo STUB 'WINSTUB.EXE' >> sc16.def
echo CODE PRELOAD MOVEABLE DISCARDABLE >> sc16.def
echo DATA PRELOAD MOVEABLE MULTIPLE >> sc16.def
echo HEAPSIZE 1024 >> sc16.def
echo STACKSIZE 8192 >> sc16.def
clean:
-del *.obj
-del *.exe
-del *.res
-del *.map
-del *.rws
-del sc32.def
-del sc16.def

View File

@@ -0,0 +1,15 @@
# Purpose: makefile for multicell example (Salford C++)
# Created 2000-07-28
PROGRAM = mtest
OBJECTS = $(PROGRAM).obj ..\src\multicell.obj
EXTRAINC=-I..\include
include ..\..\src\makeprog.sl
all: wx $(TARGET)
wx:
cd $(WXDIR)\src\msw ^ mk32 -f makefile.sl all
cd $(WXDIR)\samples\notebook

View File

@@ -0,0 +1,39 @@
# Purpose: makefile for multicell example (TWIN)
# Created 2000-07-28
WXDIR = ../..
# All common UNIX compiler flags and options are now in
# this central makefile.
include $(WXDIR)/src/maketwin.env
OBJECTS = $(OBJDIR)/mtest.$(OBJSUFF) $(OBJDIR)/multicell.$(OBJSUFF)
EXTRAINC=-I../include
all: $(OBJDIR) mtest$(GUISUFFIX)$(EXESUFF)
wx:
$(OBJDIR):
mkdir $(OBJDIR)
mtest$(GUISUFFIX)$(EXESUFF): $(OBJECTS) $(WXLIB)
$(CC) $(LDFLAGS) -o mtest$(GUISUFFIX)$(EXESUFF) $(OBJECTS) $(LDLIBS)
$(OBJDIR)/mtest.$(OBJSUFF): mtest.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ mtest.$(SRCSUFF)
$(OBJDIR)/multicell.$(OBJSUFF): multicell.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ multicell.$(SRCSUFF)
mtest.c: mtest.rc
$(RESCOMP) $(RCINPUTSWITCH) mtest.rc $(RCOUTPUTSWITCH) mtest.c $(RESFLAGS)
$(OBJDIR)/mtest.$(OBJSUFF): mtest.c
$(CC) -c $(CPPFLAGS) -o $@ mtest.c
#$(OBJDIR)/mtest.o: mtest.rc
# $(RESCOMP) $(RCINPUTSWITCH) mtest.rc $(RCOUTPUTSWITCH) $(OBJDIR)/mtest.o $(RESFLAGS)
clean:
rm -f $(OBJECTS) mtest$(GUISUFFIX).exe core *.rsc *.res

View File

@@ -0,0 +1,24 @@
# Purpose: makefile for multicell example (Unix)
# Created 2000-07-28
CC = gcc
PROGRAM = mtest
OBJECTS = $(PROGRAM).o ../src/multicell.o
EXTRAINC=-I../include
# implementation
.SUFFIXES: .o .cpp
.cpp.o :
$(CC) -c `wx-config --cflags` -o $@ $<
all: $(PROGRAM)
$(PROGRAM): $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS) `wx-config --libs`
clean:
rm -f *.o $(PROGRAM)

View File

@@ -0,0 +1,19 @@
# Makefile : Builds sample (VC++, WIN32)
# Use FINAL=1 argument to nmake to build final version with no debug info.
# Created 2000-07-28
# Set WXDIR for your system
WXDIR = $(WXWIN)
FINAL=0
PROGRAM=mtest
OBJECTS = $(PROGRAM).obj
!if "$(FINAL)" == "0"
EXTRALIBS=$(WXDIR)\lib\gizmosd.lib
!else
EXTRALIBS=$(WXDIR)\lib\gizmos.lib
!endif
!include $(WXDIR)\src\makeprog.vc

View File

@@ -0,0 +1,12 @@
# Purpose: makefile for multicell example (Watcom)
# Created 2000-07-28
WXDIR = $(%WXWIN)
PROGRAM = mtest
OBJECTS = $(PROGRAM).obj ..\src\multicell.obj
EXTRAINC=-I..\include
!include $(WXDIR)\src\makeprog.wat

View File

@@ -0,0 +1,215 @@
/*
* File: mtest.cpp
* Purpose: wxMultiCellSizer and wxMultiCellCanvas test
* Author: Alex Andruschak
* Created: 2000
* Updated:
* Copyright:
*/
static const char sccsid[] = "%W% %G%";
#ifdef __GNUG__
#pragma implementation
#pragma interface
#endif
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/gizmos/multicell.h"
class MyApp: public wxApp
{public:
bool OnInit(void);
};
class MyFrame: public wxFrame
{
public:
MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size);
void OnCloseWindow(wxCloseEvent& event);
void OnPaint(wxPaintEvent& event);
wxMultiCellSizer *sizer;
DECLARE_EVENT_TABLE()
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void)
{
MyFrame *frame = new MyFrame(1, (wxFrame *) NULL, (char *) "wxMultiCellSizer Sample", wxPoint(50, 50), wxDefaultSize); //, wxSize(600, 500));
frame->Show(TRUE);
SetTopWindow(frame);
frame = new MyFrame(2, (wxFrame *) NULL, (char *) "wxMultiCellCanvas Sample", wxPoint(100, 100), wxSize(600, 500));
frame->Show(TRUE);
SetTopWindow(frame);
return TRUE;
}
MyFrame::MyFrame(int type, wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size):
wxFrame(frame, -1, title, pos, size, wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL)
{
CreateStatusBar(1);
sizer = NULL;
if (type == 1)
{
// create sizer 4 columns 5 rows
wxSize aa(4,9);
sizer = new wxMultiCellSizer(aa);
sizer->SetDefaultCellSize(wxSize(15,15));
sizer->SetRowHeight(7,5,TRUE);
sizer->SetRowHeight(8,5,FALSE);
// add first row
sizer->Add(
new wxButton( this, -1, "B1 - 0,0, horizontal resizable" ),
0, 0, 0, new wxMultiCellItemHandle(0,0,1,1, wxDefaultSize, wxHORIZENTAL_RESIZABLE, wxSize(2,2)));
sizer->Add(
new wxButton( this, -1, "B2 - 0,1, vertical resizable" ),
0, 0, 0, new wxMultiCellItemHandle(0,1,1,1, wxDefaultSize, wxVERTICAL_RESIZABLE, wxSize(2, 2)));
sizer->Add(
new wxButton( this, -1, "B3 - 0,2" ),
0, 0, 0, new wxMultiCellItemHandle(0,2,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_CENTER_HORIZONTAL)); //, wxALIGN_CENTER));
sizer->Add(
new wxStaticText(this, -1, "jbb 0,3, lower-right"),
0, 0, 0, new wxMultiCellItemHandle(0,3,1,1, wxDefaultSize, wxNOT_RESIZABLE, wxSize(1,1), wxALIGN_BOTTOM | wxALIGN_RIGHT));
// add button for secord row
sizer->Add(
new wxTextCtrl(this, -1, "Text control - 1,0, 4 cols wide"),
0, 0, 0, new wxMultiCellItemHandle(1,0,1,4));
// add buttons for next row
sizer->Add(
new wxButton( this, -1, "B6 - 2,0, 2 cols wide" ),
0, 0, 0, new wxMultiCellItemHandle(2,0,1,2));
sizer->Add(
new wxButton( this, -1, "B7 - 2,3" ),
0, 0, 0, new wxMultiCellItemHandle(2,3,1,1));
// and last additions
sizer->Add(
new wxButton( this, -1, "B8 - 3,0, 4 rows high, vert resizable" ),
0, 0, 0, new wxMultiCellItemHandle(3,0,4,1,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B9 - 3,2, 2 cols wide, vert resizable" ),
0, 0, 0, new wxMultiCellItemHandle(3,2,1,2,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B10 - 4,1, 3 cols wide, vert resizable" ),
0, 0, 0, new wxMultiCellItemHandle(4,1,1,3,wxDefaultSize, wxVERTICAL_RESIZABLE));
sizer->Add(
new wxButton( this, -1, "B11 - 5,1, 3 cols wide" ),
0, 0, 0, new wxMultiCellItemHandle(5,1,1,3));
sizer->Add(
new wxButton( this, -1, "B12 - 6,1, 3 cols wide" ),
0, 0, 0, new wxMultiCellItemHandle(6,1,1,3));
sizer->Add(
new wxButton( this, -1, "B13 - 7,1, 2 cols wide" ),
0, 0, 0, new wxMultiCellItemHandle(7,1,1,2));
sizer->Add(
new wxButton( this, -1, "B14 - 8,1, 3 cols wide" ),
0, 0, 0, new wxMultiCellItemHandle(8,1,1,3));
SetAutoLayout( TRUE );
// sizer->SetMinSize(sizer->CalcMin());
SetSizer( sizer );
wxSize s = sizer->CalcMin();
wxSize c = GetSize() - GetClientSize();
SetSizeHints(s.GetWidth() + c.GetWidth() , s.GetHeight() + c.GetHeight());
sizer->EnableGridLines(this);
}
else
{
// create sizer 4 columns 5 rows
wxMultiCellCanvas *sizer = new wxMultiCellCanvas(this, 5,5);
// add first row
sizer->Add(
new wxButton( this, -1, "Button 1" ),
0, 0);
sizer->Add(
new wxButton( this, -1, "Button 2" ),
0, 1);
sizer->Add(
new wxButton( this, -1, "Button 3" ),
0, 2);
sizer->Add(
new wxStaticText(this, -1, "jbb test"),
0, 3);
sizer->Add(
new wxStaticText(this, -1, "jbb test 2"),
0, 4);
// add button for secord row
sizer->Add(
new wxTextCtrl(this, -1, "Text control"),
1, 0);
// add buttons for next row
sizer->Add(
new wxButton( this, -1, "Button 6" ),
2, 0);
sizer->Add(
new wxButton( this, -1, "Button 7" ),
2, 3);
// and last additions
sizer->Add(
new wxButton( this, -1, "Button 8" ),
3, 0);
sizer->Add(
new wxButton( this, -1, "Button 9" ),
3, 1);
sizer->Add(
new wxButton( this, -1, "Button 10" ),
4, 1);
sizer->CalculateConstraints();
SetSizer( sizer );
SetAutoLayout( TRUE );
}
}
// Define the repainting behaviour
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_PAINT(MyFrame::OnPaint)
EVT_CLOSE(MyFrame::OnCloseWindow)
END_EVENT_TABLE()
void MyFrame::OnPaint(wxPaintEvent& WXUNUSED(event) )
{
wxPaintDC dc(this);
if (sizer)
{
sizer->OnPaint(dc);
}
}
void MyFrame::OnCloseWindow(wxCloseEvent& event)
{
Destroy();
}

View File

@@ -0,0 +1,3 @@
#include "wx/msw/wx.rc"

View File

@@ -0,0 +1,18 @@
[COMPILER]
version=5.0b
compile=concur|capture|:Compile:&Compile,gcc
make=concur|capture|:Build:&Build,make
rebuild=concur|capture|:Rebuild:&Rebuild,
debug=:Debug:&Debug,gdb
execute=:Execute:E&xecute,
user1=hide|:User 1:User 1,
user2=hide|:User 2:User 2,
workingdir=.
includedirs=
reffile=
MACRO=\n
[FILES]
mtest.cpp
multicell.cpp
multicell.h
[ASSOCIATION]