Compare commits

...

91 Commits

Author SHA1 Message Date
Bryan Petty
f95a28b1bc This commit was manufactured by cvs2svn to create tag
'BEFORE_NEW_DYNLOADER'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/BEFORE_NEW_DYNLOADER@13086 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 01:56:38 +00:00
Vadim Zeitlin
0cb50c83aa suppress some warnings appearing in the optimized build only
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13085 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 01:56:38 +00:00
Vadim Zeitlin
c848b2f955 compilation fix for Windows
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 01:31:27 +00:00
Vadim Zeitlin
1e3a888e72 fixed redraw problems in wxStaticText
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-19 01:27:26 +00:00
Václav Slavík
5b96a71a56 send Host header in HTTP requests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13082 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 23:12:52 +00:00
Václav Slavík
3f2eabd59d fixed i18n handling of _ in XRC texts
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 23:12:40 +00:00
Vadim Zeitlin
48f72114ba fix for the X fatal error when closing frames
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13080 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 20:40:25 +00:00
Julian Smart
b59da6c285 Minor doc changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 20:25:32 +00:00
Vadim Zeitlin
33754c4d83 fix for using wxDataObjectComposite with the clipboard
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 18:43:10 +00:00
Vadim Zeitlin
5ece068d9f compilation fix for old mingw32
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 18:26:52 +00:00
Vadim Zeitlin
df22f86063 1. fixed file descriptors leak in wxFileName::CreateTempFileName()
2. really made it race-safe (provided we have mkstemp())


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 17:47:27 +00:00
David Webster
32334453e7 Fixed a linking problem as some virtuals and static not properly defined
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 17:35:58 +00:00
David Webster
5c8835b94c Taking out __WXPM__ ifdef around wxUSE_UNICODE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 16:36:22 +00:00
Vadim Zeitlin
17154fc8aa fix for handling the standard X toolkit options
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 16:07:15 +00:00
Robert Roebling
e044f6001e The mac toolbar was redrawing buttons when not shown -
making them appear at arbitrary times.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-18 11:31:55 +00:00
Václav Slavík
501d97d4fe it doesn't make sense to have translatable string in wxFAIL_MSG...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 23:42:59 +00:00
Václav Slavík
13b1472fdd updated message catalogs from sources and translated the rest of Czech messages
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 23:42:22 +00:00
Václav Slavík
dfc40ef343 comment clarification
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 23:39:23 +00:00
Václav Slavík
639692727b present, not past sense
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 23:39:01 +00:00
David Webster
c26d72f10d OS/2 common controls code def file
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 23:19:25 +00:00
David Webster
3c299c3ab6 OS/2 common controls code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 22:56:41 +00:00
David Webster
4c53d9ece2 OS/2 does not support Unicode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 22:55:44 +00:00
Vadim Zeitlin
8f684821f6 slightly expanded and updated the Unicode overview
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 16:52:22 +00:00
Vadim Zeitlin
be03c0ec26 fixes error/usage messages given by the cmd line parsing logic in wxApp;
also fixed the handling of long-only options in the usage messages


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13058 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 12:21:03 +00:00
Vadim Zeitlin
a250392c48 don't discard the informational log messages given after an error one in
wxLogGui (only those given before)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 12:17:27 +00:00
Robert Roebling
3355efa93c MacOS 9 seems to clear the background itself, too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 10:06:33 +00:00
Robert Roebling
00500f403c MAcOS X clears the background (with stripes) for
us, so there is no need to do it again. This
    solves to optical bugs for the wxStatusBar and
    wxStaticText.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 09:42:22 +00:00
Robert Roebling
d21d2e5adf Smooth Aqua buttons in wxTreeCtrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:20:25 +00:00
Robert Roebling
754c44ae38 Header change for smooth Aqua buttons in wxTreeCtrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:18:47 +00:00
Vadim Zeitlin
9d7de3c2b8 don't use EM_STREAMIN at all in Unicode mode, it's not needed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:06:55 +00:00
Vadim Zeitlin
c640e407d5 add missing header for !wxUSE_PCH case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:06:21 +00:00
Vadim Zeitlin
3f562374f1 added __TDATE__ and __TTIME__ and use them instead of __DATE__ and __TIME__ for Unicode-friendliness
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:05:37 +00:00
Robert Roebling
5fc67e5cf4 Forgot to unset m_relative in wxFilename::Normalize().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13049 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:37:49 +00:00
Václav Slavík
7613582bcc fixed Unicode compilation (please use wxT()...)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:30:55 +00:00
Václav Slavík
33984936de added sample showing wxTR_FULL_ROW_HIGHLIGHT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:30:43 +00:00
Václav Slavík
c6f4913a76 applied patch that adds wxTR_FULL_ROW_HIGHLIGHT to wxTreeCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:30:23 +00:00
Václav Slavík
db3272a001 added wxUSE_UNICODE_MSLU
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13045 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:29:52 +00:00
Václav Slavík
c4d596ea01 safety check for wxUSE_UNICODE and wxUSE_UNICODE_MSLU
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:29:04 +00:00
Václav Slavík
eb5e4d9ac1 making wxMSW MSLU(unicows)-friendly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:28:31 +00:00
Václav Slavík
e168b6acfd fixes to wxFindFirstFile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 20:38:01 +00:00
Václav Slavík
df16a53ef9 another segfault fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13041 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 20:37:49 +00:00
Václav Slavík
783fab59e5 a mistake; djgpp doesn't have vsnprintf at all
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 20:35:22 +00:00
Václav Slavík
c4e1b7f244 cache return value of ftime
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 20:35:05 +00:00
Robert Roebling
353f41cb3b Reimplemented wxFileName with m_relative field.
Adapted wxFileDialog to trailing slashes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 12:07:44 +00:00
Václav Slavík
c04857dd6a removed platform-specific code for wxFindFirst/NextFile and replaced it with a generic implementation that uses wxDir
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-16 11:20:16 +00:00
Václav Slavík
c4bcd8fcdd fixed a segfaulting bug in wxUniv: invalid assumption that every window has a parent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:18:45 +00:00
Václav Slavík
65d48d095f fix for stupid segfault
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:18:31 +00:00
Václav Slavík
c1725ec7f3 DJGPP support in libtiff (what else can I do that to touch libtiff headers?)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:18:18 +00:00
Václav Slavík
d3b4d71020 DOS compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13033 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:18:08 +00:00
Václav Slavík
147043343e DJGPP compilation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:17:56 +00:00
Václav Slavík
865c589e50 correct platform detection with DJGPP
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:17:40 +00:00
Václav Slavík
b916f80933 DJGPP compilation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:17:04 +00:00
Václav Slavík
713a0efc61 timezone is not defined in DJGPP in any form, use ftime() to get it
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13029 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:16:33 +00:00
Václav Slavík
9283436576 long long for DJGPP
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13028 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:16:10 +00:00
Václav Slavík
f9bc168497 MS-DOS cross-compilation w/ DJGPP
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 23:15:39 +00:00
Vadim Zeitlin
d00407b2c6 fixed flicker in wxTreeCtrl::SetItemXXX()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 22:20:54 +00:00
Václav Slavík
2e351786c5 compilation with DJGPP
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13025 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 16:45:57 +00:00
Václav Slavík
b0c4280587 blind fix for Unicode compilation of wxTextCtrl/msw
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13024 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 16:45:34 +00:00
Václav Slavík
c16d276354 oops, wxGTK.spec missed clean section
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 16:45:18 +00:00
Václav Slavík
7070f55b2c Oops, Watcom doesn't have _mktemp in DOS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13022 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 16:44:43 +00:00
Robert Roebling
17d5bdf9e9 Aqua gets Aqua tree buttons automatically now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 13:49:05 +00:00
Vadim Zeitlin
4b614012da added EVT_CUSTOM test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13019 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 23:45:17 +00:00
Vadim Zeitlin
4ec2df6cbc added custom events demo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 23:38:33 +00:00
Vadim Zeitlin
3f345b477e 1. define -D_THREAD_SAFE, not -D_REENTRANT for MT programs under FreeBSD
(not as if it really helped with my test system, they still crash)
2. don't link with gthread if --disable-threads was specified


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:34:00 +00:00
Václav Slavík
e7ca6139d0 don't include windows.h unless neccessary
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13015 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:25:48 +00:00
Václav Slavík
ffd10d5da7 implemented wxDir as pure MGL code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:25:39 +00:00
Václav Slavík
8ff1234234 wxFindFirstFile and friends for wxMGL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:25:16 +00:00
Václav Slavík
abb855613b unimportant DOS fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13012 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:59 +00:00
Václav Slavík
7332adf035 move pmapi.h to mgl/private.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:49 +00:00
Václav Slavík
dccaf28056 Oops, Watcom doesn't have _mktemp in DOS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13010 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:32 +00:00
Václav Slavík
9210a48a33 filled-in DOS parts of wxMGL utils
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:24 +00:00
Václav Slavík
dbdcff5102 Watcom compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:15 +00:00
Václav Slavík
f05605ff4d fixes to wxMGL build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 19:24:04 +00:00
David Webster
24eb81cbcf OS/2 compile fixes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13006 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 17:09:03 +00:00
Vadim Zeitlin
2ba4130573 wxConfig clean up and bug fix for record defaults
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 00:58:59 +00:00
Vadim Zeitlin
4a0f7f3f17 got rid of ^Ms
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-14 00:28:47 +00:00
Robert Roebling
01ec8f969d Verbose languages such as German need a big
wxFileDialog (like it already was in the
  2.2.X tree).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 23:36:32 +00:00
Robert Roebling
e856571123 More on announcing wxWindows.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13000 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 23:35:36 +00:00
Robin Dunn
c5e8ed2391 Build and distrib tweaks
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 18:55:19 +00:00
Robin Dunn
0a1d59000c A fix from Patrick
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12997 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 18:54:44 +00:00
Robin Dunn
9a3ba92945 Removed Alt or Ctrl hack
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 18:53:47 +00:00
Robin Dunn
71f1334b40 Typo fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 18:51:23 +00:00
Ron Lee
f20ad12c58 Vadim, please check this, I think it's what you meant
and doesn't build for me otherwise.  Thanks.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-13 07:10:39 +00:00
Vadim Zeitlin
771a855fb9 another memory leak fixed
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12992 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-12 14:08:02 +00:00
Vadim Zeitlin
cb3b65d4e2 small clarification for SetRecordDefaults
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12991 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-12 13:38:28 +00:00
Vadim Zeitlin
6d7f865fb0 extremely dumb script to create wxBase distrib
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-12 00:36:25 +00:00
Vadim Zeitlin
1a2c3cae6d added wxUniv porting note
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-11 19:30:05 +00:00
Vadim Zeitlin
048bd5039e moved wxUniv readme to its own directory
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-11 19:28:13 +00:00
Vadim Zeitlin
2bcdcf7e2a some wxUniv docs
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-11 18:53:22 +00:00
Vadim Zeitlin
84a32a7796 fixes for wxBase dist and install
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-11 18:39:59 +00:00
Vadim Zeitlin
22b41d3e01 some basic docs for wxBase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-11 17:52:51 +00:00
170 changed files with 13641 additions and 22595 deletions

View File

@@ -436,6 +436,9 @@ preinstall: $(build_libdir)/@WX_TARGET_LIBRARY@ $(top_builddir)/wx@TOOLCHAIN_NAM
@if test "$(USE_GUI)" = 1; then $(INSTALL) -d $(includedir)/wx/generic; fi
@if test "@TOOLKIT_DIR@" = "msw"; then $(INSTALL) -d $(includedir)/wx/msw/ole; fi
@# always install msw headers for wxBase, it's much simpler
@if test "$(USE_GUI)" = 0; then $(INSTALL) -d $(includedir)/wx/msw; fi
$(INSTALL) -d $(includedir)/wx/protocol
$(INSTALL) -d $(includedir)/wx/unix
@list='$(HEADERS)'; for p in $$list; do \
@@ -532,8 +535,6 @@ ALL_DIST: distclean
mkdir $(DISTDIR)
cp $(WXDIR)/wxwin.m4 $(DISTDIR)
cp $(WXDIR)/aclocal.m4 $(DISTDIR)
cp $(WXDIR)/configure.in $(DISTDIR)
cp $(WXDIR)/configure $(DISTDIR)
cp $(WXDIR)/config.sub $(DISTDIR)
cp $(WXDIR)/config.guess $(DISTDIR)
cp $(WXDIR)/install-sh $(DISTDIR)
@@ -543,11 +544,11 @@ ALL_DIST: distclean
cp $(WXDIR)/setup.h_vms $(DISTDIR)
cp $(WXDIR)/descrip.mms $(DISTDIR)
cp $(WXDIR)/Makefile.in $(DISTDIR)
cp $(WXDIR)/wxBase.spec $(DISTDIR)
cp $(DOCDIR)/lgpl.txt $(DISTDIR)/COPYING.LIB
cp $(DOCDIR)/licence.txt $(DISTDIR)/LICENCE.txt
cp $(DOCDIR)/symbols.txt $(DISTDIR)/SYMBOLS.txt
cp $(DOCDIR)/changes.txt $(DISTDIR)/CHANGES.txt
cp $(DOCDIR)/readme.txt $(DISTDIR)/README.txt
mkdir $(DISTDIR)/lib
cp $(WXDIR)/lib/vms.opt $(DISTDIR)/lib
cp $(WXDIR)/lib/vms_gtk.opt $(DISTDIR)/lib
@@ -572,8 +573,10 @@ ALL_DIST: distclean
# this target is the common part of distribution script for all GUI toolkits,
# but is not used when building wxBase distribution
ALL_GUI_DIST: ALL_DIST
cp $(WXDIR)/wxBase.spec $(DISTDIR)
cp $(DOCDIR)/$(TOOLKITDIR)/install.txt $(DISTDIR)/INSTALL.txt
cp $(WXDIR)/configure.in $(DISTDIR)
cp $(WXDIR)/configure $(DISTDIR)
cp $(DOCDIR)/readme.txt $(DISTDIR)/README.txt
cp $(DOCDIR)/$(TOOLKITDIR)/install.txt $(DISTDIR)/INSTALL.txt
if test -f $(DOCDIR)/$(TOOLKITDIR)/changes.txt ; then \
cp $(DOCDIR)/$(TOOLKITDIR)/changes.txt $(DISTDIR)/CHANGES-$(TOOLKIT).txt ; fi
cp $(DOCDIR)/$(TOOLKITDIR)/readme.txt $(DISTDIR)/README-$(TOOLKIT).txt
@@ -636,19 +639,25 @@ ALL_GUI_DIST: ALL_DIST
cp $(ODBCDIR)/Changes.log $(DISTDIR)/src/iodbc
BASE_DIST: ALL_DIST
# make --disable-gui the default
sed 's/DEFAULT_wxUSE_GUI=yes/DEFAULT_wxUSE_GUI=no/' \
$(WXDIR)/configure.in > $(DISTDIR)/configure.in
sed 's/DEFAULT_wxUSE_GUI=yes/DEFAULT_wxUSE_GUI=no/' \
$(WXDIR)/configure > $(DISTDIR)/configure
chmod +x $(DISTDIR)/configure
mkdir $(DISTDIR)/include
mkdir $(DISTDIR)/include/wx
mkdir $(DISTDIR)/include/wx/protocol
mkdir $(DISTDIR)/include/wx/unix
mkdir $(DISTDIR)/include/wx/msw
mkdir $(DISTDIR)/src/common
mkdir $(DISTDIR)/src/unix
mkdir $(DISTDIR)/src/msw
cp $(WXDIR)/wxBase.spec $(DISTDIR)
cp @PORT_FILES@ $(DISTDIR)
cp $(WXDIR)/src/wxBase*.dsp $(DISTDIR)
cp $(WXDIR)/src/wxBase*.dsw $(DISTDIR)
cp $(DOCDIR)/changes.txt $(DISTDIR)/CHANGES.txt
cp $(DOCDIR)/readme.txt $(DISTDIR)/README.txt
cp $(DOCDIR)/install.txt $(DISTDIR)/README.txt
cp $(SRCDIR)/*.in $(DISTDIR)/src
cp $(WXDIR)/src/common/*.inc $(DISTDIR)/src/common
cp $(WXDIR)/src/common/base.rc $(DISTDIR)/src/common
@@ -669,6 +678,7 @@ BASE_DIST: ALL_DIST
cp $(SAMPDIR)/console/Makefile.in $(DISTDIR)/samples/console
cp $(SAMPDIR)/console/makefile.unx $(DISTDIR)/samples/console
cp $(SAMPDIR)/console/console.cpp $(DISTDIR)/samples/console
cp $(SAMPDIR)/console/console.dsp $(DISTDIR)/samples/console
cp $(SAMPDIR)/console/testdata.fc $(DISTDIR)/samples/console
GTK_DIST: ALL_GUI_DIST

180
aclocal.m4 vendored
View File

@@ -10,14 +10,29 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
dnl PARTICULAR PURPOSE.
# Configure paths for GTK+
# Owen Taylor 97-11-3
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS. Uses variables
dnl gtk_config_prefix and/or gtk_config_exec_prefix if defined.
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
dnl
AC_DEFUN(AM_PATH_GTK,
[
[dnl
dnl Get the cflags and libraries from the gtk-config script
dnl
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
gtk_config_prefix="$withval", gtk_config_prefix="")
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
, enable_gtktest=yes)
for module in . $4
do
case "$module" in
gthread)
gtk_config_args="$gtk_config_args gthread"
;;
esac
done
if test x$gtk_config_exec_prefix != x ; then
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
if test x${GTK_CONFIG+set} != xset ; then
@@ -35,63 +50,156 @@ AC_DEFUN(AM_PATH_GTK,
min_gtk_version=ifelse([$1], ,0.99.7,$1)
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
no_gtk=""
if test "$GTK_CONFIG" != "no" ; then
GTK_CFLAGS=`$GTK_CONFIG --cflags`
GTK_LIBS=`$GTK_CONFIG --libs gthread`
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
if test "$GTK_CONFIG" = "no" ; then
no_gtk=yes
else
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_gtktest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS"
dnl
dnl Now check if the installed GTK is sufficiently new. (Also sanity
dnl checks the results of gtk-config to some extent)
dnl checks the results of gtk-config to some extent
dnl
AC_TRY_RUN([
rm -f conf.gtktest
AC_TRY_RUN([
#include <gtk/gtk.h>
#include <gtk/gtkfeatures.h>
#include <stdio.h>
#include <stdlib.h>
int
int
main ()
{
int major, minor, micro;
char *tmp_version;
if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, &micro) != 3) {
system ("touch conf.gtktest");
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = g_strdup("$min_gtk_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_gtk_version");
exit(1);
}
if ((GTK_MAJOR_VERSION != gtk_major_version) ||
(GTK_MINOR_VERSION != gtk_minor_version) ||
(GTK_MICRO_VERSION != gtk_micro_version)) {
printf("Headers vs. library version mismatch!\n");
exit(1);
}
if (gtk_minor_version == 1) return FALSE;
return !((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
if ((gtk_major_version != $gtk_config_major_version) ||
(gtk_minor_version != $gtk_config_minor_version) ||
(gtk_micro_version != $gtk_config_micro_version))
{
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf ("*** was found! If gtk-config was correct, then it is best\n");
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
printf("*** required on your system.\n");
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
printf("*** before re-running configure\n");
}
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
(gtk_minor_version != GTK_MINOR_VERSION) ||
(gtk_micro_version != GTK_MICRO_VERSION))
{
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
printf("*** library (version %d.%d.%d)\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
}
#endif /* defined (GTK_MAJOR_VERSION) ... */
else
{
if ((gtk_major_version > major) ||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
gtk_major_version, gtk_minor_version, gtk_micro_version);
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
major, minor, micro);
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
printf("***\n");
printf("*** If you have already installed a sufficiently new version, this error\n");
printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
printf("*** being found. The easiest way to fix this is to remove the old version\n");
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
printf("*** correct copy of gtk-config. (In this case, you will have to\n");
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
printf("*** so that the correct libraries are found at run-time))\n");
}
}
return 1;
}
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
else
no_gtk=yes
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_gtk" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$GTK_CONFIG" = "no" ; then
echo "*** The gtk-config script installed by GTK could not be found"
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the GTK_CONFIG environment variable to the"
echo "*** full path to gtk-config."
else
if test -f conf.gtktest ; then
:
else
echo "*** Could not run GTK test program, checking why..."
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
AC_TRY_LINK([
#include <gtk/gtk.h>
#include <stdio.h>
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK or finding the wrong"
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
echo "***"
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
echo "*** came with the system with the command"
echo "***"
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
GTK_CFLAGS=""
GTK_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
rm -f conf.gtktest
])
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])

2324
configure vendored

File diff suppressed because it is too large Load Diff

View File

