Various wxMotif fixes. Changed rotate sample to use a wxScrolledWindow
instead of the frame, so it works on wxMotif. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7420 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,6 +25,7 @@ distrib/msw/*.bat
|
|||||||
distrib/msw/*.cpp
|
distrib/msw/*.cpp
|
||||||
distrib/msw/*.txt
|
distrib/msw/*.txt
|
||||||
distrib/msw/tardist
|
distrib/msw/tardist
|
||||||
|
distrib/msw/tarwxmotif
|
||||||
distrib/msw/tmake/*.t
|
distrib/msw/tmake/*.t
|
||||||
distrib/msw/tmake/Makefile
|
distrib/msw/tmake/Makefile
|
||||||
distrib/msw/tmake/filelist.txt
|
distrib/msw/tmake/filelist.txt
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
# Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver)
|
# Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver)
|
||||||
|
|
||||||
init=""
|
init=""
|
||||||
|
WXVER=2.1.16
|
||||||
if [ $1 = "" ]
|
if [ $1 = "" ]
|
||||||
then
|
then
|
||||||
exit
|
exit
|
||||||
@@ -24,56 +25,55 @@ cd $1
|
|||||||
echo Removing backup files...
|
echo Removing backup files...
|
||||||
rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~
|
rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~
|
||||||
|
|
||||||
rm -f $2/wx200*.tgz
|
rm -f $2/wx${WXVER}*.tgz
|
||||||
rm -f $2/tex2rtf2.tgz
|
rm -f $2/tex2rtf2.tgz
|
||||||
rm -f $2/ogl3.tgz
|
rm -f $2/ogl3.tgz
|
||||||
rm -f $2/treedraw.tar.gz
|
|
||||||
rm -f $2/glcanvas.tar.gz
|
|
||||||
rm -f $2/jpeg.tgz
|
rm -f $2/jpeg.tgz
|
||||||
|
rm -f $2/tiff.tgz
|
||||||
|
|
||||||
echo Tarring...
|
echo Tarring...
|
||||||
|
|
||||||
### Generic
|
### Generic
|
||||||
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgen.txt
|
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgen.txt
|
||||||
tar cvf $2/wx200gen.tar -T /tmp/wxgen.txt
|
tar cvf $2/wx${WXVER}gen.tar -T /tmp/wxgen.txt
|
||||||
gzip $2/wx200gen.tar
|
gzip $2/wx${WXVER}gen.tar
|
||||||
mv $2/wx200gen.tar.gz $2/wx200gen.tgz
|
mv $2/wx${WXVER}gen.tar.gz $2/wx${WXVER}gen.tgz
|
||||||
|
|
||||||
### wxGTK
|
### wxGTK
|
||||||
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/gtk.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgtk.txt
|
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/gtk.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxgtk.txt
|
||||||
tar cvf $2/wx200gtk.tar -T /tmp/wxgtk.txt
|
tar cvf $2/wx${WXVER}gtk.tar -T /tmp/wxgtk.txt
|
||||||
gzip $2/wx200gtk.tar
|
gzip $2/wx${WXVER}gtk.tar
|
||||||
mv $2/wx200gtk.tar.gz $2/wx200gtk.tgz
|
mv $2/wx${WXVER}gtk.tar.gz $2/wx${WXVER}gtk.tgz
|
||||||
|
|
||||||
### wxMotif
|
### wxMotif
|
||||||
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/motif.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxmotif.txt
|
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/motif.rsp $1/distrib/msw/makefile.rsp` > /tmp/wxmotif.txt
|
||||||
tar cvf $2/wx200mot.tar -T /tmp/wxmotif.txt
|
tar cvf $2/wx${WXVER}mot.tar -T /tmp/wxmotif.txt
|
||||||
gzip $2/wx200mot.tar
|
gzip $2/wx${WXVER}mot.tar
|
||||||
mv $2/wx200mot.tar.gz $2/wx200mot.tgz
|
mv $2/wx${WXVER}mot.tar.gz $2/wx${WXVER}mot.tgz
|
||||||
|
|
||||||
### Doc sources
|
### Doc sources
|
||||||
ls `cat $1/distrib/msw/docsrc.rsp` > /tmp/docsrc.txt
|
ls `cat $1/distrib/msw/docsrc.rsp` > /tmp/docsrc.txt
|
||||||
tar cvf $2/wx200doc.tar -T /tmp/docsrc.txt
|
tar cvf $2/wx${WXVER}doc.tar -T /tmp/docsrc.txt
|
||||||
gzip $2/wx200doc.tar
|
gzip $2/wx${WXVER}doc.tar
|
||||||
mv $2/wx200doc.tar.gz $2/wx200doc.tgz
|
mv $2/wx${WXVER}doc.tar.gz $2/wx${WXVER}doc.tgz
|
||||||
|
|
||||||
### HTML docs
|
### HTML docs
|
||||||
ls `cat $1/distrib/msw/wx_html.rsp` > /tmp/html.txt
|
ls `cat $1/distrib/msw/wx_html.rsp` > /tmp/html.txt
|
||||||
tar cvf $2/wx200htm.tar -T /tmp/html.txt
|
tar cvf $2/wx${WXVER}htm.tar -T /tmp/html.txt
|
||||||
gzip $2/wx200htm.tar
|
gzip $2/wx${WXVER}htm.tar
|
||||||
mv $2/wx200htm.tar.gz $2/wx200htm.tgz
|
mv $2/wx${WXVER}htm.tar.gz $2/wx${WXVER}htm.tgz
|
||||||
|
|
||||||
### PDF docs
|
### PDF docs
|
||||||
ls `cat $1/distrib/msw/wx_pdf.rsp` > /tmp/pdf.txt
|
ls `cat $1/distrib/msw/wx_pdf.rsp` > /tmp/pdf.txt
|
||||||
tar cvf $2/wx200pdf.tar -T /tmp/pdf.txt
|
tar cvf $2/wx${WXVER}pdf.tar -T /tmp/pdf.txt
|
||||||
gzip $2/wx200pdf.tar
|
gzip $2/wx${WXVER}pdf.tar
|
||||||
mv $2/wx200pdf.tar.gz $2/wx200pdf.tgz
|
mv $2/wx${WXVER}pdf.tar.gz $2/wx${WXVER}pdf.tgz
|
||||||
|
|
||||||
### Stubs files
|
### Stubs files
|
||||||
ls `cat $1/distrib/msw/stubs.rsp` > /tmp/stubs.txt
|
ls `cat $1/distrib/msw/stubs.rsp` > /tmp/stubs.txt
|
||||||
tar cvf $2/wx200stubs.tar -T /tmp/stubs.txt
|
tar cvf $2/wx${WXVER}stubs.tar -T /tmp/stubs.txt
|
||||||
gzip $2/wx200stubs.tar
|
gzip $2/wx${WXVER}stubs.tar
|
||||||
mv $2/wx200stubs.tar.gz $2/wx200stubs.tgz
|
mv $2/wx${WXVER}stubs.tar.gz $2/wx${WXVER}stubs.tgz
|
||||||
|
|
||||||
### Tex2RTF
|
### Tex2RTF
|
||||||
ls `cat $1/distrib/msw/tex2rtf.rsp` > /tmp/tex2rtf.txt
|
ls `cat $1/distrib/msw/tex2rtf.rsp` > /tmp/tex2rtf.txt
|
||||||
@@ -87,22 +87,16 @@ tar cvf $2/ogl3.tar -T /tmp/ogl.txt
|
|||||||
gzip $2/ogl3.tar
|
gzip $2/ogl3.tar
|
||||||
mv $2/ogl3.tar.gz $2/ogl3.tgz
|
mv $2/ogl3.tar.gz $2/ogl3.tgz
|
||||||
|
|
||||||
### wxGLCanvas
|
|
||||||
ls `cat $1/distrib/msw/glcanvas.rsp` > /tmp/glcanvas.txt
|
|
||||||
tar cvf $2/glcanvas.tar -T /tmp/glcanvas.txt
|
|
||||||
gzip $2/glcanvas.tar
|
|
||||||
mv $2/glcanvas.tar.gz $2/glcanvas.tgz
|
|
||||||
|
|
||||||
### wxTreeLayout
|
|
||||||
ls `cat $1/distrib/msw/wxtree.rsp` > /tmp/wxtree.txt
|
|
||||||
tar cvf $2/treedraw.tar -T /tmp/wxtree.txt
|
|
||||||
gzip $2/treedraw.tar
|
|
||||||
mv $2/treedraw.tar.gz $2/treedraw.tgz
|
|
||||||
|
|
||||||
### JPEG
|
### JPEG
|
||||||
ls `cat $1/distrib/msw/jpeg.rsp` > /tmp/jpeg.txt
|
ls `cat $1/distrib/msw/jpeg.rsp` > /tmp/jpeg.txt
|
||||||
tar cvf $2/jpeg.tar -T /tmp/jpeg.txt
|
tar cvf $2/jpeg.tar -T /tmp/jpeg.txt
|
||||||
gzip $2/jpeg.tar
|
gzip $2/jpeg.tar
|
||||||
mv $2/jpeg.tar.gz $2/jpeg.tgz
|
mv $2/jpeg.tar.gz $2/jpeg.tgz
|
||||||
|
|
||||||
|
### TIFF
|
||||||
|
ls `cat $1/distrib/msw/tiff.rsp` > /tmp/tiff.txt
|
||||||
|
tar cvf $2/tiff.tar -T /tmp/tiff.txt
|
||||||
|
gzip $2/tiff.tar
|
||||||
|
mv $2/tiff.tar.gz $2/tiff.tgz
|
||||||
|
|
||||||
echo Done!
|
echo Done!
|
||||||
|
91
distrib/msw/tarwxmotif
Normal file
91
distrib/msw/tarwxmotif
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# tardist: make up a tar.gz distribution of wxWindows 2
|
||||||
|
# Supply a source (e.g. ~/wx2) and destination (e.g. ~/wx2/deliver)
|
||||||
|
|
||||||
|
init=""
|
||||||
|
WXVER=2.1.16
|
||||||
|
if [ $1 = "" ]
|
||||||
|
then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $2 = "" ]
|
||||||
|
then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo About to archive wxWindows:
|
||||||
|
echo From $1
|
||||||
|
echo To $2
|
||||||
|
echo CTRL-C if this is not correct.
|
||||||
|
read dummy
|
||||||
|
|
||||||
|
cd $1
|
||||||
|
|
||||||
|
echo Removing backup files...
|
||||||
|
rm *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~
|
||||||
|
|
||||||
|
rm -f $2/wxMotif-${WXVER}*.tgz
|
||||||
|
rm -f $2/wxWindows*.tgz
|
||||||
|
rm -f $2/tex2rtf2.tgz
|
||||||
|
rm -f $2/ogl3.tgz
|
||||||
|
rm -f $2/jpeg.tgz
|
||||||
|
rm -f $2/tiff.tgz
|
||||||
|
|
||||||
|
echo Tarring...
|
||||||
|
|
||||||
|
### wxMotif
|
||||||
|
ls `cat $1/distrib/msw/generic.rsp $1/distrib/msw/motif.rsp $1/distrib/msw/makefile.rsp $1/distrib/msw/jpeg.rsp $1/distrib/msw/tiff.rsp` > /tmp/wxmotif.txt
|
||||||
|
tar cvf $2/wxMotif-${WXVER}.tar -T /tmp/wxmotif.txt
|
||||||
|
gzip $2/wxMotif-${WXVER}.tar
|
||||||
|
mv $2/wxMotif-${WXVER}.tar.gz $2/wxMotif-${WXVER}.tgz
|
||||||
|
|
||||||
|
### HTML docs
|
||||||
|
ls `cat $1/distrib/msw/wx_html.rsp` > /tmp/html.txt
|
||||||
|
tar cvf $2/wxWindows-${WXVER}-htm.tar -T /tmp/html.txt
|
||||||
|
gzip $2/wxWindows-${WXVER}-htm.tar
|
||||||
|
mv $2/wxWindows-${WXVER}-htm.tar.gz $2/wxWindows-${WXVER}-htm.tgz
|
||||||
|
|
||||||
|
### HTB (wxHTML Help) docs
|
||||||
|
ls `cat $1/distrib/msw/wx_htb.rsp` > /tmp/htb.txt
|
||||||
|
tar cvf $2/wxWindows-${WXVER}-htb.tar -T /tmp/htb.txt
|
||||||
|
gzip $2/wxWindows-${WXVER}-htb.tar
|
||||||
|
mv $2/wxWindows-${WXVER}-htb.tar.gz $2/wxWindows-${WXVER}-htb.tgz
|
||||||
|
|
||||||
|
### PDF docs
|
||||||
|
ls `cat $1/distrib/msw/wx_pdf.rsp` > /tmp/pdf.txt
|
||||||
|
tar cvf $2/wxWindows-${WXVER}-pdf.tar -T /tmp/pdf.txt
|
||||||
|
gzip $2/wxWindows-${WXVER}-pdf.tar
|
||||||
|
mv $2/wxWindows-${WXVER}-pdf.tar.gz $2/wxWindows-${WXVER}-pdf.tgz
|
||||||
|
|
||||||
|
### Stubs files
|
||||||
|
#ls `cat $1/distrib/msw/stubs.rsp` > /tmp/stubs.txt
|
||||||
|
#tar cvf $2/wxWindows-${WXVER}-stubs.tar -T /tmp/stubs.txt
|
||||||
|
#gzip $2/wxWindows-${WXVER}-stubs.tar
|
||||||
|
#mv $2/wxWindows-${WXVER}-stubs.tar.gz $2/wxWindows-${WXVER}-stubs.tgz
|
||||||
|
|
||||||
|
### Tex2RTF
|
||||||
|
ls `cat $1/distrib/msw/tex2rtf.rsp` > /tmp/tex2rtf.txt
|
||||||
|
tar cvf $2/tex2rtf2.tar -T /tmp/tex2rtf.txt
|
||||||
|
gzip $2/tex2rtf2.tar
|
||||||
|
mv $2/tex2rtf2.tar.gz $2/tex2rtf2.tgz
|
||||||
|
|
||||||
|
### OGL
|
||||||
|
ls `cat $1/distrib/msw/ogl.rsp` > /tmp/ogl.txt
|
||||||
|
tar cvf $2/ogl3.tar -T /tmp/ogl.txt
|
||||||
|
gzip $2/ogl3.tar
|
||||||
|
mv $2/ogl3.tar.gz $2/ogl3.tgz
|
||||||
|
|
||||||
|
### JPEG
|
||||||
|
#ls `cat $1/distrib/msw/jpeg.rsp` > /tmp/jpeg.txt
|
||||||
|
#tar cvf $2/jpeg.tar -T /tmp/jpeg.txt
|
||||||
|
#gzip $2/jpeg.tar
|
||||||
|
#mv $2/jpeg.tar.gz $2/jpeg.tgz
|
||||||
|
|
||||||
|
### TIFF
|
||||||
|
#ls `cat $1/distrib/msw/tiff.rsp` > /tmp/tiff.txt
|
||||||
|
#tar cvf $2/tiff.tar -T /tmp/tiff.txt
|
||||||
|
#gzip $2/tiff.tar
|
||||||
|
#mv $2/tiff.tar.gz $2/tiff.tgz
|
||||||
|
|
||||||
|
echo Done!
|
@@ -104,7 +104,6 @@ copy %src\docs\msw\install.txt %dest\install_msw.txt
|
|||||||
copy %src\docs\motif\install.txt %dest\install_motif.txt
|
copy %src\docs\motif\install.txt %dest\install_motif.txt
|
||||||
copy %src\docs\gtk\install.txt %dest\install_gtk.txt
|
copy %src\docs\gtk\install.txt %dest\install_gtk.txt
|
||||||
copy %src\docs\readme.txt %dest
|
copy %src\docs\readme.txt %dest
|
||||||
copy %src\docs\release.txt %dest
|
|
||||||
copy %src\docs\motif\makewxmotif %dest
|
copy %src\docs\motif\makewxmotif %dest
|
||||||
copy %src\docs\gtk\makewxgtk %dest
|
copy %src\docs\gtk\makewxgtk %dest
|
||||||
|
|
||||||
|
@@ -1,13 +1,13 @@
|
|||||||
Readme for wxWindows 2.0 Ide-files
|
Readme for wxWindows 2.0 Ide-files
|
||||||
First release Feb. 1999, detlev@reymann-online.de
|
First release Feb. 1999, detlev@reymann-online.de
|
||||||
|
|
||||||
1. What you can do with this IDE files
|
1. What you can do with the BC++ IDE files
|
||||||
2. Where to install the files
|
2. Where to install the files
|
||||||
3. How to modify them for your own needs
|
3. How to modify them for your own needs
|
||||||
4. How to create IDE files for your own wxWindows-programs
|
4. How to create IDE files for your own wxWindows-programs
|
||||||
|
|
||||||
1. What you can do with this IDE files
|
1. What you can do with the IDE files
|
||||||
======================================
|
=====================================
|
||||||
|
|
||||||
There are two IDE files. src\bc32.ide should help you to
|
There are two IDE files. src\bc32.ide should help you to
|
||||||
create the wxWindows libraries from within the Ide of Borlands
|
create the wxWindows libraries from within the Ide of Borlands
|
||||||
@@ -40,14 +40,14 @@ $inherit-macro (Julian found the trick), this should work.
|
|||||||
|
|
||||||
To add a new sample to samples\bc32.ide, follow these steps:
|
To add a new sample to samples\bc32.ide, follow these steps:
|
||||||
|
|
||||||
a. Choose Project->New target... and type in e.g.
|
1. Choose Project->New target... and type in e.g.
|
||||||
samples\newsample. Press OK.
|
samples\newsample. Press OK.
|
||||||
b. Static, no OWL, MFC or class libraries. Check Multithread
|
2. Static, no OWL, MFC or class libraries. Check Multithread
|
||||||
on. Press OK.
|
on. Press OK.
|
||||||
c. Right-click on the new node, choose Add node... and add
|
3. Right-click on the new node, choose Add node... and add
|
||||||
..\lib\wx32.lib and ..\lib\xpm.lib. Add any other source
|
..\lib\wx32.lib and ..\lib\xpm.lib. Add any other source
|
||||||
files you require.
|
files you require.
|
||||||
d. Right-click on the new node, choose Edit Local Options.. and
|
4. Right-click on the new node, choose Edit Local Options.. and
|
||||||
add in Directories, specify the following:
|
add in Directories, specify the following:
|
||||||
|
|
||||||
Include: $inherit;.\newsample
|
Include: $inherit;.\newsample
|
||||||
@@ -59,22 +59,21 @@ d. Right-click on the new node, choose Edit Local Options.. and
|
|||||||
4. How to create IDE files for your own wxWindows-programs
|
4. How to create IDE files for your own wxWindows-programs
|
||||||
==========================================================
|
==========================================================
|
||||||
|
|
||||||
I think you are familiar with the necessary options for your own
|
If you want to create an IDE file for your own wxWindows program,
|
||||||
program. So I will only describe what is neccessary to link
|
please follow these steps.
|
||||||
yout program with the wxWindows library. If you want to create
|
|
||||||
an IDE file for your own wxWindows program, create a new project
|
1. Create a new project from the menu file->new->project.
|
||||||
from the menu file->new->project. Deactivate all the
|
2. Deactivate all the standard-options, the only three things
|
||||||
standard-options, the only three thing that should be activated is
|
that should be activated are "static" for the libraries,
|
||||||
"static" for the libraries, if you want to use the library
|
the checkbox OLE (you can leave this checkbox unchecked,
|
||||||
produced with the library-ide, the checkbox OLE (you can
|
but then you have to add the library \bc5\lib\ole2w32.lib
|
||||||
leave this checkbox unchecked, but then you have to add the
|
to your project), and the Multithread checkbox.
|
||||||
library \bc5\lib\ole2w32.lib to your project), and the
|
3. Add the include-path of wxWindows to the include-path in the
|
||||||
Multithread checkbox. You have to add
|
options-dialog (options->project->directories->include). The
|
||||||
the include-path of wxWindows to the include-path in the
|
result should be something like:
|
||||||
options-dialog (options->project->directories->include). The
|
path_of_my_program;\bc5\include;\wxwin2\include;
|
||||||
result should be something like:
|
4. Add the libraries to the project. Open the project-view and
|
||||||
path_of_my_program;\bc5\include;\wxwin2\include; Then you have
|
activate your program. Then right-click and choose "add" and
|
||||||
to add the libraries to the project. Open the project-view and
|
select the wxWindows library (e.g. \wxwin\lib\wx32.lib). Also
|
||||||
activate your program. Then right-click and choose "add" and
|
add the xpm library.
|
||||||
select the wxWindows library (e.g. \wxwin\lib\wx32.lib). Also
|
|
||||||
add the xpm library.
|
|
||||||
|
@@ -305,10 +305,25 @@ of how to create your own project files.
|
|||||||
Borland C++Builder compilation
|
Borland C++Builder compilation
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
C++Builder compilation is the same as for Borland C++ above.
|
1. Build the wxWindows libraries using the Borland make utility as
|
||||||
|
specified in the section called "Borland C++ 4.5/5.0 compilation"
|
||||||
|
above. (C++ Builder includes a stand-alone C++ compiler. For example,
|
||||||
|
C++ Builder 4.0 comes with C++ 5.4.)
|
||||||
|
|
||||||
Tested with C++Builder 1.0 and 3.0. Only makefiles are currently
|
2. Create a template .bpr (project) file for new Borland/wxWindows,
|
||||||
supplied.
|
being sure to make the following settings:
|
||||||
|
|
||||||
|
a) 32 bit compiler
|
||||||
|
b) Defines: __WXMSW__;__WIN95__
|
||||||
|
c) Data alignment=byte
|
||||||
|
d) Include path: \libs\wx2\include
|
||||||
|
|
||||||
|
To use this template project file, just add the wxWindows libraries to
|
||||||
|
the project along with your own source files. If you need to run one or
|
||||||
|
two wx source files in the debugger, include them explicitly in your BCB
|
||||||
|
project and they will get linked in in preference to any files in the
|
||||||
|
lib; just make sure that your include path finds all the wx include
|
||||||
|
files.
|
||||||
|
|
||||||
Watcom C++ 10.6/11 compilation
|
Watcom C++ 10.6/11 compilation
|
||||||
---------------------------
|
---------------------------
|
||||||
|
@@ -96,6 +96,8 @@ protected:
|
|||||||
WXWidget* m_widgetList ;
|
WXWidget* m_widgetList ;
|
||||||
WXWidget m_formWidget;
|
WXWidget m_formWidget;
|
||||||
wxStringList m_stringList;
|
wxStringList m_stringList;
|
||||||
|
wxList m_clientList; // contains the client data for the items
|
||||||
|
|
||||||
|
|
||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
|
@@ -599,10 +599,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
|
|||||||
m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,-1),
|
m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,-1),
|
||||||
5, choices, wxCB_SORT );
|
5, choices, wxCB_SORT );
|
||||||
|
|
||||||
#ifndef __WXMOTIF__
|
|
||||||
SetControlClientData("choice", m_choice);
|
SetControlClientData("choice", m_choice);
|
||||||
SetControlClientData("choice", m_choiceSorted);
|
SetControlClientData("choice", m_choiceSorted);
|
||||||
#endif
|
|
||||||
|
|
||||||
m_choice->SetSelection(2);
|
m_choice->SetSelection(2);
|
||||||
m_choice->SetBackgroundColour( "red" );
|
m_choice->SetBackgroundColour( "red" );
|
||||||
|
@@ -113,8 +113,10 @@ bool MyApp::OnInit(void)
|
|||||||
|
|
||||||
MyApp::~MyApp()
|
MyApp::~MyApp()
|
||||||
{
|
{
|
||||||
|
#if defined(__WXMSW__)
|
||||||
delete dialog1;
|
delete dialog1;
|
||||||
delete menu1;
|
delete menu1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
BEGIN_EVENT_TABLE(MyPanel, wxPanel)
|
||||||
|
@@ -43,6 +43,19 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class MyCanvas: public wxScrolledWindow
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MyCanvas(wxWindow* parent);
|
||||||
|
|
||||||
|
void OnMouseLeftUp (wxMouseEvent & event);
|
||||||
|
void OnMouseRightUp (wxMouseEvent & event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
class MyFrame: public wxFrame
|
class MyFrame: public wxFrame
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -50,10 +63,7 @@ public:
|
|||||||
|
|
||||||
void OnQuit (wxCommandEvent &);
|
void OnQuit (wxCommandEvent &);
|
||||||
void OnAngle(wxCommandEvent &);
|
void OnAngle(wxCommandEvent &);
|
||||||
void OnMouseLeftUp (wxMouseEvent & event);
|
|
||||||
void OnMouseRightUp (wxMouseEvent & event);
|
|
||||||
|
|
||||||
private:
|
|
||||||
double m_angle;
|
double m_angle;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
@@ -65,16 +75,18 @@ enum
|
|||||||
ID_Angle
|
ID_Angle
|
||||||
};
|
};
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MyCanvas, wxScrolledWindow)
|
||||||
|
EVT_LEFT_UP (MyCanvas::OnMouseLeftUp)
|
||||||
|
EVT_RIGHT_UP (MyCanvas::OnMouseRightUp)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||||
EVT_MENU (ID_Quit, MyFrame::OnQuit)
|
EVT_MENU (ID_Quit, MyFrame::OnQuit)
|
||||||
EVT_MENU (ID_Angle, MyFrame::OnAngle)
|
EVT_MENU (ID_Angle, MyFrame::OnAngle)
|
||||||
EVT_LEFT_UP (MyFrame::OnMouseLeftUp)
|
|
||||||
EVT_RIGHT_UP (MyFrame::OnMouseRightUp)
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
IMPLEMENT_APP(MyApp)
|
IMPLEMENT_APP(MyApp)
|
||||||
|
|
||||||
|
|
||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
m_image = wxImage("kclub.bmp", wxBITMAP_TYPE_BMP);
|
m_image = wxImage("kclub.bmp", wxBITMAP_TYPE_BMP);
|
||||||
@@ -92,8 +104,6 @@ bool MyApp::OnInit()
|
|||||||
MyFrame *frame = new MyFrame ("wxWindows rotate sample",
|
MyFrame *frame = new MyFrame ("wxWindows rotate sample",
|
||||||
wxPoint(20,20), wxSize(600,450));
|
wxPoint(20,20), wxSize(600,450));
|
||||||
|
|
||||||
frame->SetBackgroundColour (wxColour (0,80,60));
|
|
||||||
frame->Clear();
|
|
||||||
frame->Show (TRUE);
|
frame->Show (TRUE);
|
||||||
SetTopWindow (frame);
|
SetTopWindow (frame);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -104,6 +114,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
|||||||
{
|
{
|
||||||
m_angle = 0.1;
|
m_angle = 0.1;
|
||||||
|
|
||||||
|
new MyCanvas(this);
|
||||||
|
|
||||||
wxMenu *menuFile = new wxMenu;
|
wxMenu *menuFile = new wxMenu;
|
||||||
menuFile->Append (ID_Angle, "Set &angle\tCtrl-A");
|
menuFile->Append (ID_Angle, "Set &angle\tCtrl-A");
|
||||||
menuFile->AppendSeparator();
|
menuFile->AppendSeparator();
|
||||||
@@ -132,13 +144,21 @@ void MyFrame::OnQuit (wxCommandEvent &)
|
|||||||
Close (TRUE);
|
Close (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyCanvas::MyCanvas(wxWindow* parent):
|
||||||
|
wxScrolledWindow(parent, -1)
|
||||||
|
{
|
||||||
|
SetBackgroundColour (wxColour (0,80,60));
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// Rotate with interpolation and with offset correction
|
// Rotate with interpolation and with offset correction
|
||||||
void MyFrame::OnMouseLeftUp (wxMouseEvent & event)
|
void MyCanvas::OnMouseLeftUp (wxMouseEvent & event)
|
||||||
{
|
{
|
||||||
|
MyFrame* frame = (MyFrame*) GetParent();
|
||||||
|
|
||||||
wxPoint offset;
|
wxPoint offset;
|
||||||
const wxImage& img = wxGetApp().GetImage();
|
const wxImage& img = wxGetApp().GetImage();
|
||||||
wxImage img2 = img.Rotate(m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), TRUE, &offset);
|
wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), TRUE, &offset);
|
||||||
|
|
||||||
wxBitmap bmp = img2.ConvertToBitmap ();
|
wxBitmap bmp = img2.ConvertToBitmap ();
|
||||||
|
|
||||||
@@ -147,10 +167,12 @@ void MyFrame::OnMouseLeftUp (wxMouseEvent & event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// without interpolation, and without offset correction
|
// without interpolation, and without offset correction
|
||||||
void MyFrame::OnMouseRightUp (wxMouseEvent & event)
|
void MyCanvas::OnMouseRightUp (wxMouseEvent & event)
|
||||||
{
|
{
|
||||||
|
MyFrame* frame = (MyFrame*) GetParent();
|
||||||
|
|
||||||
const wxImage& img = wxGetApp().GetImage();
|
const wxImage& img = wxGetApp().GetImage();
|
||||||
wxImage img2 = img.Rotate(m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), FALSE);
|
wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), FALSE);
|
||||||
|
|
||||||
wxBitmap bmp = img2.ConvertToBitmap ();
|
wxBitmap bmp = img2.ConvertToBitmap ();
|
||||||
|
|
||||||
|
@@ -1262,7 +1262,7 @@ void wxPostScriptDC::DoDrawText( const wxString& text, wxCoord x, wxCoord y )
|
|||||||
XLOG2DEV(x), YLOG2DEV(uy),
|
XLOG2DEV(x), YLOG2DEV(uy),
|
||||||
m_underlineThickness,
|
m_underlineThickness,
|
||||||
XLOG2DEV(x + text_w), YLOG2DEV(uy) );
|
XLOG2DEV(x + text_w), YLOG2DEV(uy) );
|
||||||
for (int i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
if (buffer[i] == ',') buffer[i] = '.';
|
if (buffer[i] == ',') buffer[i] = '.';
|
||||||
fprintf( m_pstream, buffer );
|
fprintf( m_pstream, buffer );
|
||||||
}
|
}
|
||||||
@@ -1391,7 +1391,7 @@ void wxPostScriptDC::DoDrawRotatedText( const wxString& text, wxCoord x, wxCoord
|
|||||||
XLOG2DEV(x), YLOG2DEV(uy),
|
XLOG2DEV(x), YLOG2DEV(uy),
|
||||||
m_underlineThickness,
|
m_underlineThickness,
|
||||||
XLOG2DEV(x + w), YLOG2DEV(uy) );
|
XLOG2DEV(x + w), YLOG2DEV(uy) );
|
||||||
for (int i = 0; i < 100; i++)
|
for (i = 0; i < 100; i++)
|
||||||
if (buffer[i] == ',') buffer[i] = '.';
|
if (buffer[i] == ',') buffer[i] = '.';
|
||||||
fprintf( m_pstream, buffer );
|
fprintf( m_pstream, buffer );
|
||||||
}
|
}
|
||||||
|
@@ -189,32 +189,37 @@ void wxChoice::Append(const wxString& item)
|
|||||||
for (i = 0; i < m_noStrings; i++)
|
for (i = 0; i < m_noStrings; i++)
|
||||||
new_widgetList[i] = m_widgetList[i];
|
new_widgetList[i] = m_widgetList[i];
|
||||||
|
|
||||||
new_widgetList[m_noStrings] = (WXWidget) w;
|
new_widgetList[m_noStrings] = (WXWidget) w;
|
||||||
|
|
||||||
if (m_widgetList)
|
if (m_widgetList)
|
||||||
delete[] m_widgetList;
|
delete[] m_widgetList;
|
||||||
m_widgetList = new_widgetList;
|
m_widgetList = new_widgetList;
|
||||||
|
|
||||||
char mnem = wxFindMnemonic ((char*) (const char*) item);
|
char mnem = wxFindMnemonic ((char*) (const char*) item);
|
||||||
if (mnem != 0)
|
if (mnem != 0)
|
||||||
XtVaSetValues (w, XmNmnemonic, mnem, NULL);
|
XtVaSetValues (w, XmNmnemonic, mnem, NULL);
|
||||||
|
|
||||||
XtAddCallback (w, XmNactivateCallback, (XtCallbackProc) wxChoiceCallback, (XtPointer) this);
|
XtAddCallback (w, XmNactivateCallback, (XtCallbackProc) wxChoiceCallback, (XtPointer) this);
|
||||||
|
|
||||||
if (m_noStrings == 0 && m_buttonWidget)
|
if (m_noStrings == 0 && m_buttonWidget)
|
||||||
{
|
{
|
||||||
XtVaSetValues ((Widget) m_buttonWidget, XmNmenuHistory, w, NULL);
|
XtVaSetValues ((Widget) m_buttonWidget, XmNmenuHistory, w, NULL);
|
||||||
Widget label = XmOptionButtonGadget ((Widget) m_buttonWidget);
|
Widget label = XmOptionButtonGadget ((Widget) m_buttonWidget);
|
||||||
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
XmString text = XmStringCreateSimple ((char*) (const char*) item);
|
||||||
XtVaSetValues (label,
|
XtVaSetValues (label,
|
||||||
XmNlabelString, text,
|
XmNlabelString, text,
|
||||||
NULL);
|
NULL);
|
||||||
XmStringFree (text);
|
XmStringFree (text);
|
||||||
}
|
}
|
||||||
wxNode *node = m_stringList.Add (item);
|
wxNode *node = m_stringList.Add (item);
|
||||||
XtVaSetValues (w, XmNuserData, node->Data (), NULL);
|
XtVaSetValues (w, XmNuserData, node->Data (), NULL);
|
||||||
|
|
||||||
m_noStrings ++;
|
if (m_noStrings == 0)
|
||||||
|
m_clientList.Append((wxObject*) NULL);
|
||||||
|
else
|
||||||
|
m_clientList.Insert( m_clientList.Item(m_noStrings-1),
|
||||||
|
(wxObject*) NULL );
|
||||||
|
m_noStrings ++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxChoice::Delete(int WXUNUSED(n))
|
void wxChoice::Delete(int WXUNUSED(n))
|
||||||
@@ -243,6 +248,21 @@ void wxChoice::Clear()
|
|||||||
m_widgetList = (WXWidget*) NULL;
|
m_widgetList = (WXWidget*) NULL;
|
||||||
if (m_buttonWidget)
|
if (m_buttonWidget)
|
||||||
XtVaSetValues ((Widget) m_buttonWidget, XmNmenuHistory, (Widget) NULL, NULL);
|
XtVaSetValues ((Widget) m_buttonWidget, XmNmenuHistory, (Widget) NULL, NULL);
|
||||||
|
|
||||||
|
if ( HasClientObjectData() )
|
||||||
|
{
|
||||||
|
// destroy the data (due to Robert's idea of using wxList<wxObject>
|
||||||
|
// and not wxList<wxClientData> we can't just say
|
||||||
|
// m_clientList.DeleteContents(TRUE) - this would crash!
|
||||||
|
wxNode *node = m_clientList.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
delete (wxClientData *)node->Data();
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_clientList.Clear();
|
||||||
|
|
||||||
m_noStrings = 0;
|
m_noStrings = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -524,26 +544,40 @@ void wxChoice::DoSetFirstItem(int WXUNUSED(n))
|
|||||||
wxFAIL_MSG( wxT("wxChoice::DoSetFirstItem not implemented") );
|
wxFAIL_MSG( wxT("wxChoice::DoSetFirstItem not implemented") );
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxChoice::DoSetItemClientData(int WXUNUSED(n), void* WXUNUSED(clientData))
|
void wxChoice::DoSetItemClientData(int n, void* clientData)
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxChoice::DoSetItemClientData not implemented") );
|
wxNode *node = m_clientList.Nth( n );
|
||||||
|
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientData") );
|
||||||
|
|
||||||
|
node->SetData( (wxObject*) clientData );
|
||||||
}
|
}
|
||||||
|
|
||||||
void* wxChoice::DoGetItemClientData(int WXUNUSED(n)) const
|
void* wxChoice::DoGetItemClientData(int n) const
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxChoice::DoGetItemClientData not implemented") );
|
wxNode *node = m_clientList.Nth( n );
|
||||||
return (void*) NULL;
|
wxCHECK_MSG( node, NULL, wxT("invalid index in wxChoice::DoGetItemClientData") );
|
||||||
|
|
||||||
|
return node->Data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxChoice::DoSetItemClientObject(int WXUNUSED(n), wxClientData* WXUNUSED(clientData))
|
void wxChoice::DoSetItemClientObject(int n, wxClientData* clientData)
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxChoice::DoSetItemClientObject not implemented") );
|
wxNode *node = m_clientList.Nth( n );
|
||||||
|
wxCHECK_RET( node, wxT("invalid index in wxChoice::DoSetItemClientObject") );
|
||||||
|
|
||||||
|
wxClientData *cd = (wxClientData*) node->Data();
|
||||||
|
delete cd;
|
||||||
|
|
||||||
|
node->SetData( (wxObject*) clientData );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxClientData* wxChoice::DoGetItemClientObject(int WXUNUSED(n)) const
|
wxClientData* wxChoice::DoGetItemClientObject(int n) const
|
||||||
{
|
{
|
||||||
wxFAIL_MSG( wxT("wxChoice::DoGetItemClientObject not implemented") );
|
wxNode *node = m_clientList.Nth( n );
|
||||||
return (wxClientData*) NULL;
|
wxCHECK_MSG( node, (wxClientData *)NULL,
|
||||||
|
wxT("invalid index in wxChoice::DoGetItemClientObject") );
|
||||||
|
|
||||||
|
return (wxClientData*) node->Data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxChoice::Select(int n)
|
void wxChoice::Select(int n)
|
||||||
|
@@ -67,11 +67,6 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
XmNstaticList, ((style & wxCB_SIMPLE) == wxCB_SIMPLE),
|
XmNstaticList, ((style & wxCB_SIMPLE) == wxCB_SIMPLE),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
XtAddCallback (buttonWidget, XmNselectionCallback, (XtCallbackProc) wxComboBoxCallback,
|
|
||||||
(XtPointer) this);
|
|
||||||
XtAddCallback (buttonWidget, XmNvalueChangedCallback, (XtCallbackProc) wxComboBoxCallback,
|
|
||||||
(XtPointer) this);
|
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
{
|
{
|
||||||
@@ -91,6 +86,11 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
m_font = parent->GetFont();
|
m_font = parent->GetFont();
|
||||||
ChangeFont(FALSE);
|
ChangeFont(FALSE);
|
||||||
|
|
||||||
|
XtAddCallback (buttonWidget, XmNselectionCallback, (XtCallbackProc) wxComboBoxCallback,
|
||||||
|
(XtPointer) this);
|
||||||
|
XtAddCallback (buttonWidget, XmNvalueChangedCallback, (XtCallbackProc) wxComboBoxCallback,
|
||||||
|
(XtPointer) this);
|
||||||
|
|
||||||
SetCanAddEventHandler(TRUE);
|
SetCanAddEventHandler(TRUE);
|
||||||
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
|
AttachWidget (parent, m_mainWidget, (WXWidget) NULL, pos.x, pos.y, size.x, size.y);
|
||||||
|
|
||||||
@@ -151,6 +151,16 @@ void wxComboBox::Delete(int n)
|
|||||||
delete[] (char *)node->Data();
|
delete[] (char *)node->Data();
|
||||||
delete node;
|
delete node;
|
||||||
}
|
}
|
||||||
|
node = m_clientList.Nth( n );
|
||||||
|
if (node)
|
||||||
|
{
|
||||||
|
if ( HasClientObjectData() )
|
||||||
|
{
|
||||||
|
delete (wxClientData *)node->Data();
|
||||||
|
}
|
||||||
|
delete node;
|
||||||
|
}
|
||||||
|
|
||||||
m_noStrings--;
|
m_noStrings--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,6 +168,21 @@ void wxComboBox::Clear()
|
|||||||
{
|
{
|
||||||
XmComboBoxDeleteAllItems((Widget) m_mainWidget);
|
XmComboBoxDeleteAllItems((Widget) m_mainWidget);
|
||||||
m_stringList.Clear();
|
m_stringList.Clear();
|
||||||
|
|
||||||
|
if ( HasClientObjectData() )
|
||||||
|
{
|
||||||
|
// destroy the data (due to Robert's idea of using wxList<wxObject>
|
||||||
|
// and not wxList<wxClientData> we can't just say
|
||||||
|
// m_clientList.DeleteContents(TRUE) - this would crash!
|
||||||
|
wxNode *node = m_clientList.First();
|
||||||
|
while ( node )
|
||||||
|
{
|
||||||
|
delete (wxClientData *)node->Data();
|
||||||
|
node = node->Next();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_clientList.Clear();
|
||||||
|
m_noStrings = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxComboBox::SetSelection (int n)
|
void wxComboBox::SetSelection (int n)
|
||||||
|
Reference in New Issue
Block a user