New location for proplist sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
66f8b9ace2
commit
07831c160b
7
contrib/samples/deprecated/proplist/.cvsignore
Normal file
7
contrib/samples/deprecated/proplist/.cvsignore
Normal file
@ -0,0 +1,7 @@
|
||||
proplistM5.mcp
|
||||
proplistM*Data
|
||||
*Classic?Debug*
|
||||
*Classic?Release*
|
||||
*Carbon?Debug*
|
||||
*Carbon?Release*
|
||||
proplist
|
15
contrib/samples/deprecated/proplist/Makefile.in
Normal file
15
contrib/samples/deprecated/proplist/Makefile.in
Normal file
@ -0,0 +1,15 @@
|
||||
# Purpose: makefile for proplist example (UNIX).
|
||||
# Created: 2000-03-15
|
||||
|
||||
top_srcdir = @top_srcdir@/..
|
||||
top_builddir = ../../../..
|
||||
program_dir = contrib/samples/deprecated/proplist
|
||||
|
||||
PROGRAM=proplist
|
||||
|
||||
OBJECTS =$(PROGRAM).o
|
||||
DEPFILES=$(PROGRAM).d
|
||||
|
||||
include ../../../../src/makeprog.env
|
||||
|
||||
@IF_GNU_MAKE@-include $(DEPFILES)
|
BIN
contrib/samples/deprecated/proplist/cross.bmp
Normal file
BIN
contrib/samples/deprecated/proplist/cross.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 198 B |
10
contrib/samples/deprecated/proplist/makefile.b32
Normal file
10
contrib/samples/deprecated/proplist/makefile.b32
Normal file
@ -0,0 +1,10 @@
|
||||
# Purpose: makefile for proplist example (BC++ 32bit)
|
||||
# Created: 2000-03-15
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
TARGET=proplist
|
||||
OBJECTS = $(TARGET).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.b32
|
||||
|
10
contrib/samples/deprecated/proplist/makefile.g95
Normal file
10
contrib/samples/deprecated/proplist/makefile.g95
Normal file
@ -0,0 +1,10 @@
|
||||
# Purpose: makefile for proplist example (Cygwin/Mingw32)
|
||||
# Created: #03.01.00
|
||||
|
||||
WXDIR = ../../../..
|
||||
|
||||
TARGET=proplist
|
||||
OBJECTS = $(TARGET).o
|
||||
|
||||
include $(WXDIR)/src/makeprog.g95
|
||||
|
37
contrib/samples/deprecated/proplist/makefile.sc
Normal file
37
contrib/samples/deprecated/proplist/makefile.sc
Normal file
@ -0,0 +1,37 @@
|
||||
# Purpose: makefile for proplist example (Symantec C++)
|
||||
# Created: 2000-03-15
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
WXLIB = $(WXDIR)\lib\wx.lib
|
||||
INCDIR = $(WXDIR)\include
|
||||
INCLUDE=$(INCDIR)
|
||||
TARGET=proplist
|
||||
|
||||
include $(WXDIR)\src\makesc.env
|
||||
|
||||
proplist.exe: proplist.obj $(DEFFILE) proplist.res
|
||||
*$(CC) $(LDFLAGS) -o$@ $** $(LIBS)
|
||||
*$(RC) -k proplist.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
|
||||
|
23
contrib/samples/deprecated/proplist/makefile.unx
Normal file
23
contrib/samples/deprecated/proplist/makefile.unx
Normal file
@ -0,0 +1,23 @@
|
||||
# Purpose: makefile for proplist example (Unix)
|
||||
# Created: 2000-03-15
|
||||
|
||||
CXX = $(shell wx-config --cxx)
|
||||
|
||||
PROGRAM = proplist
|
||||
|
||||
OBJECTS = $(PROGRAM).o
|
||||
|
||||
# implementation
|
||||
|
||||
.SUFFIXES: .o .cpp
|
||||
|
||||
.cpp.o :
|
||||
$(CXX) -c `wx-config --cxxflags` -o $@ $<
|
||||
|
||||
all: $(PROGRAM)
|
||||
|
||||
$(PROGRAM): $(OBJECTS)
|
||||
$(CXX) -o $(PROGRAM) $(OBJECTS) `wx-config --libs`
|
||||
|
||||
clean:
|
||||
rm -f *.o $(PROGRAM)
|
11
contrib/samples/deprecated/proplist/makefile.vc
Normal file
11
contrib/samples/deprecated/proplist/makefile.vc
Normal file
@ -0,0 +1,11 @@
|
||||
# Purpose: makefile for proplist example (VC++ 32bit)
|
||||
# Created: 2000-03-15
|
||||
|
||||
# Set WXDIR for your system
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
PROGRAM=proplist
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.vc
|
||||
|
11
contrib/samples/deprecated/proplist/makefile.wat
Normal file
11
contrib/samples/deprecated/proplist/makefile.wat
Normal file
@ -0,0 +1,11 @@
|
||||
# Purpose: makefile for proplist example (Watcom)
|
||||
# Created: 2000-03-15
|
||||
|
||||
WXDIR = $(%WXWIN)
|
||||
|
||||
PROGRAM = proplist
|
||||
OBJECTS = $(PROGRAM).obj
|
||||
|
||||
!include $(WXDIR)\src\makeprog.wat
|
||||
|
||||
|
420
contrib/samples/deprecated/proplist/proplist.cpp
Normal file
420
contrib/samples/deprecated/proplist/proplist.cpp
Normal file
@ -0,0 +1,420 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: proplist.cpp
|
||||
// Purpose: Property sheet test implementation
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "proplist_sample.h"
|
||||
#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
|
||||
|
||||
|
||||
#if !wxUSE_PROPSHEET
|
||||
#error Please set wxUSE_PROPSHEET to 1 in include/wx/msw/setup.h and recompile.
|
||||
#endif
|
||||
|
||||
#include "proplist.h"
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
|
||||
wxPropertyValidatorRegistry myListValidatorRegistry;
|
||||
wxPropertyValidatorRegistry myFormValidatorRegistry;
|
||||
|
||||
MyApp::MyApp(void)
|
||||
{
|
||||
m_childWindow = NULL;
|
||||
m_mainFrame = NULL;
|
||||
}
|
||||
|
||||
bool MyApp::OnInit(void)
|
||||
{
|
||||
RegisterValidators();
|
||||
|
||||
// Create the main frame window
|
||||
m_mainFrame = new MyFrame(NULL, _T("wxPropertySheet Demo"), wxPoint(0, 0), wxSize(300, 400), wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
file_menu->Append(PROPERTY_TEST_DIALOG_LIST, _T("Test property list &dialog..."));
|
||||
file_menu->Append(PROPERTY_TEST_FRAME_LIST, _T("Test property list &frame..."));
|
||||
file_menu->AppendSeparator();
|
||||
file_menu->Append(PROPERTY_TEST_DIALOG_FORM, _T("Test property form d&ialog..."));
|
||||
file_menu->Append(PROPERTY_TEST_FRAME_FORM, _T("Test property form f&rame..."));
|
||||
file_menu->AppendSeparator();
|
||||
file_menu->Append(PROPERTY_QUIT, _T("E&xit"));
|
||||
|
||||
wxMenu *help_menu = new wxMenu;
|
||||
help_menu->Append(PROPERTY_ABOUT, _T("&About"));
|
||||
|
||||
wxMenuBar *menu_bar = new wxMenuBar;
|
||||
|
||||
menu_bar->Append(file_menu, _T("&File"));
|
||||
menu_bar->Append(help_menu, _T("&Help"));
|
||||
|
||||
// Associate the menu bar with the frame
|
||||
m_mainFrame->SetMenuBar(menu_bar);
|
||||
|
||||
m_mainFrame->Centre(wxBOTH);
|
||||
m_mainFrame->Show(TRUE);
|
||||
|
||||
SetTopWindow(m_mainFrame);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_CLOSE(MyFrame::OnCloseWindow)
|
||||
EVT_MENU(PROPERTY_QUIT, MyFrame::OnQuit)
|
||||
EVT_MENU(PROPERTY_ABOUT, MyFrame::OnAbout)
|
||||
EVT_MENU(PROPERTY_TEST_DIALOG_LIST, MyFrame::OnDialogList)
|
||||
EVT_MENU(PROPERTY_TEST_FRAME_LIST, MyFrame::OnFrameList)
|
||||
EVT_MENU(PROPERTY_TEST_DIALOG_FORM, MyFrame::OnDialogForm)
|
||||
EVT_MENU(PROPERTY_TEST_FRAME_FORM, MyFrame::OnFrameForm)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Define my frame constructor
|
||||
MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type):
|
||||
wxFrame(frame, -1, title, pos, size, type)
|
||||
{
|
||||
}
|
||||
|
||||
// Define the behaviour for the frame closing
|
||||
// - must delete all frames except for the main one.
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
if (wxGetApp().m_childWindow)
|
||||
{
|
||||
wxGetApp().m_childWindow->Close(TRUE);
|
||||
}
|
||||
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnDialogList(wxCommandEvent& event)
|
||||
{
|
||||
wxGetApp().PropertyListTest(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnFrameList(wxCommandEvent& event)
|
||||
{
|
||||
wxGetApp().PropertyListTest(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnDialogForm(wxCommandEvent& event)
|
||||
{
|
||||
wxGetApp().PropertyFormTest(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnFrameForm(wxCommandEvent& event)
|
||||
{
|
||||
wxGetApp().PropertyFormTest(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& event)
|
||||
{
|
||||
(void)wxMessageBox(_T("Property Classes Demo\nAuthor: Julian Smart"), _T("About Property Classes Test"));
|
||||
}
|
||||
|
||||
void MyApp::RegisterValidators(void)
|
||||
{
|
||||
myListValidatorRegistry.RegisterValidator((wxString)_T("real"), new wxRealListValidator);
|
||||
myListValidatorRegistry.RegisterValidator((wxString)_T("string"), new wxStringListValidator);
|
||||
myListValidatorRegistry.RegisterValidator((wxString)_T("integer"), new wxIntegerListValidator);
|
||||
myListValidatorRegistry.RegisterValidator((wxString)_T("bool"), new wxBoolListValidator);
|
||||
myListValidatorRegistry.RegisterValidator((wxString)_T("stringlist"), new wxListOfStringsListValidator);
|
||||
|
||||
myFormValidatorRegistry.RegisterValidator((wxString)_T("real"), new wxRealFormValidator);
|
||||
myFormValidatorRegistry.RegisterValidator((wxString)_T("string"), new wxStringFormValidator);
|
||||
myFormValidatorRegistry.RegisterValidator((wxString)_T("integer"), new wxIntegerFormValidator);
|
||||
myFormValidatorRegistry.RegisterValidator((wxString)_T("bool"), new wxBoolFormValidator);
|
||||
}
|
||||
|
||||
void MyApp::PropertyListTest(bool useDialog)
|
||||
{
|
||||
if (m_childWindow)
|
||||
return;
|
||||
|
||||
wxPropertySheet *sheet = new wxPropertySheet;
|
||||
|
||||
sheet->AddProperty(new wxProperty(_T("fred"), 1.0, _T("real")));
|
||||
sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool")));
|
||||
sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerListValidator(-50, 50)));
|
||||
sheet->AddProperty(new wxProperty(_T("bill"), 25.0, _T("real"), new wxRealListValidator(0.0, 100.0)));
|
||||
sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string")));
|
||||
sheet->AddProperty(new wxProperty(_T("bitmap"), _T("none"), _T("string"), new wxFilenameListValidator(_T("Select a bitmap file"), _T("*.bmp"))));
|
||||
wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
|
||||
sheet->AddProperty(new wxProperty(_T("constrained"), _T("one"), _T("string"), new wxStringListValidator(strings)));
|
||||
|
||||
wxStringList *strings2 = new wxStringList(wxT("earth"), wxT("fire"), wxT("wind"), wxT("water"), NULL);
|
||||
sheet->AddProperty(new wxProperty(_T("string list"), strings2, _T("stringlist")));
|
||||
|
||||
wxPropertyListView *view = new wxPropertyListView
|
||||
(
|
||||
NULL,
|
||||
wxPROP_BUTTON_OK | wxPROP_BUTTON_CANCEL | wxPROP_BUTTON_CHECK_CROSS
|
||||
|wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN|wxPROP_SHOWVALUES
|
||||
);
|
||||
|
||||
wxDialog *propDialog = NULL;
|
||||
wxPropertyListFrame *propFrame = NULL;
|
||||
if (useDialog)
|
||||
{
|
||||
propDialog = new PropListDialog(view, NULL, _T("Property Sheet Test"),
|
||||
wxPoint(-1, -1), wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS);
|
||||
m_childWindow = propDialog;
|
||||
}
|
||||
else
|
||||
{
|
||||
propFrame = new PropListFrame(view, NULL, _T("Property Sheet Test"), wxPoint(-1, -1), wxSize(400, 500));
|
||||
m_childWindow = propFrame;
|
||||
}
|
||||
|
||||
view->AddRegistry(&myListValidatorRegistry);
|
||||
|
||||
if (useDialog)
|
||||
{
|
||||
view->ShowView(sheet, (wxPanel *)propDialog);
|
||||
propDialog->Centre(wxBOTH);
|
||||
propDialog->Show(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
propFrame->Initialize();
|
||||
view->ShowView(sheet, propFrame->GetPropertyPanel());
|
||||
|
||||
propFrame->Centre(wxBOTH);
|
||||
propFrame->Show(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void MyApp::PropertyFormTest(bool useDialog)
|
||||
{
|
||||
if (m_childWindow)
|
||||
return;
|
||||
|
||||
wxPropertySheet *sheet = new wxPropertySheet;
|
||||
|
||||
sheet->AddProperty(new wxProperty(_T("fred"), 25.0, _T("real"), new wxRealFormValidator(0.0, 100.0)));
|
||||
sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool")));
|
||||
sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerFormValidator(-50, 50)));
|
||||
sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string")));
|
||||
wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
|
||||
sheet->AddProperty(new wxProperty(_T("constrained"), _T("one"), _T("string"), new wxStringFormValidator(strings)));
|
||||
|
||||
wxPropertyFormView *view = new wxPropertyFormView(NULL);
|
||||
|
||||
wxDialog *propDialog = NULL;
|
||||
wxPropertyFormFrame *propFrame = NULL;
|
||||
|
||||
if (useDialog)
|
||||
{
|
||||
propDialog = new PropFormDialog(view, NULL, _T("Property Form Test"),
|
||||
wxPoint(-1, -1), wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL);
|
||||
m_childWindow = propDialog;
|
||||
}
|
||||
else
|
||||
{
|
||||
propFrame = new PropFormFrame(view, NULL, _T("Property Form Test"),
|
||||
wxPoint(-1, -1), wxSize(380, 250));
|
||||
propFrame->Initialize();
|
||||
m_childWindow = propFrame;
|
||||
}
|
||||
|
||||
// BCC32 does not like ?:
|
||||
wxWindow *panel ;
|
||||
if ( propDialog )
|
||||
{
|
||||
panel = propDialog;
|
||||
}
|
||||
else
|
||||
{
|
||||
panel = propFrame->GetPropertyPanel() ;
|
||||
}
|
||||
|
||||
wxLayoutConstraints* c;
|
||||
|
||||
#if 0
|
||||
if (!propDialog)
|
||||
{
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(m_childWindow, wxLeft, 4);
|
||||
c->right.SameAs(m_childWindow, wxRight, 4);
|
||||
c->top.SameAs(m_childWindow, wxTop, 4);
|
||||
c->bottom.SameAs(m_childWindow, wxBottom, 40);
|
||||
|
||||
panel->SetConstraints(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Add items to the panel
|
||||
wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxPoint(-1, -1),
|
||||
wxSize(80, 26), 0, wxDefaultValidator, _T("ok"));
|
||||
wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, _T("Cancel"), wxPoint(-1, -1),
|
||||
wxSize(80, 26), 0, wxDefaultValidator, _T("cancel"));
|
||||
wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, _T("Update"), wxPoint(-1, -1),
|
||||
wxSize(80, 26), 0, wxDefaultValidator, _T("update"));
|
||||
wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, _T("Revert"), wxPoint(-1, -1),
|
||||
wxSize(80, 26), 0, wxDefaultValidator, _T("revert"));
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->right.SameAs(panel, wxRight, 4);
|
||||
c->bottom.SameAs(panel, wxBottom, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
revertButton->SetConstraints(c);
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->right.SameAs(revertButton, wxLeft, 4);
|
||||
c->bottom.SameAs(panel, wxBottom, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
updateButton->SetConstraints(c);
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->right.SameAs(updateButton, wxLeft, 4);
|
||||
c->bottom.SameAs(panel, wxBottom, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
cancelButton->SetConstraints(c);
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->right.SameAs(cancelButton, wxLeft, 4);
|
||||
c->bottom.SameAs(panel, wxBottom, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
okButton->SetConstraints(c);
|
||||
|
||||
// The name of this text item matches the "fred" property
|
||||
wxTextCtrl *text = new wxTextCtrl(panel, -1, _T("Fred"), wxPoint(-1, -1), wxSize(
|
||||
200, -1), 0, wxDefaultValidator, _T("fred"));
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(panel, wxLeft, 4);
|
||||
c->top.SameAs(panel, wxTop, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
text->SetConstraints(c);
|
||||
|
||||
wxCheckBox *checkBox = new wxCheckBox(panel, -1, _T("Yes or no"), wxPoint(-1, -1),
|
||||
wxSize(-1, -1), 0, wxDefaultValidator, _T("tough choice"));
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(text, wxRight, 20);
|
||||
c->top.SameAs(panel, wxTop, 4);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
checkBox->SetConstraints(c);
|
||||
|
||||
wxSlider *slider = new wxSlider(panel, -1, -50, 50, 150, wxPoint(-1, -1),
|
||||
wxSize(200,10), 0, wxDefaultValidator, _T("ian"));
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(panel, wxLeft, 4);
|
||||
c->top.SameAs(text, wxBottom, 10);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
slider->SetConstraints(c);
|
||||
|
||||
wxListBox *listBox = new wxListBox(panel, -1, wxPoint(-1, -1),
|
||||
wxSize(200, 100), 0, NULL, 0, wxDefaultValidator, _T("constrained"));
|
||||
|
||||
c = new wxLayoutConstraints;
|
||||
c->left.SameAs(panel, wxLeft, 4);
|
||||
c->top.SameAs(slider, wxBottom, 10);
|
||||
c->height.AsIs();
|
||||
c->width.AsIs();
|
||||
listBox->SetConstraints(c);
|
||||
|
||||
view->AddRegistry(&myFormValidatorRegistry);
|
||||
|
||||
panel->SetAutoLayout(TRUE);
|
||||
|
||||
view->ShowView(sheet, panel);
|
||||
view->AssociateNames();
|
||||
view->TransferToDialog();
|
||||
|
||||
if (useDialog) {
|
||||
propDialog->Layout();
|
||||
propDialog->Centre(wxBOTH);
|
||||
propDialog->Show(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
// panel->Layout();
|
||||
propFrame->Centre(wxBOTH);
|
||||
propFrame->Show(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(PropListFrame, wxPropertyListFrame)
|
||||
EVT_CLOSE(PropListFrame::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void PropListFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
wxGetApp().m_childWindow = NULL;
|
||||
|
||||
wxPropertyListFrame::OnCloseWindow(event);
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(PropListDialog, wxPropertyListDialog)
|
||||
EVT_CLOSE(PropListDialog::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void PropListDialog::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
wxGetApp().m_childWindow = NULL;
|
||||
|
||||
wxPropertyListDialog::OnCloseWindow(event);
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(PropFormFrame, wxPropertyFormFrame)
|
||||
EVT_CLOSE(PropFormFrame::OnCloseWindow)
|
||||
EVT_SIZE(PropFormFrame::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void PropFormFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
wxGetApp().m_childWindow = NULL;
|
||||
|
||||
wxPropertyFormFrame::OnCloseWindow(event);
|
||||
}
|
||||
|
||||
void PropFormFrame::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
wxPropertyFormFrame::OnSize(event);
|
||||
GetPropertyPanel()->Layout();
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(PropFormDialog, wxPropertyFormDialog)
|
||||
EVT_CLOSE(PropFormDialog::OnCloseWindow)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void PropFormDialog::OnCloseWindow(wxCloseEvent& event)
|
||||
{
|
||||
wxGetApp().m_childWindow = NULL;
|
||||
|
||||
wxPropertyFormDialog::OnCloseWindow(event);
|
||||
}
|
||||
|
154
contrib/samples/deprecated/proplist/proplist.dsp
Normal file
154
contrib/samples/deprecated/proplist/proplist.dsp
Normal file
@ -0,0 +1,154 @@
|
||||
# Microsoft Developer Studio Project File - Name="proplist" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Application" 0x0101
|
||||
|
||||
CFG=proplist - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "proplist.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "proplist.mak" CFG="proplist - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "proplist - Win32 Release DLL" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "proplist - Win32 Debug DLL" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "proplist - Win32 Release" (based on "Win32 (x86) Application")
|
||||
!MESSAGE "proplist - Win32 Debug" (based on "Win32 (x86) Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
MTL=midl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!ELSEIF "$(CFG)" == "proplist - Win32 Release DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "ReleaseDll"
|
||||
# PROP BASE Intermediate_Dir "ReleaseDll"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "ReleaseDll"
|
||||
# PROP Intermediate_Dir "ReleaseDll"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W4 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c
|
||||
# ADD CPP /nologo /W4 /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D WIN32 /D WINVER=0x400 /D _MT /D wxUSE_GUI=1 /YX /FD /c /MD /D WXUSINGDLL /I..\..\lib\mswdll
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /I "../../include"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /I "../../include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 ..\..\lib\wxmsw250.lib
|
||||
|
||||
!ELSEIF "$(CFG)" == "proplist - Win32 Debug DLL"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "DebugDll"
|
||||
# PROP BASE Intermediate_Dir "DebugDll"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "DebugDll"
|
||||
# PROP Intermediate_Dir "DebugDll"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W4 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c
|
||||
# ADD CPP /nologo /W4 /Zi /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D WIN32 /D WINVER=0x400 /D _MT /D wxUSE_GUI=1 /YX /FD /c /MDd /D "__WXDEBUG__" /D "WXDEBUG=1" /D WXUSINGDLL /I..\..\lib\mswdlld
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /I "../../include"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /I "../../include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ..\..\lib\wxmsw250d.lib
|
||||
|
||||
!ELSEIF "$(CFG)" == "proplist - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W4 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c
|
||||
# ADD CPP /nologo /W4 /O2 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D WIN32 /D WINVER=0x400 /D _MT /D wxUSE_GUI=1 /YX /FD /c /MD /I..\..\lib\msw
|
||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG" /I "../../include"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG" /I "../../include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /machine:I386 ..\..\lib\zlib.lib ..\..\lib\regex.lib ..\..\lib\png.lib ..\..\lib\jpeg.lib ..\..\lib\tiff.lib ..\..\lib\wxmsw.lib
|
||||
|
||||
!ELSEIF "$(CFG)" == "proplist - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W4 /Zi /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /YX /FD /c
|
||||
# ADD CPP /nologo /W4 /Zi /Od /I "../../include" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D WINVER=0x400 /D WIN32 /D WINVER=0x400 /D _MT /D wxUSE_GUI=1 /YX /FD /c /MDd /D "__WXDEBUG__" /D "WXDEBUG=1" /I..\..\lib\mswd
|
||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG" /I "../../include"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG" /I "../../include"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept ..\..\lib\zlibd.lib ..\..\lib\regexd.lib ..\..\lib\pngd.lib ..\..\lib\jpegd.lib ..\..\lib\tiffd.lib ..\..\lib\wxmswd.lib
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "proplist - Win32 Release DLL"
|
||||
# Name "proplist - Win32 Debug DLL"
|
||||
# Name "proplist - Win32 Release"
|
||||
# Name "proplist - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\proplist.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\proplist.rc
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
128
contrib/samples/deprecated/proplist/proplist.h
Normal file
128
contrib/samples/deprecated/proplist/proplist.h
Normal file
@ -0,0 +1,128 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: proplist.h
|
||||
// Purpose: Property sheet sample
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if defined(__GNUG__) && !defined(__APPLE__)
|
||||
#pragma interface "proplist_sample.h"
|
||||
#endif
|
||||
|
||||
#ifndef _PROPTEST_H_
|
||||
#define _PROPTEST_H_
|
||||
|
||||
#include "wx/proplist.h"
|
||||
#include "wx/propform.h"
|
||||
|
||||
class MyChild;
|
||||
|
||||
// Define a new application
|
||||
class MyFrame;
|
||||
class MyApp: public wxApp
|
||||
{
|
||||
public:
|
||||
MyApp(void);
|
||||
bool OnInit(void);
|
||||
|
||||
void RegisterValidators(void);
|
||||
void PropertyListTest(bool useDialog);
|
||||
void PropertyFormTest(bool useDialog);
|
||||
|
||||
MyFrame* m_mainFrame;
|
||||
wxWindow* m_childWindow;
|
||||
};
|
||||
|
||||
DECLARE_APP(MyApp)
|
||||
|
||||
// Define a new frame
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
public:
|
||||
MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type);
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnDialogList(wxCommandEvent& event);
|
||||
void OnFrameList(wxCommandEvent& event);
|
||||
void OnDialogForm(wxCommandEvent& event);
|
||||
void OnFrameForm(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class PropListFrame: public wxPropertyListFrame
|
||||
{
|
||||
public:
|
||||
PropListFrame(wxPropertyListView *v, wxFrame *parent, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")):
|
||||
wxPropertyListFrame(v, parent, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class PropListDialog: public wxPropertyListDialog
|
||||
{
|
||||
public:
|
||||
PropListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = _T("dialogBox")):
|
||||
wxPropertyListDialog(v, parent, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class PropFormFrame: public wxPropertyFormFrame
|
||||
{
|
||||
public:
|
||||
PropFormFrame(wxPropertyFormView *v, wxFrame *parent, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")):
|
||||
wxPropertyFormFrame(v, parent, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class PropFormDialog: public wxPropertyFormDialog
|
||||
{
|
||||
public:
|
||||
PropFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = _T("dialogBox")):
|
||||
wxPropertyFormDialog(v, parent, title, pos, size, style, name)
|
||||
{
|
||||
}
|
||||
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#define PROPERTY_QUIT 1
|
||||
#define PROPERTY_ABOUT 2
|
||||
#define PROPERTY_TEST_DIALOG_LIST 3
|
||||
#define PROPERTY_TEST_FRAME_LIST 4
|
||||
#define PROPERTY_TEST_DIALOG_FORM 5
|
||||
#define PROPERTY_TEST_FRAME_FORM 6
|
||||
|
||||
#endif
|
||||
|
17
contrib/samples/deprecated/proplist/proplist.pro
Normal file
17
contrib/samples/deprecated/proplist/proplist.pro
Normal file
@ -0,0 +1,17 @@
|
||||
# this is the project file for the proplist wxWindows sample
|
||||
|
||||
# we generate the VC++ IDE project file, comment this line
|
||||
# to generate a makefile for (n)make
|
||||
TEMPLATE = vc6app
|
||||
|
||||
# wx is mandatory for wxWindows projects
|
||||
CONFIG = wx
|
||||
|
||||
# the configurations of wxWindows we want to use: the value below is the
|
||||
# default one; possible other values are {Debug|Release}Unicode[Dll]
|
||||
#WXCONFIGS = Debug Release DebugDll ReleaseDll
|
||||
|
||||
# project files
|
||||
SOURCES = proplist.cpp
|
||||
RC_FILE = proplist.rc
|
||||
TARGET = proplist
|
5
contrib/samples/deprecated/proplist/proplist.rc
Normal file
5
contrib/samples/deprecated/proplist/proplist.rc
Normal file
@ -0,0 +1,5 @@
|
||||
//tick_bmp BITMAP "tick.bmp"
|
||||
//cross_bmp BITMAP "cross.bmp"
|
||||
|
||||
#include "wx/msw/wx.rc"
|
||||
|
3685
contrib/samples/deprecated/proplist/proplistM5.xml
Normal file
3685
contrib/samples/deprecated/proplist/proplistM5.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
contrib/samples/deprecated/proplist/tick.bmp
Normal file
BIN
contrib/samples/deprecated/proplist/tick.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 198 B |
Loading…
Reference in New Issue
Block a user