@@ -384,6 +384,7 @@ dnl ------------------------------------------------------------------------
dnl assume Unix
USE_UNIX=1
USE_WIN32=0
USE_DOS=0
USE_BEOS=0
USE_MAC=0
@@ -412,6 +413,9 @@ dnl _REENTRANT" and it's easier to just define this symbol for these platforms
dnl than checking it during run-time
NEEDS_D_REENTRANT_FOR_R_FUNCS=0
dnl the additional define needed for MT programs
CPP_MT_FLAG=-D_REENTRANT
dnl the list of all available toolkits
dnl
dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
@@ -492,6 +496,7 @@ case "${host}" in
*-*-freebsd*)
USE_BSD=1
USE_FREEBSD=1
CPP_MT_FLAG=-D_THREAD_SAFE
AC_DEFINE(__FREEBSD__)
AC_DEFINE(__BSD__)
DEFAULT_DEFAULT_wxUSE_GTK=1
@@ -557,6 +562,15 @@ case "${host}" in
DEFAULT_DEFAULT_wxUSE_MSW=1
;;
*-pc-msdosdjgpp )
USE_UNIX=0
USE_DOS=1
AC_DEFINE(__DOS__)
PROGRAM_EXT=".exe"
DEFAULT_DEFAULT_wxUSE_MGL=1
DEFAULT_DEFAULT_wxUSE_SHARED=0
;;
*-pc-os2_emx | *-pc-os2-emx )
AC_DEFINE(__EMX__)
PROGRAM_EXT=".exe"
@@ -567,6 +581,7 @@ case "${host}" in
dnl PowerPC Darwin based distributions (including Mac OS X)
USE_BSD=1
USE_DARWIN=1
CPP_MT_FLAG=
SO_SUFFIX=dylib
AC_DEFINE(__BSD__)
AC_DEFINE(__DARWIN__)
@@ -1414,7 +1429,7 @@ AC_CACHE_SAVE
dnl cross-compiling support: we're cross compiling if the build system is
dnl different from the target one (assume host and target be always the same)
if test "$build" != "$host" ; then
if test "$USE_WIN32" = 1 ; then
if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 ; then
CC=$host_alias-gcc
CXX=$host_alias-c++
AR=$host_alias-ar
@@ -1959,17 +1974,24 @@ if test "$wxUSE_GUI" = "yes"; then
gtk_version_cached=0
AC_MSG_RESULT()
dnl we must link against lgthread unless the user
dnl used --disable-threads
GTK_MODULES=
if test "$wxUSE_THREADS" = "yes"; then
GTK_MODULES=gthread
fi
wx_cv_lib_gtk=
if test "x$wxUSE_GTK2" = "xyes"; then
AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, gthread)
AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
fi
if test -z "$wx_cv_lib_gtk"; then
AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7)
AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
fi
if test -z "$wx_cv_lib_gtk"; then
AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3)
AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
fi
if test -z "$wx_cv_lib_gtk"; then
@@ -2019,8 +2041,6 @@ equivalent variable and GTK+ is version 1.2.3 or above.
fi
if test "$wxUSE_MGL" = 1; then
dnl FIXME_MGL - test for MGL's variants for freebsd etc.
AC_MSG_CHECKING(for SciTech MGL library)
if test "x$MGL_ROOT" = x ; then
AC_MSG_RESULT(not found)
@@ -2029,7 +2049,19 @@ equivalent variable and GTK+ is version 1.2.3 or above.
AC_MSG_RESULT($MGL_ROOT)
fi
mgl_os=linux/gcc/glibc
dnl Find MGL library that we want
dnl FIXME_MGL - test for MGL variants for freebsd etc.
case "${host}" in
*-*-linux* )
mgl_os=linux/gcc/glibc
;;
*-pc-msdosdjgpp )
mgl_os=dos32/dj2
;;
*)
AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
esac
mgl_lib_type=""
if test "$wxUSE_DEBUG_FLAG" = yes ; then
@@ -2242,7 +2274,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)"
if test "$TOOLKIT" != "MSW"; then
if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then
ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)"
fi
@@ -2889,20 +2921,21 @@ AC_FUNC_VPRINTF
dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS here,
dnl do it manually
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS() here,
dnl do it manually. We can't use AC_TRY_COMPILE(), either, because it doesn't
dnl check if the symbol is available at linking time
dnl we use AC_TRY_COMPILE() here instead of AC_TRY_RUN() to make the checks
dnl work for cross-compilation, but AC_TRY_COMPILE() normally only compiles
dnl we use AC_TRY_LINK() here instead of AC_TRY_RUN() to make the checks
dnl work for cross-compilation, but AC_TRY_LINK() normally only compiles
dnl one function while we need at least 2 - hence the ugly hack below. To
dnl understand why it works, remember that AC_TRY_COMPILE() just prepends
dnl understand why it works, remember that AC_TRY_LINK() just prepends
dnl "int main() {" in the beginning of the code and "; return 0; }" at the
dnl end...
dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
dnl we'll find under MSW if it exists.
dnl final note: AC_TRY_COMPILE will only be executed if there is nothing in
dnl final note: AC_TRY_LINK will only be executed if there is nothing in
dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
dnl runs
@@ -2910,7 +2943,7 @@ dnl runs
dnl check for vsnprintf() - a safe version of vsprintf()
AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
[
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <stdio.h>
#include <stdarg.h>
], [
@@ -2931,7 +2964,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
], [
wx_cv_func_vsnprintf=yes
], [
AC_TRY_COMPILE([
AC_TRY_LINK([
#include <stdio.h>
#include <stdarg.h>
], [
@@ -2960,7 +2993,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
if test "$wx_cv_func_vsnprintf" = yes; then
AC_DEFINE(HAVE_VSNPRINTF)
else
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
fi
dnl check for vsscanf()
@@ -3434,10 +3467,8 @@ fi
if test "$wxUSE_THREADS" = "yes"; then
AC_DEFINE(wxUSE_THREADS)
dnl must define _REENTRANT for multithreaded code except for Darwin/Mac OS X
if test "$USE_DARWIN" != 1; then
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -D_REENTRANT"
fi
dnl we must define _REENTRANT or something along these lines for MT code
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS $CPP_MT_FLAG"
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
else
@@ -3763,7 +3794,11 @@ if test "$wxUSE_DATETIME" = "yes"; then
[
wx_cv_var_timezone=__timezone
],
AC_MSG_ERROR(no timezone variable)
[
if test "$USE_DOS" = 0 ; then
AC_MSG_ERROR(no timezone variable)
fi
]
)
]
)
@@ -3773,7 +3808,9 @@ if test "$wxUSE_DATETIME" = "yes"; then
)
dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
if test "x$wx_cv_var_timezone" != x ; then
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
fi
dnl check for localtime (it's POSIX, but the check can do no harm...)
AC_CHECK_FUNCS(localtime)

View File

@@ -230,7 +230,7 @@ void wxLEDNumberCtrl::OnPaint(wxPaintEvent &Event)
// just skip it
break;
default :
wxFAIL_MSG(_("Unknown digit value"));
wxFAIL_MSG(wxT("Unknown digit value"));
break;
}
}
@@ -344,7 +344,7 @@ void wxLEDNumberCtrl::RecalcInternals(const wxSize &CurrentSize)
m_LeftStartPos = (ClientWidth - ValueWidth) / 2;
break;
default :
wxFAIL_MSG(_("Unknown alignent value for wxLEDNumberCtrl."));
wxFAIL_MSG(wxT("Unknown alignent value for wxLEDNumberCtrl."));
break;
}
}

View File

@@ -494,11 +494,16 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
wxString wxXmlResourceHandler::GetText(const wxString& param)
{
wxString str1 = GetParamValue(param);
wxString str1;
wxString str2;
const wxChar *dt;
wxChar amp_char;
if (m_resource->GetUseLocale())
str1 = wxGetTranslation(GetParamValue(param));
else
str1 = GetParamValue(param);
// VS: First version of XRC resources used $ instead of & (which is illegal in XML),
// but later I realized that '_' fits this purpose much better (because
// &File means "File with F underlined").
@@ -529,11 +534,8 @@ wxString wxXmlResourceHandler::GetText(const wxString& param)
}
else str2 << *dt;
}
if (m_resource->GetUseLocale())
return wxGetTranslation(str2);
else
return str2;
return str2;
}

View File

@@ -1,15 +0,0 @@
# Top dir of wxWindows
top_builddir = /gtm/bart/wxGTK
PROGRAM=dbbrowser_gtk
OBJECTS= dbbrowse.o doc.o pgmctrl.o tabpgwin.o\
browsedb.o dbtree.o dbgrid.o dlguser.o
include $(top_builddir)/src/makeprog.env

224
distrib/msw/copybase.bat Executable file
View File

@@ -0,0 +1,224 @@
@echo off
rem VZ: this is quick and _very_ dirty
set VER=2.3.2
set DEST=s:\upload\wxBase-%VER%
mkdir %DEST%
mkdir %DEST%\include
mkdir %DEST%\include\wx
mkdir %DEST%\include\wx\msw
mkdir %DEST%\include\wx\protocol
mkdir %DEST%\include\wx\unix
mkdir %DEST%\locale
mkdir %DEST%\samples
mkdir %DEST%\samples\console
mkdir %DEST%\src
mkdir %DEST%\src\common
mkdir %DEST%\src\msw
mkdir %DEST%\src\regex
mkdir %DEST%\src\unix
mkdir %DEST%\src\zlib
chdir %WXWIN%
rem Copy the files to the root directory
copy /q docs\changes.txt %DEST%\CHANGES.txt
copy /q docs\licence.txt %DEST%\LICENCE.txt
copy /q docs\install.txt %DEST%\README.txt
copy /q docs\symbols.txt %DEST%\SYMBOLS.txt
rem Copy the project files
copy /q src\wxBase.dsp %DEST%\src\wxBase.dsp
copy /q src\wxBase.dsw %DEST%\src\wxBase.dsw
copy /q include\wx\msw\setup.h %DEST%\include\wx\msw\setup.h
rem Copy the sample
copy /q samples\console\console.cpp %DEST%\samples\console\console.cpp
copy /q samples\console\console.dsp %DEST%\samples\console\console.dsp
copy /q samples\console\testdata.fc %DEST%\samples\console\testdata.fc
rem Copy regex and zlib files
copy /q src\regex\*.* %DEST%\src\regex
copy /q src\zlib\*.* %DEST%\src\zlib
rem The rest is generated from src/files.lst
copy /q include\wx\app.h %DEST%\include\wx\app.h
copy /q include\wx\arrimpl.cpp %DEST%\include\wx\arrimpl.cpp
copy /q include\wx\buffer.h %DEST%\include\wx\buffer.h
copy /q include\wx\chkconf.h %DEST%\include\wx\chkconf.h
copy /q include\wx\clntdata.h %DEST%\include\wx\clntdata.h
copy /q include\wx\cmdline.h %DEST%\include\wx\cmdline.h
copy /q include\wx\confbase.h %DEST%\include\wx\confbase.h
copy /q include\wx\config.h %DEST%\include\wx\config.h
copy /q include\wx\date.h %DEST%\include\wx\date.h
copy /q include\wx\datetime.h %DEST%\include\wx\datetime.h
copy /q include\wx\datetime.inl %DEST%\include\wx\datetime.inl
copy /q include\wx\datstrm.h %DEST%\include\wx\datstrm.h
copy /q include\wx\db.h %DEST%\include\wx\db.h
copy /q include\wx\dbtable.h %DEST%\include\wx\dbtable.h
copy /q include\wx\dde.h %DEST%\include\wx\dde.h
copy /q include\wx\debug.h %DEST%\include\wx\debug.h
copy /q include\wx\defs.h %DEST%\include\wx\defs.h
copy /q include\wx\dir.h %DEST%\include\wx\dir.h
copy /q include\wx\dynarray.h %DEST%\include\wx\dynarray.h
copy /q include\wx\dynlib.h %DEST%\include\wx\dynlib.h
copy /q include\wx\encconv.h %DEST%\include\wx\encconv.h
copy /q include\wx\event.h %DEST%\include\wx\event.h
copy /q include\wx\ffile.h %DEST%\include\wx\ffile.h
copy /q include\wx\file.h %DEST%\include\wx\file.h
copy /q include\wx\fileconf.h %DEST%\include\wx\fileconf.h
copy /q include\wx\filefn.h %DEST%\include\wx\filefn.h
copy /q include\wx\filename.h %DEST%\include\wx\filename.h
copy /q include\wx\filesys.h %DEST%\include\wx\filesys.h
copy /q include\wx\fontenc.h %DEST%\include\wx\fontenc.h
copy /q include\wx\fontmap.h %DEST%\include\wx\fontmap.h
copy /q include\wx\fs_inet.h %DEST%\include\wx\fs_inet.h
copy /q include\wx\fs_mem.h %DEST%\include\wx\fs_mem.h
copy /q include\wx\fs_zip.h %DEST%\include\wx\fs_zip.h
copy /q include\wx\gsocket.h %DEST%\include\wx\gsocket.h
copy /q include\wx\hash.h %DEST%\include\wx\hash.h
copy /q include\wx\intl.h %DEST%\include\wx\intl.h
copy /q include\wx\ioswrap.h %DEST%\include\wx\ioswrap.h
copy /q include\wx\ipcbase.h %DEST%\include\wx\ipcbase.h
copy /q include\wx\list.h %DEST%\include\wx\list.h
copy /q include\wx\listimpl.cpp %DEST%\include\wx\listimpl.cpp
copy /q include\wx\log.h %DEST%\include\wx\log.h
copy /q include\wx\longlong.h %DEST%\include\wx\longlong.h
copy /q include\wx\memconf.h %DEST%\include\wx\memconf.h
copy /q include\wx\memory.h %DEST%\include\wx\memory.h
copy /q include\wx\memtext.h %DEST%\include\wx\memtext.h
copy /q include\wx\mimetype.h %DEST%\include\wx\mimetype.h
copy /q include\wx\module.h %DEST%\include\wx\module.h
copy /q include\wx\mstream.h %DEST%\include\wx\mstream.h
copy /q include\wx\object.h %DEST%\include\wx\object.h
copy /q include\wx\objstrm.h %DEST%\include\wx\objstrm.h
copy /q include\wx\platform.h %DEST%\include\wx\platform.h
copy /q include\wx\process.h %DEST%\include\wx\process.h
copy /q include\wx\regex.h %DEST%\include\wx\regex.h
copy /q include\wx\sckaddr.h %DEST%\include\wx\sckaddr.h
copy /q include\wx\sckipc.h %DEST%\include\wx\sckipc.h
copy /q include\wx\sckstrm.h %DEST%\include\wx\sckstrm.h
copy /q include\wx\serbase.h %DEST%\include\wx\serbase.h
copy /q include\wx\snglinst.h %DEST%\include\wx\snglinst.h
copy /q include\wx\socket.h %DEST%\include\wx\socket.h
copy /q include\wx\strconv.h %DEST%\include\wx\strconv.h
copy /q include\wx\stream.h %DEST%\include\wx\stream.h
copy /q include\wx\string.h %DEST%\include\wx\string.h
copy /q include\wx\sysopt.h %DEST%\include\wx\sysopt.h
copy /q include\wx\textbuf.h %DEST%\include\wx\textbuf.h
copy /q include\wx\textfile.h %DEST%\include\wx\textfile.h
copy /q include\wx\thread.h %DEST%\include\wx\thread.h
copy /q include\wx\time.h %DEST%\include\wx\time.h
copy /q include\wx\timer.h %DEST%\include\wx\timer.h
copy /q include\wx\tokenzr.h %DEST%\include\wx\tokenzr.h
copy /q include\wx\txtstrm.h %DEST%\include\wx\txtstrm.h
copy /q include\wx\url.h %DEST%\include\wx\url.h
copy /q include\wx\utils.h %DEST%\include\wx\utils.h
copy /q include\wx\variant.h %DEST%\include\wx\variant.h
copy /q include\wx\vector.h %DEST%\include\wx\vector.h
copy /q include\wx\version.h %DEST%\include\wx\version.h
copy /q include\wx\wfstream.h %DEST%\include\wx\wfstream.h
copy /q include\wx\wx.h %DEST%\include\wx\wx.h
copy /q include\wx\wxchar.h %DEST%\include\wx\wxchar.h
copy /q include\wx\wxprec.h %DEST%\include\wx\wxprec.h
copy /q include\wx\zipstrm.h %DEST%\include\wx\zipstrm.h
copy /q include\wx\zstream.h %DEST%\include\wx\zstream.h
copy /q include\wx\unix\gsockunx.h %DEST%\include\wx\unix\gsockunx.h
copy /q include\wx\unix\mimetype.h %DEST%\include\wx\unix\mimetype.h
copy /q include\wx\msw\dde.h %DEST%\include\wx\msw\dde.h
copy /q include\wx\msw\mimetype.h %DEST%\include\wx\msw\mimetype.h
copy /q include\wx\protocol\file.h %DEST%\include\wx\protocol\file.h
copy /q include\wx\protocol\ftp.h %DEST%\include\wx\protocol\ftp.h
copy /q include\wx\protocol\http.h %DEST%\include\wx\protocol\http.h
copy /q include\wx\protocol\protocol.h %DEST%\include\wx\protocol\protocol.h
copy /q src\common\init.cpp %DEST%\src\common\init.cpp
copy /q src\common\appcmn.cpp %DEST%\src\common\appcmn.cpp
copy /q src\common\clntdata.cpp %DEST%\src\common\clntdata.cpp
copy /q src\common\cmdline.cpp %DEST%\src\common\cmdline.cpp
copy /q src\common\config.cpp %DEST%\src\common\config.cpp
copy /q src\common\datetime.cpp %DEST%\src\common\datetime.cpp
copy /q src\common\datstrm.cpp %DEST%\src\common\datstrm.cpp
copy /q src\common\db.cpp %DEST%\src\common\db.cpp
copy /q src\common\dbtable.cpp %DEST%\src\common\dbtable.cpp
copy /q src\common\dircmn.cpp %DEST%\src\common\dircmn.cpp
copy /q src\common\dynarray.cpp %DEST%\src\common\dynarray.cpp
copy /q src\common\dynlib.cpp %DEST%\src\common\dynlib.cpp
copy /q src\common\encconv.cpp %DEST%\src\common\encconv.cpp
copy /q src\common\event.cpp %DEST%\src\common\event.cpp
copy /q src\common\extended.c %DEST%\src\common\extended.c
copy /q src\common\ffile.cpp %DEST%\src\common\ffile.cpp
copy /q src\common\file.cpp %DEST%\src\common\file.cpp
copy /q src\common\fileconf.cpp %DEST%\src\common\fileconf.cpp
copy /q src\common\filefn.cpp %DEST%\src\common\filefn.cpp
copy /q src\common\filename.cpp %DEST%\src\common\filename.cpp
copy /q src\common\filesys.cpp %DEST%\src\common\filesys.cpp
copy /q src\common\fontmap.cpp %DEST%\src\common\fontmap.cpp
copy /q src\common\fs_inet.cpp %DEST%\src\common\fs_inet.cpp
copy /q src\common\fs_mem.cpp %DEST%\src\common\fs_mem.cpp
copy /q src\common\fs_zip.cpp %DEST%\src\common\fs_zip.cpp
copy /q src\common\ftp.cpp %DEST%\src\common\ftp.cpp
copy /q src\common\hash.cpp %DEST%\src\common\hash.cpp
copy /q src\common\http.cpp %DEST%\src\common\http.cpp
copy /q src\common\intl.cpp %DEST%\src\common\intl.cpp
copy /q src\common\ipcbase.cpp %DEST%\src\common\ipcbase.cpp
copy /q src\common\list.cpp %DEST%\src\common\list.cpp
copy /q src\common\log.cpp %DEST%\src\common\log.cpp
copy /q src\common\longlong.cpp %DEST%\src\common\longlong.cpp
copy /q src\common\memory.cpp %DEST%\src\common\memory.cpp
copy /q src\common\mimecmn.cpp %DEST%\src\common\mimecmn.cpp
copy /q src\common\module.cpp %DEST%\src\common\module.cpp
copy /q src\common\mstream.cpp %DEST%\src\common\mstream.cpp
copy /q src\common\object.cpp %DEST%\src\common\object.cpp
copy /q src\common\objstrm.cpp %DEST%\src\common\objstrm.cpp
copy /q src\common\process.cpp %DEST%\src\common\process.cpp
copy /q src\common\protocol.cpp %DEST%\src\common\protocol.cpp
copy /q src\common\regex.cpp %DEST%\src\common\regex.cpp
copy /q src\common\sckaddr.cpp %DEST%\src\common\sckaddr.cpp
copy /q src\common\sckfile.cpp %DEST%\src\common\sckfile.cpp
copy /q src\common\sckipc.cpp %DEST%\src\common\sckipc.cpp
copy /q src\common\sckstrm.cpp %DEST%\src\common\sckstrm.cpp
copy /q src\common\serbase.cpp %DEST%\src\common\serbase.cpp
copy /q src\common\socket.cpp %DEST%\src\common\socket.cpp
copy /q src\common\strconv.cpp %DEST%\src\common\strconv.cpp
copy /q src\common\stream.cpp %DEST%\src\common\stream.cpp
copy /q src\common\string.cpp %DEST%\src\common\string.cpp
copy /q src\common\sysopt.cpp %DEST%\src\common\sysopt.cpp
copy /q src\common\textbuf.cpp %DEST%\src\common\textbuf.cpp
copy /q src\common\textfile.cpp %DEST%\src\common\textfile.cpp
copy /q src\common\timercmn.cpp %DEST%\src\common\timercmn.cpp
copy /q src\common\tokenzr.cpp %DEST%\src\common\tokenzr.cpp
copy /q src\common\txtstrm.cpp %DEST%\src\common\txtstrm.cpp
copy /q src\common\unzip.c %DEST%\src\common\unzip.c
copy /q src\common\url.cpp %DEST%\src\common\url.cpp
copy /q src\common\utilscmn.cpp %DEST%\src\common\utilscmn.cpp
copy /q src\common\variant.cpp %DEST%\src\common\variant.cpp
copy /q src\common\wfstream.cpp %DEST%\src\common\wfstream.cpp
copy /q src\common\wxchar.cpp %DEST%\src\common\wxchar.cpp
copy /q src\common\zipstrm.cpp %DEST%\src\common\zipstrm.cpp
copy /q src\common\zstream.cpp %DEST%\src\common\zstream.cpp
copy /q src\unix\dir.cpp %DEST%\src\unix\dir.cpp
copy /q src\unix\gsocket.c %DEST%\src\unix\gsocket.c
copy /q src\unix\mimetype.cpp %DEST%\src\unix\mimetype.cpp
copy /q src\unix\snglinst.cpp %DEST%\src\unix\snglinst.cpp
copy /q src\unix\threadpsx.cpp %DEST%\src\unix\threadpsx.cpp
copy /q src\unix\utilsunx.cpp %DEST%\src\unix\utilsunx.cpp
copy /q src\msw\dde.cpp %DEST%\src\msw\dde.cpp
copy /q src\msw\dir.cpp %DEST%\src\msw\dir.cpp
copy /q src\msw\gsocket.c %DEST%\src\msw\gsocket.c
copy /q src\msw\gsockmsw.c %DEST%\src\msw\gsockmsw.c
copy /q src\msw\main.cpp %DEST%\src\msw\main.cpp
copy /q src\msw\mimetype.cpp %DEST%\src\msw\mimetype.cpp
copy /q src\msw\regconf.cpp %DEST%\src\msw\regconf.cpp
copy /q src\msw\registry.cpp %DEST%\src\msw\registry.cpp
copy /q src\msw\snglinst.cpp %DEST%\src\msw\snglinst.cpp
copy /q src\msw\thread.cpp %DEST%\src\msw\thread.cpp
copy /q src\msw\utils.cpp %DEST%\src\msw\utils.cpp
copy /q src\msw\utilsexc.cpp %DEST%\src\msw\utilsexc.cpp

View File

@@ -350,9 +350,9 @@ wave.cpp MSW
window.cpp MSW LowLevel
dialup.cpp Unix NotMac
dir.cpp Unix Base,NotMac
fontenum.cpp Unix NotMac
fontutil.cpp Unix NotMac
dir.cpp Unix Base,NotMac,NotMGL
fontenum.cpp Unix NotMac,NotMGL
fontutil.cpp Unix NotMac,NotMGL
gsocket.c Unix Base,NotMac
mimetype.cpp Unix Base,NotMac
snglinst.cpp Unix Base
@@ -1444,11 +1444,12 @@ brush.cpp MGL LowLevel
pen.cpp MGL LowLevel
font.cpp MGL LowLevel
data.cpp MGL LowLevel
#fontenum.cpp MGL LowLevel
#fontutil.cpp MGL LowLevel
fontenum.cpp MGL LowLevel
fontutil.cpp MGL LowLevel
evtloop.cpp MGL LowLevel
app.cpp MGL LowLevel
bitmap.cpp MGL LowLevel
dir.cpp MGL LowLevel
clipbrd.cpp MGL LowLevel
cursor.cpp MGL LowLevel
dcclient.cpp MGL LowLevel

