This commit was manufactured by cvs2svn to create tag 'WX_2_2_9'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_2_9@13364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
TN0001 How to add a new sample
|
||||
TN0002 wxWindows translator guide
|
||||
TN0003 Adding wxWindows class documentation
|
||||
TN0004 Compiling a sample in the C++Builder IDE
|
||||
TN0005 Adding a wxWindows contribution
|
||||
TN0006 Making and installing RPMs for wxWindows
|
||||
TN0007 Using and modifying the BC++ IDE files
|
||||
TN0008 How to learn wxWindows programming
|
||||
TN0009 Creating and converting icons
|
||||
TN0010 Compiling wxWindows applications in the VC++ IDE
|
||||
|
||||
Version: $Id$
|
||||
|
@@ -45,6 +45,15 @@ For Word RTF:
|
||||
|
||||
tex2rtf manual.tex manual.rtf -rtf -twice
|
||||
|
||||
If you wish to have a GUI display show the status of what is happening
|
||||
as the conversion is happening, use the '-interactive' command line
|
||||
parameter, and then choose FILE|GO from the menu. For example:
|
||||
|
||||
tex2rtf manual.tex manual.rtf -rtf -twice -interactive
|
||||
|
||||
NOTE: You must be using the latest tex2rtf which was released with
|
||||
v2.2.0 of wxWindowsto use the -interactive switch
|
||||
|
||||
If you wish to generate documentation for wxHTML Help Viewer
|
||||
(or Windows HTML Help), set htmlWorkshopFiles to true in your
|
||||
tex2rtf.ini file. See also the wxHTML Notes section in the
|
||||
|
218
docs/tech/tn0004.htm
Normal file
218
docs/tech/tn0004.htm
Normal file
@@ -0,0 +1,218 @@
|
||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="Author" content="chris elliott">
|
||||
<meta name="GENERATOR" content="Mozilla/4.7 [en] (Win95; I) [Netscape]">
|
||||
<title>Compiling wx Samples in the Borland IDE</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>
|
||||
Compiling wxWindows samples with the Borland CBuilder</h2>
|
||||
|
||||
This document is available online <a href="http://biolpc22.york.ac.uk/wx/bc/ide.html">here</a>.<P>
|
||||
|
||||
<h2>
|
||||
Before you begin</h2>
|
||||
This refers to the 2.1.15 wxWindows distribution. It is my account of trying
|
||||
to compile the samples so I can use the Borland IDE to edit/compile/debug.
|
||||
I have used CBuilder 1.00 (2 patches, nice and fast) CBuilder 3 (slower)
|
||||
and CBuilder 4 (only occasionally)
|
||||
<p>Make sure that the wx distribution is extracted to a path with no spaces
|
||||
in it, and preferably on the root of your drive. Borland's compilers sometimes
|
||||
have problems with spaces and with the long paths which occur if you try
|
||||
to place it in a tree like <tt>d:\compiler\gui\wx...</tt>
|
||||
<h2>
|
||||
Part 1 Build the library</h2>
|
||||
Build the <b>wx\wx32.lib</b> and related files using the command line compiler
|
||||
<br>Run a command prompt in the <tt>wx/src/msw</tt> directory and type
|
||||
<p><tt>set wxwin=pathtowx</tt>
|
||||
<br><tt>set bccdir=pathtobc4</tt>
|
||||
<br><tt>make -f makefile.b32</tt>
|
||||
<p>In my case this I extracted the wx distribution in <b>c:\ </b>and the
|
||||
compiler is in <b>w:\borland\cb\bin </b>so this looks:
|
||||
<p><tt>set wxwin=c:\wx</tt>
|
||||
<br><tt>set bccdir=w:\borland\cb</tt>
|
||||
<br><tt>make -f makefile.b32</tt>
|
||||
<p>If this doesn't <b>compile</b>,
|
||||
<ul>
|
||||
<li>
|
||||
you've probably got the <b><tt>set wxwin </tt></b>command wrong,</li>
|
||||
|
||||
<li>
|
||||
or the path was not set by the Borland setup</li>
|
||||
</ul>
|
||||
If this doesn't <b>link</b>,
|
||||
<ul>
|
||||
<li>
|
||||
you've probably got the <b><tt>set bccdir </tt></b>command wrong</li>
|
||||
</ul>
|
||||
|
||||
<hr WIDTH="100%">
|
||||
<h2>
|
||||
To make the samples</h2>
|
||||
|
||||
<h3>
|
||||
Solution 1</h3>
|
||||
|
||||
<h4>
|
||||
<a href="http://biolpc22.york.ac.uk/wx/bc/download.html">Download</a> a zip file which contains modifed
|
||||
cpp, mak and bpr files - it will overwrite your wx distribution cpp files!</h4>
|
||||
|
||||
<h4>
|
||||
Solution 2</h4>
|
||||
Creating the files by hand . This is for the calendar sample; you will
|
||||
have to change the names for the other samples
|
||||
<ul>
|
||||
<li>
|
||||
Create a calendar.mak file [must have the same name as the cpp file] in
|
||||
a plain text editor with <a href="http://biolpc22.york.ac.uk/wx/bc/calendar.mak">this contents</a></li>
|
||||
</ul>
|
||||
<tt>#-----------------------------------------------------------------------------</tt>
|
||||
<br><tt>#this is for Borland CBuilder IDE v1 and 3</tt>
|
||||
<br><tt>#add a \ at the end of the lines if you editor breaks the long
|
||||
lines up</tt>
|
||||
<br><tt>#copy this into notepad and save from there</tt>
|
||||
<br><tt>#-----------------------------------------------------------------------------</tt>
|
||||
<br><tt>!ifndef BCB</tt>
|
||||
<br><tt>BCB = $(MAKEDIR)\..</tt>
|
||||
<br><tt>!endif</tt>
|
||||
<br><tt>PROJECT = calendar.exe</tt>
|
||||
<br><tt>OBJFILES =</tt>
|
||||
<br><tt>RESFILES = calendar.res</tt>
|
||||
<br><tt>RESDEPEN = $(RESFILES)</tt>
|
||||
<br><tt>LIBFILES =</tt>
|
||||
<br><tt>#-----------------------------------------------------------------------------</tt>
|
||||
<br><tt>CFLAG1 = -Od -v -a1 -c</tt>
|
||||
<br><tt># -Od disable optimisations -v debug -a1 byte align -c compile
|
||||
only (matches my make for the library)</tt>
|
||||
<br><tt>CFLAG2 = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32;__BIDE__;-I$(BCB)\include;$(BCB)\include\vcl;..\..\include;
|
||||
-H=BC32.CSM</tt>
|
||||
<br><tt>PFLAGS =</tt>
|
||||
<br><tt>RFLAGS = -DINC_OLE2;__WIN95__;__WXMSW__;__WINDOWS__;WIN32;__BIDE__;
|
||||
-I$(BCB)\include;..\..\include;</tt>
|
||||
<br><tt>LFLAGS = -L$(BCB)\lib;$(BCB)\lib\obj;..\..\lib -aa -Tpe -v -V4.0
|
||||
-c</tt>
|
||||
<br><tt>IFLAGS =</tt>
|
||||
<br><tt>LINKER = ilink32</tt>
|
||||
<br><tt>#-----------------------------------------------------------------------------</tt>
|
||||
<br><tt>ALLOBJ = c0w32.obj $(OBJFILES)</tt>
|
||||
<br><tt>ALLRES = $(RESFILES)</tt>
|
||||
<br><tt>ALLLIB = $(LIBFILES) vcl.lib xpm.lib wx32.lib ole2w32.lib import32.lib
|
||||
odbc32.lib cw32mt.lib</tt>
|
||||
<br><tt>#you will need to add other libraries to the line above, eg the
|
||||
jpeg.lib for image samples</tt>
|
||||
<br><tt>---------------------------------------------------------------------------</tt>
|
||||
<br><tt>.autodepend</tt>
|
||||
<br>
|
||||
<p><tt>#-----------------------------------------------------------------------------</tt>
|
||||
<br><tt>$(PROJECT): $(OBJFILES) $(RESDEPEN)</tt>
|
||||
<p><tt>#end of file</tt>
|
||||
<br>
|
||||
<ul>
|
||||
<li>
|
||||
modify the .cpp file to include these<a href="http://biolpc22.york.ac.uk/wx/bc/calendar_include.cpp">
|
||||
lines </a>near the top</li>
|
||||
</ul>
|
||||
<tt>#ifdef __BIDE__</tt>
|
||||
<br><tt>#define _NO_VCL</tt>
|
||||
<br><tt>#include "condefs.h"</tt>
|
||||
<br><tt>#define WinMain WinMain</tt>
|
||||
<br><tt> // USEUNIT ("another.cpp"); // use a line like this
|
||||
if you have more than one .cpp file</tt>
|
||||
<br><tt> USERC ("calendar.rc");</tt>
|
||||
<br><tt>#endif</tt>
|
||||
<br>
|
||||
<p>In CBuilder 1 you can use <b>Open Project</b> to open the mak file and
|
||||
edit/compile/debug.
|
||||
<br>In CBuilder 3 and 4, then you can use <b>Open Project </b>and choose
|
||||
the Open Borland CBuilder 1 Project from the drop down file types. The
|
||||
system will modify the mak file and update it for you.
|
||||
<p>Now try compiling it in the ide.
|
||||
<h4>
|
||||
Hints:</h4>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
You can set it up for normal and debug modes (change the -v switch in CFLAG1
|
||||
and LFLAG)</li>
|
||||
|
||||
<li>
|
||||
If you get problems saying Project undefined, then copy the text using
|
||||
a simple editor like notepad to the file minimal.mak (I have had problems
|
||||
in CBuilder 1.00 with Unix style line endings)</li>
|
||||
|
||||
<li>
|
||||
If you want to avoid the warnings about hiding virtual methods add <b><tt>-w-hid
|
||||
</tt></b>to the CFLAGS1 line</li>
|
||||
|
||||
<li>
|
||||
the #define WinMain WinMain line allows CBuilder to think it has a non-VCL
|
||||
<tt>main </tt>function</li>
|
||||
|
||||
<li>
|
||||
the USEUNIT macros tell CBuilder which other source files to include, without
|
||||
needing a VCL form</li>
|
||||
|
||||
<li>
|
||||
the condefs.h file defines the USEUNIT macros for non-VCL use</li>
|
||||
|
||||
<li>
|
||||
For the other samples, change the names of the cpp and rc files. If you
|
||||
have multiple files, just add more USEUNIT and USERC macros</li>
|
||||
</ul>
|
||||
|
||||
<h3>
|
||||
Solution 3</h3>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
download the wxWindows-2.1.15-bcb.zip file,</li>
|
||||
|
||||
<li>
|
||||
extract it</li>
|
||||
|
||||
<li>
|
||||
use the <b><tt>idetomak</tt></b> (CBuilder 1) or <b><tt>idetobpr</tt></b>
|
||||
(CBuilder 3/4) utility on the <b><tt>.ide</tt></b> file in the samples
|
||||
directory. This modifies the cpp source and makes a "suitable" bpr file
|
||||
(at least in CBuilder 1/3/4).</li>
|
||||
|
||||
<li>
|
||||
add the location of the wx/include files in the project | options
|
||||
| directory dialog</li>
|
||||
</ul>
|
||||
I found in CBuilder 1 that the <tt>idetomak</tt> utility did not manage
|
||||
to convert all the samples, but <tt>idetobpr</tt> worked OK in CBuilder
|
||||
3 and 4. I have a report that not all the bpr files made inb CBuilder 4
|
||||
are correct
|
||||
<h2>
|
||||
Error with ODBC32</h2>
|
||||
Sometimes you get an error saying that there are unreolved externals in
|
||||
ODBC. The soltuion is to run a command prompt in your <b><tt>wx\lib </tt></b>directory
|
||||
and use the <b><tt>implib </tt></b>command:
|
||||
<p><tt>C:\wx\lib><b>implib odbc32 c:\windows\system\odbc32.dll</b></tt>
|
||||
<p>This creates the necessary library, odbc32.lib
|
||||
<h2>
|
||||
Unresolved Problem</h2>
|
||||
<tt>In Borland CBuilder 1.00 (with linker service patch) I frequently
|
||||
get an error</tt>
|
||||
<p><tt>Turbo Incremental Link Version 1.0 Copyright (c) 1997 Borland
|
||||
International</tt>
|
||||
<br><tt>Fatal: Assertion failed: typeInx < typeCnt at "ilinkdbg.c",
|
||||
line 2060</tt>
|
||||
<br><tt>Fatal: Access violation. Program terminated.</tt>
|
||||
<br><tt>Error: Internal failure -- retrying link...</tt>
|
||||
<br><tt>Fatal: Assertion failed: typeInx < typeCnt at "ilinkdbg.c",
|
||||
line 2060</tt>
|
||||
<br><tt>Fatal: Access violation. Program terminated.</tt>
|
||||
<p><tt>** error 2 ** deleting minimal.exe</tt>
|
||||
<p>I have not been able to track down why sometimes this error occurs and
|
||||
other times it is OK
|
||||
<br>I have not seen this in Cbuilder 3 or 4
|
||||
<p>
|
||||
<hr WIDTH="100%">
|
||||
<p>Page updated on 31 May 2000 by Chris Elliott
|
||||
</body>
|
||||
</html>
|
66
docs/tech/tn0005.txt
Normal file
66
docs/tech/tn0005.txt
Normal file
@@ -0,0 +1,66 @@
|
||||
Adding a wxWindows contribution
|
||||
===============================
|
||||
|
||||
Here are some different kinds of contribution:
|
||||
|
||||
1. Bug fixes. You can send these to the wx-devel list.
|
||||
2. New classes. New classes normally go in the contrib hierarchy:
|
||||
please see below for more details. They may be promoted to
|
||||
the main wxWindows hierarchy if they are deemed to be 'core'.
|
||||
3. A utility application, such as a new dialog editor or
|
||||
file format conversion utility. If adding to the CVS
|
||||
archive, you may put it under the utils hierarchy,
|
||||
preferably with further src and docs directories.
|
||||
|
||||
You may or may not wish to add your code to the main wxWindows CVS
|
||||
archive. Whether your code is appropriate for this archive
|
||||
should first be ascertained by discussing it on wx-devel@wxwindows.org.
|
||||
|
||||
The contrib hierarchy
|
||||
---------------------
|
||||
|
||||
When contributing a new class or set of classes, please
|
||||
organise your files in the following hierarchy, so that
|
||||
when a user unarchives your contribution, it
|
||||
slots neatly into the existing source hierarchy.
|
||||
It also simplifies compilation for users, since wxWindows
|
||||
makefiles and project files are set up to search in
|
||||
contrib/include/wx and contrib/lib. For example, to
|
||||
include yourclass.h, the following directive is used:
|
||||
|
||||
#include "wx/yourclass/yourclass.h"
|
||||
|
||||
Here are the directories:
|
||||
|
||||
contrib/include/wx/yourclass/ ; Your header(s) go here
|
||||
contrib/src/yourclass/ ; Your source file(s) go here
|
||||
contrib/samples/yourclass/ ; Your sample(s) go here
|
||||
contrib/docs/latex/yourclass/ ; Your Latex doc sources go here
|
||||
contrib/docs/html/yourclass/ ; Your HTML doc files go here
|
||||
contrib/docs/htmlhelp/yourclass/ ; Your MS HTML Help doc files go here
|
||||
contrib/docs/htb/yourclass/ ; Your wxHTML doc files go here
|
||||
contrib/docs/pdf/yourclass/ ; Your PDF doc files go here
|
||||
contrib/docs/winhelp/yourclass/ ; Your WinHelp doc files go here
|
||||
|
||||
It is recommended that you produce a manual using Tex2RTF, as specified
|
||||
in Technical Note TN0003. This allows you to output all the above
|
||||
formats, though for PDF you will need Latex and Ghostscript or
|
||||
Word and Adobe Acrobat, and for MS HTML Help and WinHelp you need
|
||||
the appropriate (freely available) help compilers.
|
||||
|
||||
Your binary library files can go in the main lib directory or contrib/lib,
|
||||
but the main lib directory is recommended.
|
||||
|
||||
Please include a readme.txt in your source directory, and conform
|
||||
as much as possible to the coding guidelines specified on the web
|
||||
site in the 'Backroom' section. Include as many makefiles as
|
||||
possible for different compilers.
|
||||
|
||||
Your archive can be in .tgz or .zip format. For inclusion on
|
||||
the wxWindows ftp site and CD-ROM, please send your submission to
|
||||
Julian Smart <julian@wxwindows.org> as a binary attachment.
|
||||
An entry will be added to the Contributions web page.
|
||||
|
||||
Author: Julian Smart
|
||||
Version: $Id$
|
||||
|
41
docs/tech/tn0006.txt
Normal file
41
docs/tech/tn0006.txt
Normal file
@@ -0,0 +1,41 @@
|
||||
How to make RPMs of the wxWindows sources
|
||||
=========================================
|
||||
|
||||
This is just a short description. It is assumed that you know what you are
|
||||
doing. I do not take any responsibility for damaged systems, use at your own
|
||||
risk!
|
||||
|
||||
1. Extract the archive in a temporary directory. Since you are
|
||||
reading this text, you already have done this.
|
||||
2. Copy the .spec file to
|
||||
(rpm-dir)/SPECS
|
||||
3. Copy the .tgz file to
|
||||
(rpm-dir)/SOURCES
|
||||
4. Start the RPM manager with
|
||||
rpm -bb (rpm-dir)/SPECS/(.spec-file)
|
||||
or with
|
||||
rpm -ba (rpm-dir)/SPECS/(.spec-file)
|
||||
(the latter also builds the .src.rpm-file)
|
||||
5. You now have a nice set of RPMs in (rpm-dir)/RPMS
|
||||
|
||||
Example
|
||||
=======
|
||||
|
||||
Here's how to install e.g. wxMotif 2.1.14:
|
||||
|
||||
cp wxMotif.spec /usr/src/packages/SPECS
|
||||
cp wxMotif-2.1.14.tgz /usr/src/packages/SOURCES
|
||||
rpm -bb /usr/src/packages/SPECS/wxMotif.spec
|
||||
|
||||
Install the resulting packages with
|
||||
|
||||
rpm --install /usr/src/packages/RPMS/i386/wxMotif-2.1.14-0.i386.rpm
|
||||
rpm --install /usr/src/packages/RPMS/i386/wxMotif-devel-2.1.14-0.i386.rpm
|
||||
rpm --install /usr/src/packages/RPMS/i386/wxMotif-gl-2.1.14-0.i386.rpm
|
||||
|
||||
|
||||
|
||||
That's all. You should now have a working wxWindows library.
|
||||
|
||||
Regards,
|
||||
Robert Fendt
|
82
docs/tech/tn0007.txt
Normal file
82
docs/tech/tn0007.txt
Normal file
@@ -0,0 +1,82 @@
|
||||
Using and modifying the BC++ IDE files
|
||||
======================================
|
||||
|
||||
Readme for wxWindows 2.0 Ide-files
|
||||
First release Feb. 1999, detlev@reymann-online.de
|
||||
|
||||
1. What you can do with the BC++ IDE files
|
||||
2. Where to install the files
|
||||
3. How to modify them for your own needs
|
||||
4. How to create IDE files for your own wxWindows-programs
|
||||
|
||||
1. What you can do with the IDE files
|
||||
=====================================
|
||||
|
||||
There are two IDE files. src\bc32.ide should help you to
|
||||
create the wxWindows libraries from within the Ide of Borlands
|
||||
C++, v. 5.x. Note that this doesn't include debugging code: you
|
||||
need to change the settings if you wish to include debug
|
||||
information. Previously, bc32d.ide was supplied with debug
|
||||
settings, but this proved to time-consuming to maintain.
|
||||
|
||||
2. Where to install the files
|
||||
=============================
|
||||
|
||||
You should copy the files for the libraries into the
|
||||
src-directory of your wxWindows-Installation (e.g. C:\wxwin\src).
|
||||
And the other file for the samples should be copied into the
|
||||
samples-directory (e.g. C:\wxwin\samples).
|
||||
|
||||
(If installing from setup.exe or wx2..._bc.zip the files
|
||||
will be installed into the appropriate directories
|
||||
automatically).
|
||||
|
||||
3. How to modify them for your own needs
|
||||
========================================
|
||||
|
||||
If your wxWindows-Installation resides on the same drive as your
|
||||
Borland-Compiler and additionally the Borland-Installation is
|
||||
the default (e.g. C:\BC5) then there should be no need to change
|
||||
anything. Otherwise please change the path from within the ide
|
||||
(Options->project->directories). Because we use the
|
||||
$inherit-macro (Julian found the trick), this should work.
|
||||
|
||||
To add a new sample to samples\bc32.ide, follow these steps:
|
||||
|
||||
1. Choose Project->New target... and type in e.g.
|
||||
samples\newsample. Press OK.
|
||||
2. Static, no OWL, MFC or class libraries. Check Multithread
|
||||
on. Press OK.
|
||||
3. Right-click on the new node, choose Add node... and add
|
||||
..\lib\wx32.lib and ..\lib\xpm.lib. Add any other source
|
||||
files you require.
|
||||
4. Right-click on the new node, choose Edit Local Options.. and
|
||||
add in Directories, specify the following:
|
||||
|
||||
Include: $inherit;.\newsample
|
||||
Library: $inherit;
|
||||
Source: .\newsample
|
||||
Intermediate: .\newsample
|
||||
Final: .\newsample
|
||||
|
||||
4. How to create IDE files for your own wxWindows-programs
|
||||
==========================================================
|
||||
|
||||
If you want to create an IDE file for your own wxWindows program,
|
||||
please follow these steps.
|
||||
|
||||
1. Create a new project from the menu file->new->project.
|
||||
2. Deactivate all the standard-options, the only three things
|
||||
that should be activated are "static" for the libraries,
|
||||
the checkbox OLE (you can leave this checkbox unchecked,
|
||||
but then you have to add the library \bc5\lib\ole2w32.lib
|
||||
to your project), and the Multithread checkbox.
|
||||
3. Add the include-path of wxWindows to the include-path in the
|
||||
options-dialog (options->project->directories->include). The
|
||||
result should be something like:
|
||||
path_of_my_program;\bc5\include;\wxwin2\include;
|
||||
4. Add the libraries to the project. Open the project-view and
|
||||
activate your program. Then right-click and choose "add" and
|
||||
select the wxWindows library (e.g. \wxwin\lib\wx32.lib). Also
|
||||
add the xpm library.
|
||||
|
144
docs/tech/tn0008.htm
Normal file
144
docs/tech/tn0008.htm
Normal file
@@ -0,0 +1,144 @@
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>How to learn wxWindows programming</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#FF0000 VLINK=#000000>
|
||||
|
||||
<font face="Arial, Lucida Sans, Helvetica">
|
||||
|
||||
<a name="top"></a>
|
||||
|
||||
<table align=center width=100% border=4 cellpadding=5 cellspacing=0>
|
||||
<tr>
|
||||
<td bgcolor="#660000" align=left colspan=2>
|
||||
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
|
||||
How to learn wxWindows programming
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<P>
|
||||
|
||||
The following is a response by Edward Ream to a common question,
|
||||
"What's the best way to learn wxWindows [and C++]?".<P>
|
||||
|
||||
Date: Sun, 04 Jun 2000 14:37:06 -0500<BR>
|
||||
From: "Edward K. Ream" <edream@tds.net> <BR>
|
||||
To: wx-users@wxwindows.org<BR>
|
||||
Subject: Re: [wx-users] How to learn using wx-windows <BR>
|
||||
Reply-To: wx-users@wxwindows.org<P>
|
||||
|
||||
> Reading the Linux Journal article on wxpython, and having used wxclips<BR>
|
||||
> I got interested in wxwindows as a development interface. However, the<BR>
|
||||
> programming experience I got is old, and from a former generation (For-<BR>
|
||||
> tran). I'd like to refresh my experience and start in C++. Will<BR>
|
||||
> wx-windows be a very high step to take?<P>
|
||||
|
||||
I'm new to wxWindows myself, but I'd like to answer this question
|
||||
anyway. In the past two years I've learned two similar frameworks
|
||||
(Apple's Yellow Box, aka NextStep/OpenStep and Borland's C++
|
||||
Builder/Delphi) and last year I became a C++ enthusiast after 20 years
|
||||
of using C.<P>
|
||||
|
||||
<B>About C++.</B><P>
|
||||
|
||||
The major Aha for me was that the complexity of C++ doesn't matter in
|
||||
practice. What _does_ matter is that C++ allows you to do simple things
|
||||
simply, more simply than C. With a system like wxWindows you will be
|
||||
creating objects and then using those objects to call methods. So don't
|
||||
be afraid of C++: you'll only be using the easy tip of the
|
||||
iceberg.<P>
|
||||
|
||||
Besides the C++ Programming Language, by Bjarne Stroustrup, the
|
||||
"official" guide to C++, I highly recommend Inside the C++ Object Model,
|
||||
by Stanley B. Lippman. (Lipmann was one of the C++ honchos at Bell
|
||||
Labs.) This book will tell you what _not_ to do, as well as why
|
||||
everything in C++ is as it is. If you are confused by anything in C++,
|
||||
Lippman's book is the cure.<P>
|
||||
|
||||
<B>About applications frameworks.</B><P>
|
||||
|
||||
Application frameworks such as wxWindows are organized around a set of
|
||||
cooperating classes. Take a look at the main application class, wxApp,
|
||||
some frame and panel classes, graphics classes, menu classes, control
|
||||
classes, etc. In general, to do anything in a framework involves
|
||||
creating an object of the specified type, then doing something with that
|
||||
object.<P>
|
||||
|
||||
For example, suppose you want to create a menu bar. A menu bar is
|
||||
composed of a single menu bar object of type(class) wxMenuBar that
|
||||
contains menu objects of type wxMenu. Each menu object contains menu
|
||||
item objects of type wxMenuItem. So you create the menu bar object,
|
||||
then create all the menu objects (creating the menu item objects along
|
||||
the way) and finally "attach" the menu objects to the menu bar object
|
||||
using a call to the wxMenuBar::Append method.<P>
|
||||
|
||||
As an overview I would look at the "Alphabetical class reference"
|
||||
section of the reference manual. I find the HTML version to be the
|
||||
easiest to use: you can browse very quickly through it. Here's how to
|
||||
read this (very large) reference:<P>
|
||||
|
||||
<ol>
|
||||
<li>Get an overview of the kinds of classes involved. The class names
|
||||
will tell you a lot about what each class does. Open some of the
|
||||
classes, in particular, wxApp (the main application object), wxFrame,
|
||||
wxControl (the base class for all controls) and one or two controls,
|
||||
like wxButton.
|
||||
|
||||
<li>When scanning a class for the first several times, read the
|
||||
introductory remarks and quickly scan the list of methods of the class
|
||||
to get a general idea about what kinds of operations can be done to
|
||||
objects of the class. You are not looking for detail at this stage,
|
||||
just for the big picture. In particular, what classes exist and how do
|
||||
they work together.
|
||||
|
||||
<li>Pay particular attention to the classes from which a class is
|
||||
derived. For example, a button (an object of type wxButton) is derived
|
||||
from the wxControl, wxWindow, wxEvtHandler and wxObject classes. What
|
||||
does this mean? It means that a button _is_ a control, and a button
|
||||
_is_ a window, and a button _is_ an event handler and a button _is_ an
|
||||
object. So you must understand the parent classes of an object to
|
||||
understand the object itself.
|
||||
|
||||
For example, if b is a button you can invoke b.m for any of method m of
|
||||
the wxControl, wxWindow, wxEvtHandler or wxObject classes. You are not
|
||||
limited to just the methods of wxButton! This is one of the keys of
|
||||
object oriented programming.
|
||||
</ol>
|
||||
|
||||
Some other tips:<P>
|
||||
|
||||
Read some sample code. You will find that almost none of the C++
|
||||
language is actually being used; it's just endlessly creating objects
|
||||
and then calling methods using those objects.<P>
|
||||
|
||||
Learn as much as you can about the String class; after using a good
|
||||
String class you'll never want to use C's string functions again.
|
||||
wxWindows contains other nifty utilty classes as well.<P>
|
||||
|
||||
The application class, wxApp, contains the main event loop. Learn about
|
||||
event handling and event tables (reading sample code will help). Almost
|
||||
everything in this kind of application framework happens as the result
|
||||
of an event and your app is essentially doing nothing but responding to
|
||||
events. Having the event loop written for you is a major, major
|
||||
benefit.<P>
|
||||
|
||||
I hope this helps. Perhaps we can work together in learning about
|
||||
wxWindows. Please feel free to ask me any questions you might have. If
|
||||
I've made any blunders in this posting I hope the wxWindows experts will
|
||||
correct me gently.<P>
|
||||
|
||||
Edward<BR>
|
||||
--------------------------------------------------------------------<BR>
|
||||
Edward K. Ream email: edream@tds.net<BR>
|
||||
Leo: Literate Editor with Outlines<BR>
|
||||
Leo: http://personalpages.tds.net/~edream/front.html<BR>
|
||||
--------------------------------------------------------------------<P>
|
||||
|
||||
</font>
|
||||
|
||||
</body>
|
||||
</html>
|
60
docs/tech/tn0009.htm
Normal file
60
docs/tech/tn0009.htm
Normal file
@@ -0,0 +1,60 @@
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Creating and converting icons</TITLE>
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#FF0000 VLINK=#000000>
|
||||
|
||||
<font face="Arial, Lucida Sans, Helvetica">
|
||||
|
||||
<a name="top"></a>
|
||||
|
||||
<table align=center width=100% border=4 cellpadding=5 cellspacing=0>
|
||||
<tr>
|
||||
<td bgcolor="#660000" align=left colspan=2>
|
||||
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#FFFFFF">
|
||||
Creating and converting icons
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<P>
|
||||
|
||||
Icons are bitmaps that may contain transparency information. Under X, icons are
|
||||
usually created from XPM files, which may be loaded from a file or created from
|
||||
data embedded in a C++ source file.<P>
|
||||
|
||||
Under Windows, icon files (extension .ico) may contain multiple icons for different sizes and colour
|
||||
depths, and can be loaded from a file or loaded from the Windows resources compiled
|
||||
into the executable.<P>
|
||||
|
||||
You can decide to use only XPMs on Windows and Unix, or you could use XPMs on Unix and
|
||||
Windows icons under Windows -- the latter will require some #idefs in your code or use of the wxICON macro.<P>
|
||||
|
||||
If you are using a compiler such as Borland C++, Visual C++ or Watcom C++, you
|
||||
can use the provided icon editor. However, if using Cygwin or Mingw32, there
|
||||
is no icon editor so you must obtain one separately, such as <a href="http://hotfiles.zdnet.com/cgi-bin/texis/swlib/hotfiles/info.html?fcode=00165P">IconEdit32</a>.<P>
|
||||
|
||||
To convert from XPM to BMP (which can be loaded or pasted into an icon editor to save as an ICO file),
|
||||
you can use Vadim Zeitlin's <a href="ftp://www.remstar.com/pub/wxwin/support/xpm2bmp.exe">xpm2bmp.exe</a> utility.
|
||||
To convert from BMP to XPM, you can use <a href="ftp://www.remstar.com/pub/wxwin/support/bmp2xpm.exe">bmp2xpm.exe</a>
|
||||
which is actually the old wxWindows 1.68 utility, xpmshow. You will have to edit the resulting
|
||||
file since the full path is used as the variable name, plus you may wish to specify a transparent colour e.g.:<P>
|
||||
|
||||
<pre>
|
||||
" s None c None",
|
||||
</pre>
|
||||
|
||||
This will indicate that the space character will be taken as the transparent colour throughout the image.<P>
|
||||
|
||||
<!--
|
||||
Author: JS
|
||||
Version: $Id$
|
||||
-->
|
||||
|
||||
</font>
|
||||
|
||||
</body>
|
||||
</html>
|
282
docs/tech/tn0010.htm
Normal file
282
docs/tech/tn0010.htm
Normal file
@@ -0,0 +1,282 @@
|
||||
<HTML>
|
||||
|
||||
<HEAD>
|
||||
<TITLE>Compiling wxWindows applications in the VC++ IDE</TITLE>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#FF0000 VLINK=#000000>
|
||||
|
||||
<font face="Arial, Lucida Sans, Helvetica">
|
||||
|
||||
<a name="top"></a>
|
||||
|
||||
<table width=100% border=0 cellpadding=5 cellspacing=0>
|
||||
<tr>
|
||||
<td bgcolor="#C4ECF9">
|
||||
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#000000">
|
||||
Compiling wxWindows applications in the VC++ IDE
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<P>
|
||||
|
||||
<CENTER>
|
||||
<a href="#wxwin2">Settings for wxWindows 2</a> / <a href="#wxwin1">Settings for wxWindows 1.68</a>
|
||||
</CENTER>
|
||||
|
||||
<P>
|
||||
|
||||
To compile wxWindows samples and applications using the VC++ 5.0 or 6.0 IDE (having compiled wxWindows
|
||||
using the makefile or project file provided), the following
|
||||
steps and settings should be used.<P>
|
||||
|
||||
<H2>Steps</H2>
|
||||
|
||||
<ol>
|
||||
<li>Create a new WIN32 Application project.
|
||||
<li>Add the .cpp and .rc files for your project.
|
||||
<li>Apply the settings listed below to the project, replacing c:\wx2 with your wxWindows
|
||||
installation path.
|
||||
</ol>
|
||||
|
||||
<P>
|
||||
|
||||
<H2><a name="wxwin2">Settings for wxWindows 2</a></H2>
|
||||
|
||||
These settings apply to wxWindows 2.1.14 and above.<P>
|
||||
|
||||
<DL>
|
||||
<DT><B>General</B><DD>
|
||||
The <B>Output files</B> and <B>Intermediate files</B> directory fields should be Debug
|
||||
for the Debug configuration, and Release for the Release configuration.<P>
|
||||
|
||||
<DT><B>Debug: General</B><DD>
|
||||
The <B>Executable for debug sessions</B> field should be altered to be the path and name
|
||||
you'd expect (it may have generated a different name).<P>
|
||||
|
||||
<DT><B>C/C++: Preprocessor</B><DD>
|
||||
The <B>Preprocessor definitions</B> field should contain the following symbols for Debug:<P>
|
||||
|
||||
<PRE>
|
||||
WIN32,_DEBUG,_WINDOWS,__WINDOWS__,__WXMSW__,__WXDEBUG__,WXDEBUG=1,
|
||||
__WIN95__,__WIN32__,WINVER=0x0400,STRICT
|
||||
</PRE>
|
||||
<P>
|
||||
and these for Release:<P>
|
||||
|
||||
<PRE>
|
||||
NDEBUG,WIN32,_WINDOWS,__WINDOWS__,__WXMSW__,__WIN95__,__WIN32__,
|
||||
WINVER=0x0400,STRICT</PRE>
|
||||
<P>
|
||||
The <B>Additional include directories</B> field should contain the following:<P>
|
||||
<PRE>
|
||||
c:\wx2\include,c:\wx2\contrib\include
|
||||
</PRE>
|
||||
<P>(and of couse any other directories you wish to use in your project).<P>
|
||||
|
||||
<DT><B>C/C++: Precompiled Headers</B><DD>
|
||||
|
||||
The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
|
||||
button should be selected.<P>
|
||||
|
||||
<DT><B>C/C++: Code Generation</B><DD>
|
||||
|
||||
The <B>Use run-time library</B> control should be set to <B>Debug Multithreaded DLL</B> (Debug)
|
||||
or <B>Multithreaded DLL</B> (Release).<P>
|
||||
|
||||
<DT><B>Link: Input</B><DD>
|
||||
|
||||
The <B>Object/library modules</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
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
|
||||
winmm.lib wxd.lib xpmd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib
|
||||
</PRE>
|
||||
|
||||
for the Debug configuration and
|
||||
|
||||
<PRE>
|
||||
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
|
||||
winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib
|
||||
</PRE>
|
||||
|
||||
for the Release configuration.<P>
|
||||
|
||||
The <B>Ignore libraries</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
libcd.lib,libcid.lib,msvcrt.lib
|
||||
</PRE>
|
||||
|
||||
for the Debug configuration and
|
||||
|
||||
<PRE>
|
||||
libc.lib,libci.lib,msvcrtd.lib
|
||||
</PRE>
|
||||
|
||||
for the Release configuration.<P>
|
||||
|
||||
The <B>Additional library path</B> field should contain
|
||||
|
||||
<PRE>
|
||||
c:\wx2\lib,c:\wx2\contrib\lib
|
||||
</PRE>
|
||||
|
||||
for both Debug and Release configurations.
|
||||
|
||||
<P>
|
||||
|
||||
<DT><B>Resources</B><DD>
|
||||
|
||||
Select your .rc file. The <B>Additional resource include directories</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
c:\wx2\include;c:\wx2\contrib\include
|
||||
</PRE>
|
||||
|
||||
</DL>
|
||||
|
||||
<HR>
|
||||
|
||||
<H2><a name="wxwin1">Settings for wxWindows 1.68</a></H2>
|
||||
|
||||
Note: these have not yet been checked.<P>
|
||||
|
||||
<DL>
|
||||
<DT><B>Debug: General</B><DD>
|
||||
The <B>Executable for debug sessions</B> field should be altered to be the path and name
|
||||
you'd expect (it may have generated a different name).<P>
|
||||
|
||||
<DT><B>General</B><DD>
|
||||
The <B>Output directories</B> fields can be made blank if you want the objects
|
||||
and executable to be created in the project directory and not a subdirectory.<P>
|
||||
|
||||
<DT><B>C/C++: Preprocessor</B><DD>
|
||||
The <B>Preprocessor definitions</B> field should contain the following symbols:<P>
|
||||
<PRE>
|
||||
WIN32,_DEBUG,_WINDOWS,wx_msw,DEBUG=1,WIN95=1,WINVER=0x0400,STRICT
|
||||
</PRE>
|
||||
<P>
|
||||
The <B>Additional include directories</B> field should contain the following:<P>
|
||||
<PRE>
|
||||
../../include/base,../../include/msw
|
||||
</PRE>
|
||||
<P>(and of couse any other directories you wish to use in your project).<P>
|
||||
|
||||
<DT><B>C/C++: Precompiled Headers</B><DD>
|
||||
|
||||
The <B>Not using precompiled headers</B> or <B>Automatic use of precompiled headers</B>
|
||||
button should be selected (I can't find a way of using the wxWindows PCH file).<P>
|
||||
|
||||
<DT><B>C/C++: Code Generation</B><DD>
|
||||
|
||||
The <B>Use run-time library</B> control should be set to <B>Multithreaded DLL</B>. This
|
||||
sets the compiler switch to /MD to match the wxWindows makefile.<P>
|
||||
|
||||
<DT><B>Link: Input</B><DD>
|
||||
|
||||
The <B>Object/library modules</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
|
||||
shell32.lib odbc32.lib odbccp32.lib comctl32.lib
|
||||
../../lib/wx.lib ../../src/msw/dummy.obj
|
||||
</PRE>
|
||||
|
||||
The <B>Ignore libraries</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
libcd.lib,libcid.lib
|
||||
</PRE>
|
||||
|
||||
<P>
|
||||
|
||||
<DT><B>Resources</B><DD>
|
||||
|
||||
Select your .rc file. The <B>Additional resource include directories</B> field should contain:
|
||||
|
||||
<PRE>
|
||||
..\..\include\msw;..\..\contrib\fafa
|
||||
</PRE>
|
||||
|
||||
</DL>
|
||||
|
||||
<P>
|
||||
|
||||
<!--
|
||||
<PRE>
|
||||
From: "Chris Breeze" <chris@hel.co.uk>
|
||||
To: <wxwin-users@wx.dent.med.uni-muenchen.de>
|
||||
Subject: Re: Compiling 2.0 wxWin Apps in the VC IDE
|
||||
Date: Wed, 20 May 1998 14:18:02 +0100
|
||||
|
||||
First the apology: the description below is for wx1.68
|
||||
not for wx2.0 - sorry if I confused everybody.
|
||||
|
||||
Anyway, third time lucky I hope! The settings for
|
||||
VC++ 5.0, wx2.0 beta 8, NT Workstation 4.0 sp3
|
||||
are:
|
||||
|
||||
In project / settings / C/C++:
|
||||
Add "__WINDOWS__" to the pre-processor definitions
|
||||
Add "{wx}\include" to the additional include directories
|
||||
where {wx} is the directory in which wx is installed
|
||||
|
||||
In project / settings / Resources:
|
||||
add "{wx}\include" to the additional resource include directories
|
||||
|
||||
In project / settings / Link:
|
||||
Add "wx.lib comctl32.lib dummy.obj" to the Object/Library modules
|
||||
|
||||
Add "libcd.lib,libcid.lib" to ignore libraries (under the "input" category)
|
||||
|
||||
Add "{wx}\lib,{wx}\src\msw" to the additional library path
|
||||
|
||||
I have tested these settings on samples/minimal and can
|
||||
build exes which can be debugged using Developer Studio.
|
||||
|
||||
I hope I've finally answered the original question. (Next time
|
||||
I'll read the question more carefully!).
|
||||
|
||||
Regards,
|
||||
Chris
|
||||
|
||||
Original message (settings for wx1.68c):
|
||||
) Try the following (tested with VC++ 5 on NT4):
|
||||
)
|
||||
) Create a new Win32 Application project and insert the source files
|
||||
) (including .rc files).
|
||||
)
|
||||
) In project / settings / C/C++:
|
||||
) Add wx_msw to the pre-processor definitions
|
||||
) add {wx}\include\base,{wx}\include\msw to the additional include
|
||||
directories
|
||||
) where {wx} is the directory in which wx is installed
|
||||
)
|
||||
) In project / settings / Resources:
|
||||
) add {wx}\include\msw;{wx}\contrib\fafa to the additional resource include
|
||||
) directories
|
||||
)
|
||||
) In project / settings / Link:
|
||||
) Add comctl32.lib wx.lib dummy.obj ctl3d32.lib to the Object/Library modules
|
||||
)
|
||||
) Add libc to ignore libraries (under the "input" category)
|
||||
)
|
||||
) Add {wx}\lib,{wx}\src\msw to the additional library path
|
||||
)
|
||||
) These settings are for a debug build. You can use the same settings for
|
||||
) a release build apart from ignoring libc.
|
||||
|
||||
</PRE>
|
||||
-->
|
||||
|
||||
</font>
|
||||
|
||||
</BODY>
|
||||
|
||||
</HTML>
|
Reference in New Issue
Block a user