View File

@@ -45,6 +45,8 @@
}
foreach $file (sort keys %wxUNIX) {
next if $wxUNIX{$file} =~ /\bNotMGL\b/;
($fileobj = $file) =~ s/cp?p?$/\o/;
$project{"MGL_SOURCES"} .= "unix/" . $file . " ";

View File

@@ -10,4 +10,5 @@ src/univ/themes/*.cpp
docs/microwin/readme.txt
docs/microwin/microwindows.patches
docs/univ/*.txt

View File

@@ -60,6 +60,20 @@ Unix ports:
and the compiler flags for C++ files only, CFLAGS should still be used
to compile pure C files.
2.3.3
-----
All:
- fixes to the command line parsing error and usage messages
- modified wxFileName::CreateTempFileName() to open the file atomically
(if possible) and, especially, not to leak the file descriptors under Unix
wxMSW:
- fixed flicker in wxTreeCtrl::SetItemXXX()
- fixed redraw problems in dynamically resized wxStaticText
2.3.2
-----
@@ -93,6 +107,8 @@ All (GUI):
wxMSW:
- support for the DBCS fonts (CP 932, 936, 949, 950) (Nathan Cook)
- new library naming convention under VC++ -- please change your application
project files
wxGTK:

View File

@@ -5,24 +5,13 @@
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#FF0000 VLINK=#000000>
<BODY BGCOLOR=#FFFFFF TEXT=#000000 VLINK="#63659C" LINK="#313063" ALINK="#313063">
<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">
<IMG src="logo.gif" align=left>
<!-- wxWindows Documentation -->
</font>
</td>
</tr>
</table>
<P>
<IMG src="logo.gif" align=left hspace=10 vspace=0>
Welcome to wxWindows 2, the premi&egrave;re cross-platform GUI C++ framework. This is an index of
the plain text, HTML, Windows Help and Acrobat documentation: availability depends on what you've
@@ -76,16 +65,16 @@ downloaded from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P
<table border=1 align=center>
<tr>
<td align=center bgcolor="#FFFF00">
<td align=center bgcolor="#C4ECF9">
<B>HTML</B>
</td>
<td align=center bgcolor="#FFFF00">
<td align=center bgcolor="#C4ECF9">
<B>WinHelp</B>
</td>
<td align=center bgcolor="#FFFF00">
<td align=center bgcolor="#C4ECF9">
<B>MS HTML Help</B>
</td>
<td align=center bgcolor="#FFFF00">
<td align=center bgcolor="#C4ECF9">
<B>PDF</B>
</td>
</tr>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

@@ -1,14 +1,121 @@
INSTALL.TXT
wxBase README
=============
NB: this file describes the installation of wxBase library. If you are using a
GUI version of wxWindows, please refer to the install.txt in the
appropriate subdirectory (msw, gtk, motif).
NB: this file applies to wxBase library only. If you are using a GUI version
of wxWindows, please refer to the documentation in the appropriate
subdirectory (msw, gtk, motif &c).
0. Requirments and supported platforms
-----------------------------------
1. Installing under Win32
----------------------
Welcome to wxBase!
0. Introduction
---------------
wxBase is the library providing most of the non-GUI classes of the wxWindows
cross-platform C++ framework. wxBase has some generic classes such as yet
another C++ string class, typesafe dynamic arrays, hashes and lists and, more
excitingly, wxDateTime - a very flexible and powerful class for manipulating
the dates in the range of 580 million years with up to millisecond precision.
Another useful class not present in the standard C++ library is wxRegEx which
allows you to use regular expressions for string matching and replacing.
There are also classes for writing portable programs in C++ painlessly which
encapsulate things like files (and their names), directories, processes,
threads, sockets and much more. Some of the other utility classes allow you to
parse the command line, limit the number of instances of your program
executing simultaneously (portably!) and so on.
1. Requirments and supported platforms
--------------------------------------
wxBase can be compiled and used under Win32, mostly any modern Unix system
(probably including Mac OS X but it wasn't tested there), VMS and BeOS (this
release couldn't be tested under these platforms neither so you might
encounter some problems but they should be easy to solve - please contact us
in this case!)
It is written without using any modern C++ features (such as templates,
exceptions, namespaces) for maximal portability and so you shouldn't have
problems compiling it with any C++ compiler at all. However, we only provide
the project files for Microsoft Visual C++ 6.0 for Win32 (any contributions
are welcome!) - but our Unix makefiles will work with any compiler.
2. Installing under Win32
-------------------------
Please note that wxBase can be compiled in different configurations under
Win32: as a static or shared library, in debug or release mode and in ANSI
or Unicode mode for a total of 8 possibilities.
a) Using Visual C++ 6.0
Simply open the src/wxBase.dsw file in MSDEV and build it. When it is
done you can also open samples/console/console.dsp project and build it as
well.
b) Cygwin
Please refer to the Unix section below
c) Other compilers
Unfortunately we don't have the makefiles for any other compilers yet.
Please contact us if you would like to help us with creating one for the
compiler you use.
3. Installing under Unix/BeOS
-----------------------------
NB: If you're building wxBase from the wxWindows distribution and not from a
separate wxBase one you will need to add "--disable-gui" to configure
arguments below!
Please note that GNU make is required to build wxBase!
The recommended way to build wxBase is:
% cd ..../wxWindows
% mkdir base-release
% cd base-release
% ../configure
# ignore the error messages about missing samples
% make
% make install
You can also do:
% mkdir base-debug
% cd base-debug
% ../configure --enable-debug
% make
To build the sample then cd to samples/console and make there.
4. Documentation and support
----------------------------
The console sample provided with this distribution tests most (but not all)
wxBase classes. It doesn't do anything useful per itself but you may want to
look at its code to see examples of usage of the class you are interested in.
There is no separate documentation for wxBase, please refer to wxWindows
documentation instead.
Support for wxBase is available from the same places as for wxWindows itself,
namely:
* Usenet newsgroup comp.soft-sys.wxwindows
* Mailing lists: see http://lists.wxwindows.org/ for more information
* WWW page: http://www.wxwindows.org/
Hope you will find wxBase useful!
Vadim Zeitlin
This file is accurate for the version 2.3.2 of wxBase. It was last modified on
Dec 11, 2001.
2. Installing under Unix/BeOS
--------------------------

View File

@@ -405,12 +405,20 @@ Add a parameter of the given {\it type} to the command line description.
\membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse}
\func{int}{Parse}{\void}
\func{int}{Parse}{\param{bool }{giveUsage = {\tt TRUE}}}
Parse the command line, return $0$ if ok, $-1$ if {\tt "-h"} or {\tt "--help"}
option was encountered and the help message was given or a positive value if a
syntax error occured.
\wxheading{Parameters}
\docparam{giveUsage}{If {\tt TRUE} (default), the usage message is given if a
syntax error was encountered while parsing the command line or if help was
requested. If {\tt FALSE}, only error messages about possible syntax errors
are given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage message
from the caller if needed.}
\membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage}
\func{void}{Usage}{\void}

View File

@@ -686,11 +686,12 @@ exist it is created.
\func{void}{SetRecordDefaults}{\param{bool }{bDoIt = TRUE}}
Sets whether defaults are written back to the config file.
Sets whether defaults are recorded to the config file whenever an attempt to
read read the value which is not present in it is done.
If on (default is off) all default values are written back to the config file.
This allows the user to see what config options may be changed and is probably
useful only for wxFileConfig.
If on (default is off) all default values for the settings used by the program
are written back to the config file. This allows the user to see what config
options may be changed and is probably useful only for wxFileConfig.
\membersection{wxConfigBase::SetUmask}\label{wxfileconfigsetumask}

View File

@@ -226,7 +226,7 @@ Set this file name object to the home directory.
\membersection{wxFileName::AssignTempFileName}\label{wxfilenameassigntempfilename}
\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}}
\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
The function calls \helpref{CreateTempFileName}{wxfilenamecreatetempfilename} to
create a temporary file and sets this object to the name of the file. If a
@@ -241,16 +241,28 @@ Reset all components to default, uninitialized state.
\membersection{wxFileName::CreateTempFileName}\label{wxfilenamecreatetempfilename}
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}}
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
Returns a temporary file name starting with the given {\it prefix}. If
the {\it prefix} is an absolute path, the temporary file is created in this
directory, otherwise it is created in the default system directory for the
temporary files or in the current directory.
If the function succeeds, the temporary file is actually created (but not
opened) as well. Under Unix, it will have read and write permissions for the
owner only.
If the function succeeds, the temporary file is actually created. If\rtfsp
{\it fileTemp} is not {\tt NULL}, this file will be opened using the name of
the temporary file. When possible, this is done in an atomic way ensuring that
no race condition occurs between the temporary file name generation and opening
it which could often lead to security compromise on the multiuser systems.
If {\it fileTemp} is {\tt NULL}, the file is only created, but not opened.
Under Unix, the temporary file will have read and write permissions for the
owner only to minimize the security problems.
\wxheading{Parameters}
\docparam{prefix}{Prefix to use for the temporary file name construction}
\docparam{fileTemp}{The file to open or {\tt NULL} to just get the name}
\wxheading{Return value}

View File

@@ -32,6 +32,10 @@ If both wxTR\_HAS\_BUTTONS and wxTR\_TWIST\_BUTTONS are given,
twister buttons are generated. Generic only.}
\twocolitem{\windowstyle{wxTR\_NO\_LINES}}{Use this style
to hide vertical level connectors.}
\twocolitem{\windowstyle{wxTR\_FULL\_ROW\_HIGHLIGHT}}{Use this style to have the background
colour and the selection highlight extend over the entire horizontal
row of the tree control window. (This flag is ignored under Windows unless you
specify wxTR\_NO\_LINES as well.) }
\twocolitem{\windowstyle{wxTR\_LINES\_AT\_ROOT}}{Use this style
to show lines between root nodes.
Only applicable if wxTR\_HIDE\_ROOT is set and wxTR\_NO\_LINES is not set.}

View File

@@ -20,9 +20,11 @@ characters from languages other than English.
Starting with release 2.1 wxWindows has support for compiling in Unicode mode
on the platforms which support it. Unicode is a standard for character
encoding which addresses the shortcomings of the previous, 8 bit standards, by
using 16 bit for encoding each character. This allows to have 65536 characters
instead of the usual 256 and is sufficient to encode all of the world
languages at once. More details about Unicode may be found at {\tt www.unicode.org}.
using at least 16 (and possibly 32) bits for encoding each character. This
allows to have at least 65536 characters (what is called the BMP, or basic
multilingual plane) and possible $2^{32}$ of them instead of the usual 256 and
is sufficient to encode all of the world languages at once. More details about
Unicode may be found at {\tt www.unicode.org}.
% TODO expand on it, say that Unicode extends ASCII, mention ISO8859, ...
@@ -52,6 +54,8 @@ Basically, there are only a few things to watch out for:
\item Character type ({\tt char} or {\tt wchar\_t})
\item Literal strings (i.e. {\tt "Hello, world!"} or {\tt '*'})
\item String functions ({\tt strlen()}, {\tt strcpy()}, ...)
\item Special preprocessor tokens ({\tt \_\_FILE\_\_}, {\tt \_\_DATE\_\_}
and {\tt \_\_TIME\_\_})
\end{itemize}
Let's look at them in order. First of all, each character in an Unicode
@@ -59,20 +63,27 @@ program takes 2 bytes instead of usual one, so another type should be used to
store the characters ({\tt char} only holds 1 byte usually). This type is
called {\tt wchar\_t} which stands for {\it wide-character type}.
Also, the string and character constants should be encoded on 2 bytes instead
of one. This is achieved by using the standard C (and C++) way: just put the
letter {\tt 'L'} after any string constant and it becomes a {\it long}
constant, i.e. a wide character one. To make things a bit more readable, you
are also allowed to prefix the constant with {\tt 'L'} instead of putting it
after it.
Also, the string and character constants should be encoded using wide
characters ({\tt wchar\_t} type) which typically take $2$ or $4$ bytes instead
of {\tt char} which only takes one. This is achieved by using the standard C
(and C++) way: just put the letter {\tt 'L'} after any string constant and it
becomes a {\it long} constant, i.e. a wide character one. To make things a bit
more readable, you are also allowed to prefix the constant with {\tt 'L'}
instead of putting it after it.
Finally, the standard C functions don't work with {\tt wchar\_t} strings, so
another set of functions exists which do the same thing but accept
Of course, the usual standard C functions don't work with {\tt wchar\_t}
strings, so another set of functions exists which do the same thing but accept
{\tt wchar\_t *} instead of {\tt char *}. For example, a function to get the
length of a wide-character string is called {\tt wcslen()} (compare with
{\tt strlen()} - you see that the only difference is that the "str" prefix
standing for "string" has been replaced with "wcs" standing for
"wide-character string").
standing for "string" has been replaced with "wcs" standing for "wide-character
string").
And finally, the standard preprocessor tokens enumerated above expand to ANSI
strings but it is more likely that Unicode strings are wanted in the Unicode
build. wxWindows provides the macros {\tt \_\_TFILE\_\_}, {\tt \_\_TDATE\_\_}
and {\tt \_\_TTIME\_\_} which behave exactly as the standard ones except that
they produce ANSI strings in ANSI build and Unicode ones in the Unicode build.
To summarize, here is a brief example of how a program which can be compiled
in both ANSI and Unicode modes could look like:
@@ -82,10 +93,14 @@ in both ANSI and Unicode modes could look like:
wchar_t wch = L'*';
const wchar_t *ws = L"Hello, world!";
int len = wcslen(ws);
wprintf(L"Compiled at %s\n", __TDATE__);
#else // ANSI
char ch = '*';
const char *s = "Hello, world!";
int len = strlen(s);
printf("Compiled at %s\n", __DATE__);
#endif // Unicode/ANSI
\end{verbatim}

View File

@@ -105,8 +105,37 @@ b) ftp.remstar.com (Julian has the password)
5. Announcing the release
-------------------------
a) FreshMeat: http://freshmeat.net/projects/wxwindowsgtk/
a) FreshMeat:
- http://freshmeat.net/projects/wxwindowsgtk/
- username and password are "wxgtk" for logging in
- hit "new release" at the top
- follow the step by step
b) wx-announce mailing list: mailto:wx-announce@lists.wxwindows.org
[where is the announcement text? TODO]
c) update www.wxwindows.org
d) GNOME (very effective, stays on front page for days):
- http://www.gnome.org/applist
- Search for wxWindows
- Update the version number
- Ignore the error message
e) MacNN:
- http://www.macnn.com
- Contact or Contribute or something
f) MacRumors:
- http://www.macrumors.com
- Contact or Contribute or something
g) Apple Developers Connection:
mailto: adcnews@apple.com
h) LinuxDevices.com:
Interesting for wxUniversal.
i) The Python mailing list:

43
docs/univ/porting.txt Normal file
View File

@@ -0,0 +1,43 @@
Porting wxUniversal to a new platform
=====================================
wxUniv relies on the low level toolkit to work. Here are the classes which
this toolkit to implement to support wxUniv (roughly sorted by importance
inside each category):
1. System classes
-----------------
wxApp
wxEventLoop
wxTimer
wxSystemSettings
2. Window classes
-----------------
wxWindow
wxTopLevelWindow
wxPopupWindow
3. GDI classes
--------------
wxDC
wxBitmap
wxBrush
wxColour
wxCursor
wxFont
wxIcon
wxPalette
wxPen
wxRegion
4. Miscellaneous
----------------
wxClipboard
wxDropSourceBase
wxDropTarget

102
docs/univ/readme.txt Normal file
View File

@@ -0,0 +1,102 @@
wxUniversal README
==================
Welcome to wxUniversal!
Acknowledgements: wxUniversal wouldn't have been written without the
generous support of SciTech Software. Many thanks to Kendall Benett and
Tom Ryan!
0. Introduction
---------------
wxUniversal is a port of wxWindows which implements the various GUI controls
by drawing them itself (using low level wxWindows classes). Please see
http://www.wxwindows.org/wxuniv.htm
for more details about it.
The advantage of wxUniversal is that you have precise control over the
controls' appearance (it is not always possible to change all aspects of the
native controls) and the theme support: the same program may be changed to
look completely differently without changing a single line of its code but
just changing the theme.
Another advantage is that it makes writing ports of wxWindows for other
platforms (such as OS/2, BeOS or QNX) much simpler, so it is of special
interest to people interested in porting wxWindows to another platform.
However, wxUniversal doesn't have a 100% native look and feel unlike the
other wxWindows ports - this is the price to pay for the extra flexibility.
1. Requirements and supported platforms
---------------------------------------
wxUniversal is used together with another wxWindows port which provides the
"low level classes" mentioned above. Currently it can be built either with
wxMSW or wxGTK. In any case, you should download the sources for the
appropriate toolkit in addition to wxUniversal - in fact, you should download
them first and then unpack wxUniversal in the same directory.
The requirments for wxUniversal are the same as for the underlying low level
toolkit.
2. Installing under Win32
-------------------------
a) Using Visual C++ 6.0
Simply open the src/wxUniv.dsw file in DevStudio and build it.
b) Cygwin
Please refer to the Unix section below
c) Other compilers
Unfortunately we don't have makefiles for any other compilers yet.
Please contact us if you would like to help us with creating one for the
compiler you use.
Note that you can use the wxUniversal classes, wxMSW and MicroWindows (from
Century Software) to build a different variant of wxUniversal than that
documented here. Please see docs/univ/readme.txt for further information.
3. Installing under Unix
------------------------
Please refer to the installation instructions for wxGTK. The only change for
wxUniversal is that you must add "--enable-univ" switch to the configure
command line.
4. Documentation and support
----------------------------
Please note that wxUniversal is not as mature as the other wxWindows ports
and is currently officially in alpha stage. In particular, it is not really
intended for the end users but rather for developers at the current stage and
this is why we don't provide any binaries for it.
There is no separate documentation for wxUniversal, please refer to wxWindows
documentation instead.
Support for wxUniversal is available from the same places as for wxWindows
itself, namely:
* Usenet newsgroup comp.soft-sys.wxwindows
* Mailing lists: see http://lists.wxwindows.org/ for more information
* WWW page: http://www.wxwindows.org/
Hope you find wxUniversal useful!
Vadim Zeitlin
This file is accurate for the version 2.3.2 of wxUniversal. It was last
modified on Dec 11, 2001.

View File

@@ -533,6 +533,22 @@
# endif
#endif /* !defined(wxUSE_WXHTML_HELP) */
#ifndef wxUSE_UNICODE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UNICODE must be defined."
# else
# define wxUSE_UNICODE 0
# endif
#endif /* !defined(wxUSE_UNICODE) */
#if defined(__WXMSW__) && !defined(wxUSE_UNICODE_MSLU)
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UNICODE_MSLU must be defined."
# else
# define wxUSE_UNICODE_MSLU 0
# endif
#endif /* !defined(wxUSE_UNICODE) */
/*
check consistency of the settings
*/
@@ -877,5 +893,14 @@
# endif
#endif /* wxUSE_CLIPBOARD */
#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_UNICODE_MSLU requires wxUSE_UNICODE"
# else
# undef wxUSE_UNICODE
# define wxUSE_UNICODE 1
# endif
#endif /* wxUSE_UNICODE_MSLU */
#endif /* wxUSE_GUI */

View File

@@ -162,7 +162,10 @@ public:
// parse the command line, return 0 if ok, -1 if "-h" or "--help" option
// was encountered and the help message was given or a positive value if a
// syntax error occured
int Parse();
//
// if showUsage is true, Usage() is called in case of syntax error or if
// help was requested
int Parse(bool showUsage = TRUE);
// give the usage message describing all program options
void Usage();

View File

@@ -155,43 +155,56 @@ public:
// key access: returns TRUE if value was really read, FALSE if default used
// (and if the key is not found the default value is returned.)
// read a string from the key
virtual bool Read(const wxString& key, wxString *pStr) const = 0;
virtual bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const;
bool Read(const wxString& key, wxString *pStr) const;
bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const;
virtual wxString Read(const wxString& key, const wxString& defVal = wxEmptyString) const;
// read a number (long)
bool Read(const wxString& key, long *pl) const;
bool Read(const wxString& key, long *pl, long defVal) const;
virtual bool Read(const wxString& key, long *pl) const = 0;
virtual bool Read(const wxString& key, long *pl, long defVal) const;
// read an int
bool Read(const wxString& key, int *pi) const;
bool Read(const wxString& key, int *pi, int defVal) const;
virtual long Read(const wxString& strKey, long defVal) const
{ long l; Read(strKey, &l, defVal); return l; }
// read a double
bool Read(const wxString& key, double* val) const;
bool Read(const wxString& key, double* val, double defVal) const;
// Convenience functions that are built on other forms
// read a bool
bool Read(const wxString& key, bool* val) const;
bool Read(const wxString& key, bool* val, bool defVal) const;
// int
virtual bool Read(const wxString& key, int *pi) const;
virtual bool Read(const wxString& key, int *pi, int defVal) const;
// convenience functions returning directly the value (we don't have them for
// int/double/bool as there would be ambiguities with the long one then)
wxString Read(const wxString& key,
const wxString& defVal = wxEmptyString) const
{ wxString s; (void)Read(key, &s, defVal); return s; }
// double
virtual bool Read(const wxString& key, double* val) const;
virtual bool Read(const wxString& key, double* val, double defVal) const;
// bool
virtual bool Read(const wxString& key, bool* val) const;
virtual bool Read(const wxString& key, bool* val, bool defVal) const;
long Read(const wxString& key, long defVal) const
{ long l; (void)Read(key, &l, defVal); return l; }
// write the value (return true on success)
virtual bool Write(const wxString& key, const wxString& value) = 0;
virtual bool Write(const wxString& key, long value) = 0;
bool Write(const wxString& key, const wxString& value)
{ return DoWriteString(key, value); }
// convenience functions
virtual bool Write(const wxString& key, double value);
virtual bool Write(const wxString& key, bool value);
bool Write(const wxString& key, long value)
{ return DoWriteLong(key, value); }
bool Write(const wxString& key, int value)
{ return DoWriteInt(key, value); }
bool Write(const wxString& key, double value)
{ return DoWriteDouble(key, value); }
bool Write(const wxString& key, bool value)
{ return DoWriteBool(key, value); }
// we have to provide a separate version for C strings as otherwise they
// would be converted to bool and not to wxString as expected!
virtual bool Write(const wxString& key, const wxChar *value);
bool Write(const wxString& key, const wxChar *value)
{ return Write(key, wxString(value)); }
// permanently writes all changes
virtual bool Flush(bool bCurrentOnly = FALSE) = 0;
@@ -242,6 +255,19 @@ protected:
static bool IsImmutable(const wxString& key)
{ return !key.IsEmpty() && key[0] == wxCONFIG_IMMUTABLE_PREFIX; }
// do read/write the values of different types
virtual bool DoReadString(const wxString& key, wxString *pStr) const = 0;
virtual bool DoReadLong(const wxString& key, long *pl) const = 0;
virtual bool DoReadInt(const wxString& key, int *pi) const;
virtual bool DoReadDouble(const wxString& key, double* val) const;
virtual bool DoReadBool(const wxString& key, bool* val) const;
virtual bool DoWriteString(const wxString& key, const wxString& value) = 0;
virtual bool DoWriteLong(const wxString& key, long value) = 0;
virtual bool DoWriteInt(const wxString& key, int value);
virtual bool DoWriteDouble(const wxString& key, double value);
virtual bool DoWriteBool(const wxString& key, bool value);
private:
// are we doing automatic environment variable expansion?
bool m_bExpandEnvVars;
@@ -260,27 +286,27 @@ private:
long m_style;
};
// a handy little class which changes current path to the path of given entry
// and restores it in dtor: so if you declare a local variable of this type,
// you work in the entry directory and the path is automatically restored
// when the function returns
// Taken out of wxConfig since not all compilers can cope with nested classes.
class wxConfigPathChanger
{
public:
// ctor/dtor do path changing/restorin
wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry);
~wxConfigPathChanger();
// a handy little class which changes current path to the path of given entry
// and restores it in dtor: so if you declare a local variable of this type,
// you work in the entry directory and the path is automatically restored
// when the function returns
// Taken out of wxConfig since not all compilers can cope with nested classes.
class wxConfigPathChanger
{
public:
// ctor/dtor do path changing/restorin
wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry);
~wxConfigPathChanger();
// get the key name
const wxString& Name() const { return m_strName; }
// get the key name
const wxString& Name() const { return m_strName; }
private:
wxConfigBase *m_pContainer; // object we live in
wxString m_strName, // name of entry (i.e. name only)
m_strOldPath; // saved path
bool m_bChanged; // was the path changed?
};
private:
wxConfigBase *m_pContainer; // object we live in
wxString m_strName, // name of entry (i.e. name only)
m_strOldPath; // saved path
bool m_bChanged; // was the path changed?
};
// ----------------------------------------------------------------------------

View File

@@ -18,6 +18,8 @@
#if wxUSE_DIALUP_MANAGER
#include "wx/event.h"
// ----------------------------------------------------------------------------
// misc
// ----------------------------------------------------------------------------

View File

@@ -152,39 +152,6 @@ public:
virtual bool HasGroup(const wxString& strName) const;
virtual bool HasEntry(const wxString& strName) const;
virtual bool Read(const wxString& key, wxString *pStr) const;
virtual bool Read(const wxString& key, wxString *pStr, const wxString& defValue) const;
virtual bool Read(const wxString& key, long *pl) const;
// The following are necessary to satisfy the compiler
wxString Read(const wxString& key, const wxString& defVal) const
{ return wxConfigBase::Read(key, defVal); }
bool Read(const wxString& key, long *pl, long defVal) const
{ return wxConfigBase::Read(key, pl, defVal); }
long Read(const wxString& key, long defVal) const
{ return wxConfigBase::Read(key, defVal); }
bool Read(const wxString& key, int *pi, int defVal) const
{ return wxConfigBase::Read(key, pi, defVal); }
bool Read(const wxString& key, int *pi) const
{ return wxConfigBase::Read(key, pi); }
bool Read(const wxString& key, double* val) const
{ return wxConfigBase::Read(key, val); }
bool Read(const wxString& key, double* val, double defVal) const
{ return wxConfigBase::Read(key, val, defVal); }
bool Read(const wxString& key, bool* val) const
{ return wxConfigBase::Read(key, val); }
bool Read(const wxString& key, bool* val, bool defVal) const
{ return wxConfigBase::Read(key, val, defVal); }
virtual bool Write(const wxString& key, const wxString& szValue);
virtual bool Write(const wxString& key, long lValue);
bool Write(const wxString& key, double value)
{ return wxConfigBase::Write(key, value); }
bool Write(const wxString& key, bool value)
{ return wxConfigBase::Write(key, value); }
bool Write(const wxString& key, const wxChar* value)
{ return wxConfigBase::Write(key, value); }
virtual bool Flush(bool bCurrentOnly = FALSE);
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
@@ -202,6 +169,13 @@ public:
void LineListRemove(wxFileConfigLineList *pLine);
bool LineListIsEmpty();
protected:
virtual bool DoReadString(const wxString& key, wxString *pStr) const;
virtual bool DoReadLong(const wxString& key, long *pl) const;
virtual bool DoWriteString(const wxString& key, const wxString& szValue);
virtual bool DoWriteLong(const wxString& key, long lValue);
private:
// GetXXXFileName helpers: return ('/' terminated) directory names
static wxString GetGlobalDir();

View File

@@ -38,6 +38,8 @@
#include "wx/filefn.h"
#include "wx/datetime.h"
class WXDLLEXPORT wxFile;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
@@ -208,9 +210,12 @@ public:
void AssignHomeDir();
static wxString GetHomeDir();
// get a temp file name starting with the specified prefix
void AssignTempFileName(const wxString& prefix);
static wxString CreateTempFileName(const wxString& prefix);
// get a temp file name starting with the specified prefix and open the
// file passed to us using this name for writing (atomically if
// possible)
void AssignTempFileName(const wxString& prefix, wxFile *fileTemp = NULL);
static wxString CreateTempFileName(const wxString& prefix,
wxFile *fileTemp = NULL);
// directory creation and removal.
// if full is TRUE, will try to make each directory in the path.
@@ -260,11 +265,12 @@ public:
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
// is this filename absolute?
bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE );
bool IsAbsolute() const
{ return !m_relative; }
// is this filename relative?
bool IsRelative( wxPathFormat format = wxPATH_NATIVE )
{ return !IsAbsolute(format); }
bool IsRelative() const
{ return m_relative; }
// Information about path format
@@ -354,6 +360,9 @@ private:
// the file name and extension (empty for directories)
wxString m_name,
m_ext;
// is the path relative
bool m_relative;
};
#endif // _WX_FILENAME_H_

View File

@@ -382,6 +382,8 @@ protected:
wxTimer *m_renameTimer;
wxString m_renameRes;
wxBitmap *m_arrowRight,*m_arrowDown;
// the common part of all ctors
void Init();

View File

@@ -543,11 +543,6 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
// debug only logging functions: use them with API name and error code
// ----------------------------------------------------------------------------
#ifndef __TFILE__
#define __XFILE__(x) Tx)
#define __TFILE__ __XFILE__(__FILE__)
#endif
#ifdef __WXDEBUG__
// make life easier for people using VC++ IDE: clicking on the message
// will take us immediately to the place of the failed API

View File

@@ -68,6 +68,8 @@
#endif
#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
#define wxLongLong_t long long
#elif defined(__DJGPP__) && __DJGPP__ >= 2
#define wxLongLong_t long long
#else // no native long long type
// both warning and pragma warning are not portable, but at least an
// unknown pragma should never be an error - except that, actually, some

View File

@@ -14,6 +14,7 @@
#define _WX_PRIVATE_H_
#include <mgraph.hpp>
#include "pmapi.h"
class WXDLLEXPORT wxBitmap;

View File

@@ -65,30 +65,6 @@ public:
// return TRUE if the current group is empty
bool IsEmpty() const;
// read/write
bool Read(const wxString& key, wxString *pStr) const;
bool Read(const wxString& key, wxString *pStr, const wxString& szDefault) const;
bool Read(const wxString& key, long *plResult) const;
// The following are necessary to satisfy the compiler
wxString Read(const wxString& key, const wxString& defVal) const
{ return wxConfigBase::Read(key, defVal); }
bool Read(const wxString& key, long *pl, long defVal) const
{ return wxConfigBase::Read(key, pl, defVal); }
long Read(const wxString& key, long defVal) const
{ return wxConfigBase::Read(key, defVal); }
bool Read(const wxString& key, int *pi, int defVal) const
{ return wxConfigBase::Read(key, pi, defVal); }
bool Read(const wxString& key, int *pi) const
{ return wxConfigBase::Read(key, pi); }
bool Read(const wxString& key, double* val) const
{ return wxConfigBase::Read(key, val); }
bool Read(const wxString& key, double* val, double defVal) const
{ return wxConfigBase::Read(key, val, defVal); }
bool Write(const wxString& key, const wxString& szValue);
bool Write(const wxString& key, long lValue);
virtual bool Flush(bool bCurrentOnly = FALSE);
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
@@ -98,6 +74,14 @@ public:
virtual bool DeleteGroup(const wxString& szKey);
virtual bool DeleteAll();
protected:
// read/write
bool DoReadString(const wxString& key, wxString *pStr) const;
bool DoReadLong(const wxString& key, long *plResult) const;
bool DoWriteString(const wxString& key, const wxString& szValue);
bool DoWriteLong(const wxString& key, long lValue);
private:
// helpers
wxString GetPrivateKeyName(const wxString& szKey) const;

View File

@@ -391,6 +391,9 @@ WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
// is, for mainly historical reasons, signed)
WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
// check if hWnd's WNDPROC is wndProc. Return true if yes, false if they are different
extern bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc);
// Does this window style specify any border?
inline bool wxStyleHasBorder(long style)
{

View File

@@ -63,41 +63,6 @@ public:
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
// read/write
bool Read(const wxString& key, wxString *pStr) const;
bool Read(const wxString& key, wxString *pStr, const wxString& szDefault) const;
wxString Read(const wxString& key, const wxString& defVal) const
{ return wxConfigBase::Read(key, defVal); }
bool Read(const wxString& key, long *plResult) const;
bool Read(const wxString& key, long *pl, long defVal) const
{ return wxConfigBase::Read(key, pl, defVal); }
long Read(const wxString& key, long defVal) const
{ return wxConfigBase::Read(key, defVal); }
// The following are necessary to satisfy the compiler
bool Read(const wxString& key, int *pi, int defVal) const
{ return wxConfigBase::Read(key, pi, defVal); }
bool Read(const wxString& key, int *pi) const
{ return wxConfigBase::Read(key, pi); }
bool Read(const wxString& key, double* val, double defVal) const
{ return wxConfigBase::Read(key, val, defVal); }
bool Read(const wxString& key, double* val) const
{ return wxConfigBase::Read(key, val); }
bool Read(const wxString& key, bool *pb, bool defVal) const
{ return wxConfigBase::Read(key, pb, defVal); }
bool Read(const wxString& key, bool *pb) const
{ return wxConfigBase::Read(key, pb); }
bool Write(const wxString& key, const wxString& szValue);
bool Write(const wxString& key, long lValue);
bool Write(const wxString& key, double dValue)
{ return wxConfigBase::Write(key, dValue); }
bool Write(const wxString& key, bool bValue)
{ return wxConfigBase::Write(key, bValue); }
virtual bool Flush(bool WXUNUSED(bCurrentOnly) = FALSE) { return TRUE; }
// rename
@@ -124,6 +89,13 @@ protected:
return self->m_keyLocal;
}
// implement read/write methods
virtual bool DoReadString(const wxString& key, wxString *pStr) const;
virtual bool DoReadLong(const wxString& key, long *plResult) const;
virtual bool DoWriteString(const wxString& key, const wxString& szValue);
virtual bool DoWriteLong(const wxString& key, long lValue);
private:
// no copy ctor/assignment operator
wxRegConfig(const wxRegConfig&);

View File

@@ -161,15 +161,27 @@
// defined as wchar_t, wxString will use Unicode internally. If you set this
// to 1, you must use wxT() macro for all literal strings in the program.
//
// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x
// Unicode is currently only fully supported under Windows NT/2000/XP (Windows 9x
// doesn't support it and the programs compiled in Unicode mode will not run
// under 9x).
//
// Default is 0
//
// Recommended setting: 0 (unless you only plan to use Windows NT/2000)
// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP)
#define wxUSE_UNICODE 0
// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWindows in Unicode mode
// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This
// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see
// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you
// will have to modify the makefiles to include unicows.lib import library as the first
// library.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_UNICODE_MSLU 0
// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without
// compiling the program in Unicode mode. More precisely, it will be possible
// to construct wxString from a wide (Unicode) string and convert any wxString

View File

@@ -16,12 +16,8 @@
#pragma interface "stattext.h"
#endif
#include "wx/control.h"
class WXDLLEXPORT wxStaticText : public wxControl
class WXDLLEXPORT wxStaticText : public wxStaticTextBase
{
DECLARE_DYNAMIC_CLASS(wxStaticText)
public:
wxStaticText() { }
@@ -44,18 +40,16 @@ public:
long style = 0,
const wxString& name = wxStaticTextNameStr);
// accessors
void SetLabel(const wxString& label);
bool SetFont( const wxFont &font );
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
// callbacks
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
// override some methods to resize the window properly
virtual void SetLabel(const wxString& label);
virtual bool SetFont( const wxFont &font );
protected:
virtual void DoSetSize(int x, int y, int w, int h,
int sizeFlags = wxSIZE_AUTO);
virtual wxSize DoGetBestSize() const;
DECLARE_DYNAMIC_CLASS(wxStaticText)
};
#endif

View File

@@ -400,6 +400,9 @@ protected:
// SetImageList helper
void SetAnyImageList(wxImageList *imageList, int which);
// refresh a single item
void RefreshItem(const wxTreeItemId& item);
wxTextCtrl *m_textCtrl; // used while editing the item label
wxImageList *m_imageListNormal, // images for tree elements
*m_imageListState; // special images for app defined states

View File

@@ -18,52 +18,68 @@ WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
class WXDLLEXPORT wxGauge: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxGauge)
public:
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
public:
inline wxGauge() { m_nRangeMax = 0; m_nGaugePos = 0; }
inline wxGauge(wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
inline wxGauge( wxWindow* pParent
,wxWindowID vId
,int nRange
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxGA_HORIZONTAL
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,const wxValidator& rValidator = wxDefaultValidator
#endif
const wxString& name = wxGaugeNameStr)
{
Create(parent, id, range, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
,const wxString& rsName = wxGaugeNameStr
)
{
Create( pParent
,vId
,nRange
,rPos
,rSize
,lStyle
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,rValidator
#endif
const wxString& name = wxGaugeNameStr);
void SetShadowWidth(int w);
void SetBezelFace(int w);
void SetRange(int r);
void SetValue(int pos);
int GetShadowWidth() const ;
int GetBezelFace() const ;
int GetRange() const ;
int GetValue() const ;
bool SetForegroundColour(const wxColour& col);
bool SetBackgroundColour(const wxColour& col);
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
protected:
int m_rangeMax;
int m_gaugePos;
};
,rsName
);
}
bool Create( wxWindow* pParent
,wxWindowID vId
,int nRange
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxGA_HORIZONTAL
#if wxUSE_VALIDATORS
,const wxValidator& rValidator = wxDefaultValidator
#endif
// _WX_GAUGE_H_
,const wxString& rsName = wxGaugeNameStr
);
int GetShadowWidth(void) const;
int GetBezelFace(void) const;
int GetRange(void) const;
int GetValue(void) const;
bool SetBackgroundColour(const wxColour& rColour);
void SetBezelFace(int nWidth);
bool SetForegroundColour(const wxColour& rColour);
void SetRange(int nRange);
void SetShadowWidth(int nWidth);
void SetValue(int nPos);
inline virtual bool AcceptsFocus(void) const { return FALSE; }
inline virtual void Command(wxCommandEvent& WXUNUSED(rEvent)) {};
protected:
int m_nRangeMax;
int m_nGaugePos;
private:
DECLARE_DYNAMIC_CLASS(wxGauge)
}; // end of CLASS wxGauge
#endif // _WX_GAUGE_H_

View File

@@ -232,6 +232,10 @@ inline bool wxStyleHasBorder(long style)
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
}
WXDLLEXPORT extern void wxOS2SetFont( HWND hWnd
,const wxFont& rFont
);
#endif
// _WX_PRIVATE_H_

View File

@@ -19,105 +19,168 @@ class WXDLLEXPORT wxBitmap ;
class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
{
DECLARE_DYNAMIC_CLASS(wxRadioBox)
public:
wxRadioBox();
wxRadioBox();
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
inline wxRadioBox( wxWindow* pParent
,wxWindowID vId
,const wxString& rsTitle
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,int nNum = 0
,const wxString asChoices[] = NULL
,int nMajorDim = 0
,long lStyle = wxRA_HORIZONTAL
#if wxUSE_VALIDATORS
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
,const wxValidator& rVal = wxDefaultValidator
#endif
{
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
}
~wxRadioBox();
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL,
,const wxString& rsName = wxRadioBoxNameStr
)
{
Create( pParent
,vId
,rsTitle
,rPos
,rSize
,nNum
,asChoices
,nMajorDim
,lStyle
#if wxUSE_VALIDATORS
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
,rVal
#endif
,rsName
);
}
virtual bool OS2Command(WXUINT param, WXWORD id);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
~wxRadioBox();
int FindString(const wxString& s) const;
void SetSelection(int N);
int GetSelection() const;
virtual int GetCount() const;
wxString GetString(int N) const;
virtual void SetString(int n, const wxString& label);
virtual int GetColumnCount() const;
virtual int GetRowCount() const;
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsTitle
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,int nNum = 0
,const wxString asChoices[] = NULL
,int nMajorDim = 0
,long lStyle = wxRA_HORIZONTAL
#if wxUSE_VALIDATORS
,const wxValidator& rVal = wxDefaultValidator
#endif
,const wxString& rsName = wxRadioBoxNameStr
);
void GetSize(int *x, int *y) const;
void GetPosition(int *x, int *y) const;
void Command(wxCommandEvent& rEvent);
bool ContainsHWND(WXHWND hWnd) const;
bool Enable(bool bEnable);
void Enable( int nItem
,bool bEnable
);
int FindString(const wxString& sStr) const;
void SetLabel(int item, const wxString& label);
void SetLabel(int item, wxBitmap *bitmap);
wxString GetLabel(int item) const;
bool Show(bool show);
void SetFocus();
bool Enable(bool enable);
void Enable(int item, bool enable);
void Show(int item, bool show) ;
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
virtual WXHBRUSH OnCtlColor( WXHDC hDC
,WXHWND hWnd
,WXUINT uCtlColor
,WXUINT uMessage
,WXWPARAM wParam
,WXLPARAM lParam
);
virtual bool OS2Command( WXUINT uParam
,WXWORD wId
);
void SendNotificationEvent(void);
void Show( int nItem
,bool bShow = TRUE
) ;
bool Show(bool bShow);
MRESULT WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
);
virtual wxString GetStringSelection() const;
virtual bool SetStringSelection(const wxString& s);
inline virtual int Number() const { return m_noItems; } ;
void Command(wxCommandEvent& event);
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
// implementation only from now on
// -------------------------------
WXHWND *GetRadioButtons() const { return m_radioButtons; }
bool ContainsHWND(WXHWND hWnd) const;
void SendNotificationEvent();
virtual int GetColumnCount(void) const;
virtual int GetCount(void) const;
inline int GetNumberOfRowsOrCols(void) const { return m_nNoRowsOrCols; }
int GetNumHor(void) const;
int GetNumVer(void) const;
void GetPosition( int* pnX
,int* pnY
) const;
inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
virtual int GetRowCount(void) const;
int GetSelection(void) const;
void GetSize( int* pnX
,int* pnY
) const;
void GetSizeFlags(void) const;
void AdjustButtons( int nX
,int nY
,int nWidth
,int nHeight
,int lSizeFlags
);
wxString GetString(int nIndex) const;
virtual wxString GetStringSelection(void) const;
// get the number of buttons per column/row
int GetNumVer() const;
int GetNumHor() const;
inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
void SetFocus(void);
virtual bool SetFont(const wxFont& rFont);
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
inline void SetNumberOfRowsOrCols(int nNum) { m_nNoRowsOrCols = nNum; }
void SetSelection(int nIndex);
virtual void SetString( int nNum
,const wxString& rsLabel
);
virtual bool SetStringSelection(const wxString& rsStr);
void SetLabel( int nItem
,const wxString& rsLabel
);
void SetLabel( int item
,wxBitmap* pBitmap
);
wxString GetLabel(int nItem) const;
#if WXWIN_COMPATIBILITY
wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
int x = -1, int y = -1, int width = -1, int height = -1,
int n = 0, char **choices = NULL,
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
#endif // WXWIN_COMPATIBILITY
protected:
void SubclassRadioButton(WXHWND hWndBtn);
void AdjustButtons( int nX
,int nY
,int nWidth
,int nHeight
,long lSizeFlags
);
virtual wxSize DoGetBestSize(void) const;
virtual void DoSetSize( int nX
,int nY
,int nWidth
,int nHeight
,int nSizeFlags = wxSIZE_AUTO
);
wxSize GetMaxButtonSize(void) const;
wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const;
void SubclassRadioButton(WXHWND hWndBtn);
WXHWND * m_radioButtons;
int m_majorDim ;
int * m_radioWidth; // for bitmaps
int * m_radioHeight;
int m_noItems;
int m_noRowsOrCols;
int m_selectedButton;
WXHWND* m_ahRadioButtons;
int m_nMajorDim ;
int* m_pnRadioWidth; // for bitmaps
int* m_pnRadioHeight;
int m_nNoItems;
int m_nNoRowsOrCols;
int m_nSelectedButton;
int m_nSizeFlags;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
private:
virtual void SetLabel(const wxString& label)
{ wxWindowBase::SetLabel(label); }
wxString GetLabel() const
{ return(wxWindowBase::GetLabel()); }
};
inline wxString GetLabel() const
{ return wxWindowBase::GetLabel(); }
inline void SetLabel(const wxString& rsLabel)
{ wxWindowBase::SetLabel(rsLabel); }
DECLARE_DYNAMIC_CLASS(wxRadioBox)
}; // end of wxRadioBox
#endif
// _WX_RADIOBOX_H_

View File

@@ -18,38 +18,55 @@ WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
class WXDLLEXPORT wxRadioButton: public wxControl
{
DECLARE_DYNAMIC_CLASS(wxRadioButton)
protected:
public:
inline wxRadioButton() {}
inline wxRadioButton(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
public:
inline wxRadioButton() {}
inline wxRadioButton( wxWindow* pParent
,wxWindowID vId
,const wxString& rsLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,const wxValidator& rValidator = wxDefaultValidator
#endif
const wxString& name = wxRadioButtonNameStr)
{
Create(parent, id, label, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
,const wxString& rsName = wxRadioButtonNameStr
)
{
Create( pParent
,vId
,rsLabel
,rPos
,rSize
,lStyle
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,rValidator
#endif
const wxString& name = wxRadioButtonNameStr);
,rsName
);
}
virtual void SetLabel(const wxString& label);
virtual void SetValue(bool val);
virtual bool GetValue() const ;
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
#if wxUSE_VALIDATORS
,const wxValidator& rValidator = wxDefaultValidator
#endif
,const wxString& rsName = wxRadioButtonNameStr
);
virtual void SetLabel(const wxString& rsLabel);
virtual void SetValue(bool bVal);
virtual bool GetValue(void) const ;
bool OS2Command(WXUINT param, WXWORD id);
void Command(wxCommandEvent& event);
};
bool OS2Command( WXUINT wParam
,WXWORD wId
);
void Command(wxCommandEvent& rEvent);
private:
DECLARE_DYNAMIC_CLASS(wxRadioButton)
}; // end of wxRadioButton
#endif
// _WX_RADIOBUT_H_

View File

@@ -376,5 +376,8 @@
#define NO_TEXT_WINDOW_STREAM 1 // defined in textctrl.h for DLL builds
#endif
#define wxUSE_UNICODE 0
#define wxUSE_UNICODE_MSLU 0
#endif
// _WX_SETUP_H_

View File

@@ -19,95 +19,135 @@ WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
// Slider
class WXDLLEXPORT wxSlider: public wxSliderBase
{
DECLARE_DYNAMIC_CLASS(wxSlider)
public:
wxSlider();
inline wxSlider(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
inline wxSlider( wxWindow* pParent
,wxWindowID vId
,int nValue
,int nMinValue
,int nMaxValue
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSL_HORIZONTAL
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,const wxValidator& rValidator = wxDefaultValidator
#endif
const wxString& name = wxSliderNameStr)
{
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
}
~wxSlider();
bool Create(wxWindow *parent, wxWindowID id,
int value, int minValue, int maxValue,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSL_HORIZONTAL,
,const wxString& rsName = wxSliderNameStr
)
{
Create( pParent
,vId
,nValue
,nMinValue
,nMaxValue
,rPos
,rSize
,lStyle
#if wxUSE_VALIDATORS
const wxValidator& validator = wxDefaultValidator,
,rValidator
#endif
const wxString& name = wxSliderNameStr);
,rsName
);
}
~wxSlider();
virtual int GetValue() const ;
virtual void SetValue(int);
bool Create( wxWindow* pParent
,wxWindowID vId
,int nValue
,int nMinValue
,int nMaxValue
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSL_HORIZONTAL
#if wxUSE_VALIDATORS
,const wxValidator& rValidator = wxDefaultValidator
#endif
,const wxString& rsName = wxSliderNameStr
);
void GetSize(int *x, int *y) const ;
void GetPosition(int *x, int *y) const ;
virtual int GetValue(void) const ;
virtual void SetValue(int);
bool Show(bool show);
void GetSize( int* pnX
,int* pnY
) const;
void GetPosition( int* pnX
,int* pnY
) const ;
bool Show(bool bShow);
void SetRange( int nMinValue
,int nMaxValue
);
void SetRange(int minValue, int maxValue);
inline int GetMin(void) const { return m_nRangeMin; }
inline int GetMax(void) const { return m_nRangeMax; }
inline int GetMin() const { return m_rangeMin; }
inline int GetMax() const { return m_rangeMax; }
//
// For trackbars only
//
void ClearSel(void);
void ClearTicks(void);
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
int GetLineSize(void) const;
int GetPageSize(void) const ;
int GetSelEnd(void) const;
int GetSelStart(void) const;
inline int GetTickFreq(void) const { return m_nTickFreq; }
int GetThumbLength(void) const ;
void SetLineSize(int nLineSize);
void SetPageSize(int nPageSize);
void SetSelection( int nMinPos
,int nMaxPos
);
void SetThumbLength(int nLen) ;
void SetTick(int ntickPos) ;
void SetTickFreq( int n
,int nPos
);
//
// IMPLEMENTATION
//
inline WXHWND GetStaticMin(void) const { return m_hStaticMin; }
inline WXHWND GetStaticMax(void) const { return m_hStaticMax; }
inline WXHWND GetEditValue(void) const { return m_hStaticValue; }
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& rEvent);
virtual WXHBRUSH OnCtlColor( WXHDC hDC
,WXHWND hWnd
,WXUINT uCtlColor
,WXUINT uMessage
,WXWPARAM wParam
,WXLPARAM lParam
);
virtual bool OS2OnScroll( int nOrientation
,WXWORD wParam
,WXWORD wPos
,WXHWND hControl
);
// For trackbars only
void SetTickFreq(int n, int pos);
inline int GetTickFreq() const { return m_tickFreq; }
void SetPageSize(int pageSize);
int GetPageSize() const ;
void ClearSel() ;
void ClearTicks() ;
void SetLineSize(int lineSize);
int GetLineSize() const ;
int GetSelEnd() const ;
int GetSelStart() const ;
void SetSelection(int minPos, int maxPos);
void SetThumbLength(int len) ;
int GetThumbLength() const ;
void SetTick(int tickPos) ;
protected:
WXHWND m_hStaticMin;
WXHWND m_hStaticMax;
WXHWND m_hStaticValue;
int m_nRangeMin;
int m_nRangeMax;
int m_nPageSize;
int m_nLineSize;
int m_nTickFreq;
double m_dPixelToRange;
int m_nThumbLength;
// IMPLEMENTATION
WXHWND GetStaticMin() const { return m_staticMin; }
WXHWND GetStaticMax() const { return m_staticMax; }
WXHWND GetEditValue() const { return m_staticValue; }
virtual bool ContainsHWND(WXHWND hWnd) const;
void Command(wxCommandEvent& event);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
virtual bool OS2OnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control);
protected:
WXHWND m_staticMin;
WXHWND m_staticMax;
WXHWND m_staticValue;
int m_rangeMin;
int m_rangeMax;
int m_pageSize;
int m_lineSize;
int m_tickFreq;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
};
virtual void DoSetSize( int nX
,int nY
,int nWidth
,int nHeight
,int nSizeFlags = wxSIZE_AUTO
);
private:
DECLARE_DYNAMIC_CLASS(wxSlider)
}; // end of CLASS wxSlider
#endif
// _WX_SLIDER_H_

View File

@@ -15,58 +15,66 @@
#include "wx/control.h"
#include "wx/event.h"
extern MRESULT EXPENTRY wxSpinCtrlWndProc(
HWND hWnd
, UINT uMessage
, MPARAM wParam
, MPARAM lParam
);
class WXDLLEXPORT wxSpinButton: public wxSpinButtonBase
{
public:
// Construction
wxSpinButton() { }
inline wxSpinButton( wxWindow *parent
,wxWindowID id = -1
,const wxPoint& pos = wxDefaultPosition
,const wxSize& size = wxDefaultSize
,long style = wxSP_VERTICAL
,const wxString& name = "wxSpinButton"
inline wxSpinButton( wxWindow* pParent
,wxWindowID vId = -1
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSP_VERTICAL
,const wxString& rsName = "wxSpinButton"
)
{
Create(parent, id, pos, size, style, name);
Create(pParent, vId, rPos, rSize, lStyle, rsName);
}
virtual ~wxSpinButton();
bool Create( wxWindow *parent
,wxWindowID id = -1
,const wxPoint& pos = wxDefaultPosition
,const wxSize& size = wxDefaultSize
,long style = wxSP_VERTICAL
,const wxString& name = "wxSpinButton"
bool Create( wxWindow* pParent
,wxWindowID vId = -1
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSP_VERTICAL
,const wxString& rsName = "wxSpinButton"
);
// Accessors
virtual int GetValue() const ;
virtual void SetValue(int val) ;
virtual void SetRange( int minVal
,int maxVal
);
inline virtual int GetMax(void) const { return m_max; }
inline virtual int GetMin(void) const { return m_min; }
virtual int GetValue(void) const;
inline bool IsVertical(void) const {return ((m_windowStyle & wxSP_VERTICAL) != 0); }
virtual void SetValue(int nVal);
virtual void SetRange( int nMinVal
,int nMaxVal
);
//
// Implementation
virtual bool OS2Command( WXUINT param
,WXWORD id
//
virtual bool OS2Command( WXUINT wParam
,WXWORD wId
);
virtual bool OS2OnNotify( int idCtrl
,WXLPARAM lParam
,WXLPARAM* result
);
virtual bool OS2OnScroll( int orientation
virtual bool OS2OnScroll( int nOrientation
,WXWORD wParam
,WXWORD pos
,WXHWND control
,WXWORD wPos
,WXHWND hControl
);
inline virtual bool AcceptsFocus(void) const { return FALSE; }
protected:
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize() const;
private:
DECLARE_DYNAMIC_CLASS(wxSpinButton)
};
#endif
// _WX_SPINBUTT_H_
}; // end of CLASS wxSpinButton
#endif // _WX_SPINBUTT_H_

View File

@@ -13,6 +13,9 @@
#define _WX_MSW_SPINCTRL_H_
#include "wx/spinbutt.h" // the base class
#include "wx/dynarray.h"
class WXDLLEXPORT wxSpinCtrl;
WX_DEFINE_EXPORTED_ARRAY(wxSpinCtrl *, wxArraySpins);
// ----------------------------------------------------------------------------
// Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy
@@ -24,55 +27,99 @@ class WXDLLEXPORT wxSpinCtrl : public wxSpinButton
{
public:
wxSpinCtrl() { }
wxSpinCtrl(wxWindow *parent,
wxWindowID id = -1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"))
wxSpinCtrl( wxWindow* pParent
,wxWindowID vId = -1
,const wxString& rsValue = wxEmptyString
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSP_ARROW_KEYS
,int nMin = 0
,int nMax = 100
,int nInitial = 0
,const wxString& rsName = _T("wxSpinCtrl")
)
{
Create(parent, id, value, pos, size, style, min, max, initial, name);
Create(pParent, vId, rsValue, rPos, rSize, lStyle, nMin, nMax, nInitial, rsName);
}
virtual ~wxSpinCtrl();
bool Create(wxWindow *parent,
wxWindowID id = -1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSP_ARROW_KEYS,
int min = 0, int max = 100, int initial = 0,
const wxString& name = _T("wxSpinCtrl"));
bool Create(wxWindow* pParent
,wxWindowID vId = -1
,const wxString& rsValue = wxEmptyString
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxSP_ARROW_KEYS
,int nMin = 0
,int nMax = 100
,int nInitial = 0
,const wxString& rsName = _T("wxSpinCtrl")
);
// a wxTextCtrl-like method (but we can't have GetValue returning wxString
//
// A wxTextCtrl-like method (but we can't have GetValue returning wxString
// because the base class already has one returning int!)
void SetValue(const wxString& text);
//
void SetValue(const wxString& rsText);
//
// implementation only from now on
// -------------------------------
//
virtual bool Enable(bool bEnable = TRUE);
virtual void SetValue(int val) { wxSpinButton::SetValue(val); }
virtual int GetValue() const;
virtual bool SetFont(const wxFont &font);
virtual int GetValue(void) const;
virtual bool SetFont(const wxFont &rFont);
virtual void SetFocus(void);
inline virtual void SetValue(int nVal) { wxSpinButton::SetValue(nVal); }
virtual bool Show(bool bShow = TRUE);
//
// wxSpinButton doesn't accept focus, but we do
//
inline virtual bool AcceptsFocus(void) const { return FALSE; }
//
// Return the spinctrl object whose buddy is the given window or NULL
// Doesn't really do much under OS/2
//
static wxSpinCtrl* GetSpinForTextCtrl(WXHWND hWndBuddy);
//
// Process a WM_COMMAND generated by the buddy text control
//
bool ProcessTextCommand( WXWORD wCmd
,WXWORD wId
);
virtual bool Enable(bool enable = TRUE);
virtual bool Show(bool show = TRUE);
protected:
void DoMoveWindow(int x, int y, int width, int height);
virtual void DoGetPosition( int* nlX
,int* nlY
) const;
void DoMoveWindow( int nX
,int nY
,int nWidth
,int nHeight
);
virtual wxSize DoGetBestSize(void) const;
virtual void DoGetSize( int* pnWidth
,int* pnHeight
) const;
virtual wxSize DoGetBestSize() const;
//
// The handler for wxSpinButton events
//
void OnSpinChange(wxSpinEvent& rEvent);
void OnChar(wxKeyEvent& rEvent);
// the handler for wxSpinButton events
void OnSpinChange(wxSpinEvent& event);
WXHWND m_hwndBuddy;
WXHWND m_hWndBuddy;
static wxArraySpins m_svAllSpins;
private:
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
DECLARE_EVENT_TABLE()
};
}; // end of CLASS wxSpinCtrl
#endif // _WX_MSW_SPINCTRL_H_

View File

@@ -60,6 +60,10 @@ class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
virtual MRESULT OS2WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
);
protected:
virtual wxSize DoGetBestSize() const;
@@ -77,7 +81,7 @@ protected:
wxGDIImage* m_pImage;
private:
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
};
}; // end of wxStaticBitmap
#endif
// _WX_STATBMP_H_

View File

@@ -19,50 +19,49 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
// Group box
class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase
{
DECLARE_DYNAMIC_CLASS(wxStaticBox)
public:
public:
inline wxStaticBox() {}
inline wxStaticBox( wxWindow* parent
,wxWindowID id
,const wxString& label
,const wxPoint& pos = wxDefaultPosition
,const wxSize& size = wxDefaultSize
,long style = 0
,const wxString& name = wxStaticBoxNameStr
inline wxStaticBox( wxWindow* pParent
,wxWindowID vId
,const wxString& rsLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rsName = wxStaticBoxNameStr
)
{
Create(parent, id, label, pos, size, style, name);
Create(pParent, vId, rsLabel, rPos, rSize, lStyle, rsName);
}
bool Create( wxWindow* parent
,wxWindowID id
,const wxString& label
,const wxPoint& pos = wxDefaultPosition
,const wxSize& size = wxDefaultSize
,long style = 0
,const wxString& name = wxStaticBoxNameStr
);
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxString& rsLabel
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = 0
,const wxString& rsName = wxStaticBoxNameStr
);
//
// implementation from now on
// --------------------------
//
virtual MRESULT OS2WindowProc( WXUINT uMsg
,WXWPARAM wParam
,WXLPARAM lParam
);
void OnEraseBackground(wxEraseEvent& event);
virtual MRESULT OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
//
// overriden base class virtuals
virtual bool AcceptsFocus() const { return FALSE; }
//
inline virtual bool AcceptsFocus(void) const { return FALSE; }
protected:
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestSize(void) const;
private:
DECLARE_EVENT_TABLE()
};
DECLARE_DYNAMIC_CLASS(wxStaticBox)
}; // end of CLASS wxStaticBox
#endif
// _WX_STATBOX_H_

View File

@@ -21,29 +21,62 @@
class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
{
DECLARE_DYNAMIC_CLASS(wxStaticLine)
public:
// constructors and pseudo-constructors
wxStaticLine() { }
wxStaticLine( wxWindow *parent,
wxWindowID id,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticTextNameStr )
wxStaticLine( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxLI_HORIZONTAL
,const wxString& rsName = wxStaticTextNameStr
)
{
Create(parent, id, pos, size, style, name);
Create(pParent, vId, rPos, rSize, lStyle, rsName);
}
bool Create( wxWindow *parent,
wxWindowID id,
const wxPoint &pos = wxDefaultPosition,
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticTextNameStr );
};
bool Create( wxWindow* pParent
,wxWindowID vId
,const wxPoint& rPos = wxDefaultPosition
,const wxSize& rSize = wxDefaultSize
,long lStyle = wxLI_HORIZONTAL
,const wxString& rsName = wxStaticTextNameStr
);
inline bool IsVertical(void) const { return((GetWindowStyleFlag() & wxLI_VERTICAL) != 0); }
inline static int GetDefaultSize(void) { return 2; }
//
// Overriden base class virtuals
//
inline virtual bool AcceptsFocus(void) const {return FALSE;}
protected:
inline wxSize AdjustSize(const wxSize& rSize) const
{
wxSize vSizeReal( rSize.x
,rSize.y
);
if (IsVertical())
{
if (rSize.x == -1 )
vSizeReal.x = GetDefaultSize();
}
else
{
if (rSize.y == -1)
vSizeReal.y = GetDefaultSize();
}
return vSizeReal;
}
inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); }
private:
DECLARE_DYNAMIC_CLASS(wxStaticLine)
}; // end of CLASS wxStaticLine
#endif // _WX_OS2_STATLINE_H_

View File

@@ -22,11 +22,8 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
class WXDLLEXPORT wxStaticText : public wxControl
{
DECLARE_DYNAMIC_CLASS(wxStaticText)
public:
public:
inline wxStaticText() { }
inline wxStaticText( wxWindow* pParent
,wxWindowID vId
,const wxString& rsLabel
@@ -69,6 +66,9 @@ class WXDLLEXPORT wxStaticText : public wxControl
protected:
virtual wxSize DoGetBestSize(void) const;
private:
DECLARE_DYNAMIC_CLASS(wxStaticText)
}; // end of CLASS wxStaticText
#endif

View File

@@ -78,13 +78,32 @@
#endif
/*
OS: first test for generic Unix defines, then for particular flavours and
OS: first of all, test for MS-DOS platform. We must do this before testing
for Unix, because DJGPP compiler defines __unix__ under MS-DOS
*/
#if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
#ifndef __DOS__
#define __DOS__
#endif
/* size_t is the same as unsigned int for Watcom 11 compiler, */
/* so define it if it hadn't been done by configure yet */
#if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
#ifdef __WATCOMC__
#define wxSIZE_T_IS_UINT
#endif
#ifdef __DJGPP__
#define wxSIZE_T_IS_ULONG
#endif
#endif
/*
OS: then test for generic Unix defines, then for particular flavours and
finally for Unix-like systems
*/
#if defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
#elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
#define __UNIX_LIKE__
@@ -168,12 +187,6 @@
#endif
#define wxSIZE_T_IS_UINT
#elif defined(__DOS__)
/* size_t is the same as unsigned int for Watcom 11 compiler, */
/* so define it if it hadn't been done by configure yet */
#if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
#define wxSIZE_T_IS_UINT
#endif
#else /* Windows */
#ifndef __WINDOWS__
#define __WINDOWS__

View File

@@ -139,6 +139,8 @@ inline int Stricmp(const char *psz1, const char *psz2)
return stricmp(psz1, psz2);
#elif defined(__WATCOMC__)
return stricmp(psz1, psz2);
#elif defined(__DJGPP__)
return stricmp(psz1, psz2);
#elif defined(__EMX__)
return stricmp(psz1, psz2);
#elif defined(__WXPM__)

View File

@@ -114,21 +114,23 @@ enum wxTreeItemIcon
* wxTreeCtrl flags
*/
// TODO: maybe renumber these?
#define wxTR_NO_BUTTONS 0x0000 // for convenience
#define wxTR_HAS_BUTTONS 0x0001 // generates a +/- button
#define wxTR_TWIST_BUTTONS 0x0002 // generates a twister button
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
#define wxTR_NO_BUTTONS 0x0000 // for convenience
#define wxTR_HAS_BUTTONS 0x0001 // generates a +/- button
#define wxTR_TWIST_BUTTONS 0x0002 // generates a twister button
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
#define wxTR_AQUA_BUTTONS 0x0010 // used internally
#define wxTR_SINGLE 0x0000 // for convenience
#define wxTR_MULTIPLE 0x0020 // can select multiple items
#define wxTR_EXTENDED 0x0040 // TODO: allow extended selection
#define wxTR_SINGLE 0x0000 // for convenience
#define wxTR_MULTIPLE 0x0020 // can select multiple items
#define wxTR_EXTENDED 0x0040 // TODO: allow extended selection
#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horizontal space
#define wxTR_EDIT_LABELS 0x0200 // can edit item labels
#define wxTR_ROW_LINES 0x0400 // put border around items
#define wxTR_HIDE_ROOT 0x0800 // don't display root node
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says
#define wxTR_EDIT_LABELS 0x0200 // can edit item labels
#define wxTR_ROW_LINES 0x0400 // put border around items
#define wxTR_HIDE_ROOT 0x0800 // don't display root node
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says
// TODO: different default styles for wxGTK, wxMotif, whatever?
#ifdef __WXMAC__

View File

@@ -439,7 +439,7 @@ typedef unsigned __WCHAR_TYPE__ wxUChar;
// define wxStricmp for various compilers without Unicode possibilities
#if !defined(wxStricmp) && !wxUSE_UNICODE
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__)
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) || defined(__DJGPP__)
# define wxStricmp stricmp
# define wxStrnicmp strnicmp
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
@@ -674,12 +674,22 @@ WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const
// and _() in wxWindows sources
#define wxT(x) _T(x)
// a Unicode-friendly __FILE__ analog
// Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs
#ifndef __TFILE__
#define __XFILE__(x) wxT(x)
#define __TFILE__ __XFILE__(__FILE__)
#endif
#ifndef __TDATE__
#define __XDATE__(x) wxT(x)
#define __TDATE__ __XDATE__(__DATE__)
#endif
#ifndef __TTIME__
#define __XTIME__(x) wxT(x)
#define __TTIME__ __XTIME__(__TIME__)
#endif
#endif
//_WX_WXCHAR_H_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -100,6 +100,11 @@ bool MyApp::OnInit()
wxConfigBase *pConfig = wxConfigBase::Get();
// uncomment this to force writing back of the defaults for all values
// if they're not present in the config - this can give the user an idea
// of all possible settings for this program
pConfig->SetRecordDefaults();
// or you could also write something like this:
// wxFileConfig *pConfig = new wxFileConfig("conftest");
// wxConfigBase::Set(pConfig);
@@ -209,7 +214,7 @@ void MyFrame::OnQuit(wxCommandEvent&)
void MyFrame::OnAbout(wxCommandEvent&)
{
wxMessageBox(_T("wxConfig demo\n<EFBFBD> Vadim Zeitlin 1998"), _T("About"),
wxMessageBox(_T("wxConfig demo\n<EFBFBD> 1998-2001 Vadim Zeitlin"), _T("About"),
wxICON_INFORMATION | wxOK);
}

View File

@@ -48,7 +48,7 @@
*/
// what to test (in alphabetic order)? uncomment the line below to do all tests
#define TEST_ALL
// #define TEST_ALL
#ifdef TEST_ALL
#define TEST_ARRAYS
#define TEST_CHARSET
@@ -828,7 +828,7 @@ static void TestFileNameConstruction()
printf("ERROR: fullname should be '%s'\n", fni.fullname);
}
bool isAbsolute = fn.IsAbsolute(fni.format);
bool isAbsolute = fn.IsAbsolute();
printf("'%s' is %s (%s)\n\t",
fullname.c_str(),
isAbsolute ? "absolute" : "relative",
@@ -5304,7 +5304,7 @@ int main(int argc, char **argv)
#endif // TEST_FILE
#ifdef TEST_FILENAME
if ( 0 )
if ( 1 )
{
wxFileName fn;
fn.Assign("c:\\foo", "bar.baz");

View File

@@ -37,6 +37,33 @@
#include "wx/wx.h"
#endif
// ----------------------------------------------------------------------------
// event constants
// ----------------------------------------------------------------------------
// declare a custom event type
//
// note that in wxWin 2.3+ these macros expand simply into the following code:
//
// extern const wxEventType wxEVT_MY_CUSTOM_COMMAND;
//
// const wxEventType wxEVT_MY_CUSTOM_COMMAND = wxNewEventType();
//
// and you may use this code directly if you don't care about 2.2 compatibility
BEGIN_DECLARE_EVENT_TYPES()
DECLARE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND, 7777)
END_DECLARE_EVENT_TYPES()
DEFINE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND)
// it may also be convenient to define an event table macro for this event type
#define EVT_MY_CUSTOM_COMMAND(id, fn) \
DECLARE_EVENT_TABLE_ENTRY( \
wxEVT_MY_CUSTOM_COMMAND, id, -1, \
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&fn, \
(wxObject *) NULL \
),
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
@@ -70,6 +97,9 @@ public:
void OnPopEventHandler(wxCommandEvent& event);
void OnTest(wxCommandEvent& event);
void OnFireCustom(wxCommandEvent& event);
void OnProcessCustom(wxCommandEvent& event);
void OnUpdateUIPop(wxUpdateUIEvent& event);
protected:
@@ -116,6 +146,7 @@ enum
Event_Dynamic,
Event_Push,
Event_Pop,
Event_Custom,
Event_Test
};
@@ -140,11 +171,17 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(Event_Connect, MyFrame::OnConnect)
EVT_MENU(Event_Custom, MyFrame::OnFireCustom)
EVT_MENU(Event_Test, MyFrame::OnTest)
EVT_MENU(Event_Push, MyFrame::OnPushEventHandler)
EVT_MENU(Event_Pop, MyFrame::OnPopEventHandler)
EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
EVT_MY_CUSTOM_COMMAND(-1, MyFrame::OnProcessCustom)
// this would also work:
//EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, -1, MyFrame::OnProcessCustom)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
@@ -170,8 +207,8 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
// create the main application window
MyFrame *frame = new MyFrame("Event wxWindows Sample",
wxPoint(50, 50), wxSize(450, 340));
MyFrame *frame = new MyFrame(_T("Event wxWindows Sample"),
wxPoint(50, 50), wxSize(600, 340));
// and show it (the frames, unlike simple controls, are not shown when
// created initially)
@@ -197,35 +234,38 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
// create a menu bar
wxMenu *menuFile = new wxMenu;
menuFile->Append(Event_About, "&About...\tCtrl-A", "Show about dialog");
menuFile->Append(Event_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
menuFile->AppendSeparator();
menuFile->Append(Event_Quit, "E&xit\tAlt-X", "Quit this program");
menuFile->Append(Event_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
wxMenu *menuEvent = new wxMenu;
menuEvent->Append(Event_Connect, "&Connect\tCtrl-C",
"Connect or disconnect the dynamic event handler",
menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"),
_T("Connect or disconnect the dynamic event handler"),
TRUE /* checkable */);
menuEvent->Append(Event_Dynamic, "&Dynamic event\tCtrl-D",
"Dynamic event sample - only works after Connect");
menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
_T("Dynamic event sample - only works after Connect"));
menuEvent->AppendSeparator();
menuEvent->Append(Event_Push, "&Push event handler\tCtrl-P",
"Push event handler for test event");
menuEvent->Append(Event_Pop, "P&op event handler\tCtrl-O",
"Pop event handler for test event");
menuEvent->Append(Event_Test, "Test event\tCtrl-T",
"Test event processed by pushed event handler");
menuEvent->Append(Event_Push, _T("&Push event handler\tCtrl-P"),
_T("Push event handler for test event"));
menuEvent->Append(Event_Pop, _T("P&op event handler\tCtrl-O"),
_T("Pop event handler for test event"));
menuEvent->Append(Event_Test, _T("Test event\tCtrl-T"),
_T("Test event processed by pushed event handler"));
menuEvent->AppendSeparator();
menuEvent->Append(Event_Custom, _T("Fire c&ustom event\tCtrl-U"),
_T("Generate a custom event"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
menuBar->Append(menuFile, "&File");
menuBar->Append(menuEvent, "&Event");
menuBar->Append(menuFile, _T("&File"));
menuBar->Append(menuEvent, _T("&Event"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
#if wxUSE_STATUSBAR
CreateStatusBar(3);
SetStatusText("Welcome to wxWindows event sample");
SetStatusText(_T("Welcome to wxWindows event sample"));
SetStatusText(_T("Dynamic: off"), Status_Dynamic);
SetStatusText(_T("Push count: 0"), Status_Push);
#endif // wxUSE_STATUSBAR
@@ -322,3 +362,19 @@ void MyFrame::OnUpdateUIPop(wxUpdateUIEvent& event)
event.Enable( m_nPush > 0 );
}
// ----------------------------------------------------------------------------
// custom event methods
// ----------------------------------------------------------------------------
void MyFrame::OnFireCustom(wxCommandEvent& event)
{
wxCommandEvent eventCustom(wxEVT_MY_CUSTOM_COMMAND);
wxPostEvent(this, eventCustom);
}
void MyFrame::OnProcessCustom(wxCommandEvent& event)
{
wxLogMessage(_T("Got a custom event!"));
}

View File

@@ -75,6 +75,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
MENU_LINK(TogHideRoot)
MENU_LINK(TogRootLines)
MENU_LINK(TogBorder)
MENU_LINK(TogFullHighlight)
MENU_LINK(Dump)
#ifndef NO_MULTIPLE_SELECTION
MENU_LINK(DumpSelected)
@@ -185,6 +186,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
style_menu->Append(TreeTest_TogRootLines, "Toggle &lines at root");
style_menu->Append(TreeTest_TogHideRoot, "Toggle &hidden root");
style_menu->Append(TreeTest_TogBorder, "Toggle &item border");
style_menu->Append(TreeTest_TogFullHighlight, "Toggle &full row highlight");
style_menu->Append(TreeTest_TogEdit, "Toggle &edit mode");
#ifndef NO_MULTIPLE_SELECTION
style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"));

View File

@@ -153,6 +153,7 @@ public:
void OnTogHideRoot(wxCommandEvent& event) { TogStyle(wxTR_HIDE_ROOT); }
void OnTogRootLines(wxCommandEvent& event) { TogStyle(wxTR_LINES_AT_ROOT); }
void OnTogBorder(wxCommandEvent& event) { TogStyle(wxTR_ROW_LINES); }
void OnTogFullHighlight(wxCommandEvent& event) { TogStyle(wxTR_FULL_ROW_HIGHLIGHT); }
void OnDump(wxCommandEvent& event);
#ifndef NO_MULTIPLE_SELECTION
@@ -223,6 +224,7 @@ enum
TreeTest_TogHideRoot,
TreeTest_TogRootLines,
TreeTest_TogBorder,
TreeTest_TogFullHighlight,
TreeTest_Dump,
TreeTest_DumpSelected,
TreeTest_Count,

View File

@@ -88,6 +88,9 @@
/* PowerPC Darwin & Mac OS X */
#undef __POWERPC__
/* MS-DOS with DJGPP */
#undef __DOS__
/* Stupid hack; __WINDOWS__ clashes with wx/defs.h */
#ifndef __WINDOWS__
#undef __WINDOWS__
@@ -603,6 +606,11 @@
*/
#define wxUSE_UNICODE 0
/*
* Use MS Layer for Unicode on Win9X (Win32 only)?
*/
#define wxUSE_UNICODE_MSLU 0
/*
* Work around a bug in GNU libc 5.x wcstombs() implementation.
*

View File

@@ -166,7 +166,7 @@ bool wxAppBase::OnInit()
OnInitCmdLine(parser);
bool cont;
switch ( parser.Parse() )
switch ( parser.Parse(FALSE /* don't show usage */) )
{
case -1:
cont = OnCmdLineHelp(parser);
@@ -287,7 +287,7 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser)
if ( !SetDisplayMode(wxDisplayModeInfo(w, h, bpp)) )
return FALSE;
}
#endif
#endif // __WXMGL__
return TRUE;
}

View File

@@ -109,7 +109,9 @@ struct wxCmdLineOption
public:
wxCmdLineEntryType kind;
wxString shortName, longName, description;
wxString shortName,
longName,
description;
wxCmdLineParamType type;
int flags;
@@ -476,7 +478,7 @@ void wxCmdLineParser::Reset()
// the real work is done here
// ----------------------------------------------------------------------------
int wxCmdLineParser::Parse()
int wxCmdLineParser::Parse(bool showUsage)
{
bool maybeOption = TRUE; // can the following arg be an option?
bool ok = TRUE; // TRUE until an error is detected
@@ -803,7 +805,7 @@ int wxCmdLineParser::Parse()
}
}
if ( !ok )
if ( !ok && showUsage )
{
Usage();
}
@@ -849,13 +851,30 @@ void wxCmdLineParser::Usage()
brief << _T('[');
}
brief << chSwitch << opt.shortName;
if ( !opt.shortName.empty() )
{
brief << chSwitch << opt.shortName;
}
else if ( !opt.longName.empty() )
{
brief << _T("--") << opt.longName;
}
else
{
wxFAIL_MSG( _T("option without neither short nor long name?") );
}
wxString option;
option << _T(" ") << chSwitch << opt.shortName;
if ( !!opt.longName )
if ( !opt.shortName.empty() )
{
option << _T(" --") << opt.longName;
option << _T(" ") << chSwitch << opt.shortName;
}
if ( !opt.longName.empty() )
{
option << (option.empty() ? _T(" ") : _T(", "))
<< _T("--") << opt.longName;
}
if ( opt.kind != wxCMD_LINE_SWITCH )
@@ -904,7 +923,13 @@ void wxCmdLineParser::Usage()
wxLogMessage(m_data->m_logo);
}
// in console mode we want to show the brief usage message first, then the
// detailed one but in GUI build we give the details first and then the
// summary - like this, the brief message appears in the wxLogGui dialog,
// as expected
#if !wxUSE_GUI
wxLogMessage(brief);
#endif // !wxUSE_GUI
// now construct the detailed help message
size_t len, lenMax = 0;
@@ -927,6 +952,11 @@ void wxCmdLineParser::Usage()
}
wxLogMessage(detailed);
// do it now if not done above
#if wxUSE_GUI
wxLogMessage(brief);
#endif // wxUSE_GUI
}
// ----------------------------------------------------------------------------

View File

@@ -42,6 +42,7 @@
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
#include <limits.h> // for INT_MAX
// ----------------------------------------------------------------------------
// global and class static variables
@@ -99,36 +100,80 @@ wxConfigBase *wxConfigBase::Create()
return ms_pConfig;
}
wxString wxConfigBase::Read(const wxString& key, const wxString& defVal) const
{
wxString s;
Read(key, &s, defVal);
return s;
}
// ----------------------------------------------------------------------------
// wxConfigBase reading entries
// ----------------------------------------------------------------------------
bool wxConfigBase::Read(const wxString& key, wxString *str, const wxString& defVal) const
{
if (!Read(key, str))
{
*str = ExpandEnvVars(defVal);
return FALSE;
// implement both Read() overloads for the given type in terms of DoRead()
#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
bool wxConfigBase::Read(const wxString& key, type *val) const \
{ \
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
\
return DoRead##name(key, val); \
} \
\
bool wxConfigBase::Read(const wxString& key, \
type *val, \
deftype defVal) const \
{ \
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
\
if ( DoRead##name(key, val) ) \
return TRUE; \
\
if ( IsRecordingDefaults() ) \
{ \
((wxConfigBase *)this)->DoWrite##name(key, defVal); \
} \
\
*val = extra(defVal); \
\
return FALSE; \
}
else
return TRUE;
}
bool wxConfigBase::Read(const wxString& key, long *pl, long defVal) const
IMPLEMENT_READ_FOR_TYPE(String, wxString, const wxString&, ExpandEnvVars)
IMPLEMENT_READ_FOR_TYPE(Long, long, long, long)
IMPLEMENT_READ_FOR_TYPE(Int, int, int, int)
IMPLEMENT_READ_FOR_TYPE(Double, double, double, double)
IMPLEMENT_READ_FOR_TYPE(Bool, bool, bool, bool)
#undef IMPLEMENT_READ_FOR_TYPE
// the DoReadXXX() for the other types have implementation in the base class
// but can be overridden in the derived ones
bool wxConfigBase::DoReadInt(const wxString& key, int *pi) const
{
if (!Read(key, pl))
{
*pl = defVal;
wxCHECK_MSG( pi, FALSE, _T("wxConfig::Read(): NULL parameter") );
long l;
if ( !DoReadLong(key, &l) )
return FALSE;
}
else
return TRUE;
wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") );
*pi = (int)l;
return TRUE;
}
bool wxConfigBase::Read(const wxString& key, double* val) const
bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const
{
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") );
long l;
if ( !DoReadLong(key, &l) )
return FALSE;
wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") );
*val = l != 0;
return TRUE;
}
bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const
{
wxString str;
if ( Read(key, &str) )
@@ -139,78 +184,7 @@ bool wxConfigBase::Read(const wxString& key, double* val) const
return FALSE;
}
bool wxConfigBase::Read(const wxString& key, double* val, double defVal) const
{
if (!Read(key, val))
{
*val = defVal;
return FALSE;
}
else
return TRUE;
}
bool wxConfigBase::Read(const wxString& key, bool* val) const
{
long l;
if (Read(key, & l))
{
*val = (l != 0);
return TRUE;
}
else
return FALSE;
}
bool wxConfigBase::Read(const wxString& key, bool* val, bool defVal) const
{
if (!Read(key, val))
{
*val = defVal;
return FALSE;
}
else
return TRUE;
}
// Convenience functions
bool wxConfigBase::Read(const wxString& key, int *pi) const
{
long l;
bool ret = Read(key, &l);
if (ret)
*pi = (int) l;
return ret;
}
bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
{
long l;
bool ret = Read(key, &l, (long) defVal);
if (ret)
*pi = (int) l;
return ret;
}
bool wxConfigBase::Write(const wxString& key, double val)
{
wxString str;
str.Printf(wxT("%g"), val);
return Write(key, str);
}
bool wxConfigBase::Write(const wxString& key, bool value)
{
return Write(key, value ? 1l : 0l);
}
bool wxConfigBase::Write(const wxString& key, const wxChar *value)
{
// explicit cast needed, otherwise value would have been converted to bool
return Write(key, wxString(value));
}
// string reading helper
wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
{
wxString tmp; // Required for BC++
@@ -221,6 +195,25 @@ wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
return tmp;
}
// ----------------------------------------------------------------------------
// wxConfigBase writing
// ----------------------------------------------------------------------------
bool wxConfigBase::DoWriteDouble(const wxString& key, double val)
{
return DoWriteString(key, wxString::Format(_T("%g"), val));
}
bool wxConfigBase::DoWriteInt(const wxString& key, int value)
{
return DoWriteLong(key, (long)value);
}
bool wxConfigBase::DoWriteBool(const wxString& key, bool value)
{
return DoWriteLong(key, value ? 1l : 0l);
}
// ----------------------------------------------------------------------------
// wxConfigPathChanger
// ----------------------------------------------------------------------------

View File

@@ -102,7 +102,22 @@
#define WX_TIMEZONE _timezone
#elif defined(__MWERKS__)
long wxmw_timezone = 28800;
#define WX_TIMEZONE wxmw_timezone;
#define WX_TIMEZONE wxmw_timezone
#elif defined(__DJGPP__)
#include <sys/timeb.h>
#include <values.h>
static long wxGetTimeZone()
{
static long timezone = MAXLONG; // invalid timezone
if (timezone == MAXLONG)
{
struct timeb tb;
ftime(&tb);
timezone = tb.timezone;
}
return timezone;
}
#define WX_TIMEZONE wxGetTimeZone()
#else // unknown platform - try timezone
#define WX_TIMEZONE timezone
#endif

View File

@@ -59,9 +59,16 @@
#ifdef __GNUWIN32__
#include <windows.h>
#endif
#elif defined(__DOS__) && defined(__WATCOMC__)
#include <io.h>
char* mktemp(char *path) { return _mktemp(path); }
#elif defined(__DOS__)
#if defined(__WATCOMC__)
#include <io.h>
#elif defined(__DJGPP__)
#include <io.h>
#include <unistd.h>
#include <stdio.h>
#else
#error "Please specify the header with file functions declarations."
#endif
#elif (defined(__WXPM__))
#include <io.h>
#define W_OK 2
@@ -425,7 +432,7 @@ bool wxFile::Eof() const
int iRc;
#if defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__)
#if defined(__DOS__) || defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__)
// @@ this doesn't work, of course, on unseekable file descriptors
off_t ofsCur = Tell(),
ofsMax = Length();
@@ -471,7 +478,7 @@ bool wxTempFile::Open(const wxString& strName)
{
m_strName = strName;
m_strTemp = wxFileName::CreateTempFileName(strName);
m_strTemp = wxFileName::CreateTempFileName(strName, &m_file);
if ( m_strTemp.empty() )
{
@@ -479,13 +486,6 @@ bool wxTempFile::Open(const wxString& strName)
return FALSE;
}
// actually open the file now (it must already exist)
if ( !m_file.Open(m_strTemp, wxFile::write) )
{
// opening existing file failed?
return FALSE;
}
#ifdef __UNIX__
// the temp file should have the same permissions as the original one
mode_t mode;

View File

@@ -819,8 +819,7 @@ bool wxFileConfig::HasEntry(const wxString& strName) const
// read/write values
// ----------------------------------------------------------------------------
bool wxFileConfig::Read(const wxString& key,
wxString* pStr) const
bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const
{
wxConfigPathChanger path(this, key);
@@ -829,32 +828,12 @@ bool wxFileConfig::Read(const wxString& key,
return FALSE;
}
*pStr = ExpandEnvVars(pEntry->Value());
*pStr = pEntry->Value();
return TRUE;
}
bool wxFileConfig::Read(const wxString& key,
wxString* pStr, const wxString& defVal) const
{
wxConfigPathChanger path(this, key);
wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(path.Name());
bool ok;
if (pEntry == NULL) {
if( IsRecordingDefaults() )
((wxFileConfig *)this)->Write(key,defVal);
*pStr = ExpandEnvVars(defVal);
ok = FALSE;
}
else {
*pStr = ExpandEnvVars(pEntry->Value());
ok = TRUE;
}
return ok;
}
bool wxFileConfig::Read(const wxString& key, long *pl) const
bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const
{
wxString str;
if ( !Read(key, & str) )
@@ -862,11 +841,10 @@ bool wxFileConfig::Read(const wxString& key, long *pl) const
return FALSE;
}
*pl = wxAtol(str);
return TRUE;
return str.ToLong(pl);
}
bool wxFileConfig::Write(const wxString& key, const wxString& szValue)
bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue)
{
wxConfigPathChanger path(this, key);
@@ -901,12 +879,9 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue)
return TRUE;
}
bool wxFileConfig::Write(const wxString& key, long lValue)
bool wxFileConfig::DoWriteLong(const wxString& key, long lValue)
{
// ltoa() is not ANSI :-(
wxString buf;
buf.Printf(wxT("%ld"), lValue);
return Write(key, buf);
return Write(key, wxString::Format(_T("%ld"), lValue));
}
bool wxFileConfig::Flush(bool /* bCurrentOnly */)

View File

@@ -33,6 +33,7 @@
#include "wx/intl.h"
#include "wx/file.h"
#include "wx/filename.h"
#include "wx/dir.h"
// there are just too many of those...
#ifdef __VISUALC__
@@ -77,10 +78,15 @@
#endif // __WINDOWS__
#endif // native Win compiler
#if defined(__DOS__) && defined(__WATCOMC__)
#include <direct.h>
#include <dos.h>
#include <io.h>
#if defined(__DOS__)
#ifdef __WATCOMC__
#include <direct.h>
#include <dos.h>
#include <io.h>
#endif
#ifdef __DJGPP__
#include <unistd.h>
#endif
#endif
#ifdef __GNUWIN32__
@@ -1196,7 +1202,16 @@ bool wxMkdir(const wxString& dir, int perm)
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
#elif defined(__WXPM__)
if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's??
#else // !MSW and !OS/2 VAC++
#elif defined(__DOS__)
#if defined(__WATCOMC__)
(void)perm;
if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
#elif defined(__DJGPP__)
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
#else
#error "Unsupported DOS compiler!"
#endif
#else // !MSW, !DOS and !OS/2 VAC++
(void)perm;
if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
#endif // !MSW/MSW
@@ -1289,435 +1304,62 @@ bool wxGetTempFileName(const wxString& prefix, wxString& buf)
// Get first file name matching given wild card.
#if defined(__UNIX__)
// Get first file name matching given wild card.
// Flags are reserved for future use.
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
static DIR *gs_dirStream = (DIR *) NULL;
static wxString gs_strFileSpec;
static int gs_findFlags = 0;
#endif
static wxDir *gs_dir = NULL;
static wxString gs_dirPath;
wxString wxFindFirstFile(const wxChar *spec, int flags)
{
wxString result;
#ifdef __VMS
wxChar *specvms = NULL;
#endif
gs_dirPath = wxPathOnly(spec);
if ( gs_dirPath.IsEmpty() )
gs_dirPath = wxT(".");
if ( gs_dirPath.Last() != wxFILE_SEP_PATH )
gs_dirPath << wxFILE_SEP_PATH;
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
if (gs_dirStream)
closedir(gs_dirStream); // edz 941103: better housekeping
gs_findFlags = flags;
gs_strFileSpec = spec;
// Find path only so we can concatenate
// found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
// special case: path is really "/"
if ( !path && gs_strFileSpec[0u] == wxT('/') )
#ifdef __VMS
{
wxStrcpy( specvms , wxT( "[000000]" ) );
gs_strFileSpec = specvms;
wxString path_vms(wxPathOnly(gs_strFileSpec));
path = path_vms;
}
#else
path = wxT('/');
#endif
// path is empty => Local directory
if ( !path )
#ifdef __VMS
{
wxStrcpy( specvms , wxT( "[]" ) );
gs_strFileSpec = specvms;
wxString path_vms1(wxPathOnly(gs_strFileSpec));
path = path_vms1;
}
#else
path = wxT('.');
#endif
gs_dirStream = opendir(path.fn_str());
if ( !gs_dirStream )
{
wxLogSysError(_("Can not enumerate files in directory '%s'"),
path.c_str());
}
else
{
result = wxFindNextFile();
}
#endif // !VMS6.x or earlier
return result;
}
wxString wxFindNextFile()
{
wxString result;
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
wxCHECK_MSG( gs_dirStream, result, wxT("must call wxFindFirstFile first") );
// Find path only so we can concatenate
// found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
wxString name(wxFileNameFromPath(gs_strFileSpec));
/* MATTHEW: special case: path is really "/" */
if ( !path && gs_strFileSpec[0u] == wxT('/'))
path = wxT('/');
// Do the reading
struct dirent *nextDir;
for ( nextDir = readdir(gs_dirStream);
nextDir != NULL;
nextDir = readdir(gs_dirStream) )
{
if (wxMatchWild(name, nextDir->d_name, FALSE) && // RR: added FALSE to find hidden files
strcmp(nextDir->d_name, ".") &&
strcmp(nextDir->d_name, "..") )
{
result.Empty();
if ( !path.IsEmpty() )
{
result = path;
if ( path != wxT('/') )
result += wxT('/');
}
result += nextDir->d_name;
// Only return "." and ".." when they match
bool isdir;
if ( (strcmp(nextDir->d_name, ".") == 0) ||
(strcmp(nextDir->d_name, "..") == 0))
{
if ( (gs_findFlags & wxDIR) != 0 )
isdir = TRUE;
else
continue;
}
else
isdir = wxDirExists(result);
// and only return directories when flags & wxDIR
if ( !gs_findFlags ||
((gs_findFlags & wxDIR) && isdir) ||
((gs_findFlags & wxFILE) && !isdir) )
{
return result;
}
}
}
result.Empty(); // not found
closedir(gs_dirStream);
gs_dirStream = (DIR *) NULL;
#endif // !VMS6.2 or earlier
return result;
}
#elif defined(__WXMAC__)
struct MacDirectoryIterator
{
CInfoPBRec m_CPB ;
wxInt16 m_index ;
long m_dirId ;
Str255 m_name ;
} ;
static int g_iter_flags ;
static MacDirectoryIterator g_iter ;
wxString g_iter_spec ;
wxString wxFindFirstFile(const wxChar *spec, int flags)
{
wxString result;
g_iter_spec = spec ;
g_iter_spec.MakeUpper() ;
g_iter_flags = flags; /* MATTHEW: [5] Remember flags */
// Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(spec));
FSSpec fsspec ;
wxMacFilename2FSSpec( path , &fsspec ) ;
g_iter.m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
g_iter.m_CPB.hFileInfo.ioNamePtr = g_iter.m_name ;
g_iter.m_index = 0 ;
Boolean isDir ;
FSpGetDirectoryID( &fsspec , &g_iter.m_dirId , &isDir ) ;
if ( !isDir )
return wxEmptyString ;
return wxFindNextFile( ) ;
}
wxString wxFindNextFile()
{
wxString result;
short err = noErr ;
wxString name ;
if (gs_dir)
delete gs_dir;
gs_dir = new wxDir(gs_dirPath);
while(1)
if ( !gs_dir->IsOpened() )
{
while ( err == noErr )
{
g_iter.m_index++ ;
g_iter.m_CPB.dirInfo.ioFDirIndex = g_iter.m_index;
g_iter.m_CPB.dirInfo.ioDrDirID = g_iter.m_dirId; /* we need to do this every time */
err = PBGetCatInfoSync((CInfoPBPtr)&g_iter.m_CPB);
if ( err != noErr )
break ;
if ( ( g_iter.m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (g_iter_flags & wxDIR) ) // we have a directory
break ;
if ( ( g_iter.m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(g_iter_flags & wxFILE ) )
continue ;
// hit !
break ;
}
if ( err != noErr )
{
return wxEmptyString ;
}
FSSpec spec ;
FSMakeFSSpecCompat(g_iter.m_CPB.hFileInfo.ioVRefNum,
g_iter.m_dirId,
g_iter.m_name,
&spec) ;
wxString name = wxMacFSSpec2MacFilename( &spec ) ;
if ( g_iter_spec.Right(4)==(":*.*") || g_iter_spec.Right(2)==(":*") || name.Upper().Matches(g_iter_spec) )
return name ;
wxLogSysError(_("Can not enumerate files '%s'"), spec);
return wxEmptyString;
}
return wxEmptyString ;
}
#elif defined(__WXMSW__)
#ifdef __WIN32__
static HANDLE gs_hFileStruct = INVALID_HANDLE_VALUE;
static WIN32_FIND_DATA gs_findDataStruct;
#else // Win16
#ifdef __BORLANDC__
static struct ffblk gs_findDataStruct;
#else
static struct _find_t gs_findDataStruct;
#endif // Borland
#endif // Win32/16
static wxString gs_strFileSpec;
static int gs_findFlags = 0;
wxString wxFindFirstFile(const wxChar *spec, int flags)
{
wxString result;
gs_strFileSpec = spec;
gs_findFlags = flags; /* MATTHEW: [5] Remember flags */
// Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
if ( !path.IsEmpty() )
result << path << wxT('\\');
#ifdef __WIN32__
if ( gs_hFileStruct != INVALID_HANDLE_VALUE )
FindClose(gs_hFileStruct);
gs_hFileStruct = ::FindFirstFile(WXSTRINGCAST spec, &gs_findDataStruct);
if ( gs_hFileStruct == INVALID_HANDLE_VALUE )
int dirFlags = 0;
switch (flags)
{
result.Empty();
case wxDIR: dirFlags = wxDIR_DIRS; break;
case wxFILE: dirFlags = wxDIR_FILES; break;
default: dirFlags = wxDIR_DIRS | wxDIR_FILES; break;
}
wxString result;
gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags);
if ( result.IsEmpty() )
{
wxDELETE(gs_dir);
return result;
}
bool isdir = !!(gs_findDataStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
if (isdir && !(flags & wxDIR))
return wxFindNextFile();
else if (!isdir && flags && !(flags & wxFILE))
return wxFindNextFile();
result += gs_findDataStruct.cFileName;
return result;
#else // !Win32
int flag = _A_NORMAL;
if (flags & wxDIR)
flag = _A_SUBDIR;
#ifdef __BORLANDC__
if (findfirst(WXSTRINGCAST spec, &gs_findDataStruct, flag) == 0)
#else
if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
#endif
{
char attrib;
#ifdef __BORLANDC__
attrib = gs_findDataStruct.ff_attrib;
#else
attrib = gs_findDataStruct.attrib;
#endif
if (attrib & _A_SUBDIR) {
if (!(gs_findFlags & wxDIR))
return wxFindNextFile();
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
return wxFindNextFile();
result +=
#ifdef __BORLANDC__
gs_findDataStruct.ff_name
#else
gs_findDataStruct.name
#endif
;
}
return result;
#endif // __WIN32__
}
wxString wxFindNextFile()
{
wxString result;
// Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
try_again:
#ifdef __WIN32__
if (gs_hFileStruct == INVALID_HANDLE_VALUE)
return result;
bool success = (FindNextFile(gs_hFileStruct, &gs_findDataStruct) != 0);
if (!success)
{
FindClose(gs_hFileStruct);
gs_hFileStruct = INVALID_HANDLE_VALUE;
}
else
{
bool isdir = !!(gs_findDataStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
if (isdir && !(gs_findFlags & wxDIR))
goto try_again;
else if (!isdir && gs_findFlags && !(gs_findFlags & wxFILE))
goto try_again;
if ( !path.IsEmpty() )
result << path << wxT('\\');
result << gs_findDataStruct.cFileName;
}
return result;
#else // Win16
#ifdef __BORLANDC__
if (findnext(&gs_findDataStruct) == 0)
#else
if (_dos_findnext(&gs_findDataStruct) == 0)
#endif
{
/* MATTHEW: [5] Check directory flag */
char attrib;
#ifdef __BORLANDC__
attrib = gs_findDataStruct.ff_attrib;
#else
attrib = gs_findDataStruct.attrib;
#endif
if (attrib & _A_SUBDIR) {
if (!(gs_findFlags & wxDIR))
goto try_again;
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
goto try_again;
result +=
#ifdef __BORLANDC__
gs_findDataStruct.ff_name
#else
gs_findDataStruct.name
#endif
;
}
return result;
#endif // Win32/16
}
#elif defined(__WXPM__)
wxString wxFindFirstFile(const wxChar *spec, int flags)
{
wxString result;
/*
// TODO: figure something out here for OS/2
gs_strFileSpec = spec;
gs_findFlags = flags;
// Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
if ( !path.IsEmpty() )
result << path << wxT('\\');
int flag = _A_NORMAL;
if (flags & wxDIR)
flag = _A_SUBDIR;
if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
{
char attrib;
attrib = gs_findDataStruct.attrib;
if (attrib & _A_SUBDIR) {
if (!(gs_findFlags & wxDIR))
return wxFindNextFile();
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
return wxFindNextFile();
result += gs_findDataStruct.name;
}
*/
return result;
return gs_dirPath + result;
}
wxString wxFindNextFile()
{
wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") );
wxString result;
// TODO:
return result;
gs_dir->GetNext(&result);
if ( result.IsEmpty() )
{
wxDELETE(gs_dir);
return result;
}
return gs_dirPath + result;
}
#endif // Unix/Windows/OS/2
// Get current working directory.
// If buf is NULL, allocates space using new, else

View File

@@ -32,9 +32,9 @@
or just
filename
(although :filename works as well).
:::filename.ext is not yet supported. TODO.
Since the volume is just part of the file path, it is not
treated like a separate entity as it is done under DOS.
treated like a separate entity as it is done under DOS and
VMS, it is just treated as another dir.
wxPATH_VMS: VMS native format, absolute file names have the form
<device>:[dir1.dir2.dir3]file.txt
@@ -80,6 +80,7 @@
#include "wx/tokenzr.h"
#include "wx/config.h" // for wxExpandEnvVars
#include "wx/utils.h"
#include "wx/file.h"
#if wxUSE_DYNLIB_CLASS
#include "wx/dynlib.h"
@@ -112,6 +113,12 @@
#include <sys/stat.h>
#endif
#ifdef __VISAGECPP__
#ifndef MAX_PATH
#define MAX_PATH 256
#endif
#endif
// ----------------------------------------------------------------------------
// private classes
// ----------------------------------------------------------------------------
@@ -219,6 +226,7 @@ void wxFileName::Assign( const wxFileName &filepath )
m_dirs = filepath.GetDirs();
m_name = filepath.GetName();
m_ext = filepath.GetExt();
m_relative = filepath.IsRelative();
}
void wxFileName::Assign(const wxString& volume,
@@ -227,18 +235,70 @@ void wxFileName::Assign(const wxString& volume,
const wxString& ext,
wxPathFormat format )
{
wxStringTokenizer tn(path, GetPathSeparators(format));
wxPathFormat my_format = GetFormat( format );
wxString my_path = path;
m_dirs.Clear();
while ( tn.HasMoreTokens() )
if (!my_path.empty())
{
wxString token = tn.GetNextToken();
// 1) Determine if the path is relative or absolute.
switch (my_format)
{
case wxPATH_MAC:
m_relative = ( my_path[0u] == wxT(':') );
// We then remove a leading ":". The reason is in our
// storage form for relative paths:
// ":dir:file.txt" actually means "./dir/file.txt" in
// DOS notation and should get stored as
// (relative) (dir) (file.txt)
// "::dir:file.txt" actually means "../dir/file.txt"
// stored as (relative) (..) (dir) (file.txt)
// This is important only for the Mac as an empty dir
// actually means <UP>, whereas under DOS, double
// slashes can be ignored: "\\\\" is the same as "\\".
if (m_relative)
my_path.Remove( 0, 1 );
break;
case wxPATH_VMS:
// TODO: what is the relative path format here?
m_relative = FALSE;
break;
case wxPATH_UNIX:
m_relative = ( my_path[0u] != wxT('/') );
break;
case wxPATH_DOS:
m_relative = ( (my_path[0u] != wxT('/')) && (my_path[0u] != wxT('\\')) );
break;
default:
wxFAIL_MSG( wxT("error") );
break;
}
// 2) Break up the path into its members. If the original path
// was just "/" or "\\", m_dirs will be empty. We know from
// the m_relative field, if this means "nothing" or "root dir".
wxStringTokenizer tn( my_path, GetPathSeparators(my_format) );
// if the path starts with a slash, we do need the first empty dir
// entry to be able to tell later that it was an absolute path, but
// otherwise ignore the double slashes
if ( m_dirs.IsEmpty() || !token.IsEmpty() )
m_dirs.Add( token );
while ( tn.HasMoreTokens() )
{
wxString token = tn.GetNextToken();
// Remove empty token under DOS and Unix, interpret them
// as .. under Mac.
if (token.empty())
{
if (my_format == wxPATH_MAC)
m_dirs.Add( wxT("..") );
// else ignore
}
else
{
m_dirs.Add( token );
}
}
}
m_volume = volume;
@@ -270,7 +330,7 @@ void wxFileName::Assign(const wxString& fullpathOrig,
wxString volume, path, name, ext;
// do some consistency checks in debug mode: the name should be really just
// the filename and the path should be realyl just a path
// the filename and the path should be really just a path
#ifdef __WXDEBUG__
wxString pathDummy, nameDummy, extDummy;
@@ -397,9 +457,9 @@ wxString wxFileName::GetHomeDir()
return ::wxGetHomeDir();
}
void wxFileName::AssignTempFileName( const wxString& prefix )
void wxFileName::AssignTempFileName(const wxString& prefix, wxFile *fileTemp)
{
wxString tempname = CreateTempFileName(prefix);
wxString tempname = CreateTempFileName(prefix, fileTemp);
if ( tempname.empty() )
{
// error, failed to get temp file name
@@ -412,7 +472,8 @@ void wxFileName::AssignTempFileName( const wxString& prefix )
}
/* static */
wxString wxFileName::CreateTempFileName(const wxString& prefix)
wxString
wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
{
wxString path, dir, name;
@@ -460,10 +521,10 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
// Temporarily remove - MN
#ifndef __WATCOMC__
::DosCreateDir(wxStringBuffer(MAX_PATH), NULL);
::DosCreateDir(wxStringBuffer(path, MAX_PATH), NULL);
#endif
#else // !Windows, !OS/2, !DOS
#else // !Windows, !OS/2
if ( dir.empty() )
{
dir = wxGetenv(_T("TMP"));
@@ -493,31 +554,31 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
path += name;
#if defined(__DOS__) && defined(__WATCOMC__)
#if defined(HAVE_MKSTEMP)
// scratch space for mkstemp()
path += _T("XXXXXX");
// can use the cast here because the length doesn't change and the string
// is not shared
if ( !_mktemp((char *)path.mb_str()) )
int fdTemp = mkstemp((char *)path.mb_str());
if ( fdTemp == -1 )
{
// this might be not necessary as mkstemp() on most systems should have
// already done it but it doesn't hurt neither...
path.clear();
}
#elif defined(HAVE_MKSTEMP)
// scratch space for mkstemp()
path += _T("XXXXXX");
// can use the cast here because the length doesn't change and the string
// is not shared
if ( mkstemp((char *)path.mb_str()) == -1 )
else // mkstemp() succeeded
{
// this might be not necessary as mkstemp() on most systems should have
// already done it but it doesn't hurt neither...
path.clear();
// avoid leaking the fd
if ( fileTemp )
{
fileTemp->Attach(fdTemp);
}
else
{
close(fdTemp);
}
}
//else: file already created
#else // !HAVE_MKSTEMP
#ifdef HAVE_MKTEMP
@@ -528,9 +589,11 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
{
path.clear();
}
#else // !HAVE_MKTEMP
#else // !HAVE_MKTEMP (includes __DOS__)
// generate the unique file name ourselves
#ifndef __DOS__
path << (unsigned int)getpid();
#endif
wxString pathTry;
@@ -552,10 +615,20 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
if ( !path.empty() )
{
// create the file - of course, there is a race condition here, this is
}
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
#endif // Windows/!Windows
if ( path.empty() )
{
wxLogSysError(_("Failed to create a temporary file name"));
}
else if ( fileTemp && !fileTemp->IsOpened() )
{
// open the file - of course, there is a race condition here, this is
// why we always prefer using mkstemp()...
wxFile file;
if ( !file.Open(path, wxFile::write_excl, wxS_IRUSR | wxS_IWUSR) )
if ( !fileTemp->Open(path, wxFile::write_excl, wxS_IRUSR | wxS_IWUSR) )
{
// FIXME: If !ok here should we loop and try again with another
// file name? That is the standard recourse if open(O_EXCL)
@@ -567,14 +640,6 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
path.clear();
}
}
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
#endif // Windows/!Windows
if ( path.empty() )
{
wxLogSysError(_("Failed to create a temporary file name"));
}
return path;
}
@@ -653,7 +718,7 @@ bool wxFileName::Normalize(wxPathNormalize flags,
format = GetFormat(format);
// make the path absolute
if ( (flags & wxPATH_NORM_ABSOLUTE) && !IsAbsolute() )
if ( (flags & wxPATH_NORM_ABSOLUTE) && m_relative )
{
if ( cwd.empty() )
{
@@ -664,6 +729,7 @@ bool wxFileName::Normalize(wxPathNormalize flags,
curDir.AssignDir(cwd);
}
#if 0
// the path may be not absolute because it doesn't have the volume name
// but in this case we shouldn't modify the directory components of it
// but just set the current volume
@@ -677,6 +743,8 @@ bool wxFileName::Normalize(wxPathNormalize flags,
curDir.Clear();
}
}
#endif
m_relative = FALSE;
}
// handle ~ stuff under Unix only
@@ -802,6 +870,8 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format)
{
m_dirs.Insert(wxT(".."), 0u);
}
m_relative = TRUE;
// we were modified
return TRUE;
@@ -837,56 +907,6 @@ bool wxFileName::IsCaseSensitive( wxPathFormat format )
return GetFormat(format) == wxPATH_UNIX;
}
bool wxFileName::IsAbsolute( wxPathFormat format )
{
// if we have no path, we can't be an abs filename
if ( m_dirs.IsEmpty() )
{
return FALSE;
}
format = GetFormat(format);
if ( format == wxPATH_UNIX )
{
const wxString& str = m_dirs[0u];
if ( str.empty() )
{
// the path started with '/', it's an absolute one
return TRUE;
}
// the path is absolute if it starts with a path separator or
// with "~" or "~user"
wxChar ch = str[0u];
return IsPathSeparator(ch, format) || ch == _T('~');
}
else // !Unix
{
// must have the drive
if ( m_volume.empty() )
return FALSE;
switch ( format )
{
default:
wxFAIL_MSG( _T("unknown wxPATH_XXX style") );
// fall through
case wxPATH_DOS:
return m_dirs[0u].empty();
case wxPATH_VMS:
// TODO: what is the relative path format here?
return TRUE;
case wxPATH_MAC:
return !m_dirs[0u].empty();
}
}
}
/* static */
wxString wxFileName::GetVolumeSeparator(wxPathFormat format)
{
@@ -1000,16 +1020,82 @@ wxString wxFileName::GetPath( bool add_separator, wxPathFormat format ) const
{
format = GetFormat( format );
wxString ret;
size_t count = m_dirs.GetCount();
for ( size_t i = 0; i < count; i++ )
wxString fullpath;
// the leading character
if ( format == wxPATH_MAC && m_relative )
{
ret += m_dirs[i];
if ( add_separator || (i < count) )
ret += wxFILE_SEP_PATH;
fullpath += wxFILE_SEP_PATH_MAC;
}
else if ( format == wxPATH_DOS )
{
if (!m_relative)
fullpath += wxFILE_SEP_PATH_DOS;
}
else if ( format == wxPATH_UNIX )
{
if (!m_relative)
fullpath += wxFILE_SEP_PATH_UNIX;
}
// then concatenate all the path components using the path separator
size_t dirCount = m_dirs.GetCount();
if ( dirCount )
{
if ( format == wxPATH_VMS )
{
fullpath += wxT('[');
}
for ( size_t i = 0; i < dirCount; i++ )
{
// TODO: What to do with ".." under VMS
switch (format)
{
case wxPATH_MAC:
{
if (m_dirs[i] == wxT("."))
break;
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
fullpath += m_dirs[i];
fullpath += wxT(':');
break;
}
case wxPATH_DOS:
{
fullpath += m_dirs[i];
fullpath += wxT('\\');
break;
}
case wxPATH_UNIX:
{
fullpath += m_dirs[i];
fullpath += wxT('/');
break;
}
case wxPATH_VMS:
{
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
fullpath += m_dirs[i];
if (i == dirCount-1)
fullpath += wxT(']');
else
fullpath += wxT('.');
break;
}
default:
{
wxFAIL_MSG( wxT("error") );
}
}
}
}
return ret;
return fullpath;
}
wxString wxFileName::GetFullPath( wxPathFormat format ) const
@@ -1021,59 +1107,91 @@ wxString wxFileName::GetFullPath( wxPathFormat format ) const
// first put the volume
if ( !m_volume.empty() )
{
{
// Special Windows UNC paths hack, part 2: undo what we did in
// SplitPath() and make an UNC path if we have a drive which is not a
// single letter (hopefully the network shares can't be one letter only
// although I didn't find any authoritative docs on this)
if ( format == wxPATH_DOS && m_volume.length() > 1 )
{
fullpath << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_DOS << m_volume;
}
else // !UNC
{
fullpath << m_volume << GetVolumeSeparator(format);
{
// Special Windows UNC paths hack, part 2: undo what we did in
// SplitPath() and make an UNC path if we have a drive which is not a
// single letter (hopefully the network shares can't be one letter only
// although I didn't find any authoritative docs on this)
if ( format == wxPATH_DOS && m_volume.length() > 1 )
{
fullpath << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_DOS << m_volume;
}
else if ( format == wxPATH_DOS || format == wxPATH_VMS )
{
fullpath << m_volume << GetVolumeSeparator(format);
}
// else ignore
}
}
// the leading character
if ( format == wxPATH_MAC && m_relative )
{
fullpath += wxFILE_SEP_PATH_MAC;
}
else if ( format == wxPATH_DOS )
{
if (!m_relative)
fullpath += wxFILE_SEP_PATH_DOS;
}
else if ( format == wxPATH_UNIX )
{
if (!m_relative)
fullpath += wxFILE_SEP_PATH_UNIX;
}
// then concatenate all the path components using the path separator
size_t dirCount = m_dirs.GetCount();
if ( dirCount )
{
// under Mac, we must have a path separator in the beginning of the
// relative path - otherwise it would be parsed as an absolute one
if ( format == wxPATH_MAC && m_dirs[0].empty() )
{
fullpath += wxFILE_SEP_PATH_MAC;
}
wxChar chPathSep = GetPathSeparators(format)[0u];
if ( format == wxPATH_VMS )
{
fullpath += _T('[');
fullpath += wxT('[');
}
for ( size_t i = 0; i < dirCount; i++ )
{
// under VMS, we shouldn't have a leading dot
if ( i && (format != wxPATH_VMS || !m_dirs[i - 1].empty()) )
fullpath += chPathSep;
// TODO: What to do with ".." under VMS
fullpath += m_dirs[i];
}
if ( format == wxPATH_VMS )
{
fullpath += _T(']');
}
else // !VMS
{
// separate the file name from the last directory, notice that we
// intentionally do it even if the name and extension are empty as
// this allows us to distinguish the directories from the file
// names (the directories have the trailing slash)
fullpath += chPathSep;
switch (format)
{
case wxPATH_MAC:
{
if (m_dirs[i] == wxT("."))
break;
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
fullpath += m_dirs[i];
fullpath += wxT(':');
break;
}
case wxPATH_DOS:
{
fullpath += m_dirs[i];
fullpath += wxT('\\');
break;
}
case wxPATH_UNIX:
{
fullpath += m_dirs[i];
fullpath += wxT('/');
break;
}
case wxPATH_VMS:
{
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
fullpath += m_dirs[i];
if (i == dirCount-1)
fullpath += wxT(']');
else
fullpath += wxT('.');
break;
}
default:
{
wxFAIL_MSG( wxT("error") );
}
}
}
}
@@ -1287,7 +1405,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
if ( format == wxPATH_DOS || format == wxPATH_VMS )
{
wxString sepVol = GetVolumeSeparator(format);
size_t posFirstColon = fullpath.find_first_of(sepVol);
if ( posFirstColon != wxString::npos )
{
@@ -1338,7 +1456,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
else
{
// take everything up to the path separator but take care to make
// tha path equal to something like '/', not empty, for the files
// the path equal to something like '/', not empty, for the files
// immediately under root directory
size_t len = posLastSlash;
if ( !len )

View File

@@ -177,6 +177,8 @@ bool wxHTTP::Connect(const wxString& host)
if (!addr->Service(wxT("http")))
addr->Service(80);
SetHeader(wxT("Host"), host);
return TRUE;
}
@@ -190,6 +192,10 @@ bool wxHTTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait))
m_addr = addr.Clone();
wxIPV4address *ipv4addr = wxDynamicCast(&addr, wxIPV4address);
if (ipv4addr)
SetHeader(wxT("Host"), ipv4addr->Hostname());
return TRUE;
}

View File

@@ -195,12 +195,17 @@ bool wxICOHandler::SaveFile(wxImage *image,
return FALSE;
}
wxUint32 m_Size = cStream.GetSize();
// wxCountingOutputStream::Ok() always returns TRUE for now and this
// "if" provokes VC++ warnings in optimized build
#if 0
if (!cStream.Ok())
{
if (verbose)
wxLogError( _("ICO: Error calculating size of DIB .") );
return FALSE;
}
#endif // 0
m_offset = m_offset + sizeof(ICONDIRENTRY) ;

View File

@@ -32,14 +32,10 @@
// This causes a conflict with jmorecfg.h header from libjpeg, so we have
// to make sure libjpeg won't try to define boolean itself. This is done by
// defining HAVE_BOOLEAN.
//
// TODO: include windows.h for MetroWerks and Watcom only after 2.3.2 release!
#if defined(__WXMSW__)
#if defined(__MWERKS__) || defined(__WATCOMC__)
#define HAVE_BOOLEAN
#endif
#if defined(__WXMSW__) && (defined(__MWERKS__) || defined(__WATCOMC__))
#define HAVE_BOOLEAN
#include <windows.h>
#endif // __WXMSW__
#endif
extern "C"
{

View File

@@ -32,6 +32,11 @@
#endif // wxUSE_SERIAL
#endif // WX_PRECOMP
#ifdef __VISAGECPP__
#include "wx/objstrm.h"
#include "wx/serbase.h"
#endif
#include <string.h>
#include <assert.h>

View File

@@ -133,7 +133,7 @@ extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
#endif //compiler
#endif // no vsnprintf
#ifdef _AIX
#if defined(_AIX)
// AIX has vsnprintf, but there's no prototype in the system headers.
extern "C" int vsnprintf(char* str, size_t n, const char* format, va_list ap);
#endif

View File

@@ -747,7 +747,7 @@ whereami(name)
t = imagedir;
if (!absolute_pathname(name)) {
#if defined(DOS) || defined(__WIN32__)
#if defined(__DOS__) || defined(__WIN32__)
int drive;
char *newrbuf;

View File

@@ -1538,14 +1538,19 @@ void wxWindowBase::OnMiddleClick( wxMouseEvent& event )
wxMessageBox(wxString::Format(
_T(
" wxWindows Library (%s port)\nVersion %u.%u.%u, compiled at %s %s\n Copyright (c) 1995-2001 wxWindows team"
" wxWindows Library (%s port)\nVersion %u.%u.%u%s, compiled at %s %s\n Copyright (c) 1995-2001 wxWindows team"
),
port.c_str(),
wxMAJOR_VERSION,
wxMINOR_VERSION,
wxRELEASE_NUMBER,
__DATE__,
__TIME__
#if wxUSE_UNICODE
L" (Unicode)",
#else
"",
#endif
__TDATE__,
__TTIME__
),
_T("wxWindows information"),
wxICON_INFORMATION | wxOK,

View File

@@ -759,6 +759,9 @@ void wxFileCtrl::GoToParentDir()
{
if (m_dirName != wxT("/"))
{
size_t len = m_dirName.Len();
if (m_dirName[len-1] == wxT('/'))
m_dirName.Remove( len-1, 1 );
wxString fname( wxFileNameFromPath(m_dirName) );
m_dirName = wxPathOnly( m_dirName );
if (m_dirName.IsEmpty()) m_dirName = wxT("/");
@@ -919,12 +922,17 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
m_dialogStyle |= wxOPEN;
m_dir = defaultDir;
if ((m_dir.IsEmpty()) || (m_dir == wxT(".")))
if ((m_dir.empty()) || (m_dir == wxT(".")))
{
char buf[200];
m_dir = getcwd( buf, sizeof(buf) );
}
m_path = defaultDir;
size_t len = m_dir.Len();
if ((len > 1) && (m_dir[len-1] == wxT('/')))
m_dir.Remove( len-1, 1 );
m_path = m_dir;
m_path += wxT("/");
m_path += defaultFile;
m_fileName = defaultFile;
@@ -1007,10 +1015,10 @@ wxFileDialog::wxFileDialog(wxWindow *parent,
if (m_dialogStyle & wxMULTIPLE)
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER );
wxSize(540,200), s_lastViewStyle | wxSUNKEN_BORDER );
else
m_list = new wxFileCtrl( this, ID_LIST_CTRL, m_dir, firstWild, wxDefaultPosition,
wxSize(440,180), s_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
wxSize(540,200), s_lastViewStyle | wxSUNKEN_BORDER | wxLC_SINGLE_SEL );
m_list -> ShowHidden(s_lastShowHidden);
mainsizer->Add( m_list, 1, wxEXPAND | wxLEFT|wxRIGHT, 10 );

View File

@@ -310,12 +310,10 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t)
if ( GetVerbose() )
case wxLOG_Message:
{
if ( !m_bErrors ) {
m_aMessages.Add(szString);
m_aSeverity.Add(wxLOG_Message);
m_aTimes.Add((long)t);
m_bHasMessages = TRUE;
}
m_aMessages.Add(szString);
m_aSeverity.Add(wxLOG_Message);
m_aTimes.Add((long)t);
m_bHasMessages = TRUE;
}
break;

View File

@@ -127,6 +127,17 @@ void wxStatusBarGeneric::SetStatusText(const wxString& text, int number)
m_statusStrings[number] = text;
#ifdef __WXMAC__
int major,minor;
wxGetOsVersion( &major, &minor );
if (major >= 10)
{
Refresh();
return;
}
#endif
wxRect rect;
GetFieldRect(number, rect);
wxClientDC dc(this);

View File

@@ -55,6 +55,54 @@ static const int NO_IMAGE = -1;
#define PIXELS_PER_UNIT 10
// ----------------------------------------------------------------------------
// Aqua arrows
// ----------------------------------------------------------------------------
/* XPM */
static char *aqua_arrow_right[] = {
/* columns rows colors chars-per-pixel */
"13 11 4 1",
" c None",
"b c #C0C0C0",
"c c #707070",
"d c #A0A0A0",
/* pixels */
" b ",
" ddb ",
" cccdb ",
" cccccd ",
" ccccccdb ",
" ccccccccd",
" ccccccdb ",
" cccccb ",
" cccdb ",
" ddb ",
" b "
};
/* XPM */
static char *aqua_arrow_down[] = {
/* columns rows colors chars-per-pixel */
"13 11 4 1",
" c None",
"b c #C0C0C0",
"c c #707070",
"d c #A0A0A0",
/* pixels */
" ",
" ",
" bdcccccccdb ",
" dcccccccd ",
" bcccccccb ",
" dcccccd ",
" bcccccb ",
" bcccd ",
" dcd ",
" bcb ",
" d "
};
// -----------------------------------------------------------------------------
// private classes
// -----------------------------------------------------------------------------
@@ -675,8 +723,21 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
style |= wxTR_NO_LINES;
if (major < 10)
style |= wxTR_ROW_LINES;
if (major >= 10)
style |= wxTR_AQUA_BUTTONS;
#endif
if (style & wxTR_AQUA_BUTTONS)
{
m_arrowRight = new wxBitmap( aqua_arrow_right );
m_arrowDown = new wxBitmap( aqua_arrow_down );
}
else
{
m_arrowRight = NULL;
m_arrowDown = NULL;
}
wxScrolledWindow::Create( parent, id, pos, size,
style|wxHSCROLL|wxVSCROLL, name );
@@ -705,6 +766,9 @@ wxGenericTreeCtrl::~wxGenericTreeCtrl()
{
delete m_hilightBrush;
delete m_hilightUnfocusedBrush;
if (m_arrowRight) delete m_arrowRight;
if (m_arrowDown) delete m_arrowDown;
DeleteAllItems();
@@ -1880,18 +1944,29 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
int offset = HasFlag(wxTR_ROW_LINES) ? 1 : 0;
if ( item->IsSelected() && image != NO_IMAGE )
if ( HasFlag(wxTR_FULL_ROW_HIGHLIGHT) )
{
// If it's selected, and there's an image, then we should
// take care to leave the area under the image painted in the
// background colour.
dc.DrawRectangle( item->GetX() + image_w - 2, item->GetY()+offset,
item->GetWidth() - image_w + 2, total_h-offset );
int x, y, w, h;
DoGetPosition(&x, &y);
DoGetSize(&w, &h);
dc.DrawRectangle(x, item->GetY()+offset, w, total_h-offset);
}
else
{
dc.DrawRectangle( item->GetX()-2, item->GetY()+offset,
item->GetWidth()+2, total_h-offset );
if ( item->IsSelected() && image != NO_IMAGE )
{
// If it's selected, and there's an image, then we should
// take care to leave the area under the image painted in the
// background colour.
dc.DrawRectangle( item->GetX() + image_w - 2, item->GetY()+offset,
item->GetWidth() - image_w + 2, total_h-offset );
}
else
{
dc.DrawRectangle( item->GetX()-2, item->GetY()+offset,
item->GetWidth()+2, total_h-offset );
}
}
if ( image != NO_IMAGE )
@@ -1960,86 +2035,6 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
if (IsExposed(exposed_x, exposed_y, 10000, h)) // 10000 = very much
{
if (item->HasPlus() && HasButtons()) // should the item show a button?
{
if (!HasFlag(wxTR_NO_LINES))
{
if (x > (signed)m_indent)
dc.DrawLine(x - m_indent, y_mid, x - 5, y_mid);
else if (HasFlag(wxTR_LINES_AT_ROOT))
dc.DrawLine(3, y_mid, x - 5, y_mid);
dc.DrawLine(x + 5, y_mid, x + m_spacing, y_mid);
}
if (m_imageListButtons != NULL)
{
// draw the image button here
int image_h = 0, image_w = 0, image = wxTreeItemIcon_Normal;
if (item->IsExpanded()) image = wxTreeItemIcon_Expanded;
if (item->IsSelected())
image += wxTreeItemIcon_Selected - wxTreeItemIcon_Normal;
m_imageListButtons->GetSize(image, image_w, image_h);
int xx = x - (image_w>>1);
int yy = y_mid - (image_h>>1);
dc.SetClippingRegion(xx, yy, image_w, image_h);
m_imageListButtons->Draw(image, dc, xx, yy,
wxIMAGELIST_DRAW_TRANSPARENT);
dc.DestroyClippingRegion();
}
else if (HasFlag(wxTR_TWIST_BUTTONS))
{
// draw the twisty button here
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(*m_hilightBrush);
wxPoint button[3];
if (item->IsExpanded())
{
button[0].x = x-5;
button[0].y = y_mid-2;
button[1].x = x+5;
button[1].y = y_mid-2;
button[2].x = x;
button[2].y = y_mid+3;
}
else
{
button[0].y = y_mid-5;
button[0].x = x-2;
button[1].y = y_mid+5;
button[1].x = x-2;
button[2].y = y_mid;
button[2].x = x+3;
}
dc.DrawPolygon(3, button);
dc.SetPen(m_dottedPen);
}
else // if (HasFlag(wxTR_HAS_BUTTONS))
{
// draw the plus sign here
dc.SetPen(*wxGREY_PEN);
dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(x-5, y_mid-4, 11, 9);
dc.SetPen(*wxBLACK_PEN);
dc.DrawLine(x-2, y_mid, x+3, y_mid);
if (!item->IsExpanded())
dc.DrawLine(x, y_mid-2, x, y_mid+3);
dc.SetPen(m_dottedPen);
}
}
else if (!HasFlag(wxTR_NO_LINES)) // no button; maybe a line?
{
// draw the horizontal line here
int x_start = x;
if (x > (signed)m_indent)
x_start -= m_indent;
else if (HasFlag(wxTR_LINES_AT_ROOT))
x_start = 3;
dc.DrawLine(x_start, y_mid, x + m_spacing, y_mid);
}
wxPen *pen =
#ifndef __WXMAC__
// don't draw rect outline if we already have the
@@ -2083,6 +2078,95 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level
dc.SetBrush(*wxWHITE_BRUSH);
dc.SetPen(m_dottedPen);
dc.SetTextForeground(*wxBLACK);
if (item->HasPlus() && HasButtons()) // should the item show a button?
{
if (!HasFlag(wxTR_NO_LINES))
{
if (x > (signed)m_indent)
dc.DrawLine(x - m_indent, y_mid, x - 5, y_mid);
else if (HasFlag(wxTR_LINES_AT_ROOT))
dc.DrawLine(3, y_mid, x - 5, y_mid);
dc.DrawLine(x + 5, y_mid, x + m_spacing, y_mid);
}
if (m_imageListButtons != NULL)
{
// draw the image button here
int image_h = 0, image_w = 0, image = wxTreeItemIcon_Normal;
if (item->IsExpanded()) image = wxTreeItemIcon_Expanded;
if (item->IsSelected())
image += wxTreeItemIcon_Selected - wxTreeItemIcon_Normal;
m_imageListButtons->GetSize(image, image_w, image_h);
int xx = x - (image_w>>1);
int yy = y_mid - (image_h>>1);
dc.SetClippingRegion(xx, yy, image_w, image_h);
m_imageListButtons->Draw(image, dc, xx, yy,
wxIMAGELIST_DRAW_TRANSPARENT);
dc.DestroyClippingRegion();
}
else if (HasFlag(wxTR_TWIST_BUTTONS))
{
// draw the twisty button here
if (HasFlag(wxTR_AQUA_BUTTONS))
{
if (item->IsExpanded())
dc.DrawBitmap( *m_arrowDown, x-5, y_mid-6, TRUE );
else
dc.DrawBitmap( *m_arrowRight, x-5, y_mid-6, TRUE );
}
else
{
dc.SetBrush(*m_hilightBrush);
dc.SetPen(*wxBLACK_PEN);
wxPoint button[3];
if (item->IsExpanded())
{
button[0].x = x-5;
button[0].y = y_mid-2;
button[1].x = x+5;
button[1].y = y_mid-2;
button[2].x = x;
button[2].y = y_mid+3;
}
else
{
button[0].y = y_mid-5;
button[0].x = x-2;
button[1].y = y_mid+5;
button[1].x = x-2;
button[2].y = y_mid;
button[2].x = x+3;
}
dc.DrawPolygon(3, button);
dc.SetPen(m_dottedPen);
}
}
else // if (HasFlag(wxTR_HAS_BUTTONS))
{
// draw the plus sign here
dc.SetPen(*wxGREY_PEN);
dc.SetBrush(*wxWHITE_BRUSH);
dc.DrawRectangle(x-5, y_mid-4, 11, 9);
dc.SetPen(*wxBLACK_PEN);
dc.DrawLine(x-2, y_mid, x+3, y_mid);
if (!item->IsExpanded())
dc.DrawLine(x, y_mid-2, x, y_mid+3);
dc.SetPen(m_dottedPen);
}
}
else if (!HasFlag(wxTR_NO_LINES)) // no button; maybe a line?
{
// draw the horizontal line here
int x_start = x;
if (x > (signed)m_indent)
x_start -= m_indent;
else if (HasFlag(wxTR_LINES_AT_ROOT))
x_start = 3;
dc.DrawLine(x_start, y_mid, x + m_spacing, y_mid);
}
}
if (item->IsExpanded())

View File

@@ -679,8 +679,8 @@ GtkWidget* wxGetRootWindow()
// wxEntry
//-----------------------------------------------------------------------------
int wxEntryStart( int argc, char *argv[] )
// NB: argc and argv may be changed here, pass by reference!
int wxEntryStart( int& argc, char *argv[] )
{
#if wxUSE_THREADS
/* GTK 1.2 up to version 1.2.3 has broken threads */

View File

@@ -244,36 +244,28 @@ selection_handler( GtkWidget *WXUNUSED(widget),
if (!data->IsSupportedFormat( format )) return;
/* this will fail for composite formats */
if (format.GetType() == wxDF_TEXT)
{
wxTextDataObject *text_object = (wxTextDataObject*) data;
wxString text( text_object->GetText() );
#if wxUSE_UNICODE
const wxWX2MBbuf s = text.mbc_str();
int len = strlen(s);
#else // more efficient in non-Unicode
const char *s = text.c_str();
int len = (int) text.Length();
#endif
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
(unsigned char*) (const char*) s,
len );
return;
}
int size = data->GetDataSize( format );
if (size == 0) return;
char *d = new char[size];
void *d = malloc(size);
data->GetDataHere( selection_data->target, (void*) d );
data->GetDataHere( selection_data->target, d );
// transform Unicode text into multibyte before putting it on clipboard
#if wxUSE_UNICODE
if ( format.GetType() == wxDF_TEXT )
{
const wchar_t *wstr = (const wchar_t *)d;
size_t len = wxConvCurrent->WC2MB(NULL, wstr, 0);
char *str = malloc(len + 1);
wxConvCurrent->WC2MB(str, wstr, len);
str[len] = '\0';
free(d);
d = str;
}
#endif // wxUSE_UNICODE
gtk_selection_data_set(
selection_data,
@@ -281,6 +273,8 @@ selection_handler( GtkWidget *WXUNUSED(widget),
8*sizeof(gchar),
(unsigned char*) d,
size );
free(d);
}
//-----------------------------------------------------------------------------

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -29,28 +29,28 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range,
long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxGauge creation failed") );
return FALSE;
return FALSE;
}
m_rangeMax = range;
m_gaugePos = 0;
m_useProgressBar = TRUE;
m_widget = gtk_progress_bar_new();
if( style & wxGA_VERTICAL)
gtk_progress_bar_set_orientation( GTK_PROGRESS_BAR(m_widget) , GTK_PROGRESS_BOTTOM_TO_TOP );
m_parent->DoAddChild( this );
PostCreation();
Show( TRUE );
return TRUE;
}
@@ -58,7 +58,7 @@ void wxGauge::SetRange( int r )
{
m_rangeMax = r;
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
}
@@ -66,7 +66,7 @@ void wxGauge::SetValue( int pos )
{
m_gaugePos = pos;
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
}
@@ -86,4 +86,5 @@ void wxGauge::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif
#endif // wxUSE_GAUGE

View File

@@ -146,7 +146,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
if (g_isIdle)
wxapp_install_idle_handler();
if (!win->m_hasVMT)
if (!win->m_hasVMT || !win->IsShown())
return FALSE;
int x = 0;

View File

@@ -679,8 +679,8 @@ GtkWidget* wxGetRootWindow()
// wxEntry
//-----------------------------------------------------------------------------
int wxEntryStart( int argc, char *argv[] )
// NB: argc and argv may be changed here, pass by reference!
int wxEntryStart( int& argc, char *argv[] )
{
#if wxUSE_THREADS
/* GTK 1.2 up to version 1.2.3 has broken threads */

View File

@@ -244,36 +244,28 @@ selection_handler( GtkWidget *WXUNUSED(widget),
if (!data->IsSupportedFormat( format )) return;
/* this will fail for composite formats */
if (format.GetType() == wxDF_TEXT)
{
wxTextDataObject *text_object = (wxTextDataObject*) data;
wxString text( text_object->GetText() );
#if wxUSE_UNICODE
const wxWX2MBbuf s = text.mbc_str();
int len = strlen(s);
#else // more efficient in non-Unicode
const char *s = text.c_str();
int len = (int) text.Length();
#endif
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
(unsigned char*) (const char*) s,
len );
return;
}
int size = data->GetDataSize( format );
if (size == 0) return;
char *d = new char[size];
void *d = malloc(size);
data->GetDataHere( selection_data->target, (void*) d );
data->GetDataHere( selection_data->target, d );
// transform Unicode text into multibyte before putting it on clipboard
#if wxUSE_UNICODE
if ( format.GetType() == wxDF_TEXT )
{
const wchar_t *wstr = (const wchar_t *)d;
size_t len = wxConvCurrent->WC2MB(NULL, wstr, 0);
char *str = malloc(len + 1);
wxConvCurrent->WC2MB(str, wstr, len);
str[len] = '\0';
free(d);
d = str;
}
#endif // wxUSE_UNICODE
gtk_selection_data_set(
selection_data,
@@ -281,6 +273,8 @@ selection_handler( GtkWidget *WXUNUSED(widget),
8*sizeof(gchar),
(unsigned char*) d,
size );
free(d);
}
//-----------------------------------------------------------------------------

View File

@@ -4,7 +4,7 @@
// Author: Robert Roebling
// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
@@ -29,28 +29,28 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range,
long style, const wxValidator& validator, const wxString& name )
{
m_needParent = TRUE;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
wxFAIL_MSG( wxT("wxGauge creation failed") );
return FALSE;
return FALSE;
}
m_rangeMax = range;
m_gaugePos = 0;
m_useProgressBar = TRUE;
m_widget = gtk_progress_bar_new();
if( style & wxGA_VERTICAL)
gtk_progress_bar_set_orientation( GTK_PROGRESS_BAR(m_widget) , GTK_PROGRESS_BOTTOM_TO_TOP );
m_parent->DoAddChild( this );
PostCreation();
Show( TRUE );
return TRUE;
}
@@ -58,7 +58,7 @@ void wxGauge::SetRange( int r )
{
m_rangeMax = r;
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
}
@@ -66,7 +66,7 @@ void wxGauge::SetValue( int pos )
{
m_gaugePos = pos;
if (m_gaugePos > m_rangeMax) m_gaugePos = m_rangeMax;
gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), ((float)m_gaugePos)/m_rangeMax );
}
@@ -86,4 +86,5 @@ void wxGauge::ApplyWidgetStyle()
gtk_widget_set_style( m_widget, m_widgetStyle );
}
#endif
#endif // wxUSE_GAUGE

Some files were not shown because too many files have changed in this diff Show More