added some wxMSW stuff
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
273
docs/msw/changes.txt
Normal file
@@ -0,0 +1,273 @@
|
||||
|
||||
wxWindows 2.0 for Windows Change Log
|
||||
------------------------------------
|
||||
|
||||
Alpha 11, May ??th 1998
|
||||
-----------------------
|
||||
|
||||
- Added thread.h, thread.cpp.
|
||||
- Changed Enabled, Checked to IsEnabled, IsChecked in wxMenu,
|
||||
wxMenuBar.
|
||||
- Changed wxMenuItem::SetBackColor to SetBackgroundColour,
|
||||
SetTextColor to SetTextColour, and added or made public several
|
||||
wxMenuItem accessors.
|
||||
- Added two overloads to wxRegion::Contains. Added
|
||||
wxRegion::IsEmpty for a more consistent naming convention.
|
||||
|
||||
Alpha 10, May 7th 1998
|
||||
----------------------
|
||||
|
||||
- Added desiredWidth, desiredHeight parameters to wxBitmapHandler
|
||||
and wxIcon functions so that you can specify what size of
|
||||
icon should be loaded. Probably will remain a Windows-specific thing.
|
||||
- wxStatusBar95 now works for MDI frames.
|
||||
- Toolbars in MDI frames now behave normally. They still
|
||||
require application-supplied positioning code though.
|
||||
- Changed installation instructions, makefiles and batch files
|
||||
for compiling with Gnu-Win32/Mingw32/EGCS. Also timercmn.cpp
|
||||
change to support Mingw32/EGCS. Bison now used by default.
|
||||
|
||||
Alpha 9, April 27th 1998
|
||||
------------------------
|
||||
|
||||
- Cured bug in wxStatusBar95 that caused a crash if multiple
|
||||
fields were used.
|
||||
- Added Gnu-Win32 b19/Mingw32 support by changing resource
|
||||
compilation and pragmas.
|
||||
- Cured wxMenu bug introduced in alpha 8 - didn't respond to
|
||||
commands because VZ changed the id setting in wxMenu::MSWCommand.
|
||||
|
||||
Alpha 8, April 17th 1998
|
||||
------------------------
|
||||
|
||||
- Added IsNull to wxGDIObject to check if the ref data is present or not.
|
||||
- Added PNG handler and sample - doesn't work for 16-bit PNGs for
|
||||
some reason :-(
|
||||
- Added wxJoystick class and event handling, and simple demo.
|
||||
- Added simple wxWave class. Needs Stop() function.
|
||||
- Added wxModule (module.h/module.cpp) to allow definition
|
||||
of modules to be initialized and cleaned up on wxWindows
|
||||
startup/exit.
|
||||
- Start of Mingw32 compatibility (see minimal and dialogs samples
|
||||
makefile.m95 files, and install.txt).
|
||||
- Note: Windows printing has stopped working... will investigate.
|
||||
VADIM'S CHANGES:
|
||||
- Updated wxString: bug fixes, added wxArrayString, some
|
||||
compatibility functions.
|
||||
- Updated log.h/cpp, added wxApp::CreateLogTarget.
|
||||
- file.h: new wxTempFile class.
|
||||
- defs.h: added wxSB_SIZE_GRIP for wxStatusBar95
|
||||
- statbr95: wxStatusBar95 control.
|
||||
- registry.h/cpp: wxRegKey class for Win95 registry.
|
||||
- listbox.cpp: corrected some bugs with owner-drawn listboxes.
|
||||
- wxConfig and wxFileConfig classes.
|
||||
|
||||
Alpha 7, March 30th 1998
|
||||
------------------------
|
||||
|
||||
- Added tab classes, tab sample.
|
||||
- Now can return FALSE from OnInit and windows will be
|
||||
cleaned up properly before exit.
|
||||
- Improved border handling so panels don't get borders
|
||||
automatically.
|
||||
- Debugged MDI activation from Window menu.
|
||||
- Changes to memory debug handling, including checking for
|
||||
memory leaks on application exit - but see issues.txt for
|
||||
unresolved issues.
|
||||
- Added wxTaskBarIcon (taskbar.cpp/h, plus samples/taskbar)
|
||||
to allow maintenance of an icon in the Windows 95 taskbar
|
||||
tray area.
|
||||
- Got MFC sample working (MFC and wxWindows in the same
|
||||
application), partly by tweaking ntwxwin.mak settings.
|
||||
- Got DLL compilation working again (VC++).
|
||||
- Changed wxProp/Dialog Editor filenames.
|
||||
|
||||
Alpha 6, March 10th 1998
|
||||
------------------------
|
||||
|
||||
- Found stack error bug - stopped unwanted OnIdle recursion.
|
||||
- Removed bug in wxTreeCtrl::InsertItem I added in alpha 5.
|
||||
- Changed exit behaviour in wxApp/wxFrame/wxDialog. Now will
|
||||
check if the number of top-level windows is zero before
|
||||
exiting. Also, wxApp::GetTopWindow will return either
|
||||
m_topWindow or the first member of wxTopLevelWindows, so you
|
||||
don't have to call wxApp::SetTopWindow.
|
||||
- Added dynarray.h/dynarray.cpp (from Vadim).
|
||||
- Added first cut at OLE drag and drop (from Vadim). dnd sample
|
||||
added. Drop target only at this stage. See src/msw/ole/*.cpp,
|
||||
wx/include/msw/ole/*.h. WIN32 only because of UUID usage.
|
||||
Doesn't work with GnuWin32 - no appropriate headers e.g. for
|
||||
IUnknown.
|
||||
Doesn't work with BC++ either - crashes on program startup.
|
||||
- Added Vadim's owner-draw modifications - will probably remain
|
||||
Windows-only. This enhances wxMenu, wxListBox. See ownerdrw sample.
|
||||
- Added wxLB_OWNERDRAW for owner-draw listboxes.
|
||||
- Vadim's wxCheckListBox derives from wxListBox. See checklst sample.
|
||||
Doesn't entirely work for WIN16.
|
||||
- Vadim has added wxMenuItem as a separate file menuitem.cpp. It
|
||||
can also be used as an argument to wxMenu::Append, not just for
|
||||
internal implementation.
|
||||
- Some #ifdefs done for MINGW32 compilation (just alter OPTIONS
|
||||
in makeg95.env, together with mingw32.bat). However, resource
|
||||
binding is not working yet so most apps with dialogs crash.
|
||||
|
||||
Alpha 5, 14th February 1998
|
||||
---------------------------
|
||||
|
||||
- GENERIC AND MSW-SPECIFIC CODE NOW TREATED AS TWO SEPARATE
|
||||
DISTRIBUTIONS. This change log will therefore now refer to
|
||||
the Windows-specific code only. See docs/changes.txt for generic
|
||||
changes.
|
||||
- Removed Windows-specific reference counting system (GDI
|
||||
resources were cleaned up in idle time) - minimal
|
||||
advantages now we have a wxWin reference counting system.
|
||||
- Added missing WXDLLEXPORT keywords so DLL compilation works
|
||||
again.
|
||||
- Removed most warnings for GnuWin32 compilation.
|
||||
- Added wxRegion/wxRegionIterator, but haven't yet used it in
|
||||
e.g. wxDC.
|
||||
|
||||
Alpha 4, 31st January 1998
|
||||
--------------------------
|
||||
|
||||
- Changed wxDC functions to take longs instead of floats. GetSize now takes
|
||||
integer pointers, plus a version that returns a wxSize.
|
||||
- const keyword added to various wxDC functions.
|
||||
- Under Windows, wxDC no longer has any knowledge of whether
|
||||
an associated window is scrolled or not. Instead, the device
|
||||
origin is set by wxScrolledWindow in wxScrolledWindow::PrepareDC.
|
||||
- wxScrolledWindow applications can optionally override the virtual OnDraw
|
||||
function instead of using the OnPaint event handler. The wxDC passed to
|
||||
OnDraw will be translated by PrepareDC to reflect scrolling.
|
||||
When drawing outside of OnDraw, must call PrepareDC explicitly.
|
||||
- wxToolBarBase/wxToolBarSimple similarly changed to allow for
|
||||
scrolling toolbars.
|
||||
- Integrated wxPostScriptDC patches for 1.xx by Chris Breeze,
|
||||
to help printing with multiple pages.
|
||||
- IPC classes given base classes (wxConnectionBase etc.) which
|
||||
define the API used by different implementations. DDE
|
||||
implementation updated to use these base classes.
|
||||
- wxHelpInstance now separated into wxHelpControllerBase (base
|
||||
for all implementations), wxWinHelpController (uses standard
|
||||
WinHelp), wxXLPHelPController (talks to wxHelp by DDE or
|
||||
TCP/IP). There will be others eventually, such as
|
||||
wxHTMLHelpController for Microsoft (and Netscape?) HTML Help.
|
||||
- Added Vadim Zeitlin's wxString class plus
|
||||
internationalization code (gettext simulation, wxLocale, etc.).
|
||||
New files from Vadim:
|
||||
include\wx\string.h
|
||||
include\wx\debug.h
|
||||
include\wx\file.h
|
||||
include\wx\log.h
|
||||
include\wx\intl.h
|
||||
src\common\string.cpp
|
||||
src\common\log.cpp
|
||||
src\common\intl.cpp
|
||||
src\common\file.cpp
|
||||
No longer use GNU wxString files.
|
||||
- Split off file-related functions into include\wx\filefn.h and
|
||||
src\common\filefn.cpp.
|
||||
- Borland C++ support (WIN32) for main library and
|
||||
samples, using makefile.b32 files.
|
||||
- Preparation done for allowing BC++ to compile wxWin as a DLL,
|
||||
including changes to defs.h.
|
||||
- wxIntPoint removed, wxPoint is now int, and wxRealPoint
|
||||
introduced.
|
||||
- Added wxShowEvent (generated when window is being shown or
|
||||
hidden).
|
||||
- Got minimal, docview, mdi samples working for 16-bit VC++ and
|
||||
cured 16-bit problem with wxTextCtrl (removed global memory
|
||||
trick).
|
||||
- Updated GnuWin32 makefiles, checked minimal, mdi, docview samples.
|
||||
|
||||
Alpha 3, September 1997
|
||||
-----------------------
|
||||
|
||||
- wxListCtrl, wxTreeCtrl, wxImageList classes done.
|
||||
- Instigated new file hierarchy, split files and classes up more logically.
|
||||
- PrologIO and some other utils now put into core library.
|
||||
- Revamped print/preview classes, added wxPageSetupDialog.
|
||||
- Started documentation.
|
||||
|
||||
Alpha 2, 30th April 1997
|
||||
------------------------
|
||||
|
||||
- EVT_... macros now have at least one argument, for conformance
|
||||
with MetroWerks compiler.
|
||||
- Added ids to .wxr file format.
|
||||
- Got Dialog Editor compiled and running again but need
|
||||
to extend functionality to be in line with new controls.
|
||||
Added dialoged\test app to allow dynamic loading of .wxr files
|
||||
for testing purposes.
|
||||
- Rewrote wxBitmap to allow installable file type
|
||||
handlers.
|
||||
- Rewrote wxBitmapButton, wxStaticBitmap to not use Fafa.
|
||||
- Wrote most of wxTreeCtrl and sample (need wxImageList to implement it
|
||||
fully).
|
||||
- Added back wxRadioBox.
|
||||
- Tidied up wx_main.cpp, wxApp class, putting PenWin code in
|
||||
a separate file.
|
||||
|
||||
Alpha 1, 5th April 1997
|
||||
-----------------------
|
||||
|
||||
At this point, the following has been achieved:
|
||||
|
||||
- A lot, but not all, of the code has been revamped for better
|
||||
naming conventions, protection of data members, and use of
|
||||
wxString instead of char *.
|
||||
- Obsolete functionality deleted (e.g. default wxPanel layout,
|
||||
old system event system) and code size reduced.
|
||||
- Class hierarchy changed (see design doc) - base classes such
|
||||
as wxbWindow now removed.
|
||||
- No longer includes windows.h in wxWin headers, by using stand-in
|
||||
Windows types where needed e.g. WXHWND.
|
||||
- PrologIO revised.
|
||||
- wxScrolledWindow, wxStatusBar and new MDI classes added.
|
||||
MDI is now achived using separate classes, not window styles.
|
||||
- wxSystemSettings added, and made use of to reflect standard
|
||||
Windows settings.
|
||||
- SetButtonFont/SetLabelFont replaced by SetFont; font and colour
|
||||
settings mucho rationalised.
|
||||
- All windows are now subclassed with the same window proc to make
|
||||
event handling far more consistent. Old internal wxWnd and derived
|
||||
classes removed.
|
||||
- API for controls revised, in particular addition of
|
||||
wxValidator parameters and removal of labels for some controls.
|
||||
- 1 validator written: see examples/validate.
|
||||
- Event table system introduced (see most samples and
|
||||
wx_event.cpp/ProcessEvent, wx_event.h). wxEvtHandler
|
||||
made more flexible, with Push/PopEventHandler allowing a chain
|
||||
of event handlers.
|
||||
- wxRadioBox removed - will be added back soon.
|
||||
- Toolbar class hierarchy revised:
|
||||
wxToolBarBase
|
||||
wxToolBarSimple (= old wxToolBar)
|
||||
wxToolBar95 (= old wxButtonBar under Win95
|
||||
wxToolBarMSW (= old wxButtonBar under WIN16/WIN32)
|
||||
- Constraint system debugged somewhat (sizers now work properly).
|
||||
- wxFileDialog, wxDirDialog added; other common dialogs now
|
||||
have class equivalents. Generic colour and font dialogs
|
||||
rewritten to not need obsolete panel layout.
|
||||
- .wxr resource system partially reinstated, though needs
|
||||
an integer ID for controls. Hopefully the resource system
|
||||
will be replaced by something better and more efficient
|
||||
in the future.
|
||||
- Device contexts no longer stored with window and accessed
|
||||
with GetDC - use wxClientDC, wxPaintDC, wxWindowDC stack
|
||||
variables instead.
|
||||
- wxSlider uses trackbar class under Win95, and wxSL_LABELS flag
|
||||
determines whether labels are shown. Other Win95-specific flags
|
||||
introduced, e.g. for showing ticks.
|
||||
- Styles introduced for dealing with 3D effects per window, for
|
||||
any window: all Win95 3D effects supported, plus transparent windows.
|
||||
- Major change to allow 3D effect support without CTL3D, under
|
||||
Win95.
|
||||
- Bitmap versions of button and checkbox separated out into new
|
||||
classes, but unimplemented as yet because I intend to remove
|
||||
the need for Fafa - it apparently causes GPFs in Win95 OSR 2.
|
||||
- utils/wxprop classes working (except maybe wxPropertyFormView)
|
||||
in preparation for use in Dialog Editor.
|
||||
- GNU-WIN32 compilation verified (a month or so ago).
|
||||
|
||||
|
128
docs/msw/install.txt
Normal file
@@ -0,0 +1,128 @@
|
||||
|
||||
Installing wxWindows 2.0
|
||||
------------------------
|
||||
|
||||
Unarchiving
|
||||
-----------
|
||||
|
||||
If there is a setup program, run the setup program that comes with the Windows version.
|
||||
Do not install into a path that contains spaces. The installation program should set the
|
||||
WXWIN environment variable, which will be activated when your machine is rebooted.
|
||||
|
||||
If there is no setup program, it will come as a series of .zip
|
||||
files:
|
||||
|
||||
wx200gen.zip Generic source code and samples (required)
|
||||
wx200msw.zip Windows-specific source code and samples (required)
|
||||
wx200doc.zip Documentation source code (not required)
|
||||
wx200hlp.zip WinHelp documentation
|
||||
wx200ps.zip PostScript documentation (will probably
|
||||
disappear in favour of PDF)
|
||||
wx200pdf.zip Acrobat PDF documentation
|
||||
wx200htm.zip HTML documentation
|
||||
|
||||
Unarchive the required files plus any optional documentation
|
||||
files into a suitable directory such as c:\wx. Alter your
|
||||
WXWIN environment variable to point to this directory.
|
||||
|
||||
Compilation
|
||||
-----------
|
||||
|
||||
At present, wxWindows compiles with VC++ 1.5, VC++ 4.0, VC++ 5.0,
|
||||
BC++ 4.5/5.0, Gnu-Win32 b19, and Mingw32.
|
||||
|
||||
Visual C++ 4.0/5.0 compilation
|
||||
------------------------------
|
||||
|
||||
1. Change directory to wx\src\msw. Type 'nmake -f makefile.nt' to
|
||||
make the wxWindows core library.
|
||||
2. Change directory to wx\samples and type 'nmake -f makefile.nt'
|
||||
to make all the samples. You can also make them individually.
|
||||
|
||||
Visual C++ 1.5 compilation
|
||||
--------------------------
|
||||
|
||||
1. Change directory to wx\src\msw. Type 'nmake -f makefile.dos' to
|
||||
make the wxWindows core library.
|
||||
2. Change directory to wx\samples and type 'nmake -f makefile.b32'
|
||||
to make all the samples. You can also make them individually.
|
||||
NOTE: only a few samples have up-to-date makefiles, e.g.
|
||||
minimal, docview, mdi. The utils makefile does not yet work.
|
||||
|
||||
Borland C++ 4.5/5.0 compilation
|
||||
-------------------------------
|
||||
|
||||
1. Change directory to wx\src\msw. Type 'make -f makefile.b32' to
|
||||
make the wxWindows core library.
|
||||
2. Change directory to wx\samples and type 'make -f makefile.b32'
|
||||
to make all the samples. You can also make them individually.
|
||||
NOTE: only a few samples have up-to-date makefiles, e.g.
|
||||
minimal, docview, mdi. The utils makefile does not yet work.
|
||||
|
||||
Gnu-Win32 b19/Mingw32 compilation
|
||||
---------------------------------
|
||||
|
||||
wxWindows 2.0 supports Gnu-Win32 b19, Mingw32, and Mingw32/EGCS.
|
||||
|
||||
Thanks are due to Keith Garry Boyce (garp@opustel.com) and Cygnus for making
|
||||
it all possible.
|
||||
|
||||
From wxWindows 2.0 beta 9, both Gnu-Win32 b19 and Mingw32 (the minimal
|
||||
distribution of Gnu-Win32) can be used with the same makefiles.
|
||||
|
||||
Here are the steps required:
|
||||
|
||||
- Retrieve and install the latest beta of Gnu-Win32, or Mingw32, as per the
|
||||
instructions with either of these packages.
|
||||
|
||||
- If using Mingw32 (including the EGCS variant), you need some
|
||||
extra files to use the wxWindows makefiles. You can find these
|
||||
files in ports/mingw32 on the ftp site or CD-ROM, as extra.zip.
|
||||
These should be extracted to the Mingw32 directory.
|
||||
|
||||
- Modify the file wx/src/cygnus.bat (or mingw32.bat or mingegcs.bat)
|
||||
to set up appropriate variables, if necessary mounting drives.
|
||||
Run it before compiling.
|
||||
|
||||
- For Gnu-Win32, make sure there's a \tmp directory on your
|
||||
Windows drive or bison will crash.
|
||||
|
||||
- Edit wx/src/makeg95.env and search for MINGW32. Take note of
|
||||
the comments for adjusting settings to suit Gnu-Win32 or
|
||||
Mingw32. Basically, this is just a case of adding the __MINGW32__ symbol
|
||||
to OPTIONS for Mingw32, or removing it for Cygnus Gnu-Win32.
|
||||
For Mingw32/EGCS, add both __MINGW32__ and __EGCS__.
|
||||
|
||||
- Use the makefile.g95 files for compiling wxWindows and samples,
|
||||
e.g.:
|
||||
> cd c:\wx\src\msw
|
||||
> make -f makefile.g95
|
||||
> cd c:\wx\samples\minimal
|
||||
> make -f makefile.g95
|
||||
|
||||
- Use the 'strip' command to reduce executable size.
|
||||
|
||||
- With Cygnus Gnu-Win32, you can invoke gdb --nw myfile.exe to
|
||||
debug an executable.
|
||||
|
||||
- If using GnuWin32 b18, you will need to copy windres.exe
|
||||
from e.g. the Mingw32 distribution, to a directory in your path.
|
||||
|
||||
All targets have 'clean' targets to allow removal of object files
|
||||
and other intermediate compiler files.
|
||||
|
||||
Gotchas:
|
||||
|
||||
- libwx.a is 28 MB or more.
|
||||
- install.exe doesn't have built-in decompression because lzexpand.lib
|
||||
isn't available with Gnu-Win32. However, you can use it with external
|
||||
decompression utilities.
|
||||
|
||||
References:
|
||||
|
||||
- The GNU-WIN32 site is at
|
||||
http://www.cygnus.com/gnu-win32/
|
||||
- Mingw32 is available at:
|
||||
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html
|
||||
- See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
|
||||
|
67
docs/msw/issues.txt
Normal file
@@ -0,0 +1,67 @@
|
||||
Current issues and bugs
|
||||
-----------------------
|
||||
|
||||
Debugging code
|
||||
--------------
|
||||
|
||||
wxDebugContext and global memory operators doesn't work correctly,
|
||||
for different (unresolved) reasons on different compilers.
|
||||
|
||||
1) In VC++ 5.0, if you use wxDebugAlloc for new and wxDebugFree
|
||||
for delete, you get a crash to do with deallocating the debug
|
||||
buffer in wxDebugContext. So although the global operators are
|
||||
defined, they are #ifdefed to just call malloc and free to avoid
|
||||
the problem. This means that non-object memory checking doesn't work.
|
||||
The problem does seem to be something to do with a pointer
|
||||
mysteriously changing its address, very similar to 2).
|
||||
|
||||
2) In BC++ 4.5, there isn't a crash, but instead the ofstream
|
||||
pointer passed to SetStream from SetFile (which is called in
|
||||
memcheck.cpp) gets mysteriously changed as it's passed to SetStream.
|
||||
This means that when counting the number of outstanding memory
|
||||
blocks, we can't compare the allocated block with m_debugStream
|
||||
to say 'ignore this block because we can't free it before the
|
||||
very end of the application'. Therefore it always looks like
|
||||
there's a memory leak of one object, in memory.cpp, unless you
|
||||
don't call wxDebugContext::SetFile.
|
||||
|
||||
The fact that pointers appear to change in both cases must
|
||||
indicate a common problem and solution. If we could use the
|
||||
standard global memory operators for ofstream and
|
||||
wxDebugStreamBuf it might help, but I don't know how to do that -
|
||||
I've redefined 'new' throughout as WXDEBUG_NEW (which is itself
|
||||
defined as the 3-argument operator).
|
||||
|
||||
Config/registry classes
|
||||
-----------------------
|
||||
|
||||
Problems with Karsten's/Vadim's existing AppConfig classes:
|
||||
|
||||
- use char* a lot instead of wxString
|
||||
- rather hard to understand
|
||||
- will need fairly substantial rewrite
|
||||
- no native .ini functions (?) for guaranteed Windows
|
||||
compatibility
|
||||
- new wxWin docs required
|
||||
|
||||
Good things:
|
||||
|
||||
- exists!
|
||||
- FileConfig independent of OS
|
||||
- specifying a base class that will meet nearly all needs for
|
||||
derived classes
|
||||
- enumerator
|
||||
|
||||
Other features we should probably have:
|
||||
|
||||
- ability to specify vendor name/app name in constructor
|
||||
- under Windows, ability to read/write all areas of registry
|
||||
as an option
|
||||
|
||||
Options:
|
||||
|
||||
- rewrite AppConfig
|
||||
- start from own CRegistry class
|
||||
- take elements from both
|
||||
- do the Windows stuff, let someone else write/adapt the
|
||||
non-Windows classes
|
5
docs/msw/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
This is the wxWindows for Windows Preview.
|
||||
|
||||
For more information, please see changes.txt, todo.txt, and the
|
||||
manuals.
|
||||
|
202
docs/msw/todo.txt
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Todo on wxWin 2.0, Windows platform
|
||||
-----------------------------------
|
||||
|
||||
HIGH PRIORITY
|
||||
-------------
|
||||
|
||||
Integrate Robert's wxGrid enhancements.
|
||||
|
||||
Find/add wxThread sample - Arthur T-D?
|
||||
|
||||
wxControl dimensions should be optionally based on dialog font
|
||||
size for portability (dialog units as per Windows).
|
||||
|
||||
Implement wxDC floating point transformations.
|
||||
|
||||
Remove transformation from device to logical coordinates from
|
||||
events e.g. mouse events.
|
||||
|
||||
Add wxDC::DeviceToLogical -> wxPoint etc (convenience accessors).
|
||||
|
||||
Revamp Dialog Editor for new controls and properties (e.g.
|
||||
window id).
|
||||
|
||||
Registry classes (check out wxConfig class - see issues.txt).
|
||||
|
||||
Update manual.
|
||||
wxApp changes DONE
|
||||
wxMenu changes DONE
|
||||
wxModule DONE
|
||||
wxRegion DONE
|
||||
wxFile DONE
|
||||
wxTempFile
|
||||
wxMask DONE
|
||||
wxDC:Blit DONE
|
||||
wxTaskBarIcon DONE
|
||||
wxMsgCatalog etc.
|
||||
wxLog
|
||||
wxConfig, wxRegKey
|
||||
wxTabCtrl
|
||||
wxWave
|
||||
wxJoystick
|
||||
wxStatusBar95 and wxFrame status bar functions
|
||||
wxListBox changes (for ownerdraw functionality)
|
||||
wxThread
|
||||
wxString
|
||||
wxTString
|
||||
Drag and drop (change API if required, e.g. const).
|
||||
wxCheckListBox
|
||||
wxBaseArray, other arrays
|
||||
(wxOwnerDrawn)
|
||||
Various events
|
||||
Document the include file for each class
|
||||
|
||||
Write tutorial.
|
||||
|
||||
Other static classes.
|
||||
|
||||
Makefiles for other compilers. Generic makefiles?
|
||||
Rewrite makefiles to maintain simultaneous debug/release
|
||||
objects.
|
||||
|
||||
More wxSystemSettings (see comment in settings.cpp).
|
||||
|
||||
wxSocket integration.
|
||||
|
||||
wxListCtrl, wxTreeCtrl, wxImageList integration with Robert
|
||||
Roebling's classes.
|
||||
|
||||
Convert OGL, other utilities and samples.
|
||||
|
||||
Check TODO entries.
|
||||
|
||||
Change #include "wx/xxx.h" to #include <wx/xxx.h>
|
||||
|
||||
Tidy code further, e.g. formatting from DevStudio, plus
|
||||
standard header.
|
||||
|
||||
Shell function to invoke a document with open, print, whatever...
|
||||
|
||||
wxTextCtrl (and wxMultiText/wxTextWindow in wxWin 1.xx) - differences between Edit
|
||||
and RichEdit controls.
|
||||
|
||||
Make use of Vadim's gettext implementation throughout wxWin code.
|
||||
Document it.
|
||||
|
||||
Change wxUpdateIterator to use wxRegion; or scrap
|
||||
wxUpdateIterator? See wxGTK.
|
||||
|
||||
Check WXWIN_COMPATIBILITY mode, remove any unnecessary #ifdefs.
|
||||
|
||||
Retain callback functions; have semi-compatible callback function prototypes
|
||||
for all controls, at least in WXWIN_COMPATIBLE mode, but
|
||||
retain (Set)Callback for all compilations. This is following a
|
||||
panicky response to losing callbacks.
|
||||
|
||||
Merge dib.cpp, dibutils.cpp.
|
||||
|
||||
Simplify the toolbar samples.
|
||||
|
||||
Add a wxTabCtrl sample.
|
||||
|
||||
LOW PRIORITY
|
||||
------------
|
||||
|
||||
Debug PNG support in wxBitmap (no 4-bit support), and possibly add a convertor from PNG
|
||||
to HICON. We could perhaps also support inclusion of PNGs into
|
||||
a .res file as a custom resource.
|
||||
|
||||
Fonts: ability to enumerate them.
|
||||
|
||||
Angled text.
|
||||
|
||||
Eliminate Set/GetDefaultBackgroundColour? Just take background
|
||||
colour for child control instead.
|
||||
|
||||
Think about reimplementing wxBitmapButton, wxStaticBitmap using
|
||||
BS_BITMAP, SS_BITMAP - but this may not allow wxBitmap
|
||||
argument, so instead just allow controls loaded from native
|
||||
resource to deal with this style and call default processing.
|
||||
|
||||
Completion of drag and drop support (Vadim).
|
||||
|
||||
Better clipboard support.
|
||||
|
||||
Toolbars: use event tables not virtual functions.
|
||||
|
||||
wxWizard class?
|
||||
|
||||
Doc/view - have some standard views/docs e.g. wxTextView.
|
||||
|
||||
wxClassWizard for generating files, chunks of code.
|
||||
|
||||
Miscellaneous file/system function wrappers.
|
||||
|
||||
wxImage or replacement; further wxBitmap/wxIcon etc. functions
|
||||
(load animated icos).
|
||||
|
||||
Integrate existing multimedia classes.
|
||||
|
||||
Rich text class?
|
||||
|
||||
Optimize size further.
|
||||
|
||||
wxThread integration.
|
||||
|
||||
Look at WinCE stuff incl. database classes.
|
||||
|
||||
Improve conversion guide, compatibility classes, tools?
|
||||
|
||||
Bug database.
|
||||
|
||||
ActiveX support?
|
||||
|
||||
OpenGL integration.
|
||||
|
||||
Menu bitmaps - document Vadim's enhancements.
|
||||
|
||||
Enhance Tex2RTF to generate Microsoft HTML help, perhaps Netscape
|
||||
HTML help also.
|
||||
|
||||
wxCreateDynamicObject is apparently slow: ~ 2000 calls to strcmp. Need to
|
||||
use some kind of hash table scheme.
|
||||
|
||||
Write wxDisplay class for querying settings and passing
|
||||
to wxFrame to mirror the X situation (multiple displays).
|
||||
|
||||
Write translator between old and new .wxr formats (including
|
||||
substituting static text for obsolete labels).
|
||||
|
||||
Improve and expand wxSizer classes.
|
||||
|
||||
Write more validators.
|
||||
|
||||
Classes for file/OS utility functions.
|
||||
|
||||
Add support for more static controls e.g. wxStaticLine.
|
||||
|
||||
GDI objects could be optimised further in constructors by
|
||||
searching for a matching, pre-existing object, and assigning from
|
||||
that, thus sharing the internal handle. A problem with this
|
||||
arises if you wish to change the data. But this can be handled by
|
||||
un-refing and creating a new handle. So we could reuse many
|
||||
Windows GDI objects without troubling the programmer. We might
|
||||
wish to switch this off in certain circumstances, e.g.
|
||||
|
||||
wxEnableGDIReuse(FALSE);
|
||||
wxBrush brush(...);
|
||||
wxEnableGDIReuse(TRUE);
|
||||
|
||||
or even
|
||||
|
||||
wxGDIReuse reuse(FALSE);
|
||||
wxBrush brush(...);
|
||||
|
||||
which lasts until its scope ends. This might be needed e.g. if we
|
||||
needed to ensure that the operation was maximally efficient
|
||||
(creating a new object rather than searching may or may not be
|
||||
more efficient).
|
||||
|
||||
Perhaps rewrite wxFile to use FILE* descriptors, so Eof and Flush
|
||||
can work.
|
179
include/wx/msw/app.h
Normal file
@@ -0,0 +1,179 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: app.h
|
||||
// Purpose: wxApp class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __APPH__
|
||||
#define __APPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "app.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxFrame;
|
||||
class WXDLLEXPORT wxWindow;
|
||||
class WXDLLEXPORT wxApp ;
|
||||
class WXDLLEXPORT wxKeyEvent;
|
||||
class WXDLLEXPORT wxLog;
|
||||
|
||||
#define wxPRINT_WINDOWS 1
|
||||
#define wxPRINT_POSTSCRIPT 2
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
|
||||
|
||||
void WXDLLEXPORT wxCleanUp(void);
|
||||
void WXDLLEXPORT wxCommonCleanUp(void); // Call this from the platform's wxCleanUp()
|
||||
void WXDLLEXPORT wxCommonInit(void); // Call this from the platform's initialization
|
||||
|
||||
// Force an exit from main loop
|
||||
void WXDLLEXPORT wxExit(void);
|
||||
|
||||
// Yield to other apps/messages
|
||||
bool WXDLLEXPORT wxYield(void);
|
||||
|
||||
// Represents the application. Derive OnInit and declare
|
||||
// a new App object to start application
|
||||
class WXDLLEXPORT wxApp: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxApp)
|
||||
wxApp(void);
|
||||
inline ~wxApp(void) {}
|
||||
|
||||
static void SetInitializerFunction(wxAppInitializerFunction fn) { m_appInitFn = fn; }
|
||||
static wxAppInitializerFunction GetInitializerFunction(void) { return m_appInitFn; }
|
||||
|
||||
virtual int MainLoop(void);
|
||||
void ExitMainLoop(void);
|
||||
bool Initialized(void);
|
||||
virtual bool Pending(void) ;
|
||||
virtual void Dispatch(void) ;
|
||||
|
||||
virtual void OnIdle(wxIdleEvent& event);
|
||||
|
||||
// Windows specific. Intercept keyboard input.
|
||||
#if WXWIN_COMPATIBILITY == 2
|
||||
virtual bool OldOnCharHook(wxKeyEvent& event);
|
||||
#endif
|
||||
|
||||
// Generic
|
||||
virtual bool OnInit(void) { return FALSE; };
|
||||
|
||||
// No specific tasks to do here.
|
||||
virtual bool OnInitGui(void) { return TRUE; }
|
||||
|
||||
// Called to set off the main loop
|
||||
virtual int OnRun(void) { return MainLoop(); };
|
||||
virtual int OnExit(void) { return 0; };
|
||||
inline void SetPrintMode(int mode) { m_printMode = mode; }
|
||||
inline int GetPrintMode(void) const { return m_printMode; }
|
||||
|
||||
inline void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
|
||||
inline bool GetExitOnFrameDelete(void) const { return m_exitOnFrameDelete; }
|
||||
|
||||
/*
|
||||
inline void SetShowFrameOnInit(bool flag) { m_showOnInit = flag; }
|
||||
inline bool GetShowFrameOnInit(void) const { return m_showOnInit; }
|
||||
*/
|
||||
|
||||
inline wxString GetAppName(void) const {
|
||||
if (m_appName != "")
|
||||
return m_appName;
|
||||
else return m_className;
|
||||
}
|
||||
|
||||
inline void SetAppName(const wxString& name) { m_appName = name; };
|
||||
inline wxString GetClassName(void) const { return m_className; }
|
||||
inline void SetClassName(const wxString& name) { m_className = name; }
|
||||
wxWindow *GetTopWindow(void) const ;
|
||||
inline void SetTopWindow(wxWindow *win) { m_topWindow = win; }
|
||||
|
||||
inline void SetWantDebugOutput(bool flag) { m_wantDebugOutput = flag; }
|
||||
inline bool GetWantDebugOutput(void) { return m_wantDebugOutput; }
|
||||
|
||||
// Send idle event to all top-level windows.
|
||||
// Returns TRUE if more idle time is requested.
|
||||
bool SendIdleEvents(void);
|
||||
|
||||
// Send idle event to window and all subwindows
|
||||
// Returns TRUE if more idle time is requested.
|
||||
bool SendIdleEvents(wxWindow* win);
|
||||
|
||||
inline void SetAuto3D(const bool flag) { m_auto3D = flag; }
|
||||
inline bool GetAuto3D(void) const { return m_auto3D; }
|
||||
|
||||
// Creates a log object
|
||||
virtual wxLog* CreateLogTarget(void);
|
||||
|
||||
public:
|
||||
// void (*work_proc)(wxApp*app); // work procedure;
|
||||
int argc;
|
||||
char ** argv;
|
||||
|
||||
protected:
|
||||
bool m_wantDebugOutput ;
|
||||
wxString m_className;
|
||||
wxString m_appName;
|
||||
wxWindow * m_topWindow;
|
||||
bool m_exitOnFrameDelete;
|
||||
bool m_showOnInit;
|
||||
int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
|
||||
bool m_auto3D ; // Always use 3D controls, except
|
||||
// where overriden
|
||||
static wxAppInitializerFunction m_appInitFn;
|
||||
|
||||
/* Windows-specific wxApp definitions */
|
||||
|
||||
public:
|
||||
|
||||
// Implementation
|
||||
static bool Initialize(WXHINSTANCE instance);
|
||||
static void CommonInit(void);
|
||||
static bool RegisterWindowClasses(void);
|
||||
static void CleanUp(void);
|
||||
static void CommonCleanUp(void);
|
||||
virtual bool DoMessage(void);
|
||||
virtual bool ProcessMessage(WXMSG* pMsg);
|
||||
void DeletePendingObjects(void);
|
||||
bool ProcessIdle(void);
|
||||
|
||||
/*
|
||||
inline void SetPendingCleanup(bool flag) { m_pendingCleanup = flag; }
|
||||
inline bool GetPendingCleanup(void) { return m_pendingCleanup; }
|
||||
|
||||
bool DoResourceCleanup(void);
|
||||
// Set resource collection scheme on or off.
|
||||
inline void SetResourceCollection(bool flag) { m_resourceCollection = flag; }
|
||||
inline bool GetResourceCollection(void) { return m_resourceCollection; }
|
||||
*/
|
||||
|
||||
public:
|
||||
static long sm_lastMessageTime;
|
||||
int m_nCmdShow;
|
||||
|
||||
protected:
|
||||
bool m_keepGoing ;
|
||||
// bool m_resourceCollection;
|
||||
// bool m_pendingCleanup; // TRUE if we need to check the GDI object lists for cleanup
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#if !defined(_WINDLL) || (defined(_WINDLL) && defined(WXMAKINGDLL))
|
||||
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, char *lpszCmdLine,
|
||||
int nCmdShow, bool enterLoop = TRUE);
|
||||
#else
|
||||
int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __APPH__
|
||||
|
201
include/wx/msw/bitmap.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bitmap.h
|
||||
// Purpose: wxBitmap class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BITMAPH__
|
||||
#define __BITMAPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bitmap.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/palette.h"
|
||||
|
||||
// Bitmap
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxControl;
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxBitmapHandler;
|
||||
class WXDLLEXPORT wxIcon;
|
||||
class WXDLLEXPORT wxCursor;
|
||||
|
||||
// A mask is a mono bitmap used for drawing bitmaps
|
||||
// transparently.
|
||||
class WXDLLEXPORT wxMask: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMask)
|
||||
|
||||
public:
|
||||
wxMask(void);
|
||||
|
||||
// Construct a mask from a bitmap and a colour indicating
|
||||
// the transparent area
|
||||
wxMask(const wxBitmap& bitmap, const wxColour& colour);
|
||||
|
||||
// Construct a mask from a bitmap and a palette index indicating
|
||||
// the transparent area
|
||||
wxMask(const wxBitmap& bitmap, const int paletteIndex);
|
||||
|
||||
// Construct a mask from a mono bitmap (copies the bitmap).
|
||||
wxMask(const wxBitmap& bitmap);
|
||||
|
||||
~wxMask(void);
|
||||
|
||||
bool Create(const wxBitmap& bitmap, const wxColour& colour);
|
||||
bool Create(const wxBitmap& bitmap, const int paletteIndex);
|
||||
bool Create(const wxBitmap& bitmap);
|
||||
|
||||
// Implementation
|
||||
inline WXHBITMAP GetMaskBitmap(void) const { return m_maskBitmap; }
|
||||
inline void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }
|
||||
protected:
|
||||
WXHBITMAP m_maskBitmap;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxIcon;
|
||||
friend class WXDLLEXPORT wxCursor;
|
||||
public:
|
||||
wxBitmapRefData(void);
|
||||
~wxBitmapRefData(void);
|
||||
|
||||
public:
|
||||
int m_width;
|
||||
int m_height;
|
||||
int m_depth;
|
||||
bool m_ok;
|
||||
int m_numColors;
|
||||
wxPalette m_bitmapPalette;
|
||||
int m_quality;
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
WXHBITMAP m_hBitmap;
|
||||
wxDC * m_selectedInto; // So bitmap knows whether it's been selected into
|
||||
// a device context (for error checking)
|
||||
wxMask * m_bitmapMask; // Option mask
|
||||
#endif
|
||||
};
|
||||
|
||||
#define M_BITMAPDATA ((wxBitmapRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxBitmapHandler: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
|
||||
public:
|
||||
wxBitmapHandler(void) { m_name = ""; m_extension = ""; m_type = 0; };
|
||||
|
||||
virtual bool Create(wxBitmap *bitmap, void *data, const long flags, const int width, const int height, const int depth = 1);
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, const long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, const int type, const wxPalette *palette = NULL);
|
||||
|
||||
inline void SetName(const wxString& name) { m_name = name; }
|
||||
inline void SetExtension(const wxString& ext) { m_extension = ext; }
|
||||
inline void SetType(const long type) { m_type = type; }
|
||||
inline wxString GetName(void) const { return m_name; }
|
||||
inline wxString GetExtension(void) const { return m_extension; }
|
||||
inline long GetType(void) const { return m_type; }
|
||||
protected:
|
||||
wxString m_name;
|
||||
wxString m_extension;
|
||||
long m_type;
|
||||
};
|
||||
#define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData())
|
||||
|
||||
class WXDLLEXPORT wxBitmap: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmap)
|
||||
|
||||
friend class WXDLLEXPORT wxBitmapHandler;
|
||||
|
||||
public:
|
||||
wxBitmap(void); // Platform-specific
|
||||
|
||||
// Copy constructors
|
||||
inline wxBitmap(const wxBitmap& bitmap)
|
||||
{ Ref(bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||
inline wxBitmap(const wxBitmap* bitmap) { if (bitmap) Ref(*bitmap); if ( wxTheBitmapList ) wxTheBitmapList->AddBitmap(this); }
|
||||
|
||||
// Initialize with raw data
|
||||
wxBitmap(const char bits[], const int width, const int height, const int depth = 1);
|
||||
|
||||
#if USE_XPM_IN_MSW
|
||||
// Initialize with XPM data
|
||||
wxBitmap(const char **data, wxItem *anItem = NULL);
|
||||
#endif
|
||||
|
||||
// Load a file or resource
|
||||
wxBitmap(const wxString& name, const long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
|
||||
// New constructor for generalised creation from data
|
||||
wxBitmap(void *data, const long type, const int width, const int height, const int depth = 1);
|
||||
|
||||
// If depth is omitted, will create a bitmap compatible with the display
|
||||
wxBitmap(const int width, const int height, const int depth = -1);
|
||||
~wxBitmap(void);
|
||||
|
||||
virtual bool Create(const int width, const int height, const int depth = -1);
|
||||
virtual bool Create(void *data, const long type, const int width, const int height, const int depth = 1);
|
||||
virtual bool LoadFile(const wxString& name, const long type = wxBITMAP_TYPE_BMP_RESOURCE);
|
||||
virtual bool SaveFile(const wxString& name, const int type, const wxPalette *cmap = NULL);
|
||||
|
||||
inline bool Ok(void) const { return (M_BITMAPDATA && M_BITMAPDATA->m_ok); }
|
||||
inline int GetWidth(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_width : 0); }
|
||||
inline int GetHeight(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_height : 0); }
|
||||
inline int GetDepth(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_depth : 0); }
|
||||
inline int GetQuality(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_quality : 0); }
|
||||
void SetWidth(int w);
|
||||
void SetHeight(int h);
|
||||
void SetDepth(int d);
|
||||
void SetQuality(int q);
|
||||
void SetOk(bool isOk);
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline wxPalette *GetColourMap(void) const { return GetPalette(); }
|
||||
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
|
||||
#endif
|
||||
inline wxPalette* GetPalette(void) const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : NULL); }
|
||||
void SetPalette(const wxPalette& palette);
|
||||
|
||||
inline wxMask *GetMask(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : NULL); }
|
||||
void SetMask(wxMask *mask) ;
|
||||
|
||||
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
|
||||
inline bool operator == (const wxBitmap& bitmap) { return m_refData == bitmap.m_refData; }
|
||||
inline bool operator != (const wxBitmap& bitmap) { return m_refData != bitmap.m_refData; }
|
||||
|
||||
// Format handling
|
||||
static inline wxList& GetHandlers(void) { return sm_handlers; }
|
||||
static void AddHandler(wxBitmapHandler *handler);
|
||||
static void InsertHandler(wxBitmapHandler *handler);
|
||||
static bool RemoveHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& name);
|
||||
static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType);
|
||||
static wxBitmapHandler *FindHandler(long bitmapType);
|
||||
|
||||
static void InitStandardHandlers(void);
|
||||
static void CleanUpHandlers(void);
|
||||
protected:
|
||||
static wxList sm_handlers;
|
||||
|
||||
// Implementation
|
||||
public:
|
||||
void SetHBITMAP(WXHBITMAP bmp);
|
||||
inline WXHBITMAP GetHBITMAP(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
|
||||
inline void SetSelectedInto(wxDC *dc) { if (M_BITMAPDATA) M_BITMAPDATA->m_selectedInto = dc; }
|
||||
inline wxDC *GetSelectedInto(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_selectedInto : NULL); }
|
||||
bool FreeResource(bool force = FALSE);
|
||||
|
||||
};
|
||||
#endif
|
||||
// __BITMAPH__
|
BIN
include/wx/msw/blank.cur
Normal file
After Width: | Height: | Size: 326 B |
85
include/wx/msw/bmpbuttn.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: bmpbuttn.h
|
||||
// Purpose: wxBitmapButton class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BMPBUTTNH__
|
||||
#define __BMPBUTTNH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "bmpbuttn.h"
|
||||
#endif
|
||||
|
||||
#include "wx/button.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||
|
||||
#define wxDEFAULT_BUTTON_MARGIN 4
|
||||
|
||||
class WXDLLEXPORT wxBitmapButton: public wxButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapButton)
|
||||
public:
|
||||
inline wxBitmapButton(void) { m_marginX = wxDEFAULT_BUTTON_MARGIN; m_marginY = wxDEFAULT_BUTTON_MARGIN; }
|
||||
inline wxBitmapButton(wxWindow *parent, const wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, bitmap, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxBitmap& bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = wxBU_AUTODRAW,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxBitmap& bitmap)
|
||||
{
|
||||
SetBitmapLabel(bitmap);
|
||||
}
|
||||
|
||||
virtual void SetBitmapLabel(const wxBitmap& bitmap);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline wxBitmap *GetBitmap(void) const { return (wxBitmap *) & m_buttonBitmap; }
|
||||
#endif
|
||||
|
||||
inline wxBitmap& GetBitmapLabel(void) const { return (wxBitmap&) m_buttonBitmap; }
|
||||
inline wxBitmap& GetBitmapSelected(void) const { return (wxBitmap&) m_buttonBitmapSelected; }
|
||||
inline wxBitmap& GetBitmapFocus(void) const { return (wxBitmap&) m_buttonBitmapFocus; }
|
||||
inline wxBitmap& GetBitmapDisabled(void) const { return (wxBitmap&) m_buttonBitmapDisabled; }
|
||||
|
||||
inline void SetBitmapSelected(const wxBitmap& sel) { m_buttonBitmapSelected = sel; };
|
||||
inline void SetBitmapFocus(const wxBitmap& focus) { m_buttonBitmapFocus = focus; };
|
||||
inline void SetBitmapDisabled(const wxBitmap& disabled) { m_buttonBitmapDisabled = disabled; };
|
||||
|
||||
inline void SetMargins(int x, int y) { m_marginX = x; m_marginY = y; }
|
||||
inline int GetMarginX(void) { return m_marginX; }
|
||||
inline int GetMarginY(void) { return m_marginY; }
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual void DrawFace( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonFocus( WXHDC dc, int left, int top, int right, int bottom, bool sel );
|
||||
virtual void DrawButtonDisable( WXHDC dc, int left, int top, int right, int bottom, bool with_marg );
|
||||
|
||||
protected:
|
||||
wxBitmap m_buttonBitmap;
|
||||
wxBitmap m_buttonBitmapSelected;
|
||||
wxBitmap m_buttonBitmapFocus;
|
||||
wxBitmap m_buttonBitmapDisabled;
|
||||
int m_marginX;
|
||||
int m_marginY;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __BMPBUTTNH__
|
84
include/wx/msw/brush.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: brush.h
|
||||
// Purpose: wxBrush class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BRUSHH__
|
||||
#define __BRUSHH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "brush.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/gdiobj.h"
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxBrush;
|
||||
|
||||
class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBrush;
|
||||
public:
|
||||
wxBrushRefData(void);
|
||||
~wxBrushRefData(void);
|
||||
|
||||
protected:
|
||||
int m_style;
|
||||
wxBitmap m_stipple ;
|
||||
wxColour m_colour;
|
||||
WXHBRUSH m_hBrush;
|
||||
};
|
||||
|
||||
#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
|
||||
|
||||
// Brush
|
||||
class WXDLLEXPORT wxBrush: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBrush)
|
||||
|
||||
public:
|
||||
wxBrush(void);
|
||||
wxBrush(const wxColour& col, const int style);
|
||||
wxBrush(const wxString& col, const int style);
|
||||
wxBrush(const wxBitmap& stipple);
|
||||
inline wxBrush(const wxBrush& brush) { Ref(brush); }
|
||||
inline wxBrush(const wxBrush* brush) { /* UnRef(); */ if (brush) Ref(*brush); }
|
||||
~wxBrush(void);
|
||||
|
||||
virtual void SetColour(const wxColour& col) ;
|
||||
virtual void SetColour(const wxString& col) ;
|
||||
virtual void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ;
|
||||
virtual void SetStyle(const int style) ;
|
||||
virtual void SetStipple(const wxBitmap& stipple) ;
|
||||
|
||||
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
|
||||
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
|
||||
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
|
||||
|
||||
inline wxColour& GetColour(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_colour : wxNullColour); };
|
||||
inline int GetStyle(void) const { return (M_BRUSHDATA ? M_BRUSHDATA->m_style : 0); };
|
||||
inline wxBitmap *GetStipple(void) const { return (M_BRUSHDATA ? & M_BRUSHDATA->m_stipple : 0); };
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
// Internal
|
||||
bool RealizeResource(void);
|
||||
WXHANDLE GetResourceHandle(void) ;
|
||||
bool FreeResource(bool force = FALSE);
|
||||
/*
|
||||
bool UseResource(void);
|
||||
bool ReleaseResource(void);
|
||||
*/
|
||||
|
||||
bool IsFree(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __BRUSHH__
|
BIN
include/wx/msw/bullseye.cur
Normal file
After Width: | Height: | Size: 326 B |
56
include/wx/msw/button.h
Normal file
@@ -0,0 +1,56 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: button.h
|
||||
// Purpose: wxButton class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __BUTTONH__
|
||||
#define __BUTTONH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "button.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxButtonNameStr;
|
||||
|
||||
// Pushbutton
|
||||
class WXDLLEXPORT wxButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxButton)
|
||||
public:
|
||||
inline wxButton(void) {}
|
||||
inline wxButton(wxWindow *parent, const wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxButtonNameStr);
|
||||
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void SetDefault(void);
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel(void) const ;
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __BUTTONH__
|
84
include/wx/msw/checkbox.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checkbox.h
|
||||
// Purpose: wxCheckBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHECKBOXH__
|
||||
#define __CHECKBOXH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "checkbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxCheckBoxNameStr;
|
||||
|
||||
// Checkbox item (single checkbox)
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxCheckBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckBox)
|
||||
|
||||
public:
|
||||
inline wxCheckBox(void) { }
|
||||
inline wxCheckBox(wxWindow *parent, const wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr);
|
||||
virtual void SetValue(const bool);
|
||||
virtual bool GetValue(void) const ;
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapCheckBox)
|
||||
|
||||
public:
|
||||
int checkWidth ;
|
||||
int checkHeight ;
|
||||
|
||||
inline wxBitmapCheckBox(void) { checkWidth = -1; checkHeight = -1; }
|
||||
inline wxBitmapCheckBox(wxWindow *parent, const wxWindowID id, const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxBitmap *bitmap,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxCheckBoxNameStr);
|
||||
virtual void SetValue(const bool);
|
||||
virtual bool GetValue(void) const ;
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void SetLabel(const wxBitmap *bitmap);
|
||||
};
|
||||
#endif
|
||||
// __CHECKBOXH__
|
62
include/wx/msw/checklst.h
Normal file
@@ -0,0 +1,62 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: checklst.h
|
||||
// Purpose: wxCheckListBox class - a listbox with checkable items
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 16.11.97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHECKLST_H__
|
||||
#define __CHECKLST_H__
|
||||
|
||||
typedef unsigned int uint;
|
||||
|
||||
#if !USE_OWNER_DRAWN
|
||||
#error "wxCheckListBox class requires owner-drawn functionality."
|
||||
#endif
|
||||
|
||||
class wxCheckListBoxItem; // fwd decl, define in checklst.cpp
|
||||
|
||||
class wxCheckListBox : public wxListBox
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCheckListBox)
|
||||
public:
|
||||
// ctors
|
||||
wxCheckListBox();
|
||||
wxCheckListBox(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int nStrings = 0,
|
||||
const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
// const wxFont& font = wxNullFont);
|
||||
|
||||
// items may be checked
|
||||
bool IsChecked(uint uiIndex) const;
|
||||
void Check(uint uiIndex, bool bCheck = TRUE);
|
||||
|
||||
// accessors
|
||||
uint GetItemHeight() const { return m_nItemHeight; }
|
||||
|
||||
protected:
|
||||
// we create our items ourselves and they have non-standard size,
|
||||
// so we need to override these functions
|
||||
virtual wxOwnerDrawn *CreateItem(uint n);
|
||||
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
|
||||
|
||||
// pressing space or clicking the check box toggles the item
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void OnLeftClick(wxMouseEvent& event);
|
||||
|
||||
private:
|
||||
uint m_nItemHeight; // height of checklistbox items (the same for all)
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif //_CHECKLST_H
|
78
include/wx/msw/choice.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: choice.h
|
||||
// Purpose: wxChoice class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CHOICEH__
|
||||
#define __CHOICEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "choice.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxChoiceNameStr;
|
||||
|
||||
// Choice item
|
||||
class WXDLLEXPORT wxChoice: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxChoice)
|
||||
|
||||
public:
|
||||
int no_strings;
|
||||
|
||||
inline wxChoice(void) { no_strings = 0; }
|
||||
|
||||
inline wxChoice(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxChoiceNameStr);
|
||||
|
||||
virtual void Append(const wxString& item);
|
||||
virtual void Delete(const int n);
|
||||
virtual void Clear(void);
|
||||
virtual int GetSelection(void) const ;
|
||||
virtual void SetSelection(const int n);
|
||||
virtual int FindString(const wxString& s) const;
|
||||
virtual wxString GetString(const int n) const ;
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
virtual wxString GetStringSelection(void) const ;
|
||||
virtual bool SetStringSelection(const wxString& sel);
|
||||
|
||||
virtual inline int Number(void) const { return no_strings; }
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
|
||||
virtual inline void SetColumns(const int WXUNUSED(n) = 1 ) { /* No effect */ } ;
|
||||
virtual inline int GetColumns(void) const { return 1 ; };
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __CHOICEH__
|
111
include/wx/msw/clipbrd.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: clipbrd.h
|
||||
// Purpose: Clipboard functionality
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CLIPBRDH__
|
||||
#define __CLIPBRDH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "clipbrd.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if USE_CLIPBOARD
|
||||
|
||||
#include "wx/list.h"
|
||||
|
||||
bool WXDLLEXPORT wxOpenClipboard(void);
|
||||
bool WXDLLEXPORT wxClipboardOpen(void);
|
||||
bool WXDLLEXPORT wxCloseClipboard(void);
|
||||
bool WXDLLEXPORT wxEmptyClipboard(void);
|
||||
bool WXDLLEXPORT wxIsClipboardFormatAvailable(int dataFormat);
|
||||
bool WXDLLEXPORT wxSetClipboardData(int dataFormat, wxObject *obj, int width = 0, int height = 0);
|
||||
wxObject* WXDLLEXPORT wxGetClipboardData(int dataFormat, long *len = NULL);
|
||||
int WXDLLEXPORT wxEnumClipboardFormats(int dataFormat);
|
||||
int WXDLLEXPORT wxRegisterClipboardFormat(char *formatName);
|
||||
bool WXDLLEXPORT wxGetClipboardFormatName(int dataFormat, char *formatName, int maxCount);
|
||||
|
||||
/* The following is Matthew Flatt's implementation of the MSW
|
||||
* side of generic clipboard functionality.
|
||||
*/
|
||||
|
||||
/* A clipboard client holds data belonging to the clipboard.
|
||||
For plain text, a client is not necessary. */
|
||||
class WXDLLEXPORT wxClipboardClient : public wxObject
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxClipboardClient)
|
||||
|
||||
public:
|
||||
/* This list should be filled in with strings indicating the formats
|
||||
this client can provide. Almost all clients will provide "TEXT".
|
||||
Format names should be 4 characters long, so things will work
|
||||
out on the Macintosh */
|
||||
wxStringList formats;
|
||||
|
||||
/* This method is called when the client is losing the selection. */
|
||||
virtual void BeingReplaced(void) = 0;
|
||||
|
||||
/* This method is called when someone wants the data this client is
|
||||
supplying to the clipboard. "format" is a string indicating the
|
||||
format of the data - one of the strings from the "formats"
|
||||
list. "*size" should be filled with the size of the resulting
|
||||
data. In the case of text, "*size" does not count the
|
||||
NULL terminator. */
|
||||
virtual char *GetData(char *format, long *size) = 0;
|
||||
};
|
||||
|
||||
/* ONE instance of this class: */
|
||||
class WXDLLEXPORT wxClipboard : public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClipboard)
|
||||
|
||||
public:
|
||||
wxClipboardClient *clipOwner;
|
||||
char *cbString, *sentString, *receivedString;
|
||||
void *receivedTargets;
|
||||
long receivedLength;
|
||||
#ifdef __XVIEW__
|
||||
long sel_owner;
|
||||
#endif
|
||||
|
||||
wxClipboard();
|
||||
~wxClipboard();
|
||||
|
||||
/* Set the clipboard data owner. "time" comes from the event record. */
|
||||
void SetClipboardClient(wxClipboardClient *, long time);
|
||||
|
||||
/* Set the clipboard string; does not require a client. */
|
||||
void SetClipboardString(char *, long time);
|
||||
|
||||
/* Get data from the clipboard in the format "TEXT". */
|
||||
char *GetClipboardString(long time);
|
||||
|
||||
/* Get data from the clipboard */
|
||||
char *GetClipboardData(char *format, long *length, long time);
|
||||
|
||||
/* Get the clipboard client directly. Will be NULL if clipboard data
|
||||
is a string, or if some other application owns the clipboard.
|
||||
This can be useful for shortcutting data translation, if the
|
||||
clipboard user can check for a specific client. (This is used
|
||||
by the wxMediaEdit class.) */
|
||||
wxClipboardClient *GetClipboardClient(void);
|
||||
};
|
||||
|
||||
/* Initialize wxTheClipboard. Can be called repeatedly */
|
||||
void WXDLLEXPORT wxInitClipboard(void);
|
||||
|
||||
/* The clipboard */
|
||||
extern wxClipboard* WXDLLEXPORT wxTheClipboard;
|
||||
|
||||
#endif // USE_CLIPBOARD
|
||||
#endif
|
||||
// __CLIPBRDH__
|
BIN
include/wx/msw/clock.cur
Normal file
After Width: | Height: | Size: 326 B |
44
include/wx/msw/colordlg.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colordlg.h
|
||||
// Purpose: wxColourDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COLORDLGH__
|
||||
#define __COLORDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "colordlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* COLOUR DIALOG
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxColourDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxColourDialog)
|
||||
protected:
|
||||
wxColourData colourData;
|
||||
wxWindow *dialogParent;
|
||||
public:
|
||||
wxColourDialog(void);
|
||||
wxColourDialog(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxColourData *data = NULL);
|
||||
|
||||
int ShowModal(void);
|
||||
wxColourData& GetColourData(void) { return colourData; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// __COLORDLGH__
|
62
include/wx/msw/colour.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: colour.h
|
||||
// Purpose: wxColour class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COLOURH__
|
||||
#define __COLOURH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "colour.h"
|
||||
#endif
|
||||
|
||||
// Colour
|
||||
class WXDLLEXPORT wxColour: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxColour)
|
||||
public:
|
||||
wxColour(void);
|
||||
wxColour(const unsigned char r, const unsigned char g, const unsigned char b);
|
||||
wxColour(const wxColour& col);
|
||||
wxColour(const wxString& col);
|
||||
~wxColour(void) ;
|
||||
wxColour& operator =(const wxColour& src) ;
|
||||
wxColour& operator =(const wxString& src) ;
|
||||
inline int Ok(void) const { return (m_isInit) ; }
|
||||
|
||||
void Set(unsigned char r, unsigned char g, unsigned char b);
|
||||
|
||||
// Let's remove this inelegant function
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
|
||||
#endif
|
||||
|
||||
inline unsigned char Red(void) const { return m_red; }
|
||||
inline unsigned char Green(void) const { return m_green; }
|
||||
inline unsigned char Blue(void) const { return m_blue; }
|
||||
|
||||
inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
|
||||
|
||||
inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
|
||||
|
||||
WXCOLORREF GetPixel(void) const { return m_pixel; };
|
||||
|
||||
private:
|
||||
bool m_isInit;
|
||||
unsigned char m_red;
|
||||
unsigned char m_blue;
|
||||
unsigned char m_green;
|
||||
public:
|
||||
WXCOLORREF m_pixel ;
|
||||
};
|
||||
|
||||
#define wxColor wxColour
|
||||
|
||||
#endif
|
||||
// __COLOURH__
|
79
include/wx/msw/combobox.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: combobox.h
|
||||
// Purpose: wxComboBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __COMBOBOXH__
|
||||
#define __COMBOBOXH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "combobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/choice.h"
|
||||
|
||||
#if USE_COMBOBOX
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxComboBoxNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Combobox item
|
||||
class WXDLLEXPORT wxComboBox: public wxChoice
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxComboBox)
|
||||
|
||||
public:
|
||||
inline wxComboBox(void) {}
|
||||
|
||||
inline wxComboBox(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// List functions: see wxChoice
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue(void) const ;
|
||||
virtual void SetValue(const wxString& value);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy(void);
|
||||
virtual void Cut(void);
|
||||
virtual void Paste(void);
|
||||
virtual void SetInsertionPoint(const long pos);
|
||||
virtual void SetInsertionPointEnd(void);
|
||||
virtual long GetInsertionPoint(void) const ;
|
||||
virtual long GetLastPosition(void) const ;
|
||||
virtual void Replace(const long from, const long to, const wxString& value);
|
||||
virtual void Remove(const long from, const long to);
|
||||
virtual void SetSelection(const long from, const long to);
|
||||
virtual void SetEditable(const bool editable);
|
||||
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
};
|
||||
|
||||
#endif // USE_COMBOBOX
|
||||
#endif
|
||||
// __COMBOBOXH__
|
86
include/wx/msw/control.h
Normal file
@@ -0,0 +1,86 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: control.h
|
||||
// Purpose: wxControl class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CONTROLH__
|
||||
#define __CONTROLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "control.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
#include "wx/list.h"
|
||||
#include "wx/validate.h"
|
||||
|
||||
// General item class
|
||||
class WXDLLEXPORT wxControl: public wxWindow
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxControl)
|
||||
public:
|
||||
wxControl(void);
|
||||
~wxControl(void);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) = 0; // Simulates an event
|
||||
virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and
|
||||
// appropriate event handlers
|
||||
virtual void SetClientSize(const int width, const int height);
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual wxString GetLabel(void) const ;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline virtual void SetButtonColour(const wxColour& WXUNUSED(col)) { }
|
||||
inline wxColour*GetButtonColour(void) const { return NULL; }
|
||||
|
||||
inline virtual void SetLabelFont(const wxFont& font);
|
||||
inline virtual void SetButtonFont(const wxFont& font);
|
||||
inline wxFont *GetLabelFont(void) const ;
|
||||
inline wxFont *GetButtonFont(void) const ;
|
||||
#endif
|
||||
|
||||
// Places item in centre of panel - so can't be used BEFORE panel->Fit()
|
||||
void Centre(const int direction = wxHORIZONTAL);
|
||||
inline void Callback(const wxFunction function); // Adds callback
|
||||
|
||||
// MSW-specific
|
||||
|
||||
// Window procedure
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual void MSWOnMouseMove(const int x, const int y, const WXUINT flags);
|
||||
virtual bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
// For ownerdraw items
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
|
||||
virtual bool MSWOnMeasure(WXMEASUREITEMSTRUCT *WXUNUSED(item)) { return FALSE; };
|
||||
|
||||
inline wxFunction GetCallback(void) { return m_callback; }
|
||||
inline wxList& GetSubcontrols(void) { return m_subControls; }
|
||||
protected:
|
||||
wxFunction m_callback; // Callback associated with the window
|
||||
|
||||
// MSW implementation
|
||||
wxList m_subControls; // For controls like radiobuttons which are really composite
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
inline void wxControl::Callback(const wxFunction function) { m_callback = function; }; // Adds callback
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline wxFont *wxControl::GetLabelFont(void) const { return GetFont() ; }
|
||||
inline wxFont *wxControl::GetButtonFont(void) const { return GetFont() ; }
|
||||
inline void wxControl::SetLabelFont(const wxFont& font) { SetFont(font); }
|
||||
inline void wxControl::SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __CONTROLH__
|
22
include/wx/msw/curico.h
Normal file
@@ -0,0 +1,22 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: curico.h
|
||||
// Purpose: Icon and cursor functions
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
HICON ReadIconFile( char *szFileName, HINSTANCE hInst,
|
||||
int *W = 0, int *H = 0);
|
||||
HCURSOR ReadCursorFile( char *szFileName, HINSTANCE hInst,
|
||||
int *W = 0, int *H = 0, int *XHot = 0, int *YHot = 0);
|
||||
HCURSOR IconToCursor( char *szFileName, HINSTANCE hInst, int XHot, int YHot,
|
||||
int *W = 0, int *H = 0);
|
||||
HICON CursorToIcon( char *szFileName, HINSTANCE hInst,
|
||||
int *W = 0, int *H = 0);
|
||||
|
||||
HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint);
|
||||
HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap);
|
63
include/wx/msw/curicop.h
Normal file
@@ -0,0 +1,63 @@
|
||||
// PRIVATE STUFF FOLLOWS UNTIL END
|
||||
|
||||
// Header signatures for various resources
|
||||
#define BFT_ICON 0x4349 /* 'IC' */
|
||||
#define BFT_BITMAP 0x4d42 /* 'BM' */
|
||||
#define BFT_CURSOR 0x5450 /* 'PT' */
|
||||
|
||||
// This WIDTHBYTES macro determines the number of BYTES per scan line.
|
||||
#define WIDTHBYTES( i) ((i + 31) / 32 * 4)
|
||||
#define IS_WIN30_DIB( lpbi) ((*(LPDWORD)( lpbi)) == sizeof( BITMAPINFOHEADER))
|
||||
|
||||
WORD DIBNumColors(LPSTR pv);
|
||||
WORD PaletteSize(LPSTR lpbi);
|
||||
|
||||
|
||||
struct tagCURFILEHEADER { WORD wReserved; // Always 0
|
||||
WORD wResourceType; // 2 = cursor
|
||||
WORD wResourceCount; // Number of icons in the file
|
||||
};
|
||||
|
||||
typedef struct tagCURFILEHEADER CURFILEHEADER;
|
||||
|
||||
struct tagCURFILERES {
|
||||
BYTE bWidth; // Width of image
|
||||
BYTE bHeight; // Height of image
|
||||
BYTE bColorCount; // Number of colors in image (2, 8, or 16)
|
||||
BYTE bReserved1; // Reserved
|
||||
WORD wXHotspot; // x coordinate of hotspot
|
||||
WORD wYHotspot; // y coordinate of hotspot
|
||||
DWORD dwDIBSize; // Size of DIB for this image
|
||||
DWORD dwDIBOffset; // Offset to DIB for this image
|
||||
};
|
||||
|
||||
typedef struct tagCURFILERES CURFILERES;
|
||||
|
||||
HANDLE ReadCur( LPSTR szFileName, LPPOINT lpptHotSpot, int *W = 0, int *H = 0);
|
||||
HBITMAP ColorDDBToMonoDDB( HBITMAP hbm);
|
||||
HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst);
|
||||
|
||||
struct tagICONFILEHEADER {
|
||||
WORD wReserved; // Always 0
|
||||
WORD wResourceType; // 1 = icon
|
||||
WORD wResourceCount; // Number of icons in the file
|
||||
};
|
||||
|
||||
typedef struct tagICONFILEHEADER ICONFILEHEADER;
|
||||
|
||||
struct tagICONFILERES {
|
||||
BYTE bWidth; // Width of image
|
||||
BYTE bHeight; // Height of image
|
||||
BYTE bColorCount; // Number of colors in image (2, 8, or 16)
|
||||
BYTE bReserved1; // Reserved
|
||||
WORD wReserved2;
|
||||
WORD wReserved3;
|
||||
DWORD dwDIBSize; // Size of DIB for this image
|
||||
DWORD dwDIBOffset; // Offset to DIB for this image
|
||||
};
|
||||
|
||||
typedef struct tagICONFILERES ICONFILERES;
|
||||
|
||||
HANDLE ReadIcon( char *szFileName, int *W = 0, int *H = 0);
|
||||
HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst);
|
||||
|
69
include/wx/msw/cursor.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: cursor.h
|
||||
// Purpose: wxCursor class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __CURSORH__
|
||||
#define __CURSORH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "cursor.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxCursorRefData: public wxBitmapRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxCursor;
|
||||
public:
|
||||
wxCursorRefData(void);
|
||||
~wxCursorRefData(void);
|
||||
|
||||
protected:
|
||||
WXHCURSOR m_hCursor;
|
||||
bool m_destroyCursor;
|
||||
};
|
||||
|
||||
#define M_CURSORDATA ((wxCursorRefData *)m_refData)
|
||||
#define M_CURSORHANDLERDATA ((wxCursorRefData *)bitmap->m_refData)
|
||||
|
||||
// Cursor
|
||||
class WXDLLEXPORT wxCursor: public wxBitmap
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxCursor)
|
||||
|
||||
public:
|
||||
wxCursor(void);
|
||||
|
||||
// Copy constructors
|
||||
inline wxCursor(const wxCursor& cursor) { Ref(cursor); }
|
||||
inline wxCursor(const wxCursor* cursor) { /* UnRef(); */ if (cursor) Ref(*cursor); }
|
||||
|
||||
wxCursor(const char bits[], const int width, const int height, const int hotSpotX = -1, const int hotSpotY = -1,
|
||||
const char maskBits[] = NULL);
|
||||
wxCursor(const wxString& name, const long flags = wxBITMAP_TYPE_CUR_RESOURCE,
|
||||
const int hotSpotX = 0, const int hotSpotY = 0);
|
||||
wxCursor(const int cursor_type);
|
||||
~wxCursor(void);
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL && M_CURSORDATA->m_hCursor) ; }
|
||||
|
||||
inline wxCursor& operator = (const wxCursor& cursor) { if (*this == cursor) return (*this); Ref(cursor); return *this; }
|
||||
inline bool operator == (const wxCursor& cursor) { return m_refData == cursor.m_refData; }
|
||||
inline bool operator != (const wxCursor& cursor) { return m_refData != cursor.m_refData; }
|
||||
|
||||
void SetHCURSOR(WXHCURSOR cursor);
|
||||
inline WXHCURSOR GetHCURSOR(void) const { return (M_CURSORDATA ? M_CURSORDATA->m_hCursor : 0); }
|
||||
|
||||
bool FreeResource(bool force = FALSE);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __CURSORH__
|
341
include/wx/msw/dc.h
Normal file
@@ -0,0 +1,341 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dc.h
|
||||
// Purpose: wxDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DCH__
|
||||
#define __DCH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dc.h"
|
||||
#endif
|
||||
|
||||
#include "wx/pen.h"
|
||||
#include "wx/brush.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/gdicmn.h"
|
||||
|
||||
class WXDLLEXPORT wxDC: public wxObject
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxDC)
|
||||
protected:
|
||||
public:
|
||||
wxDC(void);
|
||||
~wxDC(void);
|
||||
|
||||
inline void wxDC::BeginDrawing(void) {}
|
||||
inline void wxDC::EndDrawing(void) {}
|
||||
|
||||
virtual void FloodFill(long x1, long y1, wxColour *col, int style=wxFLOOD_SURFACE) ;
|
||||
virtual bool GetPixel(long x1, long y1, wxColour *col) const ;
|
||||
|
||||
virtual void DrawLine(long x1, long y1, long x2, long y2);
|
||||
virtual void CrossHair(long x, long y) ;
|
||||
virtual void DrawArc(long x1,long y1,long x2,long y2,double xc, double yc);
|
||||
virtual void DrawEllipticArc (long x, long y, long w, long h, double sa, double ea);
|
||||
virtual void DrawPoint(long x, long y);
|
||||
|
||||
virtual void DrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0);
|
||||
|
||||
virtual void DrawPolygon(int n, wxPoint points[], long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
||||
|
||||
virtual void DrawRectangle(long x, long y, long width, long height);
|
||||
virtual void DrawRoundedRectangle(long x, long y, long width, long height, double radius = 20.0);
|
||||
virtual void DrawEllipse(long x, long y, long width, long height);
|
||||
|
||||
virtual void DrawIcon(const wxIcon& icon, long x, long y);
|
||||
|
||||
virtual void Clear(void);
|
||||
virtual void SetFont(const wxFont& font);
|
||||
virtual void SetPen(const wxPen& pen);
|
||||
virtual void SetBrush(const wxBrush& brush);
|
||||
virtual void SetLogicalFunction(int function);
|
||||
virtual void SetBackground(const wxBrush& brush);
|
||||
virtual void SetBackgroundMode(int mode);
|
||||
virtual void SetClippingRegion(long x, long y, long width, long height);
|
||||
virtual void SetPalette(const wxPalette& palette);
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual inline void SetColourMap(const wxPalette& palette) { SetPalette(palette); };
|
||||
#endif
|
||||
virtual void DestroyClippingRegion(void);
|
||||
virtual void DrawText(const wxString& text, long x, long y, bool use16bit = FALSE);
|
||||
|
||||
virtual long GetCharHeight(void) const;
|
||||
virtual long GetCharWidth(void) const;
|
||||
virtual void GetTextExtent(const wxString& string, long *x, long *y,
|
||||
long *descent = NULL, long *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE) const;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void GetTextExtent(const wxString& string, float *x, float *y,
|
||||
float *descent = NULL, float *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE) const ;
|
||||
#endif
|
||||
|
||||
// Size in device units
|
||||
virtual void GetSize(int* width, int* height) const;
|
||||
inline wxSize GetSize(void) const { int w, h; GetSize(&w, &h); return wxSize(w, h); }
|
||||
|
||||
// Size in mm
|
||||
virtual void GetSizeMM(long* width, long* height) const ;
|
||||
|
||||
// Compatibility
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void GetSize(float* width, float* height) const { int w, h; GetSize(& w, & h); *width = w; *height = h; }
|
||||
inline void GetSizeMM(float *width, float *height) const { long w, h; GetSizeMM(& w, & h); *width = (float) w; *height = (float) h; }
|
||||
#endif
|
||||
|
||||
virtual bool StartDoc(const wxString& message);
|
||||
virtual void EndDoc(void);
|
||||
virtual void StartPage(void);
|
||||
virtual void EndPage(void);
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void SetUserScale(double x, double y);
|
||||
virtual void SetSystemScale(double x, double y);
|
||||
virtual void SetLogicalOrigin(long x, long y);
|
||||
virtual void SetDeviceOrigin(long x, long y);
|
||||
|
||||
// This group of functions does actual conversion
|
||||
// of the input, as you'd expect.
|
||||
|
||||
long DeviceToLogicalX(long x) const;
|
||||
long DeviceToLogicalY(long y) const;
|
||||
long DeviceToLogicalXRel(long x) const;
|
||||
long DeviceToLogicalYRel(long y) const;
|
||||
long LogicalToDeviceX(long x) const;
|
||||
long LogicalToDeviceY(long y) const;
|
||||
long LogicalToDeviceXRel(long x) const;
|
||||
long LogicalToDeviceYRel(long y) const;
|
||||
|
||||
// This group of functions may not do any conversion
|
||||
// if m_scaleGDI is TRUE, since the HDC does the
|
||||
// conversion automatically.
|
||||
// m_scaleGDI NOW OBSOLETE
|
||||
long ImplDeviceToLogicalX(long x) const;
|
||||
long ImplDeviceToLogicalY(long y) const;
|
||||
long ImplDeviceToLogicalXRel(long x) const;
|
||||
long ImplDeviceToLogicalYRel(long y) const;
|
||||
long ImplLogicalToDeviceX(long x) const;
|
||||
long ImplLogicalToDeviceY(long y) const;
|
||||
long ImplLogicalToDeviceXRel(long x) const;
|
||||
long ImplLogicalToDeviceYRel(long y) const;
|
||||
|
||||
virtual bool Blit(long xdest, long ydest, long width, long height,
|
||||
wxDC *source, long xsrc, long ysrc, int rop = wxCOPY, bool useMask = FALSE);
|
||||
|
||||
virtual bool CanDrawBitmap(void) const;
|
||||
virtual bool CanGetTextExtent(void) const;
|
||||
|
||||
//
|
||||
// This function is intended to improves drawing, by avoiding to
|
||||
// repeatly call ::SetPen/::SetBrush. If set to FALSE, these functions
|
||||
// aren't called when calling ::DrawLine(),...
|
||||
// Please note that this is YOUR responsability to use it, and do it
|
||||
// only when you KNOWN that pen/brush isn't changed between 2 calls to
|
||||
// DrawLine,... !!!
|
||||
// Note also that in X, we don't test m_autoSetting on brushes, because they
|
||||
// modify Foreground, as pens. So, convention is:
|
||||
// - call your SetBrush(), THEN your SetPen, THEN AutoSetTools(FALSE)
|
||||
// - call DrawLine,...
|
||||
// [mainly coded for Windows]
|
||||
inline virtual void AutoSetTools(bool auto_setting) { m_autoSetting = auto_setting ; }
|
||||
inline virtual void DrawPoint(wxPoint& point) { DrawPoint(point.x, point.y); }
|
||||
virtual void DrawLines(wxList *list, long xoffset = 0, long yoffset = 0);
|
||||
virtual void DrawPolygon(wxList *list, long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
||||
#if USE_SPLINES
|
||||
// Splines
|
||||
// 3-point spline
|
||||
virtual void DrawSpline(long x1, long y1, long x2, long y2, long x3, long y3);
|
||||
// Any number of control points - a list of pointers to wxPoints
|
||||
virtual void DrawSpline(wxList *points);
|
||||
virtual void DrawSpline(int n, wxPoint points[]);
|
||||
#endif
|
||||
virtual void SetTextForeground(const wxColour& colour);
|
||||
virtual void SetTextBackground(const wxColour& colour);
|
||||
inline virtual bool Ok(void) const {return m_ok;};
|
||||
inline virtual int GetMapMode(void) const {return m_mappingMode;};
|
||||
|
||||
inline virtual wxBrush *GetBackground(void) const { return (wxBrush*) &m_backgroundBrush ;}
|
||||
inline virtual wxBrush *GetBrush(void) const { return (wxBrush*) &m_brush ;}
|
||||
inline virtual wxFont *GetFont(void) const { return (wxFont*) &m_font ;}
|
||||
inline virtual int GetLogicalFunction(void) const { return m_logicalFunction ;}
|
||||
inline virtual wxPen *GetPen(void) const { return (wxPen*) &m_pen ;}
|
||||
inline virtual wxColour&GetTextBackground(void) const { return (wxColour&) m_textBackgroundColour ;}
|
||||
inline virtual wxColour&GetTextForeground(void) const { return (wxColour&) m_textForegroundColour ;}
|
||||
|
||||
virtual void SetLogicalScale(double x, double y);
|
||||
virtual inline void GetUserScale(double* x, double *y) const { *x = m_userScaleX; *y = m_userScaleY; }
|
||||
virtual void CalcBoundingBox(long x, long y);
|
||||
// Get the final bounding box of the PostScript or Metafile picture.
|
||||
virtual inline long MinX(void) const { return m_minX; }
|
||||
virtual inline long MaxX(void) const { return m_maxX; }
|
||||
virtual inline long MinY(void) const { return m_minY; }
|
||||
virtual inline long MaxY(void) const { return m_maxY; }
|
||||
// Sometimes we need to override optimization, e.g.
|
||||
// if other software is drawing onto our surface and we
|
||||
// can't be sure of who's done what.
|
||||
virtual inline void SetOptimization(bool WXUNUSED(opt)) { }
|
||||
virtual inline bool GetOptimization(void) { return FALSE; }
|
||||
|
||||
virtual void GetClippingBox(long *x,long *y,long *w,long *h) const ;
|
||||
|
||||
virtual void SetRop(WXHDC cdc);
|
||||
virtual void DoClipping(WXHDC cdc);
|
||||
virtual void SelectOldObjects(WXHDC dc);
|
||||
|
||||
inline wxWindow *GetWindow(void) const { return m_canvas; }
|
||||
inline void SetWindow(wxWindow *win) { m_canvas = win; }
|
||||
inline WXHDC GetHDC(void) const { return m_hDC; }
|
||||
inline void SetHDC(WXHDC dc, bool bOwnsDC = FALSE) { m_hDC = dc; m_bOwnsDC = bOwnsDC; }
|
||||
inline bool GetAutoSetting(void) const { return m_autoSetting; }
|
||||
|
||||
// inline bool GetScaleGDI(void) const { return m_scaleGDI; }
|
||||
// inline void SetScaleGDI(bool flag) { m_scaleGDI = flag; }
|
||||
|
||||
protected:
|
||||
bool m_colour;
|
||||
bool m_ok;
|
||||
bool m_clipping;
|
||||
bool m_isInteractive;
|
||||
|
||||
// Coordinate system variables
|
||||
long m_logicalOriginX;
|
||||
long m_logicalOriginY;
|
||||
|
||||
long m_deviceOriginX;
|
||||
long m_deviceOriginY;
|
||||
|
||||
double m_logicalScaleX;
|
||||
double m_logicalScaleY;
|
||||
|
||||
double m_userScaleX;
|
||||
double m_userScaleY;
|
||||
|
||||
int m_mappingMode;
|
||||
|
||||
long m_minX; // bounding box
|
||||
long m_minY;
|
||||
long m_maxX;
|
||||
long m_maxY;
|
||||
|
||||
int m_logicalFunction;
|
||||
int m_backgroundMode;
|
||||
|
||||
wxPen m_pen;
|
||||
wxBrush m_brush;
|
||||
wxBrush m_backgroundBrush;
|
||||
wxColour m_textForegroundColour;
|
||||
wxColour m_textBackgroundColour;
|
||||
wxFont m_font;
|
||||
wxPalette m_palette;
|
||||
bool m_autoSetting ;
|
||||
int m_clipX1;
|
||||
int m_clipY1;
|
||||
int m_clipX2;
|
||||
int m_clipY2;
|
||||
// bool m_dontDelete;
|
||||
int m_windowExtX;
|
||||
int m_windowExtY;
|
||||
double m_systemScaleX;
|
||||
double m_systemScaleY;
|
||||
|
||||
wxWindow * m_canvas;
|
||||
wxBitmap m_selectedBitmap;
|
||||
wxString m_filename;
|
||||
|
||||
// TRUE => DeleteDC() in dtor, FALSE => only ReleaseDC() it
|
||||
bool m_bOwnsDC;
|
||||
|
||||
WXHDC m_hDC;
|
||||
int m_hDCCount;
|
||||
|
||||
// Store all old GDI objects when do a SelectObject,
|
||||
// so we can select them back in (this unselecting user's
|
||||
// objects) so we can safely delete the DC.
|
||||
WXHBITMAP m_oldBitmap;
|
||||
WXHPEN m_oldPen;
|
||||
WXHBRUSH m_oldBrush;
|
||||
WXHFONT m_oldFont;
|
||||
WXHPALETTE m_oldPalette;
|
||||
|
||||
// Stores scaling, translation, rotation
|
||||
// wxTransformMatrix m_transformMatrix;
|
||||
|
||||
// Do we wish to scale GDI objects too, e.g. pen width?
|
||||
// bool m_scaleGDI;
|
||||
};
|
||||
|
||||
// Logical to device
|
||||
// Absolute
|
||||
#define XLOG2DEV(x) ImplLogicalToDeviceX(x)
|
||||
|
||||
#define YLOG2DEV(y) ImplLogicalToDeviceY(y)
|
||||
|
||||
// Relative
|
||||
#define XLOG2DEVREL(x) ImplLogicalToDeviceXRel(x)
|
||||
#define YLOG2DEVREL(y) ImplLogicalToDeviceYRel(y)
|
||||
|
||||
// Device to logical
|
||||
// Absolute
|
||||
#define XDEV2LOG(x) ImplDeviceToLogicalX(x)
|
||||
|
||||
#define YDEV2LOG(y) ImplDeviceToLogicalY(y)
|
||||
|
||||
// Relative
|
||||
#define XDEV2LOGREL(x) ImplDeviceToLogicalXRel(x)
|
||||
#define YDEV2LOGREL(y) ImplDeviceToLogicalYRel(y)
|
||||
|
||||
/*
|
||||
* Have the same macros as for XView but not for every operation:
|
||||
* just for calculating window/viewport extent (a better way of scaling).
|
||||
*/
|
||||
|
||||
// Logical to device
|
||||
// Absolute
|
||||
#define MS_XLOG2DEV(x) LogicalToDevice(x)
|
||||
|
||||
#define MS_YLOG2DEV(y) LogicalToDevice(y)
|
||||
|
||||
// Relative
|
||||
#define MS_XLOG2DEVREL(x) LogicalToDeviceXRel(x)
|
||||
#define MS_YLOG2DEVREL(y) LogicalToDeviceYRel(y)
|
||||
|
||||
// Device to logical
|
||||
// Absolute
|
||||
#define MS_XDEV2LOG(x) DeviceToLogicalX(x)
|
||||
|
||||
#define MS_YDEV2LOG(y) DeviceToLogicalY(y)
|
||||
|
||||
// Relative
|
||||
#define MS_XDEV2LOGREL(x) DeviceToLogicalXRel(x)
|
||||
#define MS_YDEV2LOGREL(y) DeviceToLogicalYRel(y)
|
||||
|
||||
#define MM_POINTS 7
|
||||
#define MM_METRIC 8
|
||||
|
||||
extern int wxPageNumber;
|
||||
|
||||
// Conversion
|
||||
#define METRIC_CONVERSION_CONSTANT 0.0393700787
|
||||
|
||||
// Scaling factors for various unit conversions
|
||||
#define mm2inches (METRIC_CONVERSION_CONSTANT)
|
||||
#define inches2mm (1/METRIC_CONVERSION_CONSTANT)
|
||||
|
||||
#define mm2twips (METRIC_CONVERSION_CONSTANT*1440)
|
||||
#define twips2mm (1/(METRIC_CONVERSION_CONSTANT*1440))
|
||||
|
||||
#define mm2pt (METRIC_CONVERSION_CONSTANT*72)
|
||||
#define pt2mm (1/(METRIC_CONVERSION_CONSTANT*72))
|
||||
|
||||
#define wx_round(a) (int)((a)+.5)
|
||||
|
||||
|
||||
#endif
|
||||
// __DCH__
|
65
include/wx/msw/dcclient.h
Normal file
@@ -0,0 +1,65 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcclient.h
|
||||
// Purpose: wxClientDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DCCLIENTH__
|
||||
#define __DCCLIENTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcclient.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxClientDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxClientDC)
|
||||
|
||||
public:
|
||||
wxClientDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxClientDC(wxWindow *win);
|
||||
|
||||
~wxClientDC(void);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxWindowDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowDC)
|
||||
|
||||
public:
|
||||
wxWindowDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxWindowDC(wxWindow *win);
|
||||
|
||||
~wxWindowDC(void);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPaintDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPaintDC)
|
||||
|
||||
public:
|
||||
wxPaintDC(void);
|
||||
|
||||
// Create a DC corresponding to a canvas
|
||||
wxPaintDC(wxWindow *win);
|
||||
|
||||
~wxPaintDC(void);
|
||||
|
||||
protected:
|
||||
static WXHDC m_staticPaintHDC ;
|
||||
static int m_staticPaintCount ;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __DCCLIENTH__
|
35
include/wx/msw/dcmemory.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcmemory.h
|
||||
// Purpose: wxMemoryDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DCMEMORYH__
|
||||
#define __DCMEMORYH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcmemory.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dcclient.h"
|
||||
|
||||
class WXDLLEXPORT wxMemoryDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMemoryDC)
|
||||
|
||||
public:
|
||||
wxMemoryDC(void);
|
||||
wxMemoryDC(wxDC *dc); // Create compatible DC
|
||||
|
||||
~wxMemoryDC(void);
|
||||
virtual void SelectObject(const wxBitmap& bitmap);
|
||||
virtual void GetSize(int* width, int* height) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __DCMEMORYH__
|
38
include/wx/msw/dcprint.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcprint.h
|
||||
// Purpose: wxPrinterDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DCPRINTH__
|
||||
#define __DCPRINTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcprint.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxPrinterDC: public wxDC
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS(wxPrinterDC)
|
||||
|
||||
// Create a printer DC
|
||||
wxPrinterDC(const wxString& driver, const wxString& device, const wxString& output, const bool interactive = TRUE, const int orientation = wxPORTRAIT);
|
||||
wxPrinterDC(WXHDC theDC);
|
||||
|
||||
~wxPrinterDC(void);
|
||||
};
|
||||
|
||||
// Gets an HDC for the default printer configuration
|
||||
WXHDC WXDLLEXPORT wxGetPrinterDC(int orientation);
|
||||
|
||||
#endif
|
||||
// __DCPRINTH__
|
||||
|
39
include/wx/msw/dcscreen.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dcscreen.h
|
||||
// Purpose: wxScreenDC class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DCSCREENH__
|
||||
#define __DCSCREENH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dcscreen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dc.h"
|
||||
|
||||
class WXDLLEXPORT wxScreenDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScreenDC)
|
||||
|
||||
public:
|
||||
// Create a DC representing the whole screen
|
||||
wxScreenDC(void);
|
||||
~wxScreenDC(void);
|
||||
|
||||
// Compatibility with X's requirements for
|
||||
// drawing on top of all windows
|
||||
static bool StartDrawingOnTop(wxWindow *window) { return TRUE; }
|
||||
static bool StartDrawingOnTop(wxRectangle *rect = NULL) { return TRUE; }
|
||||
static bool EndDrawingOnTop(void) { return TRUE; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// __DCSCREENH__
|
||||
|
161
include/wx/msw/dde.h
Normal file
@@ -0,0 +1,161 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dde.h
|
||||
// Purpose: DDE class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DDEH__
|
||||
#define __DDEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dde.h"
|
||||
#endif
|
||||
|
||||
#include "wx/ipcbase.h"
|
||||
|
||||
/*
|
||||
* Mini-DDE implementation
|
||||
|
||||
Most transactions involve a topic name and an item name (choose these
|
||||
as befits your application).
|
||||
|
||||
A client can:
|
||||
|
||||
- ask the server to execute commands (data) associated with a topic
|
||||
- request data from server by topic and item
|
||||
- poke data into the server
|
||||
- ask the server to start an advice loop on topic/item
|
||||
- ask the server to stop an advice loop
|
||||
|
||||
A server can:
|
||||
|
||||
- respond to execute, request, poke and advice start/stop
|
||||
- send advise data to client
|
||||
|
||||
Note that this limits the server in the ways it can send data to the
|
||||
client, i.e. it can't send unsolicited information.
|
||||
*
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDDEServer;
|
||||
class WXDLLEXPORT wxDDEClient;
|
||||
|
||||
class WXDLLEXPORT wxDDEConnection: public wxConnectionBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDDEConnection)
|
||||
public:
|
||||
char *buf_ptr;
|
||||
wxString topic_name;
|
||||
int buf_size;
|
||||
wxDDEServer *server;
|
||||
wxDDEClient *client;
|
||||
|
||||
WXHCONV hConv;
|
||||
char *sending_data;
|
||||
int data_size;
|
||||
int data_type;
|
||||
|
||||
wxDDEConnection(char *buffer, int size);
|
||||
wxDDEConnection(void);
|
||||
~wxDDEConnection(void);
|
||||
|
||||
// Calls that CLIENT can make
|
||||
virtual bool Execute(char *data, int size = -1, int format = wxCF_TEXT);
|
||||
virtual bool Execute(const wxString& str) { return Execute((char *)(const char *)str, -1, wxCF_TEXT); }
|
||||
virtual char *Request(const wxString& item, int *size = NULL, int format = wxCF_TEXT);
|
||||
virtual bool Poke(const wxString& item, char *data, int size = -1, int format = wxCF_TEXT);
|
||||
virtual bool StartAdvise(const wxString& item);
|
||||
virtual bool StopAdvise(const wxString& item);
|
||||
|
||||
// Calls that SERVER can make
|
||||
virtual bool Advise(const wxString& item, char *data, int size = -1, int format = wxCF_TEXT);
|
||||
|
||||
// Calls that both can make
|
||||
virtual bool Disconnect(void);
|
||||
|
||||
// Callbacks to SERVER - override at will
|
||||
virtual bool OnExecute(const wxString& topic, char *data, int size, int format) { return FALSE; };
|
||||
virtual char *OnRequest(const wxString& topic, const wxString& item, int *size, int format) { return NULL; };
|
||||
virtual bool OnPoke(const wxString& topic, const wxString& item, char *data, int size, int format) { return FALSE; };
|
||||
virtual bool OnStartAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
||||
virtual bool OnStopAdvise(const wxString& topic, const wxString& item) { return FALSE; };
|
||||
|
||||
// Callbacks to CLIENT - override at will
|
||||
virtual bool OnAdvise(const wxString& topic, const wxString& item, char *data, int size, int format) { return FALSE; };
|
||||
|
||||
// Callbacks to BOTH
|
||||
|
||||
// Default behaviour is to delete connection and return TRUE
|
||||
virtual bool OnDisconnect(void);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxDDEServer: public wxServerBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDDEServer)
|
||||
public:
|
||||
|
||||
wxDDEServer(void);
|
||||
~wxDDEServer(void);
|
||||
bool Create(const wxString& server_name); // Returns FALSE if can't create server (e.g. port
|
||||
// number is already in use)
|
||||
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic);
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
// Find/delete wxDDEConnection corresponding to the HCONV
|
||||
wxDDEConnection *FindConnection(WXHCONV conv);
|
||||
bool DeleteConnection(WXHCONV conv);
|
||||
inline wxString& GetServiceName(void) const { return (wxString&) service_name; }
|
||||
inline wxList& GetConnections(void) const { return (wxList&) connections; }
|
||||
|
||||
protected:
|
||||
int lastError;
|
||||
wxString service_name;
|
||||
wxList connections;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxDDEClient: public wxClientBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDDEClient)
|
||||
public:
|
||||
wxDDEClient(void);
|
||||
~wxDDEClient(void);
|
||||
bool ValidHost(const wxString& host);
|
||||
virtual wxConnectionBase *MakeConnection(const wxString& host, const wxString& server, const wxString& topic);
|
||||
// Call this to make a connection.
|
||||
// Returns NULL if cannot.
|
||||
virtual wxConnectionBase *OnMakeConnection(void); // Tailor this to return own connection.
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
// Implementation
|
||||
|
||||
// Find/delete wxDDEConnection corresponding to the HCONV
|
||||
wxDDEConnection *FindConnection(WXHCONV conv);
|
||||
bool DeleteConnection(WXHCONV conv);
|
||||
inline wxList& GetConnections(void) const { return (wxList&) connections; }
|
||||
|
||||
protected:
|
||||
int lastError;
|
||||
wxList connections;
|
||||
};
|
||||
|
||||
void WXDLLEXPORT wxDDEInitialize();
|
||||
void WXDLLEXPORT wxDDECleanUp();
|
||||
|
||||
// Compatibility
|
||||
#if WXWIN_COMPATIBILITY
|
||||
#define wxServer wxDDEServer
|
||||
#define wxClient wxDDEClient
|
||||
#define wxConnection wxDDEConnection
|
||||
#define wxIPCInitialize wxDDEInitialize
|
||||
#define wxIPCCleanUp wxDDECleanUp
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __DDEH__
|
118
include/wx/msw/dialog.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dialog.h
|
||||
// Purpose: wxDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOGH__
|
||||
#define __DIALOGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dialog.h"
|
||||
#endif
|
||||
|
||||
#include "wx/panel.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr;
|
||||
|
||||
// Dialog boxes
|
||||
class WXDLLEXPORT wxDialog: public wxPanel
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDialog)
|
||||
protected:
|
||||
bool m_modalShowing;
|
||||
public:
|
||||
|
||||
wxDialog(void);
|
||||
|
||||
// Constructor with a modal flag, but no window id - the old convention
|
||||
inline wxDialog(wxWindow *parent,
|
||||
const wxString& title, bool modal,
|
||||
const int x = -1, const int y= -1, const int width = 500, const int height = 500,
|
||||
const long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
{
|
||||
long modalStyle = modal ? wxDIALOG_MODAL : wxDIALOG_MODELESS ;
|
||||
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), style|modalStyle, name);
|
||||
}
|
||||
|
||||
// Constructor with no modal flag - the new convention.
|
||||
inline wxDialog(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& title, // bool modal = FALSE, // TODO make this a window style?
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_DIALOG_STYLE,
|
||||
const wxString& name = wxDialogNameStr);
|
||||
|
||||
~wxDialog(void);
|
||||
|
||||
virtual bool Destroy(void);
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
void SetClientSize(const int width, const int height);
|
||||
void GetPosition(int *x, int *y) const;
|
||||
bool Show(const bool show);
|
||||
bool IsShown(void) const ;
|
||||
void Iconize(const bool iconize);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline bool Iconized(void) const { return IsIconized(); };
|
||||
#endif
|
||||
|
||||
virtual bool IsIconized(void) const;
|
||||
void Fit(void);
|
||||
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle(void) const ;
|
||||
|
||||
bool OnClose(void);
|
||||
void OnCharHook(wxKeyEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
void SetModal(const bool flag);
|
||||
|
||||
virtual void Centre(const int direction = wxBOTH);
|
||||
virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
|
||||
|
||||
// For now, same as Show(TRUE) but returns return code
|
||||
virtual int ShowModal(void);
|
||||
virtual void EndModal(int retCode);
|
||||
|
||||
// Standard buttons
|
||||
void OnOK(wxCommandEvent& event);
|
||||
void OnApply(wxCommandEvent& event);
|
||||
void OnCancel(wxCommandEvent& event);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// IMPLEMENTATION
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
||||
// virtual bool MSWOnEraseBkgnd(WXHDC pDC);
|
||||
virtual bool MSWOnClose(void);
|
||||
inline bool IsModalShowing() const { return m_modalShowing ; }
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __DIALOGH__
|
26
include/wx/msw/dib.h
Normal file
@@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dib.h
|
||||
// Purpose: Routines for loading and saving DIBs
|
||||
// Author: Various
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Save (device dependent) wxBitmap as a DIB
|
||||
bool wxSaveBitmap(char *filename, wxBitmap *bitmap, wxColourMap *colourmap = NULL);
|
||||
|
||||
// Load device independent bitmap into device dependent bitmap
|
||||
wxBitmap *wxLoadBitmap(char *filename, wxColourMap **colourmap = NULL);
|
||||
|
||||
// Load into existing bitmap;
|
||||
bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal = NULL);
|
||||
|
||||
HANDLE BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal);
|
||||
BOOL ReadDIB(LPSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette);
|
||||
HANDLE ReadDIB2(LPSTR lpFileName);
|
||||
LPSTR FindDIBBits (LPSTR lpbi);
|
||||
HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo);
|
||||
|
131
include/wx/msw/dibutils.h
Normal file
@@ -0,0 +1,131 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dibutils.h
|
||||
// Purpose: Utilities for DIBs
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Microsoft, Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/***************************************************************************
|
||||
|
||||
(C) Copyright 1994 Microsoft Corp. All rights reserved.
|
||||
|
||||
You have a royalty-free right to use, modify, reproduce and
|
||||
distribute the Sample Files (and/or any modified version) in
|
||||
any way you find useful, provided that you agree that
|
||||
Microsoft has no warranty obligations or liability for any
|
||||
Sample Application Files which are modified.
|
||||
|
||||
**************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
Functions for handling Device Independent Bitmaps and clearing the
|
||||
System Palette.
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef SAMPLES_UTILS_H
|
||||
#define SAMPLES_UTILS_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dibutils.h"
|
||||
#endif
|
||||
|
||||
typedef LPBITMAPINFOHEADER PDIB;
|
||||
typedef HANDLE HDIB;
|
||||
|
||||
/***************************************************************************
|
||||
External function declarations
|
||||
**************************************************************************/
|
||||
|
||||
void ClearSystemPalette(void);
|
||||
PDIB DibOpenFile(LPSTR szFile);
|
||||
int DibWriteFile(LPSTR szFile, LPBITMAPINFOHEADER lpbi);
|
||||
BOOL DibSetUsage(PDIB pdib, HPALETTE hpal,UINT wUsage);
|
||||
PDIB DibCreate(int bits, int dx, int dy);
|
||||
BOOL DibMapToPalette(PDIB pdib, HPALETTE hpal);
|
||||
HPALETTE MakePalette(const BITMAPINFO FAR* Info, UINT flags);
|
||||
|
||||
/****************************************************************************
|
||||
Internal function declarations
|
||||
***************************************************************************/
|
||||
|
||||
PDIB DibReadBitmapInfo(HFILE fh);
|
||||
|
||||
/****************************************************************************
|
||||
DIB macros.
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef WIN32
|
||||
#define HandleFromDib(lpbi) GlobalHandle(lpbi)
|
||||
#else
|
||||
#define HandleFromDib(lpbi) (HANDLE)GlobalHandle(SELECTOROF(lpbi))
|
||||
#endif
|
||||
|
||||
#define DibFromHandle(h) (PDIB)GlobalLock(h)
|
||||
|
||||
#define DibFree(pdib) GlobalFreePtr(pdib)
|
||||
|
||||
#define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */
|
||||
|
||||
#define DibWidth(lpbi) (UINT)(((LPBITMAPINFOHEADER)(lpbi))->biWidth)
|
||||
#define DibHeight(lpbi) (UINT)(((LPBITMAPINFOHEADER)(lpbi))->biHeight)
|
||||
#define DibBitCount(lpbi) (UINT)(((LPBITMAPINFOHEADER)(lpbi))->biBitCount)
|
||||
#define DibCompression(lpbi) (DWORD)(((LPBITMAPINFOHEADER)(lpbi))->biCompression)
|
||||
|
||||
#define DibWidthBytesN(lpbi, n) (UINT)WIDTHBYTES((UINT)(lpbi)->biWidth * (UINT)(n))
|
||||
#define DibWidthBytes(lpbi) DibWidthBytesN(lpbi, (lpbi)->biBitCount)
|
||||
|
||||
#define DibSizeImage(lpbi) ((lpbi)->biSizeImage == 0 \
|
||||
? ((DWORD)(UINT)DibWidthBytes(lpbi) * (DWORD)(UINT)(lpbi)->biHeight) \
|
||||
: (lpbi)->biSizeImage)
|
||||
|
||||
#define DibSize(lpbi) ((lpbi)->biSize + (lpbi)->biSizeImage + (int)(lpbi)->biClrUsed * sizeof(RGBQUAD))
|
||||
#define DibPaletteSize(lpbi) (DibNumColors(lpbi) * sizeof(RGBQUAD))
|
||||
|
||||
#define DibFlipY(lpbi, y) ((int)(lpbi)->biHeight-1-(y))
|
||||
|
||||
//HACK for NT BI_BITFIELDS DIBs
|
||||
#ifdef WIN32
|
||||
#define DibPtr(lpbi) ((lpbi)->biCompression == BI_BITFIELDS \
|
||||
? (LPVOID)(DibColors(lpbi) + 3) \
|
||||
: (LPVOID)(DibColors(lpbi) + (UINT)(lpbi)->biClrUsed))
|
||||
#else
|
||||
#define DibPtr(lpbi) (LPVOID)(DibColors(lpbi) + (UINT)(lpbi)->biClrUsed)
|
||||
#endif
|
||||
|
||||
#define DibColors(lpbi) ((RGBQUAD FAR *)((LPBYTE)(lpbi) + (int)(lpbi)->biSize))
|
||||
|
||||
#define DibNumColors(lpbi) ((lpbi)->biClrUsed == 0 && (lpbi)->biBitCount <= 8 \
|
||||
? (int)(1 << (int)(lpbi)->biBitCount) \
|
||||
: (int)(lpbi)->biClrUsed)
|
||||
|
||||
#define DibXYN(lpbi,pb,x,y,n) (LPVOID)( \
|
||||
(BYTE _huge *)(pb) + \
|
||||
(UINT)((UINT)(x) * (UINT)(n) / 8u) + \
|
||||
((DWORD)DibWidthBytesN(lpbi,n) * (DWORD)(UINT)(y)))
|
||||
|
||||
#define DibXY(lpbi,x,y) DibXYN(lpbi,DibPtr(lpbi),x,y,(lpbi)->biBitCount)
|
||||
|
||||
#define FixBitmapInfo(lpbi) if ((lpbi)->biSizeImage == 0) \
|
||||
(lpbi)->biSizeImage = DibSizeImage(lpbi); \
|
||||
if ((lpbi)->biClrUsed == 0) \
|
||||
(lpbi)->biClrUsed = DibNumColors(lpbi); \
|
||||
if ((lpbi)->biCompression == BI_BITFIELDS && (lpbi)->biClrUsed == 0) \
|
||||
; // (lpbi)->biClrUsed = 3;
|
||||
|
||||
#define DibInfo(pDIB) ((BITMAPINFO FAR *)(pDIB))
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifndef BI_BITFIELDS
|
||||
#define BI_BITFIELDS 3
|
||||
#endif
|
||||
|
||||
#ifndef HALFTONE
|
||||
#define HALFTONE COLORONCOLOR
|
||||
#endif
|
||||
|
||||
#endif
|
47
include/wx/msw/dirdlg.h
Normal file
@@ -0,0 +1,47 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dirdlg.h
|
||||
// Purpose: wxDirDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIRDLGH__
|
||||
#define __DIRDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dirdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
class WXDLLEXPORT wxDirDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxDirDialog)
|
||||
public:
|
||||
wxDirDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultPath = "",
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
inline void SetPath(const wxString& path) { m_path = path; }
|
||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||
|
||||
inline wxString GetMessage(void) const { return m_message; }
|
||||
inline wxString GetPath(void) const { return m_path; }
|
||||
inline long GetStyle(void) const { return m_dialogStyle; }
|
||||
|
||||
int ShowModal(void);
|
||||
|
||||
protected:
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
wxString m_path;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __DIRDLGH__
|
BIN
include/wx/msw/disable.bmp
Normal file
After Width: | Height: | Size: 630 B |
88
include/wx/msw/filedlg.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: filedlg.h
|
||||
// Purpose: wxFileDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __FILEDLGH__
|
||||
#define __FILEDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "filedlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
|
||||
/*
|
||||
* File selector
|
||||
*/
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorPromptStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFileSelectorDefaultWildcardStr;
|
||||
|
||||
class WXDLLEXPORT wxFileDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFileDialog)
|
||||
protected:
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
wxString m_dir;
|
||||
wxString m_path; // Full path
|
||||
wxString m_fileName;
|
||||
wxString m_wildCard;
|
||||
int m_filterIndex;
|
||||
public:
|
||||
wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr,
|
||||
const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
|
||||
long style = 0, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
inline void SetMessage(const wxString& message) { m_message = message; }
|
||||
inline void SetPath(const wxString& path) { m_path = path; }
|
||||
inline void SetDirectory(const wxString& dir) { m_dir = dir; }
|
||||
inline void SetFilename(const wxString& name) { m_fileName = name; }
|
||||
inline void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; }
|
||||
inline void SetStyle(long style) { m_dialogStyle = style; }
|
||||
inline void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; }
|
||||
|
||||
inline wxString GetMessage(void) const { return m_message; }
|
||||
inline wxString GetPath(void) const { return m_path; }
|
||||
inline wxString GetDirectory(void) const { return m_dir; }
|
||||
inline wxString GetFilename(void) const { return m_fileName; }
|
||||
inline wxString GetWildcard(void) const { return m_wildCard; }
|
||||
inline long GetStyle(void) const { return m_dialogStyle; }
|
||||
inline int GetFilterIndex(void) const { return m_filterIndex ; }
|
||||
|
||||
int ShowModal(void);
|
||||
};
|
||||
|
||||
#define wxOPEN 1
|
||||
#define wxSAVE 2
|
||||
#define wxOVERWRITE_PROMPT 4
|
||||
#define wxHIDE_READONLY 8
|
||||
|
||||
// File selector - backward compatibility
|
||||
char* WXDLLEXPORT wxFileSelector(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||
const char *default_filename = NULL, const char *default_extension = NULL,
|
||||
const char *wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0,
|
||||
wxWindow *parent = NULL, int x = -1, int y = -1);
|
||||
|
||||
// An extended version of wxFileSelector
|
||||
char* WXDLLEXPORT wxFileSelectorEx(const char *message = wxFileSelectorPromptStr, const char *default_path = NULL,
|
||||
const char *default_filename = NULL, int *indexDefaultExtension = NULL,
|
||||
const char *wildcard = wxFileSelectorDefaultWildcardStr, const int flags = 0,
|
||||
wxWindow *parent = NULL, const int x = -1, const int y = -1);
|
||||
|
||||
// Generic file load dialog
|
||||
char* WXDLLEXPORT wxLoadFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||
|
||||
// Generic file save dialog
|
||||
char* WXDLLEXPORT wxSaveFileSelector(const char *what, const char *extension, const char *default_name = NULL, wxWindow *parent = NULL);
|
||||
|
||||
#endif
|
||||
// __FILEDLGH__
|
98
include/wx/msw/font.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: font.h
|
||||
// Purpose: wxFont class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __FONTH__
|
||||
#define __FONTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "font.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxFont;
|
||||
|
||||
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxFont;
|
||||
public:
|
||||
wxFontRefData(void);
|
||||
~wxFontRefData(void);
|
||||
protected:
|
||||
bool m_temporary; // If TRUE, the pointer to the actual font
|
||||
// is temporary and SHOULD NOT BE DELETED by
|
||||
// destructor
|
||||
int m_pointSize;
|
||||
int m_family;
|
||||
int m_fontId;
|
||||
int m_style;
|
||||
int m_weight;
|
||||
bool m_underlined;
|
||||
wxString m_faceName;
|
||||
WXHFONT m_hFont;
|
||||
|
||||
};
|
||||
|
||||
#define M_FONTDATA ((wxFontRefData *)m_refData)
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Font
|
||||
class WXDLLEXPORT wxFont: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFont)
|
||||
public:
|
||||
wxFont(void);
|
||||
wxFont(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
|
||||
inline wxFont(const wxFont& font) { Ref(font); }
|
||||
inline wxFont(const wxFont* font) { /* UnRef(); */ if (font) Ref(*font); }
|
||||
|
||||
~wxFont(void);
|
||||
|
||||
bool Create(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
|
||||
|
||||
// Internal
|
||||
virtual bool RealizeResource(void);
|
||||
virtual WXHANDLE GetResourceHandle(void) ;
|
||||
virtual bool FreeResource(bool force = FALSE);
|
||||
/*
|
||||
virtual bool UseResource(void);
|
||||
virtual bool ReleaseResource(void);
|
||||
*/
|
||||
|
||||
virtual bool IsFree(void);
|
||||
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
inline int GetPointSize(void) const { return M_FONTDATA->m_pointSize; }
|
||||
inline int GetFamily(void) const { return M_FONTDATA->m_family; }
|
||||
inline int GetFontId(void) const { return M_FONTDATA->m_fontId; } /* New font system */
|
||||
inline int GetStyle(void) const { return M_FONTDATA->m_style; }
|
||||
inline int GetWeight(void) const { return M_FONTDATA->m_weight; }
|
||||
wxString GetFamilyString(void) const ;
|
||||
wxString GetFaceName(void) const ;
|
||||
wxString GetStyleString(void) const ;
|
||||
wxString GetWeightString(void) const ;
|
||||
inline bool GetUnderlined(void) const { return M_FONTDATA->m_underlined; }
|
||||
|
||||
void SetPointSize(const int pointSize);
|
||||
void SetFamily(const int family);
|
||||
void SetStyle(const int style);
|
||||
void SetWeight(const int weight);
|
||||
void SetFaceName(const wxString& faceName);
|
||||
void SetUnderlined(const bool underlined);
|
||||
|
||||
inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; }
|
||||
inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; }
|
||||
inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// __FONTH__
|
44
include/wx/msw/fontdlg.h
Normal file
@@ -0,0 +1,44 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: fontdlg.h
|
||||
// Purpose: wxFontDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __FONTDLGH__
|
||||
#define __FONTDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "fontdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* FONT DIALOG
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxFontDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxFontDialog)
|
||||
protected:
|
||||
wxWindow *dialogParent;
|
||||
wxFontData fontData;
|
||||
public:
|
||||
wxFontDialog(void);
|
||||
wxFontDialog(wxWindow *parent, wxFontData *data = NULL);
|
||||
|
||||
bool Create(wxWindow *parent, wxFontData *data = NULL);
|
||||
|
||||
int ShowModal(void);
|
||||
wxFontData& GetFontData(void) { return fontData; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// __FONTDLGH__
|
||||
|
162
include/wx/msw/frame.h
Normal file
@@ -0,0 +1,162 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: frame.h
|
||||
// Purpose: wxFrame class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __FRAMEH__
|
||||
#define __FRAMEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "frame.h"
|
||||
#endif
|
||||
|
||||
#include "wx/window.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMenuBar;
|
||||
class WXDLLEXPORT wxStatusBar;
|
||||
|
||||
class WXDLLEXPORT wxFrame: public wxWindow {
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxFrame)
|
||||
|
||||
public:
|
||||
wxFrame(void);
|
||||
inline wxFrame(wxWindow *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxFrame(void);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// The default thing is to set the focus for the first child window.
|
||||
// Override for your own behaviour.
|
||||
virtual void OldOnActivate(bool flag);
|
||||
|
||||
// Default behaviour is to display a help string for the menu item.
|
||||
virtual void OldOnMenuSelect(int id);
|
||||
|
||||
inline virtual void OldOnMenuCommand(int WXUNUSED(id)) {}; // Called on frame menu command
|
||||
void OldOnSize(int x, int y);
|
||||
#endif
|
||||
|
||||
virtual bool Destroy(void);
|
||||
void SetClientSize(const int width, const int height);
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
void GetSize(int *width, int *height) const ;
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnMenuHighlight(wxMenuEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
void OnCloseWindow(wxCloseEvent& event);
|
||||
|
||||
bool Show(const bool show);
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
virtual wxMenuBar *GetMenuBar(void) const ;
|
||||
|
||||
// Set title
|
||||
void SetTitle(const wxString& title);
|
||||
wxString GetTitle(void) const ;
|
||||
|
||||
void Centre(const int direction = wxBOTH);
|
||||
|
||||
// Call this to simulate a menu command
|
||||
virtual void Command(int id);
|
||||
virtual void ProcessCommand(int id);
|
||||
|
||||
// Set icon
|
||||
virtual void SetIcon(const wxIcon& icon);
|
||||
|
||||
// Create status line
|
||||
virtual bool CreateStatusBar(const int number=1);
|
||||
inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
|
||||
|
||||
// Set status line text
|
||||
virtual void SetStatusText(const wxString& text, const int number = 0);
|
||||
|
||||
// Set status line widths
|
||||
virtual void SetStatusWidths(const int n, const int *widths_field);
|
||||
|
||||
// Hint to tell framework which status bar to use
|
||||
// TODO: should this go into a wxFrameworkSettings class perhaps?
|
||||
static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
|
||||
static bool UsesNativeStatusBar(void) { return m_useNativeStatusBar; };
|
||||
|
||||
// Fit frame around subwindows
|
||||
virtual void Fit(void);
|
||||
|
||||
// Iconize
|
||||
virtual void Iconize(const bool iconize);
|
||||
|
||||
virtual bool IsIconized(void) const ;
|
||||
|
||||
// Compatibility
|
||||
inline bool Iconized(void) const { return IsIconized(); }
|
||||
|
||||
virtual void Maximize(const bool maximize);
|
||||
virtual bool LoadAccelerators(const wxString& table);
|
||||
|
||||
virtual void PositionStatusBar(void);
|
||||
virtual wxStatusBar *OnCreateStatusBar(const int number);
|
||||
|
||||
// Query app for menu item updates (called from OnIdle)
|
||||
void DoMenuUpdates(void);
|
||||
void DoMenuUpdates(wxMenu* menu);
|
||||
|
||||
WXHMENU GetWinMenu(void) const ;
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// Handlers
|
||||
bool MSWOnPaint(void);
|
||||
WXHICON MSWOnQueryDragIcon(void);
|
||||
void MSWOnSize(const int x, const int y, const WXUINT flag);
|
||||
bool MSWOnCommand(const WXWORD id, const WXWORD cmd, const WXHWND control);
|
||||
bool MSWOnClose(void);
|
||||
void MSWOnMenuHighlight(const WXWORD item, const WXWORD flags, const WXHMENU sysmenu);
|
||||
bool MSWProcessMessage(WXMSG *msg);
|
||||
void MSWCreate(const int id, wxWindow *parent, const char *WXUNUSED(wclass), wxWindow *wx_win, const char *title,
|
||||
const int x, const int y, const int width, const int height, const long style);
|
||||
|
||||
protected:
|
||||
wxMenuBar * m_frameMenuBar;
|
||||
wxStatusBar * m_frameStatusBar;
|
||||
wxIcon m_icon;
|
||||
bool m_iconized;
|
||||
WXHICON m_defaultIcon;
|
||||
static bool m_useNativeStatusBar;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __FRAMEH__
|
81
include/wx/msw/gauge.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gauge.h
|
||||
// Purpose: wxGauge class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GAUGEH__
|
||||
#define __GAUGEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "gauge.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxGauge: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
public:
|
||||
inline wxGauge(void) { m_rangeMax = 0; m_gaugePos = 0; m_useProgressBar = FALSE; }
|
||||
|
||||
inline wxGauge(wxWindow *parent, const wxWindowID id,
|
||||
const int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr)
|
||||
{
|
||||
Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxGA_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
void SetShadowWidth(const int w);
|
||||
void SetBezelFace(const int w);
|
||||
void SetRange(const int r);
|
||||
void SetValue(const int pos);
|
||||
|
||||
int GetShadowWidth(void) const ;
|
||||
int GetBezelFace(void) const ;
|
||||
int GetRange(void) const ;
|
||||
int GetValue(void) const ;
|
||||
|
||||
void SetForegroundColour(const wxColour& col);
|
||||
void SetBackgroundColour(const wxColour& col);
|
||||
|
||||
// Backward compatibility
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void SetButtonColour(const wxColour& col) { SetForegroundColour(col); }
|
||||
#endif
|
||||
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Are we a Win95 progress bar, or a normal gauge?
|
||||
inline bool GetProgressBar(void) const { return m_useProgressBar; }
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
bool m_useProgressBar;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GAUGEH__
|
67
include/wx/msw/gdiobj.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: gdiobj.h
|
||||
// Purpose: wxGDIObject class: base class for other GDI classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __GDIOBJH__
|
||||
#define __GDIOBJH__
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "gdiobj.h"
|
||||
#endif
|
||||
|
||||
// wxGDIRefData is the reference-counted data part of a GDI object.
|
||||
// It contains another counter, m_usageCount, which counts the number
|
||||
// of times this object has been used; e.g. in SetFont, the count
|
||||
// is incremented. This is different from reference counting,
|
||||
// where only the constructors, destructors and (un)clone operations
|
||||
// affect the reference count.
|
||||
// THIS IS NOW BEING REMOVED AS REDUNDANT AND ERROR-PRONE
|
||||
|
||||
class WXDLLEXPORT wxGDIRefData: public wxObjectRefData {
|
||||
public:
|
||||
inline wxGDIRefData(void)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#define M_GDIDATA ((wxGDIRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxGDIObject: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGDIObject)
|
||||
public:
|
||||
inline wxGDIObject(void) { m_visible = FALSE; };
|
||||
inline ~wxGDIObject(void) {};
|
||||
|
||||
// Creates the resource
|
||||
virtual bool RealizeResource(void) { return FALSE; };
|
||||
|
||||
// Frees the resource
|
||||
virtual bool FreeResource(bool WXUNUSED(force) = FALSE) { return FALSE; };
|
||||
|
||||
virtual bool IsFree(void) { return FALSE; };
|
||||
|
||||
inline bool IsNull(void) const { return (m_refData == 0); }
|
||||
|
||||
// Returns handle.
|
||||
virtual WXHANDLE GetResourceHandle(void) { return 0; }
|
||||
|
||||
virtual bool GetVisible(void) { return m_visible; }
|
||||
virtual void SetVisible(bool v) { m_visible = v; }
|
||||
|
||||
protected:
|
||||
bool m_visible; // Can a pointer to this object be safely taken?
|
||||
// - only if created within FindOrCreate...
|
||||
};
|
||||
|
||||
#endif
|
||||
// __GDIOBJH__
|
BIN
include/wx/msw/hand.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
include/wx/msw/heart.cur
Normal file
After Width: | Height: | Size: 326 B |
54
include/wx/msw/helpwin.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: helpwin.h
|
||||
// Purpose: Help system: WinHelp implementation
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __HELPWINH__
|
||||
#define __HELPWINH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "helpwin.h"
|
||||
#endif
|
||||
|
||||
#include "wx/wx.h"
|
||||
|
||||
#if USE_HELP
|
||||
|
||||
#include "wx/helpbase.h"
|
||||
|
||||
class WXDLLEXPORT wxWinHelpController: public wxHelpControllerBase
|
||||
{
|
||||
DECLARE_CLASS(wxWinHelpController)
|
||||
|
||||
public:
|
||||
wxWinHelpController(void);
|
||||
~wxWinHelpController(void);
|
||||
|
||||
// Must call this to set the filename and server name
|
||||
virtual bool Initialize(const wxString& file, int server = -1);
|
||||
|
||||
// If file is "", reloads file given in Initialize
|
||||
virtual bool LoadFile(const wxString& file = "");
|
||||
virtual bool DisplayContents(void);
|
||||
virtual bool DisplaySection(int sectionNo);
|
||||
virtual bool DisplayBlock(long blockNo);
|
||||
virtual bool KeywordSearch(const wxString& k);
|
||||
|
||||
virtual bool Quit(void);
|
||||
virtual void OnQuit(void);
|
||||
|
||||
inline wxString GetHelpFile(void) const { return m_helpFile; }
|
||||
|
||||
protected:
|
||||
wxString m_helpFile;
|
||||
};
|
||||
|
||||
#endif // USE_HELP
|
||||
#endif
|
||||
// __HELPWINH__
|
102
include/wx/msw/icon.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: icon.h
|
||||
// Purpose: wxIcon class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __ICONH__
|
||||
#define __ICONH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "icon.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
class WXDLLEXPORT wxIconRefData: public wxBitmapRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxBitmap;
|
||||
friend class WXDLLEXPORT wxIcon;
|
||||
public:
|
||||
wxIconRefData(void);
|
||||
~wxIconRefData(void);
|
||||
|
||||
public:
|
||||
WXHICON m_hIcon;
|
||||
};
|
||||
|
||||
#define M_ICONDATA ((wxIconRefData *)m_refData)
|
||||
#define M_ICONHANDLERDATA ((wxIconRefData *)bitmap->GetRefData())
|
||||
|
||||
// Icon
|
||||
class WXDLLEXPORT wxIcon: public wxBitmap
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxIcon)
|
||||
|
||||
public:
|
||||
wxIcon(void);
|
||||
|
||||
// Copy constructors
|
||||
inline wxIcon(const wxIcon& icon) { Ref(icon); }
|
||||
inline wxIcon(const wxIcon* icon) { /* UnRef(); */ if (icon) Ref(*icon); }
|
||||
|
||||
wxIcon(const char bits[], const int width, const int height);
|
||||
wxIcon(const wxString& name, const long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
~wxIcon(void);
|
||||
|
||||
bool LoadFile(const wxString& name, const long flags = wxBITMAP_TYPE_ICO_RESOURCE,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
|
||||
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
|
||||
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
|
||||
|
||||
void SetHICON(WXHICON ico);
|
||||
inline WXHICON GetHICON(void) const { return (M_ICONDATA ? M_ICONDATA->m_hIcon : 0); }
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL && M_ICONDATA->m_hIcon) ; }
|
||||
|
||||
bool FreeResource(bool force = FALSE);
|
||||
};
|
||||
|
||||
// TODO: Put these in separate, private header
|
||||
|
||||
class WXDLLEXPORT wxICOFileHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxICOFileHandler)
|
||||
public:
|
||||
inline wxICOFileHandler(void)
|
||||
{
|
||||
m_name = "ICO icon file";
|
||||
m_extension = "ico";
|
||||
m_type = wxBITMAP_TYPE_ICO;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, const long flags,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxICOResourceHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxICOResourceHandler)
|
||||
public:
|
||||
inline wxICOResourceHandler(void)
|
||||
{
|
||||
m_name = "ICO resource";
|
||||
m_extension = "ico";
|
||||
m_type = wxBITMAP_TYPE_ICO_RESOURCE;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, const long flags,
|
||||
int desiredWidth = -1, int desiredHeight = -1);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// __ICONH__
|
226
include/wx/msw/imaglist.h
Normal file
@@ -0,0 +1,226 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: imaglist.h
|
||||
// Purpose: wxImageList class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __IMAGLISTH__
|
||||
#define __IMAGLISTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "imaglist.h"
|
||||
#endif
|
||||
|
||||
#include "wx/bitmap.h"
|
||||
|
||||
/*
|
||||
* wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to
|
||||
* images for their items by an index into an image list.
|
||||
* A wxImageList is capable of creating images with optional masks from
|
||||
* a variety of sources - a single bitmap plus a colour to indicate the mask,
|
||||
* two bitmaps, or an icon.
|
||||
*
|
||||
* Image lists can also create and draw images used for drag and drop functionality.
|
||||
* This is not yet implemented in wxImageList. We need to discuss a generic API
|
||||
* for doing drag and drop and see whether it ties in with the Win95 view of it.
|
||||
* See below for candidate functions and an explanation of how they might be
|
||||
* used.
|
||||
*/
|
||||
|
||||
// Flags for Draw
|
||||
#define wxIMAGELIST_DRAW_NORMAL 0x0001
|
||||
#define wxIMAGELIST_DRAW_TRANSPARENT 0x0002
|
||||
#define wxIMAGELIST_DRAW_SELECTED 0x0004
|
||||
#define wxIMAGELIST_DRAW_FOCUSED 0x0008
|
||||
|
||||
// Flag values for Set/GetImageList
|
||||
enum {
|
||||
wxIMAGE_LIST_NORMAL, // Normal icons
|
||||
wxIMAGE_LIST_SMALL, // Small icons
|
||||
wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation)
|
||||
};
|
||||
|
||||
// Eventually we'll make this a reference-counted wxGDIObject. For
|
||||
// now, the app must take care of ownership issues. That is, the
|
||||
// image lists must be explicitly deleted after the control(s) that uses them
|
||||
// is (are) deleted, or when the app exits.
|
||||
class WXDLLEXPORT wxImageList: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxImageList)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxImageList(void);
|
||||
|
||||
// Creates an image list.
|
||||
// Specify the width and height of the images in the list,
|
||||
// whether there are masks associated with them (e.g. if creating images
|
||||
// from icons), and the initial size of the list.
|
||||
inline wxImageList(const int width, const int height, const bool mask = TRUE, const int initialCount = 1)
|
||||
{
|
||||
Create(width, height, mask, initialCount);
|
||||
}
|
||||
~wxImageList(void);
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the number of images in the image list.
|
||||
int GetImageCount(void) const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Creates an image list
|
||||
// width, height specify the size of the images in the list (all the same).
|
||||
// mask specifies whether the images have masks or not.
|
||||
// initialNumber is the initial number of images to reserve.
|
||||
bool Create(const int width, const int height, const bool mask = TRUE, const int initialNumber = 1);
|
||||
|
||||
// Adds a bitmap, and optionally a mask bitmap.
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
// Adds a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates *new* bitmaps, so you may delete
|
||||
// 'bitmap' after calling Add.
|
||||
int Add(const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
|
||||
// Adds a bitmap and mask from an icon.
|
||||
int Add(const wxIcon& icon);
|
||||
|
||||
// Replaces a bitmap, optionally passing a mask bitmap.
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap' and 'mask' after calling Replace.
|
||||
bool Replace(const int index, const wxBitmap& bitmap, const wxBitmap& mask = wxNullBitmap);
|
||||
|
||||
/* Not supported by Win95
|
||||
// Replacing a bitmap, using the specified colour to create the mask bitmap
|
||||
// Note that wxImageList creates new bitmaps, so you may delete
|
||||
// 'bitmap'.
|
||||
bool Replace(const int index, const wxBitmap& bitmap, const wxColour& maskColour);
|
||||
*/
|
||||
|
||||
// Replaces a bitmap and mask from an icon.
|
||||
// You can delete 'icon' after calling Replace.
|
||||
bool Replace(const int index, const wxIcon& icon);
|
||||
|
||||
// Removes the image at the given index.
|
||||
bool Remove(const int index);
|
||||
|
||||
// Remove all images
|
||||
bool RemoveAll(void);
|
||||
|
||||
// Draws the given image on a dc at the specified position.
|
||||
// If 'solidBackground' is TRUE, Draw sets the image list background
|
||||
// colour to the background colour of the wxDC, to speed up
|
||||
// drawing by eliminating masked drawing where possible.
|
||||
bool Draw(const int index, wxDC& dc, const int x, const int y,
|
||||
const int flags = wxIMAGELIST_DRAW_NORMAL, const bool solidBackground = FALSE);
|
||||
|
||||
// TODO: miscellaneous functionality
|
||||
/*
|
||||
wxIcon *MakeIcon(const int index);
|
||||
bool SetOverlayImage(const int index, const int overlayMask);
|
||||
|
||||
*/
|
||||
|
||||
// TODO: Drag-and-drop related functionality.
|
||||
|
||||
#if 0
|
||||
// Creates a new drag image by combining the given image (typically a mouse cursor image)
|
||||
// with the current drag image.
|
||||
bool SetDragCursorImage(const int index, const wxPoint& hotSpot);
|
||||
|
||||
// If successful, returns a pointer to the temporary image list that is used for dragging;
|
||||
// otherwise, NULL.
|
||||
// dragPos: receives the current drag position.
|
||||
// hotSpot: receives the offset of the drag image relative to the drag position.
|
||||
static wxImageList *GetDragImageList(wxPoint& dragPos, wxPoint& hotSpot);
|
||||
|
||||
// Call this function to begin dragging an image. This function creates a temporary image list
|
||||
// that is used for dragging. The image combines the specified image and its mask with the
|
||||
// current cursor. In response to subsequent mouse move messages, you can move the drag image
|
||||
// by using the DragMove member function. To end the drag operation, you can use the EndDrag
|
||||
// member function.
|
||||
bool BeginDrag(const int index, const wxPoint& hotSpot);
|
||||
|
||||
// Ends a drag operation.
|
||||
bool EndDrag(void);
|
||||
|
||||
// Call this function to move the image that is being dragged during a drag-and-drop operation.
|
||||
// This function is typically called in response to a mouse move message. To begin a drag
|
||||
// operation, use the BeginDrag member function.
|
||||
static bool DragMove(const wxPoint& point);
|
||||
|
||||
// During a drag operation, locks updates to the window specified by lockWindow and displays
|
||||
// the drag image at the position specified by point.
|
||||
// The coordinates are relative to the window's upper left corner, so you must compensate
|
||||
// for the widths of window elements, such as the border, title bar, and menu bar, when
|
||||
// specifying the coordinates.
|
||||
// If lockWindow is NULL, this function draws the image in the display context associated
|
||||
// with the desktop window, and coordinates are relative to the upper left corner of the screen.
|
||||
// This function locks all other updates to the given window during the drag operation.
|
||||
// If you need to do any drawing during a drag operation, such as highlighting the target
|
||||
// of a drag-and-drop operation, you can temporarily hide the dragged image by using the
|
||||
// wxImageList::DragLeave function.
|
||||
|
||||
// lockWindow: pointer to the window that owns the drag image.
|
||||
// point: position at which to display the drag image. Coordinates are relative to the
|
||||
// upper left corner of the window (not the client area).
|
||||
|
||||
static bool DragEnter( wxWindow *lockWindow, const wxPoint& point );
|
||||
|
||||
// Unlocks the window specified by pWndLock and hides the drag image, allowing the
|
||||
// window to be updated.
|
||||
static bool DragLeave( wxWindow *lockWindow );
|
||||
|
||||
/* Here's roughly how you'd use these functions if implemented in this Win95-like way:
|
||||
|
||||
1) Starting to drag:
|
||||
|
||||
wxImageList *dragImageList = new wxImageList(16, 16, TRUE);
|
||||
dragImageList->Add(myDragImage); // Provide an image to combine with the current cursor
|
||||
dragImageList->BeginDrag(0, wxPoint(0, 0));
|
||||
wxShowCursor(FALSE); // wxShowCursor not yet implemented in wxWin
|
||||
myWindow->CaptureMouse();
|
||||
|
||||
2) Dragging:
|
||||
|
||||
// Called within mouse move event. Could also use dragImageList instead of assuming
|
||||
// these are static functions.
|
||||
// These two functions could possibly be combined into one, since DragEnter is
|
||||
// a bit obscure.
|
||||
wxImageList::DragMove(wxPoint(x, y)); // x, y are current cursor position
|
||||
wxImageList::DragEnter(NULL, wxPoint(x, y)); // NULL assumes dragging across whole screen
|
||||
|
||||
3) Finishing dragging:
|
||||
|
||||
dragImageList->EndDrag();
|
||||
myWindow->ReleaseMouse();
|
||||
wxShowCursor(TRUE);
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
// Implementation
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns the native image list handle
|
||||
inline WXHIMAGELIST GetHIMAGELIST(void) const { return m_hImageList; }
|
||||
|
||||
protected:
|
||||
WXHIMAGELIST m_hImageList;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __IMAGLISTH__
|
93
include/wx/msw/joystick.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: joystick.h
|
||||
// Purpose: wxJoystick class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __JOYSTICKH__
|
||||
#define __JOYSTICKH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "joystick.h"
|
||||
#endif
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
class WXDLLEXPORT wxJoystick: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxJoystick)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxJoystick(int joystick = wxJOYSTICK1) { m_joystick = joystick; };
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
wxPoint GetPosition(void) const;
|
||||
int GetZPosition(void) const;
|
||||
int GetButtonState(void) const;
|
||||
int GetPOVPosition(void) const;
|
||||
int GetPOVCTSPosition(void) const;
|
||||
int GetRudderPosition(void) const;
|
||||
int GetUPosition(void) const;
|
||||
int GetVPosition(void) const;
|
||||
int GetMovementThreshold(void) const;
|
||||
void SetMovementThreshold(int threshold) ;
|
||||
|
||||
// Capabilities
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool IsOk(void) const; // Checks that the joystick is functioning
|
||||
int GetNumberJoysticks(void) const ;
|
||||
int GetManufacturerId(void) const ;
|
||||
int GetProductId(void) const ;
|
||||
wxString GetProductName(void) const ;
|
||||
int GetXMin(void) const;
|
||||
int GetYMin(void) const;
|
||||
int GetZMin(void) const;
|
||||
int GetXMax(void) const;
|
||||
int GetYMax(void) const;
|
||||
int GetZMax(void) const;
|
||||
int GetNumberButtons(void) const;
|
||||
int GetNumberAxes(void) const;
|
||||
int GetMaxButtons(void) const;
|
||||
int GetMaxAxes(void) const;
|
||||
int GetPollingMin(void) const;
|
||||
int GetPollingMax(void) const;
|
||||
int GetRudderMin(void) const;
|
||||
int GetRudderMax(void) const;
|
||||
int GetUMin(void) const;
|
||||
int GetUMax(void) const;
|
||||
int GetVMin(void) const;
|
||||
int GetVMax(void) const;
|
||||
|
||||
bool HasRudder(void) const;
|
||||
bool HasZ(void) const;
|
||||
bool HasU(void) const;
|
||||
bool HasV(void) const;
|
||||
bool HasPOV(void) const;
|
||||
bool HasPOV4Dir(void) const;
|
||||
bool HasPOVCTS(void) const;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// pollingFreq = 0 means that movement events are sent when above the threshold.
|
||||
// If pollingFreq > 0, events are received every this many milliseconds.
|
||||
bool SetCapture(wxWindow* win, int pollingFreq = 0);
|
||||
bool ReleaseCapture(void);
|
||||
|
||||
protected:
|
||||
int m_joystick;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __JOYSTICKH__
|
135
include/wx/msw/listbox.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listbox.h
|
||||
// Purpose: wxListBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __LISTBOXH__
|
||||
#define __LISTBOXH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "listbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxListBoxNameStr;
|
||||
|
||||
#if USE_OWNER_DRAWN
|
||||
class WXDLLEXPORT wxOwnerDrawn;
|
||||
|
||||
// define the array of list box items
|
||||
#include <wx/dynarray.h>
|
||||
WX_DEFINE_ARRAY(wxOwnerDrawn *, wxListBoxItemsArray);
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// List box item
|
||||
class WXDLLEXPORT wxListBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListBox)
|
||||
public:
|
||||
|
||||
wxListBox(void);
|
||||
inline wxListBox(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxListBoxNameStr);
|
||||
|
||||
~wxListBox();
|
||||
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
|
||||
#if USE_OWNER_DRAWN
|
||||
bool MSWOnMeasure(WXMEASUREITEMSTRUCT *item);
|
||||
bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
|
||||
// plug-in for derived classes
|
||||
virtual wxOwnerDrawn *CreateItem(uint n);
|
||||
|
||||
// allows to get the item and use SetXXX functions to set it's appearance
|
||||
wxOwnerDrawn *GetItem(uint n) const { return m_aItems[n]; }
|
||||
#endif
|
||||
|
||||
virtual void Append(const wxString& item);
|
||||
virtual void Append(const wxString& item, char *clientData);
|
||||
virtual void Set(const int n, const wxString* choices, char **clientData = NULL);
|
||||
virtual int FindString(const wxString& s) const ;
|
||||
virtual void Clear(void);
|
||||
virtual void SetSelection(const int n, const bool select = TRUE);
|
||||
|
||||
virtual void Deselect(const int n);
|
||||
|
||||
// For single choice list item only
|
||||
virtual int GetSelection(void) const ;
|
||||
virtual void Delete(const int n);
|
||||
virtual char *GetClientData(const int n) const ;
|
||||
virtual void SetClientData(const int n, char *clientData);
|
||||
virtual void SetString(const int n, const wxString& s);
|
||||
|
||||
// For single or multiple choice list item
|
||||
virtual int GetSelections(int **listSelections) const ;
|
||||
virtual bool Selected(const int n) const ;
|
||||
virtual wxString GetString(const int n) const ;
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Set the specified item at the first visible item
|
||||
// or scroll to max range.
|
||||
virtual void SetFirstItem(const int n) ;
|
||||
virtual void SetFirstItem(const wxString& s) ;
|
||||
|
||||
virtual void InsertItems(const int nItems, const wxString items[], const int pos);
|
||||
|
||||
virtual wxString GetStringSelection(void) const ;
|
||||
virtual bool SetStringSelection(const wxString& s, const bool flag = TRUE);
|
||||
virtual int Number(void) const ;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
// Windows-specific code to set the horizontal extent of
|
||||
// the listbox, if necessary. If s is non-NULL, it's
|
||||
// used to calculate the horizontal extent.
|
||||
// Otherwise, all strings are used.
|
||||
virtual void SetHorizontalExtent(const wxString& s = wxEmptyString);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual void SetupColours(void);
|
||||
|
||||
protected:
|
||||
int m_noItems;
|
||||
int m_selected;
|
||||
int *m_selections;
|
||||
|
||||
#if USE_OWNER_DRAWN
|
||||
// control items
|
||||
wxListBoxItemsArray m_aItems;
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// __LISTBOXH__
|
476
include/wx/msw/listctrl.h
Normal file
@@ -0,0 +1,476 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: listctrl.h
|
||||
// Purpose: wxListCtrl class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __LISTCTRLH__
|
||||
#define __LISTCTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "listctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
/*
|
||||
The wxListCtrl can show lists of items in four different modes:
|
||||
wxLC_LIST: multicolumn list view, with optional small icons (icons could be
|
||||
optional for some platforms). Columns are computed automatically,
|
||||
i.e. you don't set columns as in wxLC_REPORT. In other words,
|
||||
the list wraps, unlike a wxListBox.
|
||||
wxLC_REPORT: single or multicolumn report view (with optional header)
|
||||
wxLC_ICON: large icon view, with optional labels
|
||||
wxLC_SMALL_ICON: small icon view, with optional labels
|
||||
|
||||
You can change the style dynamically, either with SetSingleStyle or
|
||||
SetWindowStyleFlag.
|
||||
|
||||
Further window styles:
|
||||
|
||||
wxLC_ALIGN_TOP icons align to the top (default)
|
||||
wxLC_ALIGN_LEFT icons align to the left
|
||||
wxLC_AUTOARRANGE icons arrange themselves
|
||||
wxLC_USER_TEXT the app provides label text on demand, except for column headers
|
||||
wxLC_EDIT_LABELS labels are editable: app will be notified.
|
||||
wxLC_NO_HEADER no header in report mode
|
||||
wxLC_NO_SORT_HEADER can't click on header
|
||||
wxLC_SINGLE_SEL single selection
|
||||
wxLC_SORT_ASCENDING sort ascending (must still supply a comparison callback in SortItems)
|
||||
wxLC_SORT_DESCENDING sort descending (ditto)
|
||||
|
||||
Items are referred to by their index (position in the list starting from zero).
|
||||
|
||||
Label text is supplied via insertion/setting functions and is stored by the
|
||||
control, unless the wxLC_USER_TEXT style has been specified, in which case
|
||||
the app will be notified when text is required (see sample).
|
||||
|
||||
Images are dealt with by (optionally) associating 3 image lists with the control.
|
||||
Zero-based indexes into these image lists indicate which image is to be used for
|
||||
which item. Each image in an image list can contain a mask, and can be made out
|
||||
of either a bitmap, two bitmaps or an icon. See ImagList.h for more details.
|
||||
|
||||
Notifications are passed via the wxWindows 2.0 event system, or using virtual
|
||||
functions in wxWindows 1.66.
|
||||
|
||||
See the sample wxListCtrl app for API usage.
|
||||
|
||||
TODO:
|
||||
- addition of further convenience functions
|
||||
to avoid use of wxListItem in some functions
|
||||
- state/overlay images: probably not needed.
|
||||
- in Win95, you can be called back to supply other information
|
||||
besides text, such as state information. This saves no memory
|
||||
and is probably superfluous to requirements.
|
||||
- discover why SetWindowLong doesn't properly change the
|
||||
style, requiring RecreateWindow instead.
|
||||
- testing of whole API, extending current sample.
|
||||
|
||||
|
||||
*/
|
||||
|
||||
// Mask flags to tell app/GUI what fields of wxListItem are valid
|
||||
#define wxLIST_MASK_STATE 0x0001
|
||||
#define wxLIST_MASK_TEXT 0x0002
|
||||
#define wxLIST_MASK_IMAGE 0x0004
|
||||
#define wxLIST_MASK_DATA 0x0008
|
||||
#define wxLIST_SET_ITEM 0x0010
|
||||
#define wxLIST_MASK_WIDTH 0x0020
|
||||
#define wxLIST_MASK_FORMAT 0x0040
|
||||
|
||||
// State flags for indicating the state of an item
|
||||
#define wxLIST_STATE_DONTCARE 0x0000
|
||||
#define wxLIST_STATE_DROPHILITED 0x0001
|
||||
#define wxLIST_STATE_FOCUSED 0x0002
|
||||
#define wxLIST_STATE_SELECTED 0x0004
|
||||
#define wxLIST_STATE_CUT 0x0008
|
||||
|
||||
// Hit test flags, used in HitTest
|
||||
#define wxLIST_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxLIST_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxLIST_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxLIST_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the client area.
|
||||
#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the client area.
|
||||
|
||||
#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL wxLIST_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
// Flags for GetNextItem
|
||||
enum {
|
||||
wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
|
||||
wxLIST_NEXT_ALL, // Searches for subsequent item by index
|
||||
wxLIST_NEXT_BELOW, // Searches for an item below the specified item
|
||||
wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
|
||||
wxLIST_NEXT_RIGHT, // Searches for an item to the right of the specified item
|
||||
};
|
||||
|
||||
// Alignment flags for Arrange
|
||||
enum {
|
||||
wxLIST_ALIGN_DEFAULT,
|
||||
wxLIST_ALIGN_LEFT,
|
||||
wxLIST_ALIGN_TOP,
|
||||
wxLIST_ALIGN_SNAP_TO_GRID
|
||||
};
|
||||
|
||||
// Column format
|
||||
enum {
|
||||
wxLIST_FORMAT_LEFT,
|
||||
wxLIST_FORMAT_RIGHT,
|
||||
wxLIST_FORMAT_CENTRE,
|
||||
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
|
||||
};
|
||||
|
||||
// Autosize values for SetColumnWidth
|
||||
enum {
|
||||
wxLIST_AUTOSIZE = -1,
|
||||
wxLIST_AUTOSIZE_USEHEADER = -2
|
||||
};
|
||||
|
||||
// Flag values for GetItemRect
|
||||
enum {
|
||||
wxLIST_RECT_BOUNDS,
|
||||
wxLIST_RECT_ICON,
|
||||
wxLIST_RECT_LABEL
|
||||
};
|
||||
|
||||
// Flag values for FindItem
|
||||
enum {
|
||||
wxLIST_FIND_UP,
|
||||
wxLIST_FIND_DOWN,
|
||||
wxLIST_FIND_LEFT,
|
||||
wxLIST_FIND_RIGHT
|
||||
};
|
||||
|
||||
// wxListItem: data representing an item, or report field.
|
||||
// It also doubles up to represent entire column information
|
||||
// when inserting or setting a column.
|
||||
class WXDLLEXPORT wxListItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListItem)
|
||||
public:
|
||||
long m_mask; // Indicates what fields are valid
|
||||
long m_itemId; // The zero-based item position
|
||||
int m_col; // Zero-based column, if in report mode
|
||||
long m_state; // The state of the item
|
||||
long m_stateMask; // Which flags of m_state are valid (uses same flags)
|
||||
wxString m_text; // The label/header text
|
||||
int m_image; // The zero-based index into an image list
|
||||
long m_data; // App-defined data
|
||||
|
||||
// For columns only
|
||||
int m_format; // left, right, centre
|
||||
int m_width; // width of column
|
||||
|
||||
wxListItem(void);
|
||||
};
|
||||
|
||||
// type of compare function for wxListCtrl sort operation
|
||||
typedef int (*wxListCtrlCompare)(const long item1, const long item2, long sortData);
|
||||
|
||||
class WXDLLEXPORT wxListCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListCtrl)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxListCtrl(void);
|
||||
|
||||
inline wxListCtrl(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "listCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
~wxListCtrl(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxLC_ICON, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListCtrl");
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Sets the background colour (GetBackgroundColour already implicit in
|
||||
// wxWindow class)
|
||||
void SetBackgroundColour(const wxColour& col);
|
||||
|
||||
// Gets information about this column
|
||||
bool GetColumn(const int col, wxListItem& item) const;
|
||||
|
||||
// Sets information about this column
|
||||
bool SetColumn(const int col, wxListItem& item) ;
|
||||
|
||||
// Gets the column width
|
||||
int GetColumnWidth(const int col) const;
|
||||
|
||||
// Sets the column width
|
||||
bool SetColumnWidth(const int col, const int width) ;
|
||||
|
||||
// Gets the number of items that can fit vertically in the
|
||||
// visible area of the list control (list or report view)
|
||||
// or the total number of items in the list control (icon
|
||||
// or small icon view)
|
||||
int GetCountPerPage(void) const;
|
||||
|
||||
// Gets the edit control for editing labels.
|
||||
wxTextCtrl& GetEditControl(void) const;
|
||||
|
||||
// Gets information about the item
|
||||
bool GetItem(wxListItem& info) const ;
|
||||
|
||||
// Sets information about the item
|
||||
bool SetItem(wxListItem& info) ;
|
||||
|
||||
// Sets a string field at a particular column
|
||||
long SetItem(const long index, const int col, const wxString& label, const int imageId = -1);
|
||||
|
||||
// Gets the item state
|
||||
int GetItemState(const long item, const long stateMask) const ;
|
||||
|
||||
// Sets the item state
|
||||
bool SetItemState(const long item, const long state, const long stateMask) ;
|
||||
|
||||
// Sets the item image
|
||||
bool SetItemImage(const long item, const int image, const int selImage) ;
|
||||
|
||||
// Gets the item text
|
||||
wxString GetItemText(const long item) const ;
|
||||
|
||||
// Sets the item text
|
||||
void SetItemText(const long item, const wxString& str) ;
|
||||
|
||||
// Gets the item data
|
||||
long GetItemData(const long item) const ;
|
||||
|
||||
// Sets the item data
|
||||
bool SetItemData(const long item, long data) ;
|
||||
|
||||
// Gets the item rectangle
|
||||
bool GetItemRect(const long item, wxRectangle& rect, const int code = wxLIST_RECT_BOUNDS) const ;
|
||||
|
||||
// Gets the item position
|
||||
bool GetItemPosition(const long item, wxPoint& pos) const ;
|
||||
|
||||
// Sets the item position
|
||||
bool SetItemPosition(const long item, const wxPoint& pos) ;
|
||||
|
||||
// Gets the number of items in the list control
|
||||
int GetItemCount(void) const;
|
||||
|
||||
// Gets the number of columns in the list control
|
||||
int GetColumnCount(void) const;
|
||||
|
||||
// Retrieves the spacing between icons in pixels.
|
||||
// If small is TRUE, gets the spacing for the small icon
|
||||
// view, otherwise the large icon view.
|
||||
int GetItemSpacing(bool isSmall) const;
|
||||
|
||||
// Gets the number of selected items in the list control
|
||||
int GetSelectedItemCount(void) const;
|
||||
|
||||
// Gets the text colour of the listview
|
||||
wxColour GetTextColour(void) const;
|
||||
|
||||
// Sets the text colour of the listview
|
||||
void SetTextColour(const wxColour& col);
|
||||
|
||||
// Gets the index of the topmost visible item when in
|
||||
// list or report view
|
||||
long GetTopItem(void) const ;
|
||||
|
||||
// Add or remove a single window style
|
||||
void SetSingleStyle(const long style, const bool add = TRUE) ;
|
||||
|
||||
// Set the whole window style
|
||||
void SetWindowStyleFlag(const long style) ;
|
||||
|
||||
// Searches for an item, starting from 'item'.
|
||||
// item can be -1 to find the first item that matches the
|
||||
// specified flags.
|
||||
// Returns the item or -1 if unsuccessful.
|
||||
long GetNextItem(const long item, int geometry = wxLIST_NEXT_ALL, int state = wxLIST_STATE_DONTCARE) const ;
|
||||
|
||||
// Implementation: converts wxWindows style to MSW style.
|
||||
// Can be a single style flag or a bit list.
|
||||
// oldStyle is 'normalised' so that it doesn't contain
|
||||
// conflicting styles.
|
||||
long ConvertToMSWStyle(long& oldStyle, const long style) const;
|
||||
|
||||
// Gets one of the three image lists
|
||||
wxImageList *GetImageList(const int which) const ;
|
||||
|
||||
// Sets the image list
|
||||
// N.B. There's a quirk in the Win95 list view implementation.
|
||||
// If in wxLC_LIST mode, it'll *still* display images by the labels if
|
||||
// there's a small-icon image list set for the control - even though you
|
||||
// haven't specified wxLIST_MASK_IMAGE when inserting.
|
||||
// So you have to set a NULL small-icon image list to be sure that
|
||||
// the wxLC_LIST mode works without icons. Of course, you may want icons...
|
||||
void SetImageList(wxImageList *imageList, const int which) ;
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Arranges the items
|
||||
bool Arrange(const int flag = wxLIST_ALIGN_DEFAULT);
|
||||
|
||||
// Deletes an item
|
||||
bool DeleteItem(const long item);
|
||||
|
||||
// Deletes all items
|
||||
bool DeleteAllItems(void) ;
|
||||
|
||||
// Deletes a column
|
||||
bool DeleteColumn(const int col);
|
||||
|
||||
// Deletes all columns
|
||||
bool DeleteAllColumns(void);
|
||||
|
||||
// Clears items, and columns if there are any.
|
||||
void ClearAll(void);
|
||||
|
||||
// Edits a label
|
||||
wxTextCtrl& Edit(const long item) ;
|
||||
|
||||
// Ensures this item is visible
|
||||
bool EnsureVisible(const long item) ;
|
||||
|
||||
// Find an item whose label matches this string, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(const long start, const wxString& str, const bool partial = FALSE);
|
||||
|
||||
// Find an item whose data matches this data, starting from the item after 'start'
|
||||
// or the beginning if 'start' is -1.
|
||||
long FindItem(const long start, const long data);
|
||||
|
||||
// Find an item nearest this position in the specified direction, starting from
|
||||
// the item after 'start' or the beginning if 'start' is -1.
|
||||
long FindItem(const long start, const wxPoint& pt, const int direction);
|
||||
|
||||
// Determines which item (if any) is at the specified point,
|
||||
// giving details in 'flags' (see wxLIST_HITTEST_... flags above)
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
|
||||
// Inserts an item, returning the index of the new item if successful,
|
||||
// -1 otherwise.
|
||||
// TOD: Should also have some further convenience functions
|
||||
// which don't require setting a wxListItem object
|
||||
long InsertItem(wxListItem& info);
|
||||
|
||||
// Insert a string item
|
||||
long InsertItem(const long index, const wxString& label);
|
||||
|
||||
// Insert an image item
|
||||
long InsertItem(const long index, const int imageIndex);
|
||||
|
||||
// Insert an image/string item
|
||||
long InsertItem(const long index, const wxString& label, const int imageIndex);
|
||||
|
||||
// For list view mode (only), inserts a column.
|
||||
long InsertColumn(const long col, wxListItem& info);
|
||||
|
||||
long InsertColumn(const long col, const wxString& heading, const int format = wxLIST_FORMAT_LEFT,
|
||||
const int width = -1);
|
||||
|
||||
// Scrolls the list control. If in icon, small icon or report view mode,
|
||||
// x specifies the number of pixels to scroll. If in list view mode, x
|
||||
// specifies the number of columns to scroll.
|
||||
// If in icon, small icon or list view mode, y specifies the number of pixels
|
||||
// to scroll. If in report view mode, y specifies the number of lines to scroll.
|
||||
bool ScrollList(const int dx, const int dy);
|
||||
|
||||
// Sort items.
|
||||
|
||||
// fn is a function which takes 3 long arguments: item1, item2, data.
|
||||
// item1 is the long data associated with a first item (NOT the index).
|
||||
// item2 is the long data associated with a second item (NOT the index).
|
||||
// data is the same value as passed to SortItems.
|
||||
// The return value is a negative number if the first item should precede the second
|
||||
// item, a positive number of the second item should precede the first,
|
||||
// or zero if the two items are equivalent.
|
||||
|
||||
// data is arbitrary data to be passed to the sort function.
|
||||
bool SortItems(wxListCtrlCompare fn, long data);
|
||||
|
||||
/* Why should we need this function? Leave for now.
|
||||
* WE NEED IT because item data may have changed,
|
||||
* but the display needs refreshing (in string callback mode)
|
||||
// Updates an item. If the list control has the wxLI_AUTO_ARRANGE style,
|
||||
// the items will be rearranged.
|
||||
bool Update(const long item);
|
||||
*/
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
|
||||
// Recreate window - seems to be necessary when changing a style.
|
||||
void RecreateWindow(void);
|
||||
|
||||
// Add to pool: necessary because Windows needs to have a string
|
||||
// still exist across 3 callbacks.
|
||||
char *AddPool(const wxString& str);
|
||||
|
||||
protected:
|
||||
wxTextCtrl m_textCtrl; // The control used for editing a label
|
||||
wxImageList * m_imageListNormal; // The image list for normal icons
|
||||
wxImageList * m_imageListSmall; // The image list for small icons
|
||||
wxImageList * m_imageListState; // The image list state icons (not implemented yet)
|
||||
|
||||
long m_baseStyle; // Basic Windows style flags, for recreation purposes
|
||||
wxStringList m_stringPool; // Pool of 3 strings to satisfy Windows callback
|
||||
// requirements
|
||||
int m_colCount; // Windows doesn't have GetColumnCount so must
|
||||
// keep track of inserted/deleted columns
|
||||
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxListEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxListEvent)
|
||||
|
||||
public:
|
||||
wxListEvent(WXTYPE commandType = 0, int id = 0);
|
||||
|
||||
int m_code;
|
||||
long m_itemIndex;
|
||||
long m_oldItemIndex;
|
||||
int m_col;
|
||||
bool m_cancelled;
|
||||
wxPoint m_pointDrag;
|
||||
|
||||
wxListItem m_item;
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
|
||||
|
||||
#define EVT_LIST_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_DELETE_ITEM(id, fn) { wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) { wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_GET_INFO(id, fn) { wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_SET_INFO(id, fn) { wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_ITEM_SELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_ITEM_DESELECTED(id, fn) { wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_KEY_DOWN(id, fn) { wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_INSERT_ITEM(id, fn) { wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
#define EVT_LIST_COL_CLICK(id, fn) { wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction) & fn },
|
||||
|
||||
#endif
|
||||
// __LISTCTRLH__
|
BIN
include/wx/msw/magnif1.cur
Normal file
After Width: | Height: | Size: 326 B |
210
include/wx/msw/mdi.h
Normal file
@@ -0,0 +1,210 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: mdi.h
|
||||
// Purpose: MDI (Multiple Document Interface) classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MDIH__
|
||||
#define __MDIH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "mdi.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStatusLineNameStr;
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow;
|
||||
class WXDLLEXPORT wxMDIChildFrame;
|
||||
|
||||
class WXDLLEXPORT wxMDIParentFrame: public wxFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
||||
|
||||
friend class WXDLLEXPORT wxMDIChildFrame;
|
||||
public:
|
||||
|
||||
wxMDIParentFrame(void);
|
||||
inline wxMDIParentFrame(wxWindow *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIParentFrame(void);
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void OldOnActivate(bool flag);
|
||||
virtual void OldOnSize(int x, int y);
|
||||
#endif
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnActivate(wxActivateEvent& event);
|
||||
|
||||
// Toolbar (currently, for use by Windows MDI parent frames ONLY)
|
||||
virtual inline void SetToolBar(wxWindow *toolbar) { m_frameToolBar = toolbar; }
|
||||
virtual inline wxWindow *GetToolBar(void) const { return m_frameToolBar; }
|
||||
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
|
||||
// Gets the size available for subwindows after menu size, toolbar size
|
||||
// and status bar size have been subtracted. If you want to manage your own
|
||||
// toolbar(s), don't call SetToolBar.
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
|
||||
// Get the active MDI child window (Windows only)
|
||||
wxMDIChildFrame *GetActiveChild(void) const ;
|
||||
|
||||
// Get the client window
|
||||
inline wxMDIClientWindow *GetClientWindow(void) const ;
|
||||
|
||||
// Create the client window class (don't Create the window,
|
||||
// just return a new class)
|
||||
virtual wxMDIClientWindow *OnCreateClient(void) ;
|
||||
|
||||
inline WXHMENU GetWindowMenu(void) const ;
|
||||
|
||||
// MDI operations
|
||||
virtual void Cascade(void);
|
||||
virtual void Tile(void);
|
||||
virtual void ArrangeIcons(void);
|
||||
virtual void ActivateNext(void);
|
||||
virtual void ActivatePrevious(void);
|
||||
|
||||
// Handlers
|
||||
void MSWOnSize(const int x, const int y, const WXUINT flag);
|
||||
bool MSWOnCommand(const WXWORD id, const WXWORD cmd, const WXHWND control);
|
||||
void MSWOnMenuHighlight(const WXWORD item, const WXWORD flags, const WXHMENU sysmenu);
|
||||
bool MSWProcessMessage(WXMSG *msg);
|
||||
void MSWOnCreate(WXLPCREATESTRUCT cs);
|
||||
long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
bool MSWOnEraseBkgnd(const WXHDC pDC);
|
||||
bool MSWOnDestroy(void);
|
||||
bool MSWOnActivate(const int state, const bool minimized, const WXHWND activate);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
wxMDIClientWindow * m_clientWindow;
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
WXHMENU m_windowMenu;
|
||||
bool m_parentFrameActive; // TRUE if MDI Frame is intercepting
|
||||
// commands, not child
|
||||
wxWindow * m_frameToolBar ;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
// Inlines
|
||||
inline wxMDIClientWindow *wxMDIParentFrame::GetClientWindow(void) const { return m_clientWindow; }
|
||||
inline WXHMENU wxMDIParentFrame::GetWindowMenu(void) const { return m_windowMenu; }
|
||||
|
||||
class WXDLLEXPORT wxMDIChildFrame: public wxFrame
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
||||
public:
|
||||
|
||||
wxMDIChildFrame(void);
|
||||
inline wxMDIChildFrame(wxMDIParentFrame *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMDIChildFrame(void);
|
||||
|
||||
bool Create(wxMDIParentFrame *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME_STYLE,
|
||||
const wxString& name = wxFrameNameStr);
|
||||
|
||||
// Set menu bar
|
||||
void SetMenuBar(wxMenuBar *menu_bar);
|
||||
void SetClientSize(const int width, const int height);
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
|
||||
// MDI operations
|
||||
virtual void Maximize(void);
|
||||
virtual void Restore(void);
|
||||
virtual void Activate(void);
|
||||
|
||||
// Handlers
|
||||
|
||||
long MSWOnMDIActivate(const long bActivate, const WXHWND, const WXHWND);
|
||||
void MSWOnSize(const int x, const int y, const WXUINT);
|
||||
void MSWOnWindowPosChanging(void *lpPos);
|
||||
bool MSWOnCommand(const WXWORD id, const WXWORD cmd, const WXHWND control);
|
||||
long MSWDefWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
bool MSWProcessMessage(WXMSG *msg);
|
||||
void MSWDestroyWindow(void);
|
||||
|
||||
// Implementation
|
||||
bool ResetWindowStyle(void *vrect);
|
||||
protected:
|
||||
// bool m_active;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMDIClientWindow: public wxWindow
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
||||
public:
|
||||
|
||||
wxMDIClientWindow(void) ;
|
||||
inline wxMDIClientWindow(wxMDIParentFrame *parent, const long style = 0)
|
||||
{
|
||||
CreateClient(parent, style);
|
||||
}
|
||||
|
||||
~wxMDIClientWindow(void);
|
||||
|
||||
// Note: this is virtual, to allow overridden behaviour.
|
||||
virtual bool CreateClient(wxMDIParentFrame *parent, const long style = wxVSCROLL | wxHSCROLL);
|
||||
|
||||
// Explicitly call default scroll behaviour
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
|
||||
// Window procedure
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// Calls an appropriate default window procedure
|
||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// Should hand the message to the default proc
|
||||
long MSWOnMDIActivate(const long bActivate, const WXHWND, const WXHWND);
|
||||
|
||||
protected:
|
||||
int m_scrollX;
|
||||
int m_scrollY;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __MDIH__
|
174
include/wx/msw/menu.h
Normal file
@@ -0,0 +1,174 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: menu.h
|
||||
// Purpose: wxMenu, wxMenuBar classes
|
||||
// Author: Julian Smart
|
||||
// Modified by: Vadim Zeitlin (wxMenuItem is now in separate file)
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MENUH__
|
||||
#define __MENUH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "menu.h"
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
class wxMenuItem;
|
||||
class wxMenuBar;
|
||||
class wxMenu;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxMenu: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMenu)
|
||||
|
||||
public:
|
||||
// ctor & dtor
|
||||
wxMenu(const wxString& title = wxEmptyString, const wxFunction func = NULL);
|
||||
~wxMenu();
|
||||
|
||||
// construct menu
|
||||
// append items to the menu
|
||||
// separator line
|
||||
void AppendSeparator();
|
||||
// normal item
|
||||
void Append(int id, const wxString& Label, const wxString& helpString = wxEmptyString,
|
||||
bool checkable = FALSE);
|
||||
// a submenu
|
||||
void Append(int id, const wxString& Label, wxMenu *SubMenu,
|
||||
const wxString& helpString = wxEmptyString);
|
||||
// the most generic form (create wxMenuItem first and use it's functions)
|
||||
void Append(wxMenuItem *pItem);
|
||||
// insert a break in the menu
|
||||
void Break();
|
||||
// delete an item
|
||||
void Delete(int id); /* If it's a submenu, menu is not destroyed. VZ: why? */
|
||||
|
||||
// menu item control
|
||||
void Enable(int id, bool Flag);
|
||||
bool Enabled(int id) const;
|
||||
inline bool IsEnabled(int id) const { return Enabled(id); };
|
||||
void Check(int id, bool Flag);
|
||||
bool Checked(int id) const;
|
||||
inline bool IsChecked(int id) const { return IsChecked(id); };
|
||||
|
||||
// item properties
|
||||
// title
|
||||
void SetTitle(const wxString& label);
|
||||
const wxString& GetTitle() const;
|
||||
// label
|
||||
void SetLabel(int id, const wxString& label);
|
||||
wxString GetLabel(int id) const;
|
||||
// help string
|
||||
virtual void SetHelpString(const int id, const wxString& helpString);
|
||||
virtual wxString GetHelpString(const int id) const ;
|
||||
|
||||
// find item
|
||||
// Finds the item id matching the given string, NOT_FOUND if not found.
|
||||
virtual int FindItem(const wxString& itemString) const ;
|
||||
// Find wxMenuItem by ID, and item's menu too if itemMenu is !NULL.
|
||||
wxMenuItem *FindItemForId(const int itemId, wxMenu **itemMenu = NULL) const;
|
||||
|
||||
void ProcessCommand(wxCommandEvent& event);
|
||||
inline void Callback(const wxFunction func) { m_callback = func; }
|
||||
|
||||
virtual void SetParent(wxEvtHandler *parent) { m_parent = parent; }
|
||||
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||
inline wxEvtHandler *GetEventHandler(void) { return m_eventHandler; }
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
|
||||
void SetInvokingWindow(wxWindow *pWin) { m_pInvokingWindow = pWin; }
|
||||
wxWindow *GetInvokingWindow() const { return m_pInvokingWindow; }
|
||||
|
||||
// semi-private accessors
|
||||
// get the window which contains this menu
|
||||
wxWindow *GetWindow() const;
|
||||
// get the menu handle
|
||||
WXHMENU GetHMenu() const;
|
||||
|
||||
private:
|
||||
bool m_doBreak ;
|
||||
|
||||
public:
|
||||
// This is used when m_hMenu is NULL because we don't want to
|
||||
// delete it in ~wxMenu (it's been added to a parent menu).
|
||||
// But we'll still need the handle for other purposes.
|
||||
// Might be better to have a flag saying whether it's deleteable or not.
|
||||
WXHMENU m_savehMenu ; // Used for Enable() on popup
|
||||
WXHMENU m_hMenu;
|
||||
wxFunction m_callback;
|
||||
|
||||
int m_noItems;
|
||||
wxString m_title;
|
||||
wxMenu * m_topLevelMenu;
|
||||
wxMenuBar * m_menuBar;
|
||||
wxList m_menuItems;
|
||||
wxEvtHandler * m_parent;
|
||||
wxEvtHandler * m_eventHandler;
|
||||
wxWindow *m_pInvokingWindow;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Menu Bar (a la Windows)
|
||||
// ----------------------------------------------------------------------------
|
||||
class wxFrame;
|
||||
class WXDLLEXPORT wxMenuBar: public wxEvtHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMenuBar)
|
||||
|
||||
wxMenuBar(void);
|
||||
wxMenuBar(const int n, wxMenu *menus[], const wxString titles[]);
|
||||
~wxMenuBar(void);
|
||||
|
||||
void Append(wxMenu *menu, const wxString& title);
|
||||
// Must only be used AFTER menu has been attached to frame,
|
||||
// otherwise use individual menus to enable/disable items
|
||||
void Enable(const int Id, const bool Flag);
|
||||
bool Enabled(const int Id) const ;
|
||||
inline bool IsEnabled(const int Id) const { return Enabled(Id); };
|
||||
void EnableTop(const int pos, const bool Flag);
|
||||
void Check(const int id, const bool Flag);
|
||||
bool Checked(const int id) const ;
|
||||
inline bool IsChecked(const int Id) const { return Checked(Id); };
|
||||
void SetLabel(const int id, const wxString& label) ;
|
||||
wxString GetLabel(const int id) const ;
|
||||
void SetLabelTop(const int pos, const wxString& label) ;
|
||||
wxString GetLabelTop(const int pos) const ;
|
||||
virtual void Delete(wxMenu *menu, const int index = 0); /* Menu not destroyed */
|
||||
virtual bool OnAppend(wxMenu *menu, const char *title);
|
||||
virtual bool OnDelete(wxMenu *menu, const int index);
|
||||
|
||||
virtual void SetHelpString(const int Id, const wxString& helpString);
|
||||
virtual wxString GetHelpString(const int Id) const ;
|
||||
|
||||
virtual int FindMenuItem(const wxString& menuString, const wxString& itemString) const ;
|
||||
|
||||
// Find wxMenuItem for item ID, and return item's
|
||||
// menu too if itemMenu is non-NULL.
|
||||
wxMenuItem *FindItemForId(const int itemId, wxMenu **menuForItem = NULL) const ;
|
||||
|
||||
inline void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
|
||||
inline wxEvtHandler *GetEventHandler(void) { return m_eventHandler; }
|
||||
|
||||
public:
|
||||
wxEvtHandler * m_eventHandler;
|
||||
int m_menuCount;
|
||||
wxMenu ** m_menus;
|
||||
wxString * m_titles;
|
||||
wxFrame * m_menuBarFrame;
|
||||
WXHMENU m_hMenu;
|
||||
};
|
||||
|
||||
#endif // __MENUH__
|
104
include/wx/msw/metafile.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: metafile.h
|
||||
// Purpose: wxMetaFile, wxMetaFileDC classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#ifndef __METAFIILEH__
|
||||
#define __METAFIILEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "metafile.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if USE_METAFILE
|
||||
#include "wx/dc.h"
|
||||
|
||||
/*
|
||||
* Metafile and metafile device context classes - work in Windows 3.1 only
|
||||
*
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxMetaFile: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMetaFile)
|
||||
public:
|
||||
wxMetaFile(const wxString& file = "");
|
||||
~wxMetaFile(void);
|
||||
|
||||
// After this is called, the metafile cannot be used for anything
|
||||
// since it is now owned by the clipboard.
|
||||
virtual bool SetClipboard(int width = 0, int height = 0);
|
||||
|
||||
virtual bool Play(wxDC *dc);
|
||||
inline bool Ok(void) { return m_metaFile != 0; };
|
||||
|
||||
// Implementation
|
||||
inline WXHANDLE GetHMETAFILE(void) { return m_metaFile; }
|
||||
inline void SetHMETAFILE(WXHANDLE mf) { m_metaFile = mf; }
|
||||
inline int GetWindowsMappingMode(void) { return m_windowsMappingMode; }
|
||||
inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
|
||||
|
||||
protected:
|
||||
WXHANDLE m_metaFile;
|
||||
int m_windowsMappingMode;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxMetaFileDC: public wxDC
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMetaFileDC)
|
||||
|
||||
public:
|
||||
// Don't supply origin and extent
|
||||
// Supply them to wxMakeMetaFilePlaceable instead.
|
||||
wxMetaFileDC(const wxString& file = "");
|
||||
|
||||
// Supply origin and extent (recommended).
|
||||
// Then don't need to supply them to wxMakeMetaFilePlaceable.
|
||||
wxMetaFileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
|
||||
|
||||
~wxMetaFileDC(void);
|
||||
|
||||
// Should be called at end of drawing
|
||||
virtual wxMetaFile *Close(void);
|
||||
virtual void SetMapMode(int mode);
|
||||
virtual void GetTextExtent(const wxString& string, float *x, float *y,
|
||||
float *descent = NULL, float *externalLeading = NULL,
|
||||
wxFont *theFont = NULL, bool use16bit = FALSE);
|
||||
|
||||
// Implementation
|
||||
inline wxMetaFile *GetMetaFile(void) { return m_metaFile; }
|
||||
inline void SetMetaFile(wxMetaFile *mf) { m_metaFile = mf; }
|
||||
inline int GetWindowsMappingMode(void) { return m_windowsMappingMode; }
|
||||
inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
|
||||
|
||||
protected:
|
||||
int m_windowsMappingMode;
|
||||
wxMetaFile *m_metaFile;
|
||||
};
|
||||
|
||||
/*
|
||||
* Pass filename of existing non-placeable metafile, and bounding box.
|
||||
* Adds a placeable metafile header, sets the mapping mode to anisotropic,
|
||||
* and sets the window origin and extent to mimic the MM_TEXT mapping mode.
|
||||
*
|
||||
*/
|
||||
|
||||
// No origin or extent
|
||||
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, float scale = 1.0);
|
||||
|
||||
// Optional origin and extent
|
||||
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE);
|
||||
|
||||
#endif // USE_METAFILE
|
||||
#endif
|
||||
// __METAFIILEH__
|
46
include/wx/msw/minifram.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: minifram.h
|
||||
// Purpose: wxMiniFrame class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MINIFRAMH__
|
||||
#define __MINIFRAMH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "minifram.h"
|
||||
#endif
|
||||
|
||||
#include "wx/frame.h"
|
||||
|
||||
class WXDLLEXPORT wxMiniFrame: public wxFrame {
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxMiniFrame)
|
||||
|
||||
public:
|
||||
inline wxMiniFrame(void) {}
|
||||
inline wxMiniFrame(wxWindow *parent,
|
||||
const wxWindowID id,
|
||||
const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxDEFAULT_FRAME|wxTINY_CAPTION_HORIZ,
|
||||
const wxString& name = wxFrameNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, style, name);
|
||||
}
|
||||
|
||||
~wxMiniFrame(void);
|
||||
|
||||
long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
#endif
|
||||
// __MINIFRAMH__
|
49
include/wx/msw/msgdlg.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msgdlg.h
|
||||
// Purpose: wxMessageDialog class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __MSGBOXDLGH__
|
||||
#define __MSGBOXDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "msgdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dialog.h"
|
||||
|
||||
/*
|
||||
* Message box dialog
|
||||
*/
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxMessageBoxCaptionStr;
|
||||
|
||||
class WXDLLEXPORT wxMessageDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxMessageDialog)
|
||||
protected:
|
||||
wxString m_caption;
|
||||
wxString m_message;
|
||||
long m_dialogStyle;
|
||||
wxWindow * m_parent;
|
||||
public:
|
||||
wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
long style = wxOK|wxCENTRE, const wxPoint& pos = wxDefaultPosition);
|
||||
|
||||
int ShowModal(void);
|
||||
};
|
||||
|
||||
|
||||
int WXDLLEXPORT wxMessageBox(const wxString& message, const wxString& caption = wxMessageBoxCaptionStr,
|
||||
const long style = wxOK|wxCENTRE,
|
||||
wxWindow *parent = NULL, const int x = -1, const int y = -1);
|
||||
|
||||
#endif
|
||||
// __MSGBOXDLGH__
|
BIN
include/wx/msw/noentry.cur
Normal file
After Width: | Height: | Size: 326 B |
66
include/wx/msw/palette.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: palette.h
|
||||
// Purpose: wxPalette class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PALETTEH__
|
||||
#define __PALETTEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "palette.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxPalette;
|
||||
|
||||
class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxPalette;
|
||||
public:
|
||||
wxPaletteRefData(void);
|
||||
~wxPaletteRefData(void);
|
||||
protected:
|
||||
WXHPALETTE m_hPalette;
|
||||
};
|
||||
|
||||
#define M_PALETTEDATA ((wxPaletteRefData *)m_refData)
|
||||
|
||||
class WXDLLEXPORT wxPalette: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPalette)
|
||||
|
||||
public:
|
||||
wxPalette(void);
|
||||
inline wxPalette(const wxPalette& palette) { Ref(palette); }
|
||||
inline wxPalette(const wxPalette* palette) { /* UnRef(); */ if (palette) Ref(*palette); }
|
||||
|
||||
wxPalette(const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
~wxPalette(void);
|
||||
bool Create(const int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue);
|
||||
int GetPixel(const unsigned char red, const unsigned char green, const unsigned char blue) const;
|
||||
bool GetRGB(const int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const;
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
inline wxPalette& operator = (const wxPalette& palette) { if (*this == palette) return (*this); Ref(palette); return *this; }
|
||||
inline bool operator == (const wxPalette& palette) { return m_refData == palette.m_refData; }
|
||||
inline bool operator != (const wxPalette& palette) { return m_refData != palette.m_refData; }
|
||||
|
||||
virtual bool FreeResource(bool force = FALSE);
|
||||
|
||||
inline WXHPALETTE GetHPALETTE(void) const { return (M_PALETTEDATA ? M_PALETTEDATA->m_hPalette : 0); }
|
||||
void SetHPALETTE(WXHPALETTE pal);
|
||||
};
|
||||
|
||||
#define wxColorMap wxPalette
|
||||
#define wxColourMap wxPalette
|
||||
|
||||
#endif
|
||||
// __PALETTEH__
|
BIN
include/wx/msw/pbrush.cur
Normal file
After Width: | Height: | Size: 326 B |
98
include/wx/msw/pen.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: pen.h
|
||||
// Purpose: wxPen class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PENH__
|
||||
#define __PENH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "pen.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
typedef WXDWORD wxDash ;
|
||||
|
||||
class WXDLLEXPORT wxPen;
|
||||
|
||||
class WXDLLEXPORT wxPenRefData: public wxGDIRefData
|
||||
{
|
||||
friend class WXDLLEXPORT wxPen;
|
||||
public:
|
||||
wxPenRefData(void);
|
||||
~wxPenRefData(void);
|
||||
|
||||
protected:
|
||||
int m_width;
|
||||
int m_style;
|
||||
int m_join ;
|
||||
int m_cap ;
|
||||
wxBitmap m_stipple ;
|
||||
int m_nbDash ;
|
||||
wxDash * m_dash ;
|
||||
wxColour m_colour;
|
||||
WXHPEN m_hPen;
|
||||
};
|
||||
|
||||
#define M_PENDATA ((wxPenRefData *)m_refData)
|
||||
|
||||
// Pen
|
||||
class WXDLLEXPORT wxPen: public wxGDIObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPen)
|
||||
public:
|
||||
wxPen(void);
|
||||
wxPen(const wxColour& col, const int width, const int style);
|
||||
wxPen(const wxString& col, const int width, const int style);
|
||||
wxPen(const wxBitmap& stipple, const int width);
|
||||
inline wxPen(const wxPen& pen) { Ref(pen); }
|
||||
inline wxPen(const wxPen* pen) { /* UnRef(); */ if (pen) Ref(*pen); }
|
||||
~wxPen(void);
|
||||
|
||||
inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
|
||||
inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; }
|
||||
inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; }
|
||||
|
||||
virtual bool Ok(void) const { return (m_refData != NULL) ; }
|
||||
|
||||
// Override in order to recreate the pen
|
||||
void SetColour(const wxColour& col) ;
|
||||
void SetColour(const wxString& col) ;
|
||||
void SetColour(const unsigned char r, const unsigned char g, const unsigned char b) ;
|
||||
|
||||
void SetWidth(const int width) ;
|
||||
void SetStyle(const int style) ;
|
||||
void SetStipple(const wxBitmap& stipple) ;
|
||||
void SetDashes(const int nb_dashes, const wxDash *dash) ;
|
||||
void SetJoin(const int join) ;
|
||||
void SetCap(const int cap) ;
|
||||
|
||||
inline wxColour& GetColour(void) const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
|
||||
inline int GetWidth(void) const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
|
||||
inline int GetStyle(void) const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
|
||||
inline int GetJoin(void) const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
|
||||
inline int GetCap(void) const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
|
||||
inline int GetDashes(wxDash **ptr) const {
|
||||
*ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
|
||||
}
|
||||
|
||||
inline wxBitmap *GetStipple(void) const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
|
||||
|
||||
// Internal
|
||||
bool RealizeResource(void);
|
||||
bool FreeResource(bool force = FALSE);
|
||||
WXHANDLE GetResourceHandle(void) ;
|
||||
bool IsFree(void);
|
||||
};
|
||||
|
||||
int wx2msPenStyle(int wx_style);
|
||||
|
||||
#endif
|
||||
// __PENH__
|
BIN
include/wx/msw/pencil.cur
Normal file
After Width: | Height: | Size: 326 B |
27
include/wx/msw/pnghand.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: pnghand.h
|
||||
// Purpose: PNG bitmap handler
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 04/01/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Microsoft, Julian Smart
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class WXDLLEXPORT wxPNGFileHandler: public wxBitmapHandler
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPNGFileHandler)
|
||||
public:
|
||||
inline wxPNGFileHandler(void)
|
||||
{
|
||||
m_name = "PNG bitmap file";
|
||||
m_extension = "bmp";
|
||||
m_type = wxBITMAP_TYPE_PNG;
|
||||
};
|
||||
|
||||
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, const long flags,
|
||||
int desiredWidth, int desiredHeight);
|
||||
virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, const int type, const wxPalette *palette = NULL);
|
||||
};
|
||||
|
294
include/wx/msw/pngread.h
Normal file
@@ -0,0 +1,294 @@
|
||||
/*
|
||||
* File: pngread.h
|
||||
* Purpose: PNG file reader
|
||||
* Author: Alejandro Aguilar Sierra/Julian Smart
|
||||
* Created: 1995
|
||||
* Copyright: (c) 1995, Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __PNGREAD__
|
||||
#define __PNGREAD__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "pngread.h"
|
||||
#endif
|
||||
|
||||
#ifndef byte
|
||||
typedef unsigned char byte;
|
||||
#endif
|
||||
|
||||
#define WXIMA_COLORS DIB_PAL_COLORS
|
||||
|
||||
#ifdef __WIN32__
|
||||
typedef byte* ImagePointerType;
|
||||
#else
|
||||
typedef byte huge* ImagePointerType;
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte red;
|
||||
byte green;
|
||||
byte blue;
|
||||
} rgb_color_struct;
|
||||
|
||||
|
||||
#define COLORTYPE_PALETTE 1
|
||||
#define COLORTYPE_COLOR 2
|
||||
#define COLORTYPE_ALPHA 4
|
||||
|
||||
class wxPNGReader
|
||||
{
|
||||
protected:
|
||||
int filetype;
|
||||
char filename[255];
|
||||
ImagePointerType RawImage; // Image data
|
||||
|
||||
int Width, Height; // Dimensions
|
||||
int Depth; // (bits x pixel)
|
||||
int ColorType; // Bit 1 = Palette used
|
||||
// Bit 2 = Color used
|
||||
// Bit 3 = Alpha used
|
||||
|
||||
long EfeWidth; // Efective Width
|
||||
|
||||
LPBITMAPINFOHEADER lpbi;
|
||||
int bgindex;
|
||||
wxPalette* Palette;
|
||||
bool imageOK;
|
||||
friend class wxPNGReaderIter;
|
||||
public:
|
||||
wxPNGReader(void);
|
||||
wxPNGReader (char* ImageFileName); // Read an image file
|
||||
~wxPNGReader ();
|
||||
|
||||
void Create(int width, int height, int deep, int colortype=-1);
|
||||
|
||||
bool ReadFile( char* ImageFileName=0 );
|
||||
bool SaveFile( char* ImageFileName=0 );
|
||||
bool SaveXPM(char *filename, char *name = 0);
|
||||
int GetWidth( void ) const { return Width; };
|
||||
int GetHeight( void ) const { return Height; };
|
||||
int GetDepth( void ) const { return Depth; };
|
||||
int GetColorType( void ) const { return ColorType; };
|
||||
|
||||
int GetIndex(int x, int y);
|
||||
bool GetRGB(int x, int y, byte* r, byte* g, byte* b);
|
||||
|
||||
bool SetIndex(int x, int y, int index);
|
||||
bool SetRGB(int x, int y, byte r, byte g, byte b);
|
||||
|
||||
// ColorMap settings
|
||||
bool SetPalette(wxPalette* colourmap);
|
||||
bool SetPalette(int n, rgb_color_struct *rgb_struct);
|
||||
bool SetPalette(int n, byte *r, byte *g=0, byte *b=0);
|
||||
wxPalette* GetPalette() const { return Palette; }
|
||||
|
||||
void NullData();
|
||||
inline int GetBGIndex(void) { return bgindex; }
|
||||
|
||||
inline bool Inside(int x, int y)
|
||||
{ return (0<=y && y<Height && 0<=x && x<Width); }
|
||||
|
||||
virtual wxBitmap *GetBitmap(void);
|
||||
virtual bool InstantiateBitmap(wxBitmap *bitmap);
|
||||
wxMask *CreateMask(void);
|
||||
|
||||
inline bool Ok(void) { return imageOK; }
|
||||
};
|
||||
|
||||
class wxPNGReaderIter
|
||||
{
|
||||
protected:
|
||||
int Itx, Ity; // Counters
|
||||
int Stepx, Stepy;
|
||||
ImagePointerType IterImage; // Image pointer
|
||||
wxPNGReader *ima;
|
||||
public:
|
||||
// Constructors
|
||||
wxPNGReaderIter ( void );
|
||||
wxPNGReaderIter ( wxPNGReader *imax );
|
||||
operator wxPNGReader* ();
|
||||
|
||||
// Iterators
|
||||
bool ItOK ();
|
||||
void reset ();
|
||||
void upset ();
|
||||
void SetRow(byte *buf, int n);
|
||||
void GetRow(byte *buf, int n);
|
||||
byte GetByte( ) { return IterImage[Itx]; }
|
||||
void SetByte(byte b) { IterImage[Itx] = b; }
|
||||
ImagePointerType GetRow(void);
|
||||
bool NextRow();
|
||||
bool PrevRow();
|
||||
bool NextByte();
|
||||
bool PrevByte();
|
||||
|
||||
void SetSteps(int x, int y=0) { Stepx = x; Stepy = y; }
|
||||
void GetSteps(int *x, int *y) { *x = Stepx; *y = Stepy; }
|
||||
bool NextStep();
|
||||
bool PrevStep();
|
||||
|
||||
////////////////////////// AD - for interlace ///////////////////////////////
|
||||
void SetY(int y);
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
};
|
||||
|
||||
|
||||
inline
|
||||
wxPNGReaderIter::wxPNGReaderIter(void)
|
||||
{
|
||||
ima = 0;
|
||||
IterImage = 0;
|
||||
Itx = Ity = 0;
|
||||
Stepx = Stepy = 0;
|
||||
}
|
||||
|
||||
inline
|
||||
wxPNGReaderIter::wxPNGReaderIter(wxPNGReader *imax): ima(imax)
|
||||
{
|
||||
if (ima)
|
||||
IterImage = ima->RawImage;
|
||||
Itx = Ity = 0;
|
||||
Stepx = Stepy = 0;
|
||||
}
|
||||
|
||||
inline
|
||||
wxPNGReaderIter::operator wxPNGReader* ()
|
||||
{
|
||||
return ima;
|
||||
}
|
||||
|
||||
inline
|
||||
bool wxPNGReaderIter::ItOK ()
|
||||
{
|
||||
if (ima)
|
||||
return ima->Inside(Itx, Ity);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
inline void wxPNGReaderIter::reset()
|
||||
{
|
||||
IterImage = ima->RawImage;
|
||||
Itx = Ity = 0;
|
||||
}
|
||||
|
||||
inline void wxPNGReaderIter::upset()
|
||||
{
|
||||
Itx = 0;
|
||||
Ity = ima->Height-1;
|
||||
IterImage = ima->RawImage + ima->EfeWidth*(ima->Height-1);
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::NextRow()
|
||||
{
|
||||
if (++Ity >= ima->Height) return 0;
|
||||
IterImage += ima->EfeWidth;
|
||||
return 1;
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::PrevRow()
|
||||
{
|
||||
if (--Ity < 0) return 0;
|
||||
IterImage -= ima->EfeWidth;
|
||||
return 1;
|
||||
}
|
||||
|
||||
////////////////////////// AD - for interlace ///////////////////////////////
|
||||
inline void wxPNGReaderIter::SetY(int y)
|
||||
{
|
||||
if ((y < 0) || (y > ima->Height)) return;
|
||||
Ity = y;
|
||||
IterImage = ima->RawImage + ima->EfeWidth*y;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
inline void wxPNGReaderIter::SetRow(byte *buf, int n)
|
||||
{
|
||||
// Here should be bcopy or memcpy
|
||||
//_fmemcpy(IterImage, (void far *)buf, n);
|
||||
if (n<0)
|
||||
n = ima->GetWidth();
|
||||
|
||||
for (int i=0; i<n; i++) IterImage[i] = buf[i];
|
||||
}
|
||||
|
||||
inline void wxPNGReaderIter::GetRow(byte *buf, int n)
|
||||
{
|
||||
for (int i=0; i<n; i++) buf[i] = IterImage[i];
|
||||
}
|
||||
|
||||
inline ImagePointerType wxPNGReaderIter::GetRow()
|
||||
{
|
||||
return IterImage;
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::NextByte()
|
||||
{
|
||||
if (++Itx < ima->EfeWidth)
|
||||
return 1;
|
||||
else
|
||||
if (++Ity < ima->Height)
|
||||
{
|
||||
IterImage += ima->EfeWidth;
|
||||
Itx = 0;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::PrevByte()
|
||||
{
|
||||
if (--Itx >= 0)
|
||||
return 1;
|
||||
else
|
||||
if (--Ity >= 0)
|
||||
{
|
||||
IterImage -= ima->EfeWidth;
|
||||
Itx = 0;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::NextStep()
|
||||
{
|
||||
Itx += Stepx;
|
||||
if (Itx < ima->EfeWidth)
|
||||
return 1;
|
||||
else {
|
||||
Ity += Stepy;
|
||||
if (Ity < ima->Height)
|
||||
{
|
||||
IterImage += ima->EfeWidth;
|
||||
Itx = 0;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool wxPNGReaderIter::PrevStep()
|
||||
{
|
||||
Itx -= Stepx;
|
||||
if (Itx >= 0)
|
||||
return 1;
|
||||
else {
|
||||
Ity -= Stepy;
|
||||
if (Ity >= 0 && Ity < ima->Height)
|
||||
{
|
||||
IterImage -= ima->EfeWidth;
|
||||
Itx = 0;
|
||||
return 1;
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
BIN
include/wx/msw/pntleft.cur
Normal file
After Width: | Height: | Size: 326 B |
BIN
include/wx/msw/pntright.cur
Normal file
After Width: | Height: | Size: 326 B |
71
include/wx/msw/printdlg.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printdlg.h
|
||||
// Purpose: wxPrintDialog, wxPageSetupDialog classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTDLGH__
|
||||
#define __PRINTDLGH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "printdlg.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/cmndata.h"
|
||||
|
||||
/*
|
||||
* wxPrinterDialog
|
||||
* The common dialog for printing.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxPrintDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPrintDialog)
|
||||
|
||||
private:
|
||||
wxPrintData printData;
|
||||
wxDC *printerDC;
|
||||
bool destroyDC;
|
||||
char *deviceName;
|
||||
char *driverName;
|
||||
char *portName;
|
||||
wxWindow *dialogParent;
|
||||
public:
|
||||
wxPrintDialog(void);
|
||||
wxPrintDialog(wxWindow *parent, wxPrintData* data = NULL);
|
||||
~wxPrintDialog(void);
|
||||
|
||||
bool Create(wxWindow *parent, wxPrintData* data = NULL);
|
||||
virtual int ShowModal(void);
|
||||
|
||||
inline wxPrintData& GetPrintData(void) { return printData; }
|
||||
virtual wxDC *GetPrintDC(void);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxPageSetupDialog: public wxDialog
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxPageSetupDialog)
|
||||
|
||||
private:
|
||||
wxPageSetupData m_pageSetupData;
|
||||
wxWindow* m_dialogParent;
|
||||
public:
|
||||
wxPageSetupDialog(void);
|
||||
wxPageSetupDialog(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
~wxPageSetupDialog(void);
|
||||
|
||||
bool Create(wxWindow *parent, wxPageSetupData *data = NULL);
|
||||
virtual int ShowModal(void);
|
||||
|
||||
inline wxPageSetupData& GetPageSetupData(void) { return m_pageSetupData; }
|
||||
};
|
||||
|
||||
#endif
|
||||
// __PRINTDLGH__
|
58
include/wx/msw/printwin.h
Normal file
@@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: printwin.h
|
||||
// Purpose: wxWindowsPrinter, wxWindowsPrintPreview classes
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRINTWINH__
|
||||
#define __PRINTWINH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "printwin.h"
|
||||
#endif
|
||||
|
||||
#include "wx/prntbase.h"
|
||||
|
||||
/*
|
||||
* Represents the printer: manages printing a wxPrintout object
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxWindowsPrinter: public wxPrinterBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxWindowsPrinter)
|
||||
|
||||
private:
|
||||
WXFARPROC lpAbortProc;
|
||||
public:
|
||||
wxWindowsPrinter(wxPrintData *data = NULL);
|
||||
~wxWindowsPrinter(void);
|
||||
|
||||
virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = TRUE);
|
||||
virtual bool PrintDialog(wxWindow *parent);
|
||||
virtual bool Setup(wxWindow *parent);
|
||||
};
|
||||
|
||||
/*
|
||||
* wxPrintPreview
|
||||
* Programmer creates an object of this class to preview a wxPrintout.
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxWindowsPrintPreview: public wxPrintPreviewBase
|
||||
{
|
||||
DECLARE_CLASS(wxWindowsPrintPreview)
|
||||
|
||||
public:
|
||||
wxWindowsPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintData *data = NULL);
|
||||
~wxWindowsPrintPreview(void);
|
||||
|
||||
virtual bool Print(bool interactive);
|
||||
virtual void DetermineScaling(void);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __PRINTWINH__
|
146
include/wx/msw/private.h
Normal file
@@ -0,0 +1,146 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: private.h
|
||||
// Purpose: Private declarations
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __PRIVATEH__
|
||||
#define __PRIVATEH__
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define VIEWPORT_EXTENT 1000
|
||||
|
||||
class WXDLLEXPORT wxFont ;
|
||||
|
||||
void WXDLLEXPORT wxGetCharSize(WXHWND wnd, int *x, int *y,wxFont *the_font);
|
||||
void WXDLLEXPORT wxSliderEvent(WXHWND control, WXWORD wParam, WXWORD pos);
|
||||
wxWindow* WXDLLEXPORT wxFindWinFromHandle(WXHWND hWnd);
|
||||
void WXDLLEXPORT wxScrollBarEvent(WXHWND hbar, WXWORD wParam, WXWORD pos);
|
||||
|
||||
WXDLLEXPORT_DATA(extern HICON) wxSTD_FRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDIPARENTFRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HICON) wxSTD_MDICHILDFRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_FRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDIPARENTFRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HICON) wxDEFAULT_MDICHILDFRAME_ICON;
|
||||
WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT;
|
||||
|
||||
extern HINSTANCE WXDLLEXPORT wxGetInstance();
|
||||
void WXDLLEXPORT wxFillLogFont(LOGFONT *logFont, wxFont *font);
|
||||
wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNew = TRUE);
|
||||
|
||||
#ifdef __GNUWIN32__
|
||||
#define CASTWNDPROC (long unsigned)
|
||||
#else
|
||||
#define CASTWNDPROC
|
||||
#endif
|
||||
|
||||
#if !defined(APIENTRY) // NT defines APIENTRY, 3.x not
|
||||
#define APIENTRY FAR PASCAL
|
||||
#endif
|
||||
|
||||
#ifdef __WIN32__
|
||||
#define _EXPORT /**/
|
||||
#else
|
||||
#define _EXPORT _export
|
||||
typedef signed short int SHORT ;
|
||||
#endif
|
||||
|
||||
#if !defined(__WIN32__) // 3.x uses FARPROC for dialogs
|
||||
#define DLGPROC FARPROC
|
||||
#endif
|
||||
|
||||
#if USE_PENWIN
|
||||
void WXDLLEXPORT wxRegisterPenWin(void);
|
||||
void WXDLLEXPORT wxCleanUpPenWin(void);
|
||||
void WXDLLEXPORT wxEnablePenAppHooks (bool hook);
|
||||
#endif
|
||||
|
||||
#if USE_ITSY_BITSY
|
||||
#define IBS_HORZCAPTION 0x4000L
|
||||
#define IBS_VERTCAPTION 0x8000L
|
||||
|
||||
UINT WINAPI ibGetCaptionSize( HWND hWnd ) ;
|
||||
UINT WINAPI ibSetCaptionSize( HWND hWnd, UINT nSize ) ;
|
||||
LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam ) ;
|
||||
VOID WINAPI ibAdjustWindowRect( HWND hWnd, LPRECT lprc ) ;
|
||||
#endif
|
||||
|
||||
/* When implementing a new item, be sure to:
|
||||
*
|
||||
* - add the item to the parent panel
|
||||
* - set window_parent to the parent
|
||||
* - NULL any extra child window pointers not created for this item
|
||||
* (e.g. label control that wasn't needed)
|
||||
* - delete any extra child windows in the destructor (e.g. label control)
|
||||
* - implement GetSize and SetSize
|
||||
* - to find panel position if coordinates are (-1, -1), use GetPosition
|
||||
* - call AdvanceCursor after creation, for panel layout mechanism.
|
||||
*
|
||||
*/
|
||||
|
||||
#if CTL3D
|
||||
#include <wx/msw/ctl3d/ctl3d.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Decide what window classes we're going to use
|
||||
* for this combination of CTl3D/FAFA settings
|
||||
*/
|
||||
|
||||
#define STATIC_CLASS "STATIC"
|
||||
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
|
||||
#define CHECK_CLASS "BUTTON"
|
||||
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
|
||||
#define CHECK_IS_FAFA FALSE
|
||||
#define RADIO_CLASS "BUTTON"
|
||||
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
|
||||
#define RADIO_SIZE 20
|
||||
#define RADIO_IS_FAFA FALSE
|
||||
#define PURE_WINDOWS
|
||||
#define GROUP_CLASS "BUTTON"
|
||||
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
|
||||
|
||||
/*
|
||||
#define BITCHECK_FLAGS (FB_BITMAP|FC_BUTTONDRAW|FC_DEFAULT|WS_VISIBLE)
|
||||
#define BITRADIO_FLAGS (FC_BUTTONDRAW|FB_BITMAP|FC_RADIO|WS_CHILD|WS_VISIBLE)
|
||||
*/
|
||||
|
||||
#define MEANING_CHARACTER '0'
|
||||
#define DEFAULT_ITEM_WIDTH 200
|
||||
#define DEFAULT_ITEM_HEIGHT 80
|
||||
#define EDIT_CONTROL_FACTOR (15.0/10.0)
|
||||
// Scale font to get edit control height
|
||||
|
||||
// Generic subclass proc, for panel item moving/sizing and intercept
|
||||
// EDIT control VK_RETURN messages
|
||||
extern LONG APIENTRY _EXPORT
|
||||
wxSubclassedGenericControlProc(WXHWND hWnd, WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// Find maximum size of window/rectangle
|
||||
extern void WXDLLEXPORT wxFindMaxSize(WXHWND hwnd, RECT *rect);
|
||||
|
||||
// List of scrollbar controls
|
||||
WXDLLEXPORT_DATA(extern wxList) wxScrollBarList;
|
||||
// The MakeProcInstance version of the function wxSubclassedGenericControlProc
|
||||
WXDLLEXPORT_DATA(extern FARPROC) wxGenericControlSubClassProc;
|
||||
WXDLLEXPORT_DATA(extern char*) wxBuffer;
|
||||
WXDLLEXPORT_DATA(extern HINSTANCE) wxhInstance;
|
||||
|
||||
wxWindow* WXDLLEXPORT wxFindControlFromHandle(WXHWND hWnd);
|
||||
void WXDLLEXPORT wxAddControlHandle(WXHWND hWnd, wxWindow *item);
|
||||
|
||||
#if !defined(__WIN32__) && !defined(WS_EX_CLIENTEDGE)
|
||||
#define WS_EX_CLIENTEDGE 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __PRIVATEH__
|
BIN
include/wx/msw/query.cur
Normal file
After Width: | Height: | Size: 326 B |
137
include/wx/msw/radiobox.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobox.h
|
||||
// Purpose: wxRadioBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __RADIOBOXH__
|
||||
#define __RADIOBOXH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "radiobox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr;
|
||||
|
||||
// List box item
|
||||
class WXDLLEXPORT wxBitmap ;
|
||||
|
||||
class WXDLLEXPORT wxRadioBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
public:
|
||||
wxRadioBox(void);
|
||||
|
||||
#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);
|
||||
|
||||
/*
|
||||
inline wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
||||
int x, int y, int width, int height,
|
||||
int n, wxBitmap **choices,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr)
|
||||
{
|
||||
Create(parent, -1, title, wxPoint(x, y), wxSize(width, height), n, (const wxBitmap **)choices, majorDim, style,
|
||||
wxDefaultValidator, name);
|
||||
Callback(func);
|
||||
}
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
inline wxRadioBox(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||
}
|
||||
|
||||
/*
|
||||
wxRadioBox(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxBitmap *choices[] = NULL,
|
||||
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||
{
|
||||
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||
}
|
||||
*/
|
||||
|
||||
~wxRadioBox(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxString choices[] = NULL,
|
||||
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||
|
||||
/*
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const int n = 0, const wxBitmap *choices[] = NULL,
|
||||
const int majorDim = 0, const long style = wxRA_HORIZONTAL,
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||
*/
|
||||
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
int FindString(const wxString& s) const;
|
||||
void SetSelection(const int N);
|
||||
int GetSelection(void) const;
|
||||
wxString GetString(const int N) const;
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
void GetSize(int *x, int *y) const;
|
||||
void GetPosition(int *x, int *y) const;
|
||||
wxString GetLabel(void) const;
|
||||
void SetLabel(const wxString& label);
|
||||
void SetLabel(const int item, const wxString& label) ;
|
||||
void SetLabel(const int item, wxBitmap *bitmap) ;
|
||||
wxString GetLabel(const int item) const;
|
||||
bool Show(const bool show);
|
||||
void SetFocus(void);
|
||||
void Enable(const bool enable);
|
||||
void Enable(const int item, const bool enable);
|
||||
void Show(const int item, const bool show) ;
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
|
||||
virtual wxString GetStringSelection(void) const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
inline virtual int Number(void) const { return m_noItems; } ;
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
inline int GetNumberOfRowsOrCols(void) const { return m_noRowsOrCols; }
|
||||
inline void SetNumberOfRowsOrCols(const int n) { m_noRowsOrCols = n; }
|
||||
|
||||
// Implementation
|
||||
inline WXHWND *GetRadioButtons(void) const { return m_radioButtons; }
|
||||
bool ContainsHWND(WXHWND hWnd) const ;
|
||||
|
||||
protected:
|
||||
WXHWND * m_radioButtons;
|
||||
int m_majorDim ;
|
||||
int * m_radioWidth ; // for bitmaps
|
||||
int * m_radioHeight ;
|
||||
|
||||
int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// __RADIOBOXH__
|
92
include/wx/msw/radiobut.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: radiobut.h
|
||||
// Purpose: wxRadioButton class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __RADIOBUTH__
|
||||
#define __RADIOBUTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "radiobut.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxRadioButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
protected:
|
||||
public:
|
||||
inline wxRadioButton(void) {}
|
||||
inline wxRadioButton(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxRadioButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void SetValue(const bool val);
|
||||
virtual bool GetValue(void) const ;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
};
|
||||
|
||||
// Not implemented
|
||||
#if 0
|
||||
class WXDLLEXPORT wxBitmap ;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxBitmapRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxBitmapRadioButton: public wxRadioButton
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxBitmapRadioButton)
|
||||
protected:
|
||||
wxBitmap *theButtonBitmap;
|
||||
public:
|
||||
inline wxBitmapRadioButton(void) { theButtonBitmap = NULL; }
|
||||
inline wxBitmapRadioButton(wxWindow *parent, const wxWindowID id,
|
||||
const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxBitmap *label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxBitmapRadioButtonNameStr);
|
||||
|
||||
virtual void SetLabel(const wxBitmap *label);
|
||||
virtual void SetValue(const bool val) ;
|
||||
virtual bool GetValue(void) const ;
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __RADIOBUTH__
|
136
include/wx/msw/region.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: region.h
|
||||
// Purpose: wxRegion class
|
||||
// Author: Markus Holzem, Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __REGIONH__
|
||||
#define __REGIONH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "region.h"
|
||||
#endif
|
||||
|
||||
#include "wx/list.h"
|
||||
#include "wx/gdiobj.h"
|
||||
|
||||
class WXDLLEXPORT wxRect;
|
||||
class WXDLLEXPORT wxPoint;
|
||||
|
||||
enum wxRegionContain {
|
||||
wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2
|
||||
};
|
||||
|
||||
// So far, for internal use only
|
||||
enum wxRegionOp {
|
||||
wxRGN_AND, // Creates the intersection of the two combined regions.
|
||||
wxRGN_COPY, // Creates a copy of the region identified by hrgnSrc1.
|
||||
wxRGN_DIFF, // Combines the parts of hrgnSrc1 that are not part of hrgnSrc2.
|
||||
wxRGN_OR, // Creates the union of two combined regions.
|
||||
wxRGN_XOR // Creates the union of two combined regions except for any overlapping areas.
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxRegion : public wxGDIObject {
|
||||
DECLARE_DYNAMIC_CLASS(wxRegion);
|
||||
friend class WXDLLEXPORT wxRegionIterator;
|
||||
public:
|
||||
wxRegion(long x, long y, long w, long h);
|
||||
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
|
||||
wxRegion(const wxRect& rect);
|
||||
|
||||
wxRegion(void);
|
||||
~wxRegion(void);
|
||||
|
||||
//# Copying
|
||||
inline wxRegion(const wxRegion& r)
|
||||
{ Ref(r); }
|
||||
inline wxRegion& operator = (const wxRegion& r)
|
||||
{ Ref(r); return (*this); }
|
||||
|
||||
//# Modify region
|
||||
// Clear current region
|
||||
void Clear(void);
|
||||
|
||||
// Union rectangle or region with this.
|
||||
inline bool Union(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_OR); }
|
||||
inline bool Union(const wxRect& rect) { return Combine(rect, wxRGN_OR); }
|
||||
inline bool Union(const wxRegion& region) { return Combine(region, wxRGN_OR); }
|
||||
|
||||
// Intersect rectangle or region with this.
|
||||
inline bool Intersect(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_AND); }
|
||||
inline bool Intersect(const wxRect& rect) { return Combine(rect, wxRGN_AND); }
|
||||
inline bool Intersect(const wxRegion& region) { return Combine(region, wxRGN_AND); }
|
||||
|
||||
// Subtract rectangle or region from this:
|
||||
// Combines the parts of 'this' that are not part of the second region.
|
||||
inline bool Subtract(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_DIFF); }
|
||||
inline bool Subtract(const wxRect& rect) { return Combine(rect, wxRGN_DIFF); }
|
||||
inline bool Subtract(const wxRegion& region) { return Combine(region, wxRGN_DIFF); }
|
||||
|
||||
// XOR: the union of two combined regions except for any overlapping areas.
|
||||
inline bool Xor(long x, long y, long width, long height) { return Combine(x, y, width, height, wxRGN_XOR); }
|
||||
inline bool Xor(const wxRect& rect) { return Combine(rect, wxRGN_XOR); }
|
||||
inline bool Xor(const wxRegion& region) { return Combine(region, wxRGN_XOR); }
|
||||
|
||||
//# Information on region
|
||||
// Outer bounds of region
|
||||
void GetBox(long& x, long& y, long&w, long &h) const;
|
||||
wxRect GetBox(void) const ;
|
||||
|
||||
// Is region empty?
|
||||
bool Empty(void) const;
|
||||
inline bool IsEmpty(void) const { return Empty(); }
|
||||
|
||||
//# Tests
|
||||
// Does the region contain the point (x,y)?
|
||||
wxRegionContain Contains(long x, long y) const;
|
||||
// Does the region contain the point pt?
|
||||
wxRegionContain Contains(const wxPoint& pt) const;
|
||||
// Does the region contain the rectangle (x, y, w, h)?
|
||||
wxRegionContain Contains(long x, long y, long w, long h) const;
|
||||
// Does the region contain the rectangle rect?
|
||||
wxRegionContain Contains(const wxRect& rect) const;
|
||||
|
||||
// Internal
|
||||
bool Combine(long x, long y, long width, long height, wxRegionOp op);
|
||||
bool Combine(const wxRegion& region, wxRegionOp op);
|
||||
bool Combine(const wxRect& rect, wxRegionOp op);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxRegionIterator : public wxObject {
|
||||
DECLARE_DYNAMIC_CLASS(wxRegionIterator);
|
||||
public:
|
||||
wxRegionIterator(void);
|
||||
wxRegionIterator(const wxRegion& region);
|
||||
~wxRegionIterator(void);
|
||||
|
||||
void Reset(void) { m_current = 0; }
|
||||
void Reset(const wxRegion& region);
|
||||
|
||||
operator bool (void) const { return m_current < m_numRects; }
|
||||
bool HaveRects(void) const { return m_current < m_numRects; }
|
||||
|
||||
void operator ++ (void);
|
||||
void operator ++ (int);
|
||||
|
||||
long GetX(void) const;
|
||||
long GetY(void) const;
|
||||
long GetW(void) const;
|
||||
long GetWidth(void) const { return GetW(); }
|
||||
long GetH(void) const;
|
||||
long GetHeight(void) const { return GetH(); }
|
||||
|
||||
private:
|
||||
long m_current;
|
||||
long m_numRects;
|
||||
wxRegion m_region;
|
||||
wxRect* m_rects;
|
||||
};
|
||||
|
||||
#endif
|
||||
// __REGIONH__
|
184
include/wx/msw/registry.h
Normal file
@@ -0,0 +1,184 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msw/registry.h
|
||||
// Purpose: Registry classes and functions
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 03.04.198
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _REGISTRY_H
|
||||
#define _REGISTRY_H
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// mutable hack (see also registry.cpp)
|
||||
// ----------------------------------------------------------------------------
|
||||
#if USE_MUTABLE
|
||||
#define MUTABLE mutable
|
||||
#else
|
||||
#define MUTABLE
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// forward decl for handle type
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifndef HKEY_DEFINED
|
||||
#define HKEY_DEFINED
|
||||
#define HKEY unsigned long
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// class wxRegKey encapsulates window HKEY handle
|
||||
// ----------------------------------------------------------------------------
|
||||
class WXDLLEXPORT wxRegKey
|
||||
{
|
||||
public:
|
||||
// NB: do _not_ change the values of elements in these enumerations!
|
||||
|
||||
// registry value types (with comments from winnt.h)
|
||||
enum ValueType
|
||||
{
|
||||
Type_None, // No value type
|
||||
Type_String, // Unicode nul terminated string
|
||||
#ifdef __WIN32__
|
||||
Type_Expand_String, // Unicode nul terminated string
|
||||
// (with environment variable references)
|
||||
Type_Binary, // Free form binary
|
||||
Type_Dword, // 32-bit number
|
||||
Type_Dword_little_endian, // 32-bit number (same as Type_DWORD)
|
||||
Type_Dword_big_endian, // 32-bit number
|
||||
Type_Link, // Symbolic Link (unicode)
|
||||
Type_Multi_String, // Multiple Unicode strings
|
||||
Type_Resource_list, // Resource list in the resource map
|
||||
Type_Full_resource_descriptor, // Resource list in the hardware description
|
||||
Type_Resource_requirements_list, // ???
|
||||
#endif //WIN32
|
||||
};
|
||||
|
||||
// predefined registry keys
|
||||
enum StdKey
|
||||
{
|
||||
HKCR, // classes root
|
||||
#ifdef __WIN32__
|
||||
HKCU, // current user
|
||||
HKLM, // local machine
|
||||
HKUSR, // users
|
||||
HKPD, // performance data (@@ NT only?)
|
||||
#if WINVER >= 0x0400
|
||||
HKCC, // current config
|
||||
HKDD, // dynamic data
|
||||
#endif // Winver
|
||||
#endif // Win32/16
|
||||
};
|
||||
|
||||
// information about standard (predefined) registry keys
|
||||
// number of standard keys
|
||||
static const size_t nStdKeys;
|
||||
// get the name of a standard key
|
||||
static const char *GetStdKeyName(uint key);
|
||||
// get the short name of a standard key
|
||||
static const char *GetStdKeyShortName(uint key);
|
||||
// get StdKey from root HKEY
|
||||
static StdKey GetStdKeyFromHkey(HKEY hkey);
|
||||
|
||||
// extacts the std key prefix from the string (return value) and
|
||||
// leaves only the part after it (i.e. modifies the string passed!)
|
||||
static StdKey ExtractKeyName(wxString& str);
|
||||
|
||||
// ctors
|
||||
// root key is set to HKCR (the only root key under Win16)
|
||||
wxRegKey();
|
||||
// strKey is the full name of the key (i.e. starting with HKEY_xxx...)
|
||||
wxRegKey(const wxString& strKey);
|
||||
// strKey is the name of key under (standard key) keyParent
|
||||
wxRegKey(StdKey keyParent, const wxString& strKey);
|
||||
// strKey is the name of key under (previously created) keyParent
|
||||
wxRegKey(const wxRegKey& keyParent, const wxString& strKey);
|
||||
//
|
||||
~wxRegKey();
|
||||
|
||||
// change key (closes the previously opened key if any)
|
||||
void SetName(const wxString& strKey);
|
||||
void SetHkey(HKEY hKey);
|
||||
|
||||
// get infomation about the key
|
||||
// get the (full) key name. Abbreviate std root keys if bShortPrefix.
|
||||
wxString GetName(bool bShortPrefix = TRUE) const;
|
||||
// return TRUE if the key exists
|
||||
bool Exists() const;
|
||||
// return TRUE if the key is opened
|
||||
bool IsOpened() const { return m_hKey != 0; }
|
||||
// for "if ( !key ) wxLogError(...)" kind of expressions
|
||||
operator bool() const { return m_dwLastError == 0; }
|
||||
|
||||
// operations on the key itself
|
||||
// explicitly open the key (will be automatically done by all functions
|
||||
// which need the key to be opened if the key is not opened yet)
|
||||
bool Open();
|
||||
// create the key: will fail if the key already exists and bOkIfExists
|
||||
bool Create(bool bOkIfExists = TRUE);
|
||||
// close the key (will be automatically done in dtor)
|
||||
bool Close();
|
||||
|
||||
// deleting keys/values
|
||||
// deletes this key and all of it's subkeys/values
|
||||
bool DeleteSelf();
|
||||
// deletes the subkey with all of it's subkeys/values recursively
|
||||
bool DeleteKey(const char *szKey);
|
||||
// deletes the named value (may be NULL to remove the default value)
|
||||
bool DeleteValue(const char *szValue);
|
||||
|
||||
// access to values and subkeys
|
||||
// get value type
|
||||
ValueType GetValueType(const char *szValue);
|
||||
|
||||
// assignment operators set the default value of the key
|
||||
wxRegKey& operator=(const wxString& strValue)
|
||||
{ SetValue(NULL, strValue); return *this; }
|
||||
wxRegKey& operator=(long lValue)
|
||||
{ SetValue(NULL, lValue); return *this; }
|
||||
|
||||
// conversion operators query the default value of the key
|
||||
operator wxString() const;
|
||||
|
||||
// set the string value
|
||||
bool SetValue(const char *szValue, const wxString& strValue);
|
||||
// return the string value
|
||||
bool QueryValue(const char *szValue, wxString& strValue) const;
|
||||
|
||||
#ifdef __WIN32__
|
||||
// set the numeric value
|
||||
bool SetValue(const char *szValue, long lValue);
|
||||
// return the numeric value
|
||||
bool QueryValue(const char *szValue, long *plValue) const;
|
||||
#endif //Win32
|
||||
|
||||
// return TRUE if given subkey exists
|
||||
bool HasSubKey(const char *szKey) const;
|
||||
// return TRUE if any subkeys exist
|
||||
bool HasSubkeys() const;
|
||||
|
||||
// enumerate values and subkeys
|
||||
#ifdef __WIN32__
|
||||
bool GetFirstValue(wxString& strValueName, long& lIndex);
|
||||
bool GetNextValue (wxString& strValueName, long& lIndex) const;
|
||||
#endif //Win32
|
||||
|
||||
bool GetFirstKey (wxString& strKeyName , long& lIndex);
|
||||
bool GetNextKey (wxString& strKeyName , long& lIndex) const;
|
||||
|
||||
private:
|
||||
// no copy ctor/assignment operator
|
||||
wxRegKey(const wxRegKey& key); // not implemented
|
||||
wxRegKey& operator=(const wxRegKey& key); // not implemented
|
||||
|
||||
HKEY m_hKey, // our handle
|
||||
m_hRootKey; // handle of the top key (i.e. StdKey)
|
||||
wxString m_strKey; // key name (relative to m_hRootKey)
|
||||
|
||||
MUTABLE long m_dwLastError; // last error (0 if none)
|
||||
};
|
||||
|
||||
#endif //_REGISTRY_H
|
BIN
include/wx/msw/roller.cur
Normal file
After Width: | Height: | Size: 326 B |
91
include/wx/msw/scrolbar.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: scrollbar.h
|
||||
// Purpose: wxScrollBar class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SCROLBARH__
|
||||
#define __SCROLBARH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "scrolbar.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxScrollBarNameStr;
|
||||
|
||||
// Scrollbar item
|
||||
class WXDLLEXPORT wxScrollBar: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxScrollBar)
|
||||
|
||||
public:
|
||||
inline wxScrollBar(void) { m_pageSize = 0; m_viewSize = 0; m_objectSize = 0; }
|
||||
~wxScrollBar(void);
|
||||
|
||||
inline wxScrollBar(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxScrollBarNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSB_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxScrollBarNameStr);
|
||||
|
||||
int GetPosition(void) const ;
|
||||
inline int GetThumbSize() const { return m_pageSize; }
|
||||
inline int GetPageSize() const { return m_viewSize; }
|
||||
inline int GetRange() const { return m_objectSize; }
|
||||
|
||||
virtual void SetPosition(const int viewStart);
|
||||
virtual void SetScrollbar(const int position, const int thumbSize, const int range, const int pageSize,
|
||||
const bool refresh = TRUE);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Backward compatibility
|
||||
inline int GetValue(void) const { return GetPosition(); }
|
||||
inline void SetValue(const int viewStart) { SetPosition(viewStart); }
|
||||
void GetValues(int *viewStart, int *viewLength, int *objectLength,
|
||||
int *pageLength) const ;
|
||||
inline int GetViewLength() const { return m_viewSize; }
|
||||
inline int GetObjectLength() const { return m_objectSize; }
|
||||
|
||||
void SetPageSize(const int pageLength);
|
||||
void SetObjectLength(const int objectLength);
|
||||
void SetViewLength(const int viewLength);
|
||||
#endif
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
void MSWOnVScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control);
|
||||
void MSWOnHScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Backward compatibility: generate an old-style scroll command
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
int m_pageSize;
|
||||
int m_viewSize;
|
||||
int m_objectSize;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __SCROLBARH__
|
129
include/wx/msw/settings.h
Normal file
@@ -0,0 +1,129 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: settings.h
|
||||
// Purpose: wxSystemSettings class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SETTINGSH__
|
||||
#define __SETTINGSH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "settings.h"
|
||||
#endif
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
#define wxSYS_WHITE_BRUSH 0
|
||||
#define wxSYS_LTGRAY_BRUSH 1
|
||||
#define wxSYS_GRAY_BRUSH 2
|
||||
#define wxSYS_DKGRAY_BRUSH 3
|
||||
#define wxSYS_BLACK_BRUSH 4
|
||||
#define wxSYS_NULL_BRUSH 5
|
||||
#define wxSYS_HOLLOW_BRUSH wxSYS_NULL_BRUSH
|
||||
#define wxSYS_WHITE_PEN 6
|
||||
#define wxSYS_BLACK_PEN 7
|
||||
#define wxSYS_NULL_PEN 8
|
||||
#define wxSYS_OEM_FIXED_FONT 10
|
||||
#define wxSYS_ANSI_FIXED_FONT 11
|
||||
#define wxSYS_ANSI_VAR_FONT 12
|
||||
#define wxSYS_SYSTEM_FONT 13
|
||||
#define wxSYS_DEVICE_DEFAULT_FONT 14
|
||||
#define wxSYS_DEFAULT_PALETTE 15
|
||||
#define wxSYS_SYSTEM_FIXED_FONT 16 // Obsolete
|
||||
#define wxSYS_DEFAULT_GUI_FONT 17
|
||||
|
||||
#define wxSYS_COLOUR_SCROLLBAR 0
|
||||
#define wxSYS_COLOUR_BACKGROUND 1
|
||||
#define wxSYS_COLOUR_ACTIVECAPTION 2
|
||||
#define wxSYS_COLOUR_INACTIVECAPTION 3
|
||||
#define wxSYS_COLOUR_MENU 4
|
||||
#define wxSYS_COLOUR_WINDOW 5
|
||||
#define wxSYS_COLOUR_WINDOWFRAME 6
|
||||
#define wxSYS_COLOUR_MENUTEXT 7
|
||||
#define wxSYS_COLOUR_WINDOWTEXT 8
|
||||
#define wxSYS_COLOUR_CAPTIONTEXT 9
|
||||
#define wxSYS_COLOUR_ACTIVEBORDER 10
|
||||
#define wxSYS_COLOUR_INACTIVEBORDER 11
|
||||
#define wxSYS_COLOUR_APPWORKSPACE 12
|
||||
#define wxSYS_COLOUR_HIGHLIGHT 13
|
||||
#define wxSYS_COLOUR_HIGHLIGHTTEXT 14
|
||||
#define wxSYS_COLOUR_BTNFACE 15
|
||||
#define wxSYS_COLOUR_BTNSHADOW 16
|
||||
#define wxSYS_COLOUR_GRAYTEXT 17
|
||||
#define wxSYS_COLOUR_BTNTEXT 18
|
||||
#define wxSYS_COLOUR_INACTIVECAPTIONTEXT 19
|
||||
#define wxSYS_COLOUR_BTNHIGHLIGHT 20
|
||||
|
||||
#define wxSYS_COLOUR_3DDKSHADOW 21
|
||||
#define wxSYS_COLOUR_3DLIGHT 22
|
||||
#define wxSYS_COLOUR_INFOTEXT 23
|
||||
#define wxSYS_COLOUR_INFOBK 24
|
||||
|
||||
#define wxSYS_COLOUR_DESKTOP wxSYS_COLOUR_BACKGROUND
|
||||
#define wxSYS_COLOUR_3DFACE wxSYS_COLOUR_BTNFACE
|
||||
#define wxSYS_COLOUR_3DSHADOW wxSYS_COLOUR_BTNSHADOW
|
||||
#define wxSYS_COLOUR_3DHIGHLIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_3DHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
#define wxSYS_COLOUR_BTNHILIGHT wxSYS_COLOUR_BTNHIGHLIGHT
|
||||
|
||||
// Metrics
|
||||
#define wxSYS_MOUSE_BUTTONS 1
|
||||
#define wxSYS_BORDER_X 2
|
||||
#define wxSYS_BORDER_Y 3
|
||||
#define wxSYS_CURSOR_X 4
|
||||
#define wxSYS_CURSOR_Y 5
|
||||
#define wxSYS_DCLICK_X 6
|
||||
#define wxSYS_DCLICK_Y 7
|
||||
#define wxSYS_DRAG_X 8
|
||||
#define wxSYS_DRAG_Y 9
|
||||
#define wxSYS_EDGE_X 10
|
||||
#define wxSYS_EDGE_Y 11
|
||||
#define wxSYS_HSCROLL_ARROW_X 12
|
||||
#define wxSYS_HSCROLL_ARROW_Y 13
|
||||
#define wxSYS_HTHUMB_X 14
|
||||
#define wxSYS_ICON_X 15
|
||||
#define wxSYS_ICON_Y 16
|
||||
#define wxSYS_ICONSPACING_X 17
|
||||
#define wxSYS_ICONSPACING_Y 18
|
||||
#define wxSYS_WINDOWMIN_X 19
|
||||
#define wxSYS_WINDOWMIN_Y 20
|
||||
#define wxSYS_SCREEN_X 21
|
||||
#define wxSYS_SCREEN_Y 22
|
||||
#define wxSYS_FRAMESIZE_X 23
|
||||
#define wxSYS_FRAMESIZE_Y 24
|
||||
#define wxSYS_SMALLICON_X 25
|
||||
#define wxSYS_SMALLICON_Y 26
|
||||
#define wxSYS_HSCROLL_Y 27
|
||||
#define wxSYS_VSCROLL_X 28
|
||||
#define wxSYS_VSCROLL_ARROW_X 29
|
||||
#define wxSYS_VSCROLL_ARROW_Y 30
|
||||
#define wxSYS_VTHUMB_Y 31
|
||||
#define wxSYS_CAPTION_Y 32
|
||||
#define wxSYS_MENU_Y 33
|
||||
#define wxSYS_NETWORK_PRESENT 34
|
||||
#define wxSYS_PENWINDOWS_PRESENT 35
|
||||
#define wxSYS_SHOW_SOUNDS 36
|
||||
#define wxSYS_SWAP_BUTTONS 37
|
||||
|
||||
class WXDLLEXPORT wxSystemSettings: public wxObject
|
||||
{
|
||||
public:
|
||||
inline wxSystemSettings(void) {}
|
||||
|
||||
// Get a system colour
|
||||
static wxColour GetSystemColour(int index);
|
||||
|
||||
// Get a system font
|
||||
static wxFont GetSystemFont(int index);
|
||||
|
||||
// Get a system metric, e.g. scrollbar size
|
||||
static int GetSystemMetric(int index);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __SETTINGSH__
|
324
include/wx/msw/setup.h
Normal file
@@ -0,0 +1,324 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: setup.h
|
||||
// Purpose: Configuration for the library
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SETUPH__
|
||||
#define __SETUPH__
|
||||
|
||||
/*
|
||||
* General features
|
||||
*
|
||||
*/
|
||||
|
||||
#define WXWIN_COMPATIBILITY 1
|
||||
// Compatibility with 1.66 API.
|
||||
// Level 0: no backward compatibility, all new features
|
||||
// Level 1: wxDC, OnSize (etc.) compatibility, but
|
||||
// some new features such as event tables
|
||||
|
||||
#define USE_AUTOTRANS 1
|
||||
// Define wxTString
|
||||
#define USE_POSTSCRIPT 1
|
||||
// 0 for no PostScript device context
|
||||
#define USE_AFM_FOR_POSTSCRIPT 0
|
||||
// 1 to use font metric files in GetTextExtent
|
||||
#define USE_METAFILE 1
|
||||
// 0 for no Metafile and metafile device context
|
||||
#define USE_FORM 0
|
||||
// 0 for no wxForm
|
||||
#define USE_IPC 1
|
||||
// 0 for no interprocess comms
|
||||
// Note: wxHELP uses IPC under X so these are interdependent!
|
||||
#define USE_HELP 1
|
||||
// 0 for no help facility
|
||||
#define USE_RESOURCES 1
|
||||
// 0 for no wxGetResource/wxWriteResource
|
||||
#define USE_CONSTRAINTS 1
|
||||
// 0 for no window layout constraint system
|
||||
|
||||
#define USE_TIMEDATE 1
|
||||
// 0 for no wxTime/wxDate classes
|
||||
|
||||
#define USE_CLIPBOARD 1
|
||||
// 0 for no clipboard functions
|
||||
#define USE_SPLINES 1
|
||||
// 0 for no splines
|
||||
#define USE_XFIG_SPLINE_CODE 1
|
||||
// 1 for XFIG spline code, 0 for AIAI spline code.
|
||||
// AIAI spline code is slower, but freer of copyright issues.
|
||||
|
||||
#define USE_DRAG_AND_DROP 1
|
||||
// 0 for no drag and drop
|
||||
|
||||
#define USE_TOOLBAR 1
|
||||
// Define 1 to use toolbar classes
|
||||
#define USE_BUTTONBAR 1
|
||||
// Define 1 to use buttonbar classes (enhanced toolbar
|
||||
// for MS Windows)
|
||||
#define USE_GAUGE 1
|
||||
// Define 1 to use Microsoft's gauge (Windows)
|
||||
// or Bull's gauge (Motif) library (both in contrib).
|
||||
#define USE_COMBOBOX 1
|
||||
// Define 1 to use COMBOXBOX control (Windows)
|
||||
// or FWW's ComboBox widget (Motif).
|
||||
#define USE_RADIOBUTTON 1
|
||||
// Define 1 to use radio button control
|
||||
|
||||
#define USE_SCROLLBAR 1
|
||||
// Define 1 to compile contributed wxScrollBar class
|
||||
#define USE_XPM_IN_X 1
|
||||
#define USE_XPM_IN_MSW 0
|
||||
// Define 1 to support the XPM package in wxBitmap,
|
||||
// separated by platform. If 1, you must link in
|
||||
// the XPM library to your applications.
|
||||
#define USE_IMAGE_LOADING_IN_X 1
|
||||
// Use dynamic icon/bitmap loading/saving code in utils/image under X.
|
||||
// If this is 1, you will need to link your applications
|
||||
// with image_X.lib. where X is motif, ol, or hp.
|
||||
|
||||
#define USE_IMAGE_LOADING_IN_MSW 1
|
||||
// Use dynamic DIB loading/saving code in utils/dib under MSW.
|
||||
#define USE_RESOURCE_LOADING_IN_MSW 0
|
||||
// Use dynamic icon/cursor loading/saving code
|
||||
// under MSW.
|
||||
#define USE_WX_RESOURCES 1
|
||||
// Use .wxr resource mechanism (requires PrologIO library)
|
||||
|
||||
#define USE_GNU_WXSTRING 0
|
||||
// Define 1 to use modified GNU wxString class
|
||||
// from (stefan.hammes@urz.uni-heidelberg.de) in contrib\string
|
||||
// TODO: why does this give an unresolved 'wxRegex::Search'
|
||||
// symbol if 1?
|
||||
|
||||
#define HAVE_SOCKET 1
|
||||
// Use WinSock if 1
|
||||
#define USE_DOC_VIEW_ARCHITECTURE 1
|
||||
// Set to 0 to disable document/view architecture
|
||||
#define USE_PRINTING_ARCHITECTURE 1
|
||||
// Set to 0 to disable print/preview architecture code
|
||||
#define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 1
|
||||
// Set to 0 to disable PostScript print/preview architecture code
|
||||
// under Windows (just use Windows printing).
|
||||
#define USE_DYNAMIC_CLASSES 1
|
||||
// If 1, enables provision of run-time type information.
|
||||
// NOW MANDATORY: don't change.
|
||||
#define USE_MEMORY_TRACING 1
|
||||
// If 1, enables debugging versions of wxObject::new and
|
||||
// wxObject::delete *IF* DEBUG is also defined.
|
||||
// WARNING: this code may not work with all architectures, especially
|
||||
// if alignment is an issue.
|
||||
#define USE_DEBUG_CONTEXT 1
|
||||
// If 1, enables wxDebugContext, for
|
||||
// writing error messages to file, etc.
|
||||
// If DEBUG is not defined, will still use
|
||||
// normal memory operators.
|
||||
// It's recommended to set this to 1,
|
||||
// since you may well need to output
|
||||
// an error log in a production
|
||||
// version (or non-debugging beta)
|
||||
#define USE_GLOBAL_MEMORY_OPERATORS 1
|
||||
// In debug mode, cause new and delete to be redefined globally.
|
||||
// If this causes problems (e.g. link errors), set this to 0.
|
||||
|
||||
#define REMOVE_UNUSED_ARG 1
|
||||
// Set this to 0 if your compiler can't cope
|
||||
// with omission of prototype parameters.
|
||||
|
||||
#define USE_C_MAIN 0
|
||||
// Set to 1 to use main.c instead of main.cpp (UNIX only)
|
||||
|
||||
#define USE_ODBC 1
|
||||
// Define 1 to use ODBC classes
|
||||
|
||||
#define USE_ODBC_IN_MSW_ONLY 1
|
||||
|
||||
#if USE_ODBC && USE_ODBC_IN_MSW_ONLY
|
||||
#undef USE_ODBC
|
||||
#define USE_ODBC 0
|
||||
#endif
|
||||
|
||||
#define USE_IOSTREAMH 1
|
||||
// VC++ 4.2 and above allows <iostream> and <iostream.h>
|
||||
// but you can't mix them. Set to 1 for <iostream.h>,
|
||||
// 0 for <iostream>
|
||||
|
||||
/*
|
||||
* Finer detail
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Motif and XView
|
||||
*
|
||||
*/
|
||||
|
||||
#define WX_STANDARD_GRAPHICS 0
|
||||
// If 1, normalizes X drawing code to behave exactly as
|
||||
// as MSW. If 0, is compatible with existing applications.
|
||||
// Some Xlib drawing primitives have non-intuitive behaviour!
|
||||
|
||||
#define USE_GADGETS 0
|
||||
// More efficient to use gadgets for some
|
||||
// widgets in Motif. 0 for no gadgets.
|
||||
// Please note: there is no reason to not
|
||||
// use it except if you intend to modify
|
||||
// color of individuals items OR
|
||||
// you need to move panel items interactively
|
||||
#define USE_BUTTON_GADGET 0
|
||||
// On JACS's system, gadget buttons
|
||||
// interfere with default button setting.
|
||||
#define PIXEL0_DISABLE 0
|
||||
// Define as 1 to disallow allocation
|
||||
// of pixel #0 (wxXOR problem).
|
||||
// JACS - I found this caused problems.
|
||||
|
||||
#define MOTIF_MENUBAR_DELETE_FIX 0
|
||||
// On some systems (Ultrix, OSF), deleting a frame
|
||||
// from within a menu callback causes a crash.
|
||||
// Set to 1 to avoid deleting the menubar handle directly,
|
||||
// which seems to cure it.
|
||||
#define DEFAULT_FILE_SELECTOR_SIZE 0
|
||||
// Let Motif defines the size of File
|
||||
// Selector Box (if 1), or fix it to
|
||||
// wxFSB_WIDTH x wxFSB_HEIGHT (if 0)
|
||||
#define wxFSB_WIDTH 600
|
||||
#define wxFSB_HEIGHT 500
|
||||
|
||||
#define MOTIF_MANAGE 1
|
||||
// Control default style of Dialogs
|
||||
// 1: use wxMOTIF_RESIZE as default
|
||||
// 0: do not use wxMOTIF_RESIZE as default
|
||||
|
||||
|
||||
/*
|
||||
* MS Windows/Windows NT
|
||||
*
|
||||
*/
|
||||
|
||||
#if defined(__WIN95__)
|
||||
#define CTL3D 0
|
||||
#else
|
||||
#define CTL3D 1
|
||||
// Define 1 to use Microsoft CTL3D library.
|
||||
// See note above about using FAFA and CTL3D.
|
||||
#endif
|
||||
|
||||
#define USE_COMMON_DIALOGS 1
|
||||
// On rare occasions (e.g. using DJGPP) may want
|
||||
// to omit common dialogs
|
||||
// (e.g. file selector, printer dialog).
|
||||
// Switching this off also switches off
|
||||
// the printing architecture and interactive
|
||||
// wxPrinterDC.
|
||||
#define USE_GREY_BACKGROUND 1
|
||||
// If 1, uses grey (gray!) panels
|
||||
// in FAFA and non-FAFA, non-CTL3D modes.
|
||||
// I (JACS) think the controls look better
|
||||
// this way. CTL3D always uses grey panels.
|
||||
#define USE_ITSY_BITSY 1
|
||||
// Define 1 to use Microsoft's ItsyBitsy
|
||||
// small title bar library
|
||||
#define USE_BITMAP_MESSAGE 1
|
||||
// Define 1 to use bitmap messages.
|
||||
#define USE_PORTABLE_FONTS_IN_MSW 0
|
||||
// Define 1 to use new portable font scheme in Windows
|
||||
// (used by default under X)
|
||||
#define FONT_SIZE_COMPATIBILITY 0
|
||||
// Define 1 for font size to be backward compatible
|
||||
// to 1.63 and earlier. 1.64 and later define point
|
||||
// sizes to be compatible with Windows.
|
||||
#define USE_GENERIC_DIALOGS_IN_MSW 1
|
||||
// Define 1 to use generic dialogs in Windows, even though
|
||||
// they duplicate native common dialog (e.g. wxColourDialog)
|
||||
#define USE_PENWINDOWS 0
|
||||
// Set to 1 to use PenWindows
|
||||
|
||||
#define USE_OWNER_DRAWN 1
|
||||
// Owner-drawn menus and listboxes
|
||||
|
||||
#define USE_NATIVE_STATUSBAR 1
|
||||
// Set to 0 to use cross-platform wxStatusBar
|
||||
|
||||
/*
|
||||
* Any platform
|
||||
*
|
||||
*/
|
||||
|
||||
#define USE_TYPEDEFS 0
|
||||
// Use typedefs not classes for wxPoint
|
||||
// and others, to reduce overhead and avoid
|
||||
// MS C7 memory bug. Bounds checker
|
||||
// complains about deallocating
|
||||
// arrays of wxPoints if wxPoint is a class.
|
||||
|
||||
#if (!defined(WIN32) && !defined(__WIN32__)) || defined(__GNUWIN32__) || defined(__BORLANDC__)
|
||||
// Can't use OLE drag and drop in Windows 3.1 because we don't know how
|
||||
// to implement UUIDs
|
||||
// GnuWin32 doesn't have appropriate headers for e.g. IUnknown.
|
||||
#undef USE_DRAG_AND_DROP
|
||||
#define USE_DRAG_AND_DROP 0
|
||||
#endif
|
||||
|
||||
// Only WIN32 supports wxStatusBar95
|
||||
#if !defined(__WIN32__) && USE_NATIVE_STATUSBAR
|
||||
#undef USE_NATIVE_STATUSBAR
|
||||
#define USE_NATIVE_STATUSBAR 0
|
||||
#endif
|
||||
|
||||
// Minimal setup e.g. for compiling small utilities
|
||||
#define MINIMAL_WXWINDOWS_SETUP 0
|
||||
|
||||
#if MINIMAL_WXWINDOWS_SETUP
|
||||
#undef USE_POSTSCRIPT
|
||||
# define USE_POSTSCRIPT 0
|
||||
#undef USE_PRINTING_ARCHITECTURE
|
||||
# define USE_PRINTING_ARCHITECTURE 0
|
||||
#undef USE_POSTSCRIPT_ARCHITECTURE_IN_MSW
|
||||
# define USE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
|
||||
#undef USE_METAFILE
|
||||
# define USE_METAFILE 0
|
||||
#undef USE_FORM
|
||||
# define USE_FORM 0
|
||||
#undef USE_SPLINES
|
||||
# define USE_SPLINES 0
|
||||
#undef USE_SCROLLBAR
|
||||
# define USE_SCROLLBAR 0
|
||||
#undef USE_COMBOBOX
|
||||
# define USE_COMBOBOX 0
|
||||
#undef USE_RADIOBUTTON
|
||||
# define USE_RADIOBUTTON 0
|
||||
#undef USE_XPM_IN_MSW
|
||||
# define USE_XPM_IN_MSW 0
|
||||
#undef USE_WX_RESOURCES
|
||||
# define USE_WX_RESOURCES 0
|
||||
#undef USE_DOC_VIEW_ARCHITECTURE
|
||||
# define USE_DOC_VIEW_ARCHITECTURE 0
|
||||
#undef USE_GNU_WXSTRING
|
||||
# define USE_GNU_WXSTRING 0
|
||||
#undef USE_ODBC
|
||||
# define USE_ODBC 0
|
||||
#undef USE_TIMEDATE
|
||||
# define USE_TIMEDATE 0
|
||||
#undef CTL3D
|
||||
# define CTL3D 0
|
||||
#undef USE_ITSY_BITSY
|
||||
# define USE_ITSY_BITSY 0
|
||||
#undef USE_IMAGE_LOADING_IN_MSW
|
||||
# define USE_IMAGE_LOADING_IN_MSW 0
|
||||
#undef USE_GAUGE
|
||||
# define USE_GAUGE 0
|
||||
#undef USE_RESOURCE_LOADING_IN_MSW
|
||||
# define USE_RESOURCE_LOADING_IN_MSW 0
|
||||
#undef USE_DRAG_AND_DROP
|
||||
# define USE_DRAG_AND_DROP 0
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// __SETUPH__
|
BIN
include/wx/msw/size.cur
Normal file
After Width: | Height: | Size: 326 B |
110
include/wx/msw/slider.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: slider.h
|
||||
// Purpose: wxSlider class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SLIDERH__
|
||||
#define __SLIDERH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "slider.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||
|
||||
// Slider
|
||||
class WXDLLEXPORT wxSlider: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
|
||||
public:
|
||||
wxSlider(void);
|
||||
|
||||
inline wxSlider(wxWindow *parent, const wxWindowID id,
|
||||
const int value, const int minValue, const int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSL_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSliderNameStr)
|
||||
{
|
||||
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
~wxSlider(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const int value, const int minValue, const int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSL_HORIZONTAL,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxSliderNameStr);
|
||||
|
||||
virtual int GetValue(void) const ;
|
||||
virtual void SetValue(const int);
|
||||
void GetSize(int *x, int *y) const ;
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
bool Show(const bool show);
|
||||
|
||||
void SetRange(const int minValue, const int maxValue);
|
||||
|
||||
inline int GetMin(void) const { return m_rangeMin; }
|
||||
inline int GetMax(void) const { return m_rangeMax; }
|
||||
|
||||
// For trackbars only
|
||||
void SetTickFreq(const int n, const int pos);
|
||||
inline int GetTickFreq(void) const { return m_tickFreq; }
|
||||
void SetPageSize(const int pageSize);
|
||||
int GetPageSize(void) const ;
|
||||
void ClearSel(void) ;
|
||||
void ClearTicks(void) ;
|
||||
void SetLineSize(const int lineSize);
|
||||
int GetLineSize(void) const ;
|
||||
int GetSelEnd(void) const ;
|
||||
int GetSelStart(void) const ;
|
||||
void SetSelection(const int minPos, const int maxPos);
|
||||
void SetThumbLength(const int len) ;
|
||||
int GetThumbLength(void) const ;
|
||||
void SetTick(const int tickPos) ;
|
||||
|
||||
// IMPLEMENTATION
|
||||
inline WXHWND GetStaticMin() const { return m_staticMin; }
|
||||
inline WXHWND GetStaticMax() const { return m_staticMax; }
|
||||
inline WXHWND GetEditValue() const { return m_staticValue; }
|
||||
virtual bool ContainsHWND(WXHWND hWnd) const;
|
||||
|
||||
// Backward compatibility: translate to familiar wxEVT_COMMAND_SLIDER_UPDATED
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void OnScroll(wxScrollEvent& event);
|
||||
#endif
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
void MSWOnVScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control);
|
||||
void MSWOnHScroll(const WXWORD wParam, const WXWORD pos, const 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;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __SLIDERH__
|
107
include/wx/msw/spinbutt.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: spinbutt.h
|
||||
// Purpose: wxSpinButton class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __SPINBUTTH__
|
||||
#define __SPINBUTTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "spinbutt.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
#if defined(__WIN95__)
|
||||
|
||||
/*
|
||||
The wxSpinButton is like a small scrollbar than is often placed next
|
||||
to a text control.
|
||||
|
||||
wxSP_HORIZONTAL: horizontal spin button
|
||||
wxSP_VERTICAL: vertical spin button (the default)
|
||||
wxSP_ARROW_KEYS: arrow keys increment/decrement value
|
||||
wxSP_WRAP: value wraps at either end
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxSpinButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxSpinButton(void);
|
||||
|
||||
inline wxSpinButton(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton")
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
~wxSpinButton(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxSP_VERTICAL, const wxString& name = "wxSpinButton");
|
||||
|
||||
|
||||
// Attributes
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int GetValue(void) const ;
|
||||
void SetValue(const int val) ;
|
||||
void SetRange(const int minVal, const int maxVal) ;
|
||||
inline int GetMin(void) const { return m_min; }
|
||||
inline int GetMax(void) const { return m_max; }
|
||||
|
||||
// Operations
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
void MSWOnVScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control);
|
||||
void MSWOnHScroll(const WXWORD wParam, const WXWORD pos, const WXHWND control);
|
||||
|
||||
protected:
|
||||
int m_min;
|
||||
int m_max;
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxSpinEvent: public wxScrollEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinEvent)
|
||||
|
||||
public:
|
||||
wxSpinEvent(WXTYPE commandType = 0, int id = 0);
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&);
|
||||
|
||||
// Spin events
|
||||
|
||||
#define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
|
||||
#define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
|
||||
|
||||
#define EVT_SPIN(id, func) \
|
||||
{ wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
|
||||
{ wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },
|
||||
|
||||
#endif
|
||||
// __WIN95__
|
||||
#endif
|
||||
// __SPINBUTTH__
|
64
include/wx/msw/statbmp.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbmp.h
|
||||
// Purpose: wxStaticBitmap class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __STATBMPH__
|
||||
#define __STATBMPH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbmp.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticBitmap: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
public:
|
||||
inline wxStaticBitmap(void) { }
|
||||
|
||||
inline wxStaticBitmap(wxWindow *parent, const wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxBitmap& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticBitmapNameStr);
|
||||
|
||||
virtual void SetBitmap(const wxBitmap& bitmap);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
inline wxBitmap& GetBitmap(void) const { return (wxBitmap&) m_messageBitmap; }
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
protected:
|
||||
wxBitmap m_messageBitmap;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
// __STATBMPH__
|
63
include/wx/msw/statbox.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: statbox.h
|
||||
// Purpose: wxStaticBox class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __STATBOXH__
|
||||
#define __STATBOXH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "statbox.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||
|
||||
// Group box
|
||||
class WXDLLEXPORT wxStaticBox: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
|
||||
public:
|
||||
inline wxStaticBox(void) {}
|
||||
inline wxStaticBox(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticBoxNameStr);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
void SetLabel(const wxString& label);
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __STATBOXH__
|
51
include/wx/msw/statbr95.h
Normal file
@@ -0,0 +1,51 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: msw/statbr95.h
|
||||
// Purpose: native implementation of wxStatusBar
|
||||
// Author: Vadim Zeitlin
|
||||
// Modified by:
|
||||
// Created: 04.04.98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
|
||||
// Licence: wxWindows license
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _STATBR95_H
|
||||
#define _STATBR95_H
|
||||
|
||||
#if USE_NATIVE_STATUSBAR
|
||||
|
||||
class WXDLLEXPORT wxStatusBar95 : public wxStatusBar
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStatusBar95);
|
||||
|
||||
public:
|
||||
// ctors
|
||||
wxStatusBar95();
|
||||
wxStatusBar95(wxWindow *parent, wxWindowID id = -1, long style = wxSB_SIZEGRIP);
|
||||
|
||||
// create status line
|
||||
bool Create(wxWindow *parent, wxWindowID id = -1, long style = wxSB_SIZEGRIP);
|
||||
|
||||
// a status line can have several (<256) fields numbered from 0
|
||||
virtual void SetFieldsCount(int number = 1, const int *widths = NULL);
|
||||
|
||||
// each field of status line has it's own text
|
||||
virtual void SetStatusText(const wxString& text, const int number = 0);
|
||||
virtual wxString GetStatusText(int number = 0) const;
|
||||
|
||||
// set status line fields' widths
|
||||
virtual void SetStatusWidths(int n, const int *widths_field);
|
||||
|
||||
// we're going to process WM_SIZE (of the parent window)
|
||||
void OnSize(wxSizeEvent& event);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
protected:
|
||||
void CopyFieldsWidth(const int *widths);
|
||||
void SetFieldsWidth();
|
||||
};
|
||||
|
||||
#endif // USE_NATIVE_STATUSBAR
|
||||
|
||||
#endif //_STATBR95_H
|
60
include/wx/msw/stattext.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: stattext.h
|
||||
// Purpose: wxStaticText class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __STATTEXTH__
|
||||
#define __STATTEXTH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "stattext.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticText: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
public:
|
||||
inline wxStaticText(void) { }
|
||||
|
||||
inline wxStaticText(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {};
|
||||
virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {};
|
||||
|
||||
void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
void SetLabel(const wxString&);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
};
|
||||
|
||||
#endif
|
||||
// __STATTEXTH__
|
148
include/wx/msw/tabctrl.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.h
|
||||
// Purpose: wxTabCtrl class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABCTRLH__
|
||||
#define __TABCTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "tabctrl.h"
|
||||
#endif
|
||||
|
||||
class wxImageList;
|
||||
|
||||
// WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
|
||||
|
||||
/*
|
||||
* Flags returned by HitTest
|
||||
*/
|
||||
|
||||
#define wxTAB_HITTEST_NOWHERE 1
|
||||
#define wxTAB_HITTEST_ONICON 2
|
||||
#define wxTAB_HITTEST_ONLABEL 4
|
||||
#define wxTAB_HITTEST_ONITEM 6
|
||||
|
||||
class WXDLLEXPORT wxTabCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabCtrl)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxTabCtrl(void);
|
||||
|
||||
inline wxTabCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "tabCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
~wxTabCtrl(void);
|
||||
|
||||
// Accessors
|
||||
|
||||
// Get the selection
|
||||
int GetSelection(void) const;
|
||||
|
||||
// Get the associated image list
|
||||
wxImageList* GetImageList(void) const;
|
||||
|
||||
// Get the number of items
|
||||
int GetItemCount(void) const;
|
||||
|
||||
// Get the rect corresponding to the tab
|
||||
bool GetItemRect(const int item, wxRect& rect) const;
|
||||
|
||||
// Get the number of rows
|
||||
int GetRowCount(void) const;
|
||||
|
||||
// Get the item text
|
||||
wxString GetItemText(const int item) const ;
|
||||
|
||||
// Get the item image
|
||||
int GetItemImage(const int item) const;
|
||||
|
||||
// Get the item data
|
||||
void* GetItemData(const int item) const;
|
||||
|
||||
// Set the selection
|
||||
int SetSelection(const int item);
|
||||
|
||||
// Set the image list
|
||||
void SetImageList(wxImageList* imageList);
|
||||
|
||||
// Set the text for an item
|
||||
bool SetItemText(const int item, const wxString& text);
|
||||
|
||||
// Set the image for an item
|
||||
bool SetItemImage(const int item, const int image);
|
||||
|
||||
// Set the data for an item
|
||||
bool SetItemData(const int item, void* data);
|
||||
|
||||
// Set the size for a fixed-width tab control
|
||||
void SetItemSize(const wxSize& size);
|
||||
|
||||
// Set the padding between tabs
|
||||
void SetPadding(const wxSize& padding);
|
||||
|
||||
// Operations
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = 0, const wxString& name = "tabCtrl");
|
||||
|
||||
// Delete all items
|
||||
bool DeleteAllItems(void);
|
||||
|
||||
// Delete an item
|
||||
bool DeleteItem(const int item);
|
||||
|
||||
// Hit test
|
||||
int HitTest(const wxPoint& pt, long& flags);
|
||||
|
||||
// Insert an item
|
||||
int InsertItem(const int item, const wxString& text, const int imageId = -1, void* data = NULL);
|
||||
|
||||
// Implementation
|
||||
|
||||
// Call default behaviour
|
||||
void OnPaint(wxPaintEvent& event) { Default() ; }
|
||||
void OnSize(wxSizeEvent& event) { Default() ; }
|
||||
void OnMouseEvent(wxMouseEvent& event) { Default() ; }
|
||||
void OnKillFocus(wxFocusEvent& event) { Default() ; }
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
wxImageList* m_imageList;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTabEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
|
||||
public:
|
||||
wxTabEvent(WXTYPE commandType = 0, int id = 0);
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
||||
#define EVT_TAB_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn },
|
||||
#define EVT_TAB_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TAB_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTabEventFunction) & fn },
|
||||
|
||||
#endif
|
||||
// __TABCTRLH__
|
66
include/wx/msw/taskbar.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// File: taskbar.h
|
||||
// Purpose: Defines wxTaskBarIcon class for manipulating icons on the
|
||||
// Windows task bar.
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 24/3/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c)
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _TASKBAR_H_
|
||||
#define _TASKBAR_H_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "taskbar.h"
|
||||
#endif
|
||||
|
||||
#include <wx/list.h>
|
||||
#include <wx/icon.h>
|
||||
|
||||
class wxTaskBarIcon: public wxObject
|
||||
{
|
||||
public:
|
||||
wxTaskBarIcon(void);
|
||||
virtual ~wxTaskBarIcon(void);
|
||||
|
||||
// Accessors
|
||||
inline WXHWND GetHWND() const { return m_hWnd; }
|
||||
inline bool IsOK() const { return (m_hWnd != 0) ; }
|
||||
inline bool IsIconInstalled() const { return m_iconAdded; }
|
||||
|
||||
// Operations
|
||||
bool SetIcon(const wxIcon& icon, const wxString& tooltip = "");
|
||||
bool RemoveIcon(void);
|
||||
|
||||
// Overridables
|
||||
virtual void OnMouseMove(void);
|
||||
virtual void OnLButtonDown(void);
|
||||
virtual void OnLButtonUp(void);
|
||||
virtual void OnRButtonDown(void);
|
||||
virtual void OnRButtonUp(void);
|
||||
virtual void OnLButtonDClick(void);
|
||||
virtual void OnRButtonDClick(void);
|
||||
|
||||
// Implementation
|
||||
static wxTaskBarIcon* FindObjectForHWND(WXHWND hWnd);
|
||||
static void AddObject(wxTaskBarIcon* obj);
|
||||
static void RemoveObject(wxTaskBarIcon* obj);
|
||||
static bool RegisterWindowClass();
|
||||
static WXHWND CreateTaskBarWindow();
|
||||
long WindowProc( WXHWND hWnd, unsigned int msg, unsigned int wParam, long lParam );
|
||||
|
||||
// Data members
|
||||
protected:
|
||||
WXHWND m_hWnd;
|
||||
bool m_iconAdded;
|
||||
static wxList sm_taskBarIcons;
|
||||
static bool sm_registeredClass;
|
||||
static unsigned int sm_taskbarMsg;
|
||||
};
|
||||
|
||||
#endif
|
||||
// _TASKBAR_H_
|
||||
|
108
include/wx/msw/tbar95.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tbar95.h
|
||||
// Purpose: wxToolBar95 (Windows 95 toolbar) class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TBAR95H__
|
||||
#define __TBAR95H__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "tbar95.h"
|
||||
#endif
|
||||
|
||||
#if USE_BUTTONBAR && USE_TOOLBAR
|
||||
#include "wx/tbarbase.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
|
||||
|
||||
#define DEFAULTBITMAPX 16
|
||||
#define DEFAULTBITMAPY 15
|
||||
#define DEFAULTBUTTONX 24
|
||||
#define DEFAULTBUTTONY 24
|
||||
#define DEFAULTBARHEIGHT 27
|
||||
|
||||
class WXDLLEXPORT wxToolBar95: public wxToolBarBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBar95)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxToolBar95(void);
|
||||
|
||||
#if WXWIN_COMPATIBILITY > 0
|
||||
inline wxToolBar95(wxWindow *parent, int x, int y, int w, int h,
|
||||
long style = wxNO_BORDER, int orientation = wxVERTICAL, int RowsOrColumns = 2,
|
||||
const char *name = wxToolBarNameStr)
|
||||
{
|
||||
Create(parent, -1, wxPoint(x, y), wxSize(w, h), style, orientation, RowsOrColumns, name);
|
||||
}
|
||||
#endif
|
||||
inline wxToolBar95(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxNO_BORDER, const int orientation = wxVERTICAL,
|
||||
const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, orientation, RowsOrColumns, name);
|
||||
}
|
||||
~wxToolBar95(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxNO_BORDER, const int orientation = wxVERTICAL,
|
||||
const int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr);
|
||||
|
||||
// Call default behaviour
|
||||
void OnPaint(wxPaintEvent& event) { Default() ; }
|
||||
void OnSize(wxSizeEvent& event) { Default() ; }
|
||||
void OnMouseEvent(wxMouseEvent& event) { Default() ; }
|
||||
void OnKillFocus(wxFocusEvent& event) { Default() ; }
|
||||
|
||||
// Handle wxToolBar95 events
|
||||
|
||||
// If pushedBitmap is NULL, a reversed version of bitmap is
|
||||
// created and used as the pushed/toggled image.
|
||||
// If toggle is TRUE, the button toggles between the two states.
|
||||
wxToolBarTool *AddTool(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
|
||||
const bool toggle = FALSE, const long xPos = -1, const long yPos = -1, wxObject *clientData = NULL,
|
||||
const wxString& helpString1 = "", const wxString& helpString2 = "");
|
||||
|
||||
// New members
|
||||
// Set default bitmap size
|
||||
void SetDefaultSize(const wxSize& size);
|
||||
void EnableTool(const int toolIndex, const bool enable); // additional drawing on enabling
|
||||
void ToggleTool(const int toolIndex, const bool toggle); // toggle is TRUE if toggled on
|
||||
void ClearTools(void);
|
||||
|
||||
// The button size is bigger than the bitmap size
|
||||
wxSize GetDefaultButtonSize(void) const;
|
||||
|
||||
wxSize GetMaxSize(void) const;
|
||||
void GetSize(int *w, int *y) const;
|
||||
|
||||
// Add all the buttons: required for Win95.
|
||||
virtual bool CreateTools(void);
|
||||
virtual void SetRows(const int nRows);
|
||||
virtual void Layout(void) {}
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
|
||||
// Responds to colour changes
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
protected:
|
||||
WXHBITMAP m_hBitmap;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif // USE_TOOL/BUTTONBAR
|
||||
#endif
|
||||
// __TBAR95H__
|
130
include/wx/msw/tbarmsw.h
Normal file
@@ -0,0 +1,130 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tbarmsw.h
|
||||
// Purpose: wxToolBarMSW class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TBARMSWH__
|
||||
#define __TBARMSWH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "tbarmsw.h"
|
||||
#endif
|
||||
|
||||
#if USE_BUTTONBAR && USE_TOOLBAR
|
||||
#include "wx/tbarbase.h"
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr;
|
||||
|
||||
// Non-Win95 (WIN32, WIN16, UNIX) version
|
||||
|
||||
class WXDLLEXPORT wxToolBarMSW: public wxToolBarBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBarMSW)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
wxToolBarMSW(void);
|
||||
|
||||
#if WXWIN_COMPATIBILITY > 0
|
||||
inline wxToolBarMSW(wxWindow *parent, int x, int y, int w, int h,
|
||||
long style = wxNO_BORDER, int orientation = wxVERTICAL, int RowsOrColumns = 2,
|
||||
const char *name = wxButtonBarNameStr)
|
||||
{
|
||||
Create(parent, -1, wxPoint(x, y), wxSize(w, h), style, orientation, RowsOrColumns, name);
|
||||
}
|
||||
#endif
|
||||
inline wxToolBarMSW(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxNO_BORDER, const int orientation = wxVERTICAL,
|
||||
const int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr)
|
||||
{
|
||||
Create(parent, id, pos, size, style, orientation, RowsOrColumns, name);
|
||||
}
|
||||
bool Create(wxWindow *parent, const wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
const long style = wxNO_BORDER, const int orientation = wxVERTICAL,
|
||||
const int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr);
|
||||
|
||||
~wxToolBarMSW(void);
|
||||
|
||||
// Handle wxWindows events
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnMouseEvent(wxMouseEvent& event);
|
||||
|
||||
// If pushedBitmap is NULL, a reversed version of bitmap is
|
||||
// created and used as the pushed/toggled image.
|
||||
// If toggle is TRUE, the button toggles between the two states.
|
||||
wxToolBarTool *AddTool(const int toolIndex, const wxBitmap& bitmap, const wxBitmap& pushedBitmap = wxNullBitmap,
|
||||
const bool toggle = FALSE, const long xPos = -1, const long yPos = -1, wxObject *clientData = NULL,
|
||||
const wxString& helpString1 = "", const wxString& helpString2 = "");
|
||||
|
||||
void DrawTool(wxDC& dc, wxMemoryDC& memDc, wxToolBarTool *tool);
|
||||
|
||||
// New members
|
||||
// Set default bitmap size
|
||||
virtual void SetDefaultSize(const wxSize& size);
|
||||
void EnableTool(const int toolIndex, const bool enable); // additional drawing on enabling
|
||||
|
||||
// The button size is bigger than the bitmap size
|
||||
wxSize GetDefaultButtonSize(void) const;
|
||||
protected:
|
||||
void DrawTool(wxDC& dc, wxToolBarTool *tool, int state);
|
||||
|
||||
void GetSysColors(void);
|
||||
bool InitGlobalObjects(void);
|
||||
void FreeGlobalObjects(void);
|
||||
void PatB(WXHDC hdc,int x,int y,int dx,int dy, long rgb);
|
||||
void CreateMask(WXHDC hDC, int xoffset, int yoffset, int dx, int dy);
|
||||
void DrawBlankButton(WXHDC hdc, int x, int y, int dx, int dy, int state);
|
||||
void DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBarTool *tool, int state);
|
||||
WXHBITMAP CreateDitherBitmap();
|
||||
bool CreateDitherBrush(void);
|
||||
bool FreeDitherBrush(void);
|
||||
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo);
|
||||
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap);
|
||||
|
||||
protected:
|
||||
|
||||
WXHBRUSH m_hbrDither;
|
||||
WXDWORD m_rgbFace;
|
||||
WXDWORD m_rgbShadow;
|
||||
WXDWORD m_rgbHilight;
|
||||
WXDWORD m_rgbFrame;
|
||||
|
||||
//
|
||||
// m_hdcMono is the DC that holds a mono bitmap, m_hbmMono
|
||||
// that is used to create highlights
|
||||
// of button faces.
|
||||
// m_hbmDefault hold the default bitmap if there is one.
|
||||
//
|
||||
WXHDC m_hdcMono;
|
||||
WXHBITMAP m_hbmMono;
|
||||
WXHBITMAP m_hbmDefault;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#define DEFAULTBITMAPX 16
|
||||
#define DEFAULTBITMAPY 15
|
||||
#define DEFAULTBUTTONX 24
|
||||
#define DEFAULTBUTTONY 22
|
||||
#define DEFAULTBARHEIGHT 27
|
||||
|
||||
//
|
||||
// States (not all of them currently used)
|
||||
//
|
||||
#define wxTBSTATE_CHECKED 0x01 // radio button is checked
|
||||
#define wxTBSTATE_PRESSED 0x02 // button is being depressed (any style)
|
||||
#define wxTBSTATE_ENABLED 0x04 // button is enabled
|
||||
#define wxTBSTATE_HIDDEN 0x08 // button is hidden
|
||||
#define wxTBSTATE_INDETERMINATE 0x10 // button is indeterminate
|
||||
|
||||
#endif // USE_TOOL/BUTTONBAR
|
||||
#endif
|
||||
// __TBARMSWH__
|
149
include/wx/msw/textctrl.h
Normal file
@@ -0,0 +1,149 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: textctrl.h
|
||||
// Purpose: wxTextCtrl class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TEXTCTRLH__
|
||||
#define __TEXTCTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
#if USE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxTextCtrlNameStr;
|
||||
WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
|
||||
|
||||
// Single-line text item
|
||||
class WXDLLEXPORT wxTextCtrl: public wxControl
|
||||
|
||||
// 16-bit Borland 4.0 doesn't seem to allow multiple inheritance with wxWindow and streambuf:
|
||||
// it complains about deriving a huge class from the huge class streambuf. !!
|
||||
// Also, can't use streambuf if making or using a DLL :-(
|
||||
|
||||
#if (defined(__BORLANDC__) && !defined(__WIN32__)) || defined(__MWERKS__) || defined(_WINDLL) || defined(WXUSINGDLL) || defined(WXMAKINGDLL)
|
||||
#define NO_TEXT_WINDOW_STREAM
|
||||
#endif
|
||||
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
, public streambuf
|
||||
#endif
|
||||
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTextCtrl)
|
||||
|
||||
protected:
|
||||
wxString fileName;
|
||||
public:
|
||||
wxTextCtrl(void);
|
||||
inline wxTextCtrl(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTextCtrlNameStr)
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
:streambuf()
|
||||
#endif
|
||||
{
|
||||
Create(parent, id, value, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, const long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxTextCtrlNameStr);
|
||||
|
||||
virtual wxString GetValue(void) const ;
|
||||
virtual void SetValue(const wxString& value);
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy(void);
|
||||
virtual void Cut(void);
|
||||
virtual void Paste(void);
|
||||
|
||||
virtual void SetInsertionPoint(const long pos);
|
||||
virtual void SetInsertionPointEnd(void);
|
||||
virtual long GetInsertionPoint(void) const ;
|
||||
virtual long GetLastPosition(void) const ;
|
||||
virtual void Replace(const long from, const long to, const wxString& value);
|
||||
virtual void Remove(const long from, const long to);
|
||||
virtual void SetSelection(const long from, const long to);
|
||||
|
||||
virtual void Command(wxCommandEvent& event);
|
||||
|
||||
virtual void SetEditable(const bool editable);
|
||||
|
||||
#ifndef NO_TEXT_WINDOW_STREAM
|
||||
int overflow(int i);
|
||||
int sync(void);
|
||||
int underflow(void);
|
||||
#endif
|
||||
|
||||
void OnDropFiles(wxDropFilesEvent& event);
|
||||
|
||||
wxTextCtrl& operator<<(const wxString& s);
|
||||
wxTextCtrl& operator<<(const int i);
|
||||
wxTextCtrl& operator<<(const long i);
|
||||
wxTextCtrl& operator<<(const float f);
|
||||
wxTextCtrl& operator<<(const double d);
|
||||
wxTextCtrl& operator<<(const char c);
|
||||
|
||||
virtual bool LoadFile(const wxString& file);
|
||||
virtual bool SaveFile(const wxString& file);
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void DiscardEdits(void);
|
||||
virtual bool IsModified(void) const;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline bool Modified(void) const { return IsModified(); }
|
||||
#endif
|
||||
|
||||
virtual long XYToPosition(const long x, const long y) const ;
|
||||
virtual void PositionToXY(const long pos, long *x, long *y) const ;
|
||||
virtual void ShowPosition(const long pos);
|
||||
virtual int GetLineLength(const long lineNo) const ;
|
||||
virtual wxString GetLineText(const long lineNo) const ;
|
||||
virtual int GetNumberOfLines(void) const ;
|
||||
virtual void Clear(void);
|
||||
|
||||
// Process special keys e.g. 'enter' and process as if it were a command, if required
|
||||
void OnChar(wxKeyEvent& event);
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
// Implementation
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
inline bool IsRich(void) { return m_isRich; }
|
||||
inline void SetRichEdit(const bool isRich) { m_isRich = isRich; }
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual void AdoptAttributesFromHWND(void);
|
||||
virtual void SetupColours(void);
|
||||
|
||||
protected:
|
||||
bool m_isRich; // Are we using rich text edit to implement this?
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
||||
// __TEXTCTRLH__
|
52
include/wx/msw/timer.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: timer.h
|
||||
// Purpose: wxTimer class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TIMERH__
|
||||
#define __TIMERH_
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "timer.h"
|
||||
#endif
|
||||
|
||||
#include "wx/object.h"
|
||||
|
||||
class WXDLLEXPORT wxTimer: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTimer)
|
||||
|
||||
public:
|
||||
bool oneShot ;
|
||||
int milli ;
|
||||
int lastMilli ;
|
||||
|
||||
long id;
|
||||
public:
|
||||
wxTimer(void);
|
||||
~wxTimer(void);
|
||||
virtual bool Start(int milliseconds = -1,bool one_shot = FALSE); // Start timer
|
||||
virtual void Stop(void); // Stop timer
|
||||
virtual void Notify(void) = 0; // Override this member
|
||||
inline int Interval(void) { return milli ; }; // Returns the current interval time (0 if stop)
|
||||
};
|
||||
|
||||
// Timer functions (milliseconds)
|
||||
void WXDLLEXPORT wxStartTimer(void);
|
||||
// Gets time since last wxStartTimer or wxGetElapsedTime
|
||||
long WXDLLEXPORT wxGetElapsedTime(bool resetTimer = TRUE);
|
||||
|
||||
// EXPERIMENTAL: comment this out if it doesn't compile.
|
||||
bool WXDLLEXPORT wxGetLocalTime(long *timeZone, int *dstObserved);
|
||||
|
||||
// Get number of seconds since 00:00:00 GMT, Jan 1st 1970.
|
||||
long WXDLLEXPORT wxGetCurrentTime(void);
|
||||
|
||||
#endif
|
||||
// __TIMERH_
|
228
include/wx/msw/treectrl.h
Normal file
@@ -0,0 +1,228 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: treectrl.h
|
||||
// Purpose: wxTreeCtrl class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TREECTRLH__
|
||||
#define __TREECTRLH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "treectrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/imaglist.h"
|
||||
|
||||
// WXDLLEXPORT_DATA(extern const char*) wxTreeNameStr;
|
||||
|
||||
#define wxTREE_MASK_HANDLE 0x0001
|
||||
#define wxTREE_MASK_STATE 0x0002
|
||||
#define wxTREE_MASK_TEXT 0x0004
|
||||
#define wxTREE_MASK_IMAGE 0x0008
|
||||
#define wxTREE_MASK_SELECTED_IMAGE 0x0010
|
||||
#define wxTREE_MASK_CHILDREN 0x0020
|
||||
#define wxTREE_MASK_DATA 0x0040
|
||||
|
||||
#define wxTREE_STATE_BOLD 0x0001
|
||||
#define wxTREE_STATE_DROPHILITED 0x0002
|
||||
#define wxTREE_STATE_EXPANDED 0x0004
|
||||
#define wxTREE_STATE_EXPANDEDONCE 0x0008
|
||||
#define wxTREE_STATE_FOCUSED 0x0010
|
||||
#define wxTREE_STATE_SELECTED 0x0020
|
||||
#define wxTREE_STATE_CUT 0x0040
|
||||
|
||||
#define wxTREE_HITTEST_ABOVE 0x0001 // Above the client area.
|
||||
#define wxTREE_HITTEST_BELOW 0x0002 // Below the client area.
|
||||
#define wxTREE_HITTEST_NOWHERE 0x0004 // In the client area but below the last item.
|
||||
#define wxTREE_HITTEST_ONITEMBUTTON 0x0010 // On the button associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMICON 0x0020 // On the bitmap associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMINDENT 0x0040 // In the indentation associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMLABEL 0x0080 // On the label (string) associated with an item.
|
||||
#define wxTREE_HITTEST_ONITEMRIGHT 0x0100 // In the area to the right of an item.
|
||||
#define wxTREE_HITTEST_ONITEMSTATEICON 0x0200 // On the state icon for a tree view item that is in a user-defined state.
|
||||
#define wxTREE_HITTEST_TOLEFT 0x0400 // To the right of the client area.
|
||||
#define wxTREE_HITTEST_TORIGHT 0x0800 // To the left of the client area.
|
||||
|
||||
#define wxTREE_HITTEST_ONITEM (wxTREE_HITTEST_ONITEMICON | wxTREE_HITTEST_ONITEMLABEL wxTREE_HITTEST_ONITEMSTATEICON)
|
||||
|
||||
// Flags for GetNextItem
|
||||
enum {
|
||||
wxTREE_NEXT_CARET, // Retrieves the currently selected item.
|
||||
wxTREE_NEXT_CHILD, // Retrieves the first child item. The hItem parameter must be NULL.
|
||||
wxTREE_NEXT_DROPHILITE, // Retrieves the item that is the target of a drag-and-drop operation.
|
||||
wxTREE_NEXT_FIRSTVISIBLE, // Retrieves the first visible item.
|
||||
wxTREE_NEXT_NEXT, // Retrieves the next sibling item.
|
||||
wxTREE_NEXT_NEXTVISIBLE, // Retrieves the next visible item that follows the specified item.
|
||||
wxTREE_NEXT_PARENT, // Retrieves the parent of the specified item.
|
||||
wxTREE_NEXT_PREVIOUS, // Retrieves the previous sibling item.
|
||||
wxTREE_NEXT_PREVIOUSVISIBLE, // Retrieves the first visible item that precedes the specified item.
|
||||
wxTREE_NEXT_ROOT // Retrieves the first child item of the root item of which the specified item is a part.
|
||||
};
|
||||
|
||||
// Flags for ExpandItem
|
||||
enum {
|
||||
wxTREE_EXPAND_EXPAND,
|
||||
wxTREE_EXPAND_COLLAPSE,
|
||||
wxTREE_EXPAND_COLLAPSE_RESET,
|
||||
wxTREE_EXPAND_TOGGLE
|
||||
};
|
||||
|
||||
// Flags for InsertItem
|
||||
enum {
|
||||
wxTREE_INSERT_LAST = -1,
|
||||
wxTREE_INSERT_FIRST = -2,
|
||||
wxTREE_INSERT_SORT = -3
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTreeItem: public wxObject
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeItem)
|
||||
public:
|
||||
long m_mask;
|
||||
long m_itemId;
|
||||
long m_state;
|
||||
long m_stateMask;
|
||||
wxString m_text;
|
||||
int m_image;
|
||||
int m_selectedImage;
|
||||
int m_children;
|
||||
long m_data;
|
||||
|
||||
wxTreeItem(void);
|
||||
};
|
||||
|
||||
class WXDLLEXPORT wxTreeCtrl: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeCtrl)
|
||||
public:
|
||||
/*
|
||||
* Public interface
|
||||
*/
|
||||
|
||||
wxTreeCtrl(void);
|
||||
|
||||
inline wxTreeCtrl(wxWindow *parent, const wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTR_HAS_BUTTONS,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "wxTreeCtrl")
|
||||
{
|
||||
Create(parent, id, pos, size, style, validator, name);
|
||||
}
|
||||
~wxTreeCtrl(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id = -1,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = wxTR_HAS_BUTTONS,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = "wxTreeCtrl");
|
||||
|
||||
// Attributes
|
||||
int GetCount(void) const ;
|
||||
int GetIndent(void) const ;
|
||||
void SetIndent(int indent) ;
|
||||
wxImageList *GetImageList(const int which = wxIMAGE_LIST_NORMAL) const ;
|
||||
void SetImageList(wxImageList *imageList, const int which = wxIMAGE_LIST_NORMAL) ;
|
||||
long GetNextItem(const long item, int code) const ;
|
||||
bool ItemHasChildren(const long item) const ;
|
||||
long GetChild(const long item) const ;
|
||||
long GetParent(const long item) const ;
|
||||
long GetFirstVisibleItem(void) const ;
|
||||
long GetNextVisibleItem(const long item) const ;
|
||||
long GetSelection(void) const ;
|
||||
long GetRootItem(void) const ;
|
||||
bool GetItem(wxTreeItem& info) const ;
|
||||
bool SetItem(wxTreeItem& info) ;
|
||||
int GetItemState(const long item, const long stateMask) const ;
|
||||
bool SetItemState(const long item, const long state, const long stateMask) ;
|
||||
bool SetItemImage(const long item, const int image, const int selImage) ;
|
||||
wxString GetItemText(const long item) const ;
|
||||
void SetItemText(const long item, const wxString& str) ;
|
||||
long GetItemData(const long item) const ;
|
||||
bool SetItemData(const long item, long data) ;
|
||||
bool GetItemRect(const long item, wxRectangle& rect, bool textOnly = FALSE) const;
|
||||
wxTextCtrl& GetEditControl(void) const;
|
||||
|
||||
// Operations
|
||||
bool DeleteItem(const long item);
|
||||
bool ExpandItem(const long item, const int action);
|
||||
long InsertItem(const long parent, wxTreeItem& info, const long insertAfter = wxTREE_INSERT_LAST);
|
||||
|
||||
// If image > -1 and selImage == -1, the same image is used for
|
||||
// both selected and unselected items.
|
||||
long InsertItem(const long parent, const wxString& label, const int image = -1, const int selImage = -1, const long insertAfter = wxTREE_INSERT_LAST);
|
||||
bool SelectItem(const long item);
|
||||
bool ScrollTo(const long item);
|
||||
bool DeleteAllItems(void) ;
|
||||
wxTextCtrl& Edit(const long item) ;
|
||||
long HitTest(const wxPoint& point, int& flags);
|
||||
// wxImageList *CreateDragImage(const long item) ;
|
||||
bool SortChildren(const long item) ;
|
||||
bool EnsureVisible(const long item) ;
|
||||
|
||||
void Command(wxCommandEvent& event) { ProcessCommand(event); };
|
||||
|
||||
// IMPLEMENTATION
|
||||
bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
|
||||
protected:
|
||||
wxTextCtrl m_textCtrl;
|
||||
wxImageList *m_imageListNormal;
|
||||
wxImageList *m_imageListState;
|
||||
};
|
||||
|
||||
/*
|
||||
wxEVT_COMMAND_TREE_BEGIN_DRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_RDRAG,
|
||||
wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_END_LABEL_EDIT,
|
||||
wxEVT_COMMAND_TREE_DELETE_ITEM,
|
||||
wxEVT_COMMAND_TREE_GET_INFO,
|
||||
wxEVT_COMMAND_TREE_SET_INFO,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDED,
|
||||
wxEVT_COMMAND_TREE_ITEM_EXPANDING,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGED,
|
||||
wxEVT_COMMAND_TREE_SEL_CHANGING,
|
||||
wxEVT_COMMAND_TREE_KEY_DOWN
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxTreeEvent: public wxCommandEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTreeEvent)
|
||||
|
||||
public:
|
||||
wxTreeEvent(WXTYPE commandType = 0, int id = 0);
|
||||
|
||||
int m_code;
|
||||
wxTreeItem m_item;
|
||||
long m_oldItem;
|
||||
wxPoint m_pointDrag;
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
|
||||
|
||||
#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn },
|
||||
|
||||
#endif
|
||||
// __TREECTRLH__
|
BIN
include/wx/msw/watch1.cur
Normal file
After Width: | Height: | Size: 326 B |
43
include/wx/msw/wave.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wave.h
|
||||
// Purpose: wxWave class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __WAVEH__
|
||||
#define __WAVEH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "wave.h"
|
||||
#endif
|
||||
|
||||
#include <wx/object.h>
|
||||
|
||||
class wxWave : public wxObject
|
||||
{
|
||||
public:
|
||||
wxWave(void);
|
||||
wxWave(const wxString& fileName, bool isResource = FALSE);
|
||||
~wxWave(void);
|
||||
|
||||
public:
|
||||
bool Create(const wxString& sFileName, bool isResource = FALSE);
|
||||
bool IsOk(void) const { return (m_waveData ? TRUE : FALSE); };
|
||||
bool Play(bool async = TRUE, bool looped = FALSE) const;
|
||||
|
||||
protected:
|
||||
bool Free(void);
|
||||
|
||||
private:
|
||||
byte* m_waveData;
|
||||
int m_waveLength;
|
||||
bool m_isResource;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
798
include/wx/msw/window.h
Normal file
@@ -0,0 +1,798 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: window.h
|
||||
// Purpose: wxWindow class
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __WINDOWH__
|
||||
#define __WINDOWH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "window.h"
|
||||
#endif
|
||||
|
||||
#include "wx/gdicmn.h"
|
||||
#include "wx/icon.h"
|
||||
#include "wx/cursor.h"
|
||||
#include "wx/pen.h"
|
||||
#include "wx/font.h"
|
||||
#include "wx/validate.h"
|
||||
#include "wx/event.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/list.h"
|
||||
|
||||
#define wxKEY_SHIFT 1
|
||||
#define wxKEY_CTRL 2
|
||||
|
||||
/*
|
||||
* Base class for frame, panel, canvas, panel items, dialog box.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Event handler: windows have themselves as their event handlers
|
||||
* by default, but their event handlers could be set to another
|
||||
* object entirely. This separation can reduce the amount of
|
||||
* derivation required, and allow alteration of a window's functionality
|
||||
* (e.g. by a resource editor that temporarily switches event handlers).
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxWindow;
|
||||
class WXDLLEXPORT wxEvent;
|
||||
class WXDLLEXPORT wxCommandEvent;
|
||||
class WXDLLEXPORT wxKeyEvent;
|
||||
class WXDLLEXPORT wxControl;
|
||||
class WXDLLEXPORT wxCursor;
|
||||
class WXDLLEXPORT wxColourMap;
|
||||
class WXDLLEXPORT wxFont;
|
||||
class WXDLLEXPORT wxMenu;
|
||||
class WXDLLEXPORT wxRectangle;
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
class WXDLLEXPORT wxSizer;
|
||||
class WXDLLEXPORT wxList;
|
||||
class WXDLLEXPORT wxLayoutConstraints;
|
||||
class WXDLLEXPORT wxMouseEvent;
|
||||
class WXDLLEXPORT wxButton;
|
||||
class WXDLLEXPORT wxColour;
|
||||
class WXDLLEXPORT wxBrush;
|
||||
class WXDLLEXPORT wxPen;
|
||||
class WXDLLEXPORT wxIcon;
|
||||
class WXDLLEXPORT wxDC;
|
||||
class WXDLLEXPORT wxValidator;
|
||||
|
||||
#if USE_DRAG_AND_DROP
|
||||
class wxDropTarget;
|
||||
#endif
|
||||
|
||||
#if USE_WX_RESOURCES
|
||||
class WXDLLEXPORT wxResourceTable;
|
||||
class WXDLLEXPORT wxItemResource;
|
||||
#endif
|
||||
|
||||
WXDLLEXPORT_DATA(extern const char*) wxPanelNameStr;
|
||||
|
||||
WXDLLEXPORT_DATA(extern const wxSize) wxDefaultSize;
|
||||
WXDLLEXPORT_DATA(extern const wxPoint) wxDefaultPosition;
|
||||
|
||||
class WXDLLEXPORT wxWindow: public wxEvtHandler
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxWindow)
|
||||
|
||||
friend class wxUpdateIterator;
|
||||
friend class wxDC;
|
||||
friend class wxPaintDC;
|
||||
|
||||
public:
|
||||
wxWindow(void);
|
||||
inline wxWindow(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxPanelNameStr)
|
||||
{
|
||||
m_children = new wxList;
|
||||
Create(parent, id, pos, size, style, name);
|
||||
}
|
||||
|
||||
virtual ~wxWindow(void);
|
||||
|
||||
bool Create(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const long style = 0,
|
||||
const wxString& name = wxPanelNameStr);
|
||||
|
||||
// Fit the window around the items
|
||||
virtual void Fit(void);
|
||||
|
||||
// Show or hide the window
|
||||
virtual bool Show(const bool show);
|
||||
|
||||
// Is the window shown?
|
||||
virtual bool IsShown(void) const;
|
||||
|
||||
// Raise the window to the top of the Z order
|
||||
virtual void Raise(void);
|
||||
|
||||
// Lower the window to the bottom of the Z order
|
||||
virtual void Lower(void);
|
||||
|
||||
// Is the window enabled?
|
||||
virtual bool IsEnabled(void) const;
|
||||
|
||||
// For compatibility
|
||||
inline bool Enabled(void) const { return IsEnabled(); }
|
||||
|
||||
// Dialog support: override these and call
|
||||
// base class members to add functionality
|
||||
// that can't be done using validators.
|
||||
|
||||
// Transfer values to controls. If returns FALSE,
|
||||
// it's an application error (pops up a dialog)
|
||||
virtual bool TransferDataToWindow(void);
|
||||
|
||||
// Transfer values from controls. If returns FALSE,
|
||||
// transfer failed: don't quit
|
||||
virtual bool TransferDataFromWindow(void);
|
||||
|
||||
// Validate controls. If returns FALSE,
|
||||
// validation failed: don't quit
|
||||
virtual bool Validate(void);
|
||||
|
||||
// Return code for dialogs
|
||||
inline void SetReturnCode(int retCode);
|
||||
inline int GetReturnCode(void);
|
||||
|
||||
// Set the cursor
|
||||
virtual void SetCursor(const wxCursor& cursor);
|
||||
inline virtual wxCursor *GetCursor(void) const { return (wxCursor *)& m_windowCursor; };
|
||||
|
||||
// Get the window with the focus
|
||||
static wxWindow *FindFocus(void);
|
||||
|
||||
// Get character size
|
||||
virtual int GetCharHeight(void) const;
|
||||
virtual int GetCharWidth(void) const;
|
||||
|
||||
// Get overall window size
|
||||
virtual void GetSize(int *width, int *height) const;
|
||||
|
||||
// Get window position, relative to parent (or screen if no parent)
|
||||
virtual void GetPosition(int *x, int *y) const;
|
||||
|
||||
// Get client (application-useable) size
|
||||
virtual void GetClientSize(int *width, int *height) const;
|
||||
|
||||
// Set overall size and position
|
||||
virtual void SetSize(const int x, const int y, const int width, const int height, const int sizeFlags = wxSIZE_AUTO);
|
||||
inline virtual void SetSize(const int width, const int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); }
|
||||
inline virtual void Move(const int x, const int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); }
|
||||
|
||||
// Set client size
|
||||
virtual void SetClientSize(const int width, const int size);
|
||||
|
||||
// Convert client to screen coordinates
|
||||
virtual void ClientToScreen(int *x, int *y) const;
|
||||
|
||||
// Convert screen to client coordinates
|
||||
virtual void ScreenToClient(int *x, int *y) const;
|
||||
|
||||
// Set the focus to this window
|
||||
virtual void SetFocus(void);
|
||||
|
||||
// Capture/release mouse
|
||||
virtual void CaptureMouse(void);
|
||||
virtual void ReleaseMouse(void);
|
||||
|
||||
// Enable or disable the window
|
||||
virtual void Enable(const bool enable);
|
||||
|
||||
#if USE_DRAG_AND_DROP
|
||||
// Associate a drop target with this window (if the window already had a drop
|
||||
// target, it's deleted!) and return the current drop target (may be NULL).
|
||||
void SetDropTarget(wxDropTarget *pDropTarget);
|
||||
wxDropTarget *GetDropTarget() const { return m_pDropTarget; }
|
||||
#endif
|
||||
|
||||
// Accept files for dragging
|
||||
virtual void DragAcceptFiles(const bool accept);
|
||||
|
||||
// Set/get the window title
|
||||
virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
|
||||
inline virtual wxString GetTitle(void) const { return wxString(""); };
|
||||
// Most windows have the concept of a label; for frames, this is the
|
||||
// title; for items, this is the label or button text.
|
||||
inline virtual wxString GetLabel(void) const { return GetTitle(); }
|
||||
|
||||
// Set/get the window name (used for resource setting in X)
|
||||
inline virtual wxString GetName(void) const;
|
||||
inline virtual void SetName(const wxString& name);
|
||||
|
||||
// Centre the window
|
||||
virtual void Centre(const int direction) ;
|
||||
inline void Center(const int direction = wxHORIZONTAL) { Centre(direction); }
|
||||
|
||||
// Popup a menu
|
||||
virtual bool PopupMenu(wxMenu *menu, const int x, const int y);
|
||||
|
||||
// Send the window a refresh event
|
||||
virtual void Refresh(const bool eraseBack = TRUE, const wxRectangle *rect = NULL);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
// Set/get scroll attributes
|
||||
virtual void SetScrollRange(const int orient, const int range, const bool refresh = TRUE);
|
||||
virtual void SetScrollPage(const int orient, const int page, const bool refresh = TRUE);
|
||||
virtual int OldGetScrollRange(const int orient) const;
|
||||
virtual int GetScrollPage(const int orient) const;
|
||||
#endif
|
||||
|
||||
// New functions that will replace the above.
|
||||
virtual void SetScrollbar(const int orient, const int pos, const int thumbVisible,
|
||||
const int range, const bool refresh = TRUE);
|
||||
|
||||
virtual void SetScrollPos(const int orient, const int pos, const bool refresh = TRUE);
|
||||
virtual int GetScrollPos(const int orient) const;
|
||||
virtual int GetScrollRange(const int orient) const;
|
||||
virtual int GetScrollThumb(const int orient) const;
|
||||
|
||||
virtual void ScrollWindow(const int dx, const int dy, const wxRectangle *rect = NULL);
|
||||
|
||||
// Caret manipulation
|
||||
virtual void CreateCaret(const int w, const int h);
|
||||
virtual void CreateCaret(const wxBitmap *bitmap);
|
||||
virtual void DestroyCaret(void);
|
||||
virtual void ShowCaret(const bool show);
|
||||
virtual void SetCaretPos(const int x, const int y);
|
||||
virtual void GetCaretPos(int *x, int *y) const;
|
||||
|
||||
// Tell window how much it can be sized
|
||||
virtual void SetSizeHints(const int minW = -1, const int minH = -1, const int maxW = -1, const int maxH = -1, const int incW = -1, const int incH = -1);
|
||||
|
||||
// Set/get the window's identifier
|
||||
inline int GetId() const;
|
||||
inline void SetId(const int id);
|
||||
|
||||
// Make the window modal (all other windows unresponsive)
|
||||
virtual void MakeModal(const bool modal);
|
||||
|
||||
// Get the private handle (platform-dependent)
|
||||
inline void *GetHandle(void) const;
|
||||
|
||||
// Set/get the window's relatives
|
||||
inline wxWindow *GetParent(void) const;
|
||||
inline void SetParent(wxWindow *p) ;
|
||||
inline wxWindow *GetGrandParent(void) const;
|
||||
inline wxList *GetChildren() const;
|
||||
|
||||
// Set/get the window's font
|
||||
virtual void SetFont(const wxFont& f);
|
||||
inline virtual wxFont *GetFont(void) const;
|
||||
|
||||
// Set/get the window's validator
|
||||
void SetValidator(const wxValidator& validator);
|
||||
inline wxValidator *GetValidator(void) const;
|
||||
|
||||
// Set/get the window's style
|
||||
inline void SetWindowStyleFlag(const long flag);
|
||||
inline long GetWindowStyleFlag(void) const;
|
||||
|
||||
// Set/get double-clickability
|
||||
// TODO: we probably wish to get rid of this, and
|
||||
// always allow double clicks.
|
||||
inline void SetDoubleClick(const bool flag);
|
||||
inline bool GetDoubleClick(void) const;
|
||||
inline void AllowDoubleClick(const bool value) { SetDoubleClick(value); }
|
||||
|
||||
// Old way to handle a control command
|
||||
virtual void OnCommand(wxWindow& win, wxCommandEvent& event);
|
||||
|
||||
// Set/get event handler
|
||||
inline void SetEventHandler(wxEvtHandler *handler);
|
||||
inline wxEvtHandler *GetEventHandler(void) const;
|
||||
|
||||
// Push/pop event handler (i.e. allow a chain of event handlers
|
||||
// be searched)
|
||||
void PushEventHandler(wxEvtHandler *handler) ;
|
||||
wxEvtHandler *PopEventHandler(bool deleteHandler = FALSE) ;
|
||||
|
||||
// Close the window by calling OnClose, posting a deletion
|
||||
virtual bool Close(const bool force = FALSE);
|
||||
|
||||
// Destroy the window (delayed, if a managed window)
|
||||
virtual bool Destroy(void) ;
|
||||
|
||||
// Mode for telling default OnSize members to
|
||||
// call Layout(), if not using Sizers, just top-down constraints
|
||||
inline void SetAutoLayout(const bool a);
|
||||
inline bool GetAutoLayout(void) const;
|
||||
|
||||
// Set/get constraints
|
||||
inline wxLayoutConstraints *GetConstraints(void) const;
|
||||
void SetConstraints(wxLayoutConstraints *c);
|
||||
|
||||
// Set/get window background colour
|
||||
inline virtual void SetBackgroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetBackgroundColour(void) const;
|
||||
|
||||
// Set/get window foreground colour
|
||||
inline virtual void SetForegroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetForegroundColour(void) const;
|
||||
|
||||
// TODO: are these really necessary???
|
||||
// Set/get window default background colour (for children to inherit)
|
||||
inline virtual void SetDefaultBackgroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetDefaultBackgroundColour(void) const;
|
||||
|
||||
// Set/get window default foreground colour (for children to inherit)
|
||||
inline virtual void SetDefaultForegroundColour(const wxColour& col);
|
||||
inline virtual wxColour GetDefaultForegroundColour(void) const;
|
||||
|
||||
// For backward compatibility
|
||||
inline virtual void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
inline virtual void SetLabelFont(const wxFont& font) { SetFont(font); }
|
||||
inline virtual wxFont *GetLabelFont(void) const { return GetFont(); };
|
||||
inline virtual wxFont *GetButtonFont(void) const { return GetFont(); };
|
||||
|
||||
// Get the default button, if there is one
|
||||
inline virtual wxButton *GetDefaultItem(void) const;
|
||||
inline virtual void SetDefaultItem(wxButton *but);
|
||||
|
||||
// Override to define new behaviour for default action (e.g. double clicking
|
||||
// on a listbox)
|
||||
virtual void OnDefaultAction(wxControl *initiatingItem);
|
||||
|
||||
// Resource loading
|
||||
#if USE_WX_RESOURCES
|
||||
virtual bool LoadFromResource(wxWindow *parent, const wxString& resourceName, const wxResourceTable *table = NULL);
|
||||
virtual wxControl *CreateItem(const wxItemResource *childResource, const wxResourceTable *table = NULL);
|
||||
#endif
|
||||
|
||||
// Native resource loading
|
||||
virtual bool LoadNativeDialog(wxWindow* parent, const wxWindowID& id);
|
||||
virtual bool LoadNativeDialog(wxWindow* parent, const wxString& name);
|
||||
virtual wxWindow* GetWindowChild1(const wxWindowID& id);
|
||||
virtual wxWindow* GetWindowChild(const wxWindowID& id);
|
||||
|
||||
virtual void GetTextExtent(const wxString& string, int *x, int *y,
|
||||
int *descent = NULL,
|
||||
int *externalLeading = NULL,
|
||||
const wxFont *theFont = NULL, const bool use16 = FALSE) const;
|
||||
#if WXWIN_COMPATIBILITY
|
||||
void GetTextExtent(const wxString& string, float *x, float *y,
|
||||
float *descent = NULL,
|
||||
float *externalLeading = NULL,
|
||||
const wxFont *theFont = NULL, const bool use16 = FALSE) const;
|
||||
#endif
|
||||
|
||||
// Gets 'context' member
|
||||
// OBSOLETE
|
||||
// TODO: how to make backward compatible?
|
||||
// inline wxDC *GetDC(void) const;
|
||||
|
||||
// Is the window retained?
|
||||
inline bool IsRetained(void) const;
|
||||
|
||||
// Set the window's colourmap/palette
|
||||
// OBSOLETE
|
||||
// virtual void SetPalette(wxPalette *palette);
|
||||
|
||||
// Warp the pointer the given position
|
||||
virtual void WarpPointer(const int x_pos, const int y_pos) ;
|
||||
|
||||
// Clear the window
|
||||
virtual void Clear(void);
|
||||
|
||||
// Find a window by id or name
|
||||
virtual wxWindow *FindWindow(const long id);
|
||||
virtual wxWindow *FindWindow(const wxString& name);
|
||||
|
||||
// Constraint operations
|
||||
bool Layout(void);
|
||||
void SetSizer(wxSizer *sizer); // Adds sizer child to this window
|
||||
inline wxSizer *GetSizer(void) const ;
|
||||
inline wxWindow *GetSizerParent(void) const ;
|
||||
inline void SetSizerParent(wxWindow *win);
|
||||
|
||||
// Do Update UI processing for controls
|
||||
void UpdateWindowUI(void);
|
||||
|
||||
void OnSize(wxSizeEvent& event);
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
void OnChar(wxKeyEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnIdle(wxIdleEvent& event);
|
||||
|
||||
// virtual void OnChangeFocus(wxControl *from, wxControl *to);
|
||||
// virtual bool OnFunctionKey(wxKeyEvent &event);
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
virtual void OldOnMenuSelect(int WXUNUSED(cmd));
|
||||
virtual void OldOnInitMenuPopup(int WXUNUSED(pos));
|
||||
virtual void OldOnScroll(wxCommandEvent& WXUNUSED(event));
|
||||
virtual void OldOnPaint(void); // Called when needs painting
|
||||
virtual void OldOnSize(int width, int height); // Called on resize
|
||||
virtual void OldOnMouseEvent(wxMouseEvent& event); // Called on mouse event
|
||||
virtual void OldOnChar(wxKeyEvent& event); // Called on character event
|
||||
virtual void OldOnMenuCommand(int cmd); // Dealt with properly in wxFrame
|
||||
inline virtual void OldOnMove(int WXUNUSED(x), int WXUNUSED(y)); // Called on move
|
||||
inline virtual void OldOnActivate(bool WXUNUSED(active)); // Called on window activation (MSW)
|
||||
virtual void OldOnSetFocus(void); // Called on setting focus
|
||||
virtual void OldOnKillFocus(void); // Called on killing focus
|
||||
#endif
|
||||
|
||||
/* THIS IS NOW OBSOLETE - all positions are in device units
|
||||
// Calculates the position of a point on the window
|
||||
// taking into account the position of scrollbars.
|
||||
// Windows doesn't automatically reflect the position of the
|
||||
// scrollbars - (0, 0) is always the top left of the visible window,
|
||||
// whereas in XView, (0, 0) moves according to scrollbar positions.
|
||||
virtual void CalcScrolledPosition(const int x, const int y, int *xx, int *yy) const ;
|
||||
|
||||
// Calculate logical (scroll-bar/scaling aware) position from
|
||||
// device (pixel) position
|
||||
virtual void CalcUnscrolledPosition(const int x, const int y, float *xx, float *yy) const ;
|
||||
*/
|
||||
|
||||
public:
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// IMPLEMENTATION
|
||||
|
||||
// Windows subclassing
|
||||
void SubclassWin(WXHWND hWnd);
|
||||
void UnsubclassWin(void);
|
||||
virtual long Default(void);
|
||||
virtual bool MSWCommand(const WXUINT param, const WXWORD id);
|
||||
virtual bool MSWNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
virtual wxWindow *FindItem(const int id) const;
|
||||
virtual wxWindow *FindItemByHWND(const WXHWND hWnd, bool controlOnly = FALSE) const ;
|
||||
virtual void PreDelete(const WXHDC dc); // Allows system cleanup
|
||||
// TO DO: how many of these need to be virtual?
|
||||
virtual WXHWND GetHWND(void) const ;
|
||||
virtual void SetHWND(WXHWND hWnd);
|
||||
|
||||
// Make a Windows extended style from the given wxWindows window style
|
||||
virtual WXDWORD MakeExtendedStyle(long style, bool eliminateBorders = TRUE);
|
||||
// Determine whether 3D effects are wanted
|
||||
virtual WXDWORD Determine3DEffects(WXDWORD defaultBorderStyle, bool *want3D);
|
||||
|
||||
virtual void AddChild(wxWindow *child); // Adds reference to the child object
|
||||
virtual void RemoveChild(wxWindow *child); // Removes reference to child
|
||||
// (but doesn't delete the child object)
|
||||
virtual void DestroyChildren(void); // Removes and destroys all children
|
||||
|
||||
inline bool IsBeingDeleted(void);
|
||||
|
||||
// MSW only: TRUE if this control is part of the main control
|
||||
virtual bool ContainsHWND(WXHWND WXUNUSED(hWnd)) const { return FALSE; };
|
||||
|
||||
// Constraint implementation
|
||||
void UnsetConstraints(wxLayoutConstraints *c);
|
||||
inline wxList *GetConstraintsInvolvedIn(void) const ;
|
||||
// Back-pointer to other windows we're involved with, so if we delete
|
||||
// this window, we must delete any constraints we're involved with.
|
||||
void AddConstraintReference(wxWindow *otherWin);
|
||||
void RemoveConstraintReference(wxWindow *otherWin);
|
||||
void DeleteRelatedConstraints(void);
|
||||
|
||||
virtual void ResetConstraints(void);
|
||||
virtual void SetConstraintSizes(const bool recurse = TRUE);
|
||||
virtual bool LayoutPhase1(int *noChanges);
|
||||
virtual bool LayoutPhase2(int *noChanges);
|
||||
virtual bool DoPhase(const int);
|
||||
// Transforms from sizer coordinate space to actual
|
||||
// parent coordinate space
|
||||
virtual void TransformSizerToActual(int *x, int *y) const ;
|
||||
|
||||
// Set size with transformation to actual coordinates if nec.
|
||||
virtual void SizerSetSize(const int x, const int y, const int w, const int h);
|
||||
virtual void SizerMove(const int x, const int y);
|
||||
|
||||
// Only set/get the size/position of the constraint (if any)
|
||||
virtual void SetSizeConstraint(const int x, const int y, const int w, const int h);
|
||||
virtual void MoveConstraint(const int x, const int y);
|
||||
virtual void GetSizeConstraint(int *w, int *h) const ;
|
||||
virtual void GetClientSizeConstraint(int *w, int *h) const ;
|
||||
virtual void GetPositionConstraint(int *x, int *y) const ;
|
||||
|
||||
wxObject *GetChild(const int number) const ;
|
||||
|
||||
void MSWCreate(const int id, wxWindow *parent, const char *wclass, wxWindow *wx_win, const char *title,
|
||||
const int x, const int y, const int width, const int height,
|
||||
const WXDWORD style, const char *dialog_template = NULL,
|
||||
const WXDWORD exendedStyle = 0);
|
||||
|
||||
// Actually defined in wx_canvs.cc since requires wxCanvas declaration
|
||||
virtual void MSWDeviceToLogical(float *x, float *y) const ;
|
||||
|
||||
// Create an appropriate wxWindow from a HWND
|
||||
virtual wxWindow* CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd);
|
||||
|
||||
// Make sure the window style reflects the HWND style (roughly)
|
||||
virtual void AdoptAttributesFromHWND(void);
|
||||
|
||||
// Setup background and foreground colours correctly
|
||||
virtual void SetupColours(void);
|
||||
|
||||
// Handlers
|
||||
virtual void MSWOnCreate(WXLPCREATESTRUCT cs);
|
||||
virtual bool MSWOnPaint(void);
|
||||
virtual WXHICON MSWOnQueryDragIcon(void) { return 0; }
|
||||
virtual void MSWOnSize(const int x, const int y, const WXUINT flag);
|
||||
virtual void MSWOnWindowPosChanging(void *lpPos);
|
||||
virtual void MSWOnHScroll(const WXWORD nSBCode, const WXWORD pos, const WXHWND control);
|
||||
virtual void MSWOnVScroll(const WXWORD nSBCode, const WXWORD pos, const WXHWND control);
|
||||
virtual bool MSWOnCommand(const WXWORD id, const WXWORD cmd, const WXHWND control);
|
||||
virtual long MSWOnSysCommand(WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWOnNotify(const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
virtual WXHBRUSH MSWOnCtlColor(const WXHDC dc, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
const WXUINT message, const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
virtual bool MSWOnColorChange(const WXHWND hWnd, const WXUINT message, const WXWPARAM wParam, const WXLPARAM lParam);
|
||||
virtual bool MSWOnEraseBkgnd(const WXHDC pDC);
|
||||
virtual void MSWOnMenuHighlight(const WXWORD item, const WXWORD flags, const WXHMENU sysmenu);
|
||||
virtual void MSWOnInitMenuPopup(const WXHMENU menu, const int pos, const bool isSystem);
|
||||
virtual bool MSWOnClose(void);
|
||||
virtual bool MSWOnDestroy(void);
|
||||
virtual bool MSWOnSetFocus(const WXHWND wnd);
|
||||
virtual bool MSWOnKillFocus(const WXHWND wnd);
|
||||
virtual void MSWOnDropFiles(const WXWPARAM wParam);
|
||||
virtual bool MSWOnInitDialog(WXHWND hWndFocus);
|
||||
virtual void MSWOnShow(bool show, int status);
|
||||
|
||||
// TODO: rationalise these functions into 1 or 2 which take the
|
||||
// event type as argument.
|
||||
virtual void MSWOnLButtonDown(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnLButtonUp(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnLButtonDClick(const int x, const int y, const WXUINT flags);
|
||||
|
||||
virtual void MSWOnMButtonDown(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnMButtonUp(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnMButtonDClick(const int x, const int y, const WXUINT flags);
|
||||
|
||||
virtual void MSWOnRButtonDown(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnRButtonUp(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnRButtonDClick(const int x, const int y, const WXUINT flags);
|
||||
|
||||
virtual void MSWOnMouseMove(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnMouseEnter(const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnMouseLeave(const int x, const int y, const WXUINT flags);
|
||||
|
||||
virtual void MSWOnChar(const WXWORD wParam, const WXLPARAM lParam, const bool isASCII = FALSE);
|
||||
|
||||
virtual bool MSWOnActivate(const int flag, const bool minimized, const WXHWND activate);
|
||||
virtual long MSWOnMDIActivate(const long flag, const WXHWND activate, const WXHWND deactivate);
|
||||
|
||||
virtual bool MSWOnDrawItem(const int id, WXDRAWITEMSTRUCT *item);
|
||||
virtual bool MSWOnMeasureItem(const int id, WXMEASUREITEMSTRUCT *item);
|
||||
|
||||
virtual void MSWOnJoyDown(const int joystick, const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnJoyUp(const int joystick, const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnJoyMove(const int joystick, const int x, const int y, const WXUINT flags);
|
||||
virtual void MSWOnJoyZMove(const int joystick, const int z, const WXUINT flags);
|
||||
|
||||
// Window procedure
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
// Calls an appropriate default window procedure
|
||||
virtual long MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool MSWProcessMessage(WXMSG* pMsg);
|
||||
virtual void MSWDestroyWindow(void);
|
||||
|
||||
// Detach "Window" menu from menu bar so it doesn't get deleted
|
||||
void MSWDetachWindowMenu(void);
|
||||
|
||||
inline WXFARPROC MSWGetOldWndProc() const;
|
||||
inline void MSWSetOldWndProc(const WXFARPROC proc);
|
||||
|
||||
// Define for each class of dialog and control
|
||||
virtual WXHBRUSH OnCtlColor(const WXHDC pDC, const WXHWND pWnd, const WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
inline void SetShowing(const bool show);
|
||||
inline bool IsUserEnabled(void) const;
|
||||
inline bool GetUseCtl3D(void) const ;
|
||||
inline bool GetTransparentBackground(void) const ;
|
||||
|
||||
// Responds to colour changes: passes event on to children.
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
|
||||
// Transfers data to any child controls
|
||||
void OnInitDialog(wxInitDialogEvent& event);
|
||||
|
||||
// Sends an OnInitDialog event, which in turns transfers data to
|
||||
// to the window via validators.
|
||||
virtual void InitDialog(void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// PROTECTED DATA
|
||||
protected:
|
||||
int m_windowId;
|
||||
long m_windowStyle; // Store the window's style
|
||||
wxEvtHandler * m_windowEventHandler; // Usually is 'this'
|
||||
wxLayoutConstraints * m_constraints; // Constraints for this window
|
||||
wxList * m_constraintsInvolvedIn; // List of constraints we're involved in
|
||||
wxSizer * m_windowSizer; // Window's top-level sizer (if any)
|
||||
wxWindow * m_sizerParent; // Window's parent sizer (if any)
|
||||
bool m_autoLayout; // Whether to call Layout() in OnSize
|
||||
wxWindow * m_windowParent; // Each window always knows its parent
|
||||
wxValidator * m_windowValidator;
|
||||
// Old window proc, for subclassed controls
|
||||
WXFARPROC m_oldWndProc;
|
||||
bool m_useCtl3D; // Using CTL3D for this control
|
||||
|
||||
bool m_inOnSize; // Protection against OnSize reentry
|
||||
#ifndef __WIN32__
|
||||
// Pointer to global memory, for EDIT controls that need
|
||||
// special treatment to reduce USER area consumption.
|
||||
WXHGLOBAL m_globalHandle;
|
||||
#endif
|
||||
|
||||
bool m_winEnabled;
|
||||
int m_minSizeX;
|
||||
int m_minSizeY;
|
||||
int m_maxSizeX;
|
||||
int m_maxSizeY;
|
||||
|
||||
// Caret data
|
||||
int m_caretWidth;
|
||||
int m_caretHeight;
|
||||
bool m_caretEnabled;
|
||||
bool m_caretShown;
|
||||
|
||||
// Device context being stored whilst drawing is done
|
||||
// WXHDC m_tempHDC;
|
||||
// Temporary device context stored during an OnPaint
|
||||
// WXHDC m_paintHDC;
|
||||
wxFont m_windowFont; // Window's font
|
||||
bool m_isShown;
|
||||
bool m_doubleClickAllowed ;
|
||||
wxCursor m_windowCursor; // Window's cursor
|
||||
bool m_winCaptured;
|
||||
wxString m_windowName; // Window name
|
||||
|
||||
#if USE_EXTENDED_STATICS
|
||||
wxList m_staticItems;
|
||||
#endif
|
||||
|
||||
wxButton * m_defaultItem;
|
||||
|
||||
wxColour m_backgroundColour ;
|
||||
wxColour m_defaultBackgroundColour;
|
||||
|
||||
wxColour m_foregroundColour ;
|
||||
wxColour m_defaultForegroundColour;
|
||||
|
||||
bool m_backgroundTransparent;
|
||||
|
||||
// wxDC * m_windowDC; // The canvas's device context
|
||||
|
||||
int m_xThumbSize;
|
||||
int m_yThumbSize;
|
||||
|
||||
float m_lastXPos;
|
||||
float m_lastYPos;
|
||||
int m_lastEvent;
|
||||
|
||||
bool m_mouseInWindow;
|
||||
|
||||
#if USE_DRAG_AND_DROP
|
||||
wxDropTarget *m_pDropTarget; // the current drop target or NULL
|
||||
#endif //USE_DRAG_AND_DROP
|
||||
|
||||
public:
|
||||
WXHWND m_hWnd; // MS Windows window handle
|
||||
WXUINT m_lastMsg;
|
||||
WXWPARAM m_lastWParam;
|
||||
WXLPARAM m_lastLParam;
|
||||
wxRectangle m_updateRect; // Bounding box for screen damage area
|
||||
#ifdef __WIN32__
|
||||
WXHRGN m_updateRgn; // NT allows access to the rectangle list
|
||||
#endif
|
||||
WXHANDLE m_acceleratorTable;
|
||||
WXHMENU m_hMenu; // Menu, if any
|
||||
wxList * m_children; // Window's children
|
||||
int m_returnCode;
|
||||
bool m_isBeingDeleted; // Fudge because can't access parent
|
||||
// when being deleted
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//// INLINES
|
||||
|
||||
inline void *wxWindow::GetHandle(void) const { return (void *)GetHWND(); }
|
||||
inline int wxWindow::GetId() const { return m_windowId; }
|
||||
inline void wxWindow::SetId(const int id) { m_windowId = id; }
|
||||
inline wxWindow *wxWindow::GetParent(void) const { return m_windowParent; }
|
||||
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
|
||||
inline wxWindow *wxWindow::GetGrandParent(void) const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); }
|
||||
inline wxList *wxWindow::GetChildren() const { return m_children; }
|
||||
inline wxFont *wxWindow::GetFont(void) const { return (wxFont *) & m_windowFont; }
|
||||
inline wxString wxWindow::GetName(void) const { return m_windowName; }
|
||||
inline void wxWindow::SetName(const wxString& name) { m_windowName = name; }
|
||||
inline long wxWindow::GetWindowStyleFlag(void) const { return m_windowStyle; }
|
||||
inline void wxWindow::SetWindowStyleFlag(const long flag) { m_windowStyle = flag; }
|
||||
inline void wxWindow::SetDoubleClick(const bool flag) { m_doubleClickAllowed = flag; }
|
||||
inline bool wxWindow::GetDoubleClick(void) const { return m_doubleClickAllowed; }
|
||||
inline void wxWindow::SetEventHandler(wxEvtHandler *handler) { m_windowEventHandler = handler; }
|
||||
inline wxEvtHandler *wxWindow::GetEventHandler(void) const { return m_windowEventHandler; }
|
||||
inline void wxWindow::SetAutoLayout(const bool a) { m_autoLayout = a; }
|
||||
inline bool wxWindow::GetAutoLayout(void) const { return m_autoLayout; }
|
||||
inline wxLayoutConstraints *wxWindow::GetConstraints(void) const { return m_constraints; }
|
||||
inline void wxWindow::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; };
|
||||
inline wxColour wxWindow::GetBackgroundColour(void) const { return m_backgroundColour; };
|
||||
inline void wxWindow::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; };
|
||||
inline wxColour wxWindow::GetForegroundColour(void) const { return m_foregroundColour; };
|
||||
inline void wxWindow::SetDefaultForegroundColour(const wxColour& col) { m_defaultForegroundColour = col; };
|
||||
inline wxColour wxWindow::GetDefaultForegroundColour(void) const { return m_defaultForegroundColour; };
|
||||
inline void wxWindow::SetDefaultBackgroundColour(const wxColour& col) { m_defaultBackgroundColour = col; };
|
||||
inline wxColour wxWindow::GetDefaultBackgroundColour(void) const { return m_defaultBackgroundColour; };
|
||||
|
||||
inline wxButton *wxWindow::GetDefaultItem(void) const { return m_defaultItem; }
|
||||
inline void wxWindow::SetDefaultItem(wxButton *but) { m_defaultItem = but; }
|
||||
// inline wxDC *wxWindow::GetDC(void) const { return m_windowDC; }
|
||||
inline bool wxWindow::IsRetained(void) const { return ((m_windowStyle & wxRETAINED) == wxRETAINED); }
|
||||
#if WXWIN_COMPATIBILITY
|
||||
inline void wxWindow::OldOnMenuSelect(int WXUNUSED(cmd)) { Default(); };
|
||||
inline void wxWindow::OldOnInitMenuPopup(int WXUNUSED(pos)) { Default(); };
|
||||
inline void wxWindow::OldOnScroll(wxCommandEvent& WXUNUSED(event)) { Default(); };
|
||||
inline void wxWindow::OldOnMenuCommand(int WXUNUSED(cmd)) { Default(); } // Dealt with properly in wxFrame
|
||||
inline void wxWindow::OldOnMove(int WXUNUSED(x), int WXUNUSED(y)) { Default(); }; // Called on move
|
||||
inline void wxWindow::OldOnActivate(bool WXUNUSED(active)) { Default(); }; // Called on window activation (MSW)
|
||||
#endif
|
||||
inline void wxWindow::SetShowing(const bool show) { m_isShown = show; }
|
||||
inline wxList *wxWindow::GetConstraintsInvolvedIn(void) const { return m_constraintsInvolvedIn; }
|
||||
inline wxSizer *wxWindow::GetSizer(void) const { return m_windowSizer; }
|
||||
inline wxWindow *wxWindow::GetSizerParent(void) const { return m_sizerParent; }
|
||||
inline void wxWindow::SetSizerParent(wxWindow *win) { m_sizerParent = win; }
|
||||
inline WXFARPROC wxWindow::MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||
inline void wxWindow::MSWSetOldWndProc(const WXFARPROC proc) { m_oldWndProc = proc; }
|
||||
inline wxValidator *wxWindow::GetValidator(void) const { return m_windowValidator; }
|
||||
inline bool wxWindow::IsUserEnabled(void) const { return m_winEnabled; }
|
||||
inline bool wxWindow::GetUseCtl3D(void) const { return m_useCtl3D; }
|
||||
inline bool wxWindow::GetTransparentBackground(void) const { return m_backgroundTransparent; }
|
||||
inline void wxWindow::SetReturnCode(int retCode) { m_returnCode = retCode; }
|
||||
inline int wxWindow::GetReturnCode(void) { return m_returnCode; }
|
||||
inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
|
||||
|
||||
// Window specific (so far)
|
||||
wxWindow* WXDLLEXPORT wxGetActiveWindow(void);
|
||||
|
||||
// Allows iteration through damaged rectangles in OnPaint
|
||||
class WXDLLEXPORT wxUpdateIterator
|
||||
{
|
||||
int rects; // How many rects in Update region
|
||||
int current; // Current rectangle index
|
||||
void *rp; // current rectangle
|
||||
#ifdef __WIN32__
|
||||
WXRGNDATA *rlist; // Storage for regiondata
|
||||
#endif
|
||||
|
||||
public:
|
||||
wxUpdateIterator(wxWindow* wnd);
|
||||
~wxUpdateIterator(void);
|
||||
|
||||
operator int (void);
|
||||
wxUpdateIterator* operator ++(int);
|
||||
void GetRect(wxRectangle *rect);
|
||||
int GetX();
|
||||
int GetY();
|
||||
int GetW();
|
||||
int GetH();
|
||||
};
|
||||
|
||||
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;
|
||||
|
||||
int WXDLLEXPORT wxCharCodeMSWToWX(int keySym);
|
||||
int WXDLLEXPORT wxCharCodeWXToMSW(int id, bool *IsVirtual);
|
||||
|
||||
// Allocates control ids
|
||||
int WXDLLEXPORT NewControlId(void);
|
||||
|
||||
#endif
|
||||
// __WINDOWH__
|
110
include/wx/msw/wx.rc
Normal file
@@ -0,0 +1,110 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// File: wx.rc
|
||||
// Purpose: wxWindows resource definitions. ALWAYS include
|
||||
// this in your application resource file.
|
||||
//
|
||||
// wxWindows version 1.50
|
||||
// Copyright (c) 1993 Artificial Intelligence Applications Institute,
|
||||
// The University of Edinburgh
|
||||
//
|
||||
// Author: Julian Smart
|
||||
// Date: 9-4-93
|
||||
//
|
||||
// Permission to use, copy, modify, and distribute this software and its
|
||||
// documentation for any purpose is hereby granted without fee, provided
|
||||
// that the above copyright notice, author statement and this permission
|
||||
// notice appear in all copies of this software and related documentation.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
|
||||
// IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
|
||||
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
|
||||
// UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
|
||||
// CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
// LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
|
||||
// DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
|
||||
// THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
#ifdef __GNUWIN32__
|
||||
#include <wx/msw/gnuwin32/winresrc.h>
|
||||
#else
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dummy Dialog for all wxCAPTION Dialog boxes
|
||||
//
|
||||
|
||||
wxCaptionDialog DIALOG DISCARDABLE 34, 22, 144, 75
|
||||
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Dummy dialog"
|
||||
BEGIN
|
||||
LTEXT "", -1,-2,-2,1,1 //necessary for __WATCOMC__
|
||||
END
|
||||
|
||||
//
|
||||
// Dummy dialog for dialog boxes without caption & with thin frame
|
||||
//
|
||||
wxNoCaptionDialog DIALOG 34, 22, 144, 75
|
||||
STYLE WS_POPUP
|
||||
BEGIN
|
||||
LTEXT "", -1,-2,-2,1,1 //necessary for __WATCOMC__
|
||||
END
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// This is the MDI Window menu
|
||||
//
|
||||
|
||||
wxWindowMenu MENU DISCARDABLE
|
||||
BEGIN
|
||||
POPUP "&Window"
|
||||
BEGIN
|
||||
MENUITEM "&Cascade", 4002
|
||||
MENUITEM "&Tile", 4001
|
||||
MENUITEM "&Arrange icons", 4003
|
||||
MENUITEM "&Next", 4004
|
||||
END
|
||||
END
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Standard wxWindows Cursors
|
||||
//
|
||||
|
||||
WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur"
|
||||
WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur"
|
||||
WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur"
|
||||
WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur"
|
||||
WXCURSOR_NO_ENTRY CURSOR DISCARDABLE "wx/msw/noentry.cur"
|
||||
WXCURSOR_SIZING CURSOR DISCARDABLE "wx/msw/size.cur"
|
||||
WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur"
|
||||
WXCURSOR_WATCH CURSOR DISCARDABLE "wx/msw/watch1.cur"
|
||||
WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur"
|
||||
WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur"
|
||||
WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur"
|
||||
WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur"
|
||||
WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Default Icons
|
||||
//
|
||||
|
||||
wxDEFAULT_FRAME ICON "wx/msw/std.ico"
|
||||
wxDEFAULT_MDIPARENTFRAME ICON "wx/msw/mdi.ico"
|
||||
wxDEFAULT_MDICHILDFRAME ICON "wx/msw/child.ico"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Bitmaps
|
||||
//
|
||||
|
||||
wxDISABLE_BUTTON_BITMAP BITMAP "wx/msw/disable.bmp"
|
||||
|
||||
|
1214
src/common/doslex.c
Normal file
517
src/common/dosyacc.c
Normal file
@@ -0,0 +1,517 @@
|
||||
#ifndef lint
|
||||
static char yysccsid[] = "@(#)yaccpar 1.7 (Berkeley) 09/09/90";
|
||||
#endif
|
||||
#define YYBYACC 1
|
||||
#line 2 "parser.y"
|
||||
#include "string.h"
|
||||
#include "wx/expr.h"
|
||||
|
||||
#ifndef __EXTERN_C__
|
||||
#define __EXTERN_C__ 1
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || defined(__STDC__)
|
||||
#if defined(__cplusplus) && defined(__EXTERN_C__)
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
int yylex(void);
|
||||
int yylook(void);
|
||||
int yywrap(void);
|
||||
int yyback(int *, int);
|
||||
|
||||
/* You may need to put /DLEX_SCANNER in your makefile
|
||||
* if you're using LEX!
|
||||
Last change: JS 13 Jul 97 6:12 pm
|
||||
*/
|
||||
#ifdef LEX_SCANNER
|
||||
/* int yyoutput(int); */
|
||||
void yyoutput(int);
|
||||
#else
|
||||
void yyoutput(int);
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || defined(__STDC__)
|
||||
#if defined(__cplusplus) && defined(__EXTERN_C__)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#line 36 "parser.y"
|
||||
typedef union {
|
||||
char *s;
|
||||
/* struct pexpr *expr; */
|
||||
} YYSTYPE;
|
||||
#line 44 "y_tab.c"
|
||||
#define INTEGER 1
|
||||
#define WORD 2
|
||||
#define STRING 3
|
||||
#define PERIOD 13
|
||||
#define OPEN 4
|
||||
#define CLOSE 5
|
||||
#define COMMA 6
|
||||
#define NEWLINE 7
|
||||
#define ERROR 8
|
||||
#define OPEN_SQUARE 9
|
||||
#define CLOSE_SQUARE 10
|
||||
#define EQUALS 11
|
||||
#define EXP 14
|
||||
#define YYERRCODE 256
|
||||
short yylhs[] = { -1,
|
||||
0, 0, 1, 1, 1, 2, 2, 2, 3, 3,
|
||||
3, 4, 4, 5, 5, 5, 5, 5, 5, 5,
|
||||
};
|
||||
short yylen[] = { 2,
|
||||
0, 2, 2, 2, 2, 4, 2, 3, 0, 1,
|
||||
3, 3, 1, 1, 1, 1, 3, 3, 5, 1,
|
||||
};
|
||||
short yydefred[] = { 1,
|
||||
0, 0, 0, 0, 2, 0, 5, 3, 0, 0,
|
||||
0, 15, 7, 20, 0, 0, 13, 4, 0, 0,
|
||||
0, 0, 8, 0, 6, 0, 18, 0, 12, 11,
|
||||
0, 19,
|
||||
};
|
||||
short yydgoto[] = { 1,
|
||||
5, 14, 15, 16, 17,
|
||||
};
|
||||
short yysindex[] = { 0,
|
||||
-2, 9, 2, 1, 0, 10, 0, 0, 11, -5,
|
||||
17, 0, 0, 0, 14, -1, 0, 0, 33, 38,
|
||||
41, 16, 0, 11, 0, 29, 0, 40, 0, 0,
|
||||
44, 0,
|
||||
};
|
||||
short yyrindex[] = { 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 42, 21,
|
||||
24, 0, 0, 0, 0, 30, 0, 0, 0, 0,
|
||||
0, 0, 0, 31, 0, 27, 0, 24, 0, 0,
|
||||
0, 0,
|
||||
};
|
||||
short yygindex[] = { 0,
|
||||
0, 45, -8, 0, 26,
|
||||
};
|
||||
#define YYTABLESIZE 254
|
||||
short yytable[] = { 3,
|
||||
19, 10, 11, 12, 24, 9, 4, 20, 21, 4,
|
||||
13, 10, 11, 12, 8, 30, 10, 28, 12, 4,
|
||||
9, 7, 18, 23, 4, 16, 16, 22, 14, 14,
|
||||
16, 17, 17, 14, 10, 9, 17, 25, 26, 10,
|
||||
9, 27, 31, 9, 32, 6, 9, 29, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 2,
|
||||
};
|
||||
short yycheck[] = { 2,
|
||||
9, 1, 2, 3, 6, 4, 9, 13, 14, 9,
|
||||
10, 1, 2, 3, 13, 24, 1, 2, 3, 9,
|
||||
4, 13, 13, 10, 9, 5, 6, 11, 5, 6,
|
||||
10, 5, 6, 10, 5, 5, 10, 5, 1, 10,
|
||||
10, 1, 14, 4, 1, 1, 5, 22, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
|
||||
-1, -1, -1, 256,
|
||||
};
|
||||
#define YYFINAL 1
|
||||
#ifndef YYDEBUG
|
||||
#define YYDEBUG 0
|
||||
#endif
|
||||
#define YYMAXTOKEN 14
|
||||
#if YYDEBUG
|
||||
char *yyname[] = {
|
||||
"end-of-file","INTEGER","WORD","STRING","OPEN","CLOSE","COMMA","NEWLINE",
|
||||
"ERROR","OPEN_SQUARE","CLOSE_SQUARE","EQUALS",0,"PERIOD","EXP",
|
||||
};
|
||||
char *yyrule[] = {
|
||||
"$accept : commands",
|
||||
"commands :",
|
||||
"commands : commands command",
|
||||
"command : WORD PERIOD",
|
||||
"command : expr PERIOD",
|
||||
"command : error PERIOD",
|
||||
"expr : WORD OPEN arglist CLOSE",
|
||||
"expr : OPEN_SQUARE CLOSE_SQUARE",
|
||||
"expr : OPEN_SQUARE arglist CLOSE_SQUARE",
|
||||
"arglist :",
|
||||
"arglist : arg",
|
||||
"arglist : arg COMMA arglist",
|
||||
"arg : WORD EQUALS arg1",
|
||||
"arg : arg1",
|
||||
"arg1 : WORD",
|
||||
"arg1 : STRING",
|
||||
"arg1 : INTEGER",
|
||||
"arg1 : INTEGER PERIOD INTEGER",
|
||||
"arg1 : INTEGER EXP INTEGER",
|
||||
"arg1 : INTEGER PERIOD INTEGER EXP INTEGER",
|
||||
"arg1 : expr",
|
||||
};
|
||||
#endif
|
||||
#define yyclearin (yychar=(-1))
|
||||
#define yyerrok (yyerrflag=0)
|
||||
#ifdef YYSTACKSIZE
|
||||
#ifndef YYMAXDEPTH
|
||||
#define YYMAXDEPTH YYSTACKSIZE
|
||||
#endif
|
||||
#else
|
||||
#ifdef YYMAXDEPTH
|
||||
#define YYSTACKSIZE YYMAXDEPTH
|
||||
#else
|
||||
#define YYSTACKSIZE 600
|
||||
#define YYMAXDEPTH 600
|
||||
#endif
|
||||
#endif
|
||||
int yydebug;
|
||||
int yynerrs;
|
||||
int yyerrflag;
|
||||
int yychar;
|
||||
short *yyssp;
|
||||
YYSTYPE *yyvsp;
|
||||
YYSTYPE yyval;
|
||||
YYSTYPE yylval;
|
||||
short yyss[YYSTACKSIZE];
|
||||
YYSTYPE yyvs[YYSTACKSIZE];
|
||||
#define yystacksize YYSTACKSIZE
|
||||
#line 118 "parser.y"
|
||||
|
||||
#include "../common/lex_yy.c"
|
||||
|
||||
/*
|
||||
void yyerror(s)
|
||||
char *s;
|
||||
{
|
||||
syntax_error(s);
|
||||
}
|
||||
*/
|
||||
|
||||
/* Ansi prototype. If this doesn't work for you... uncomment
|
||||
the above instead.
|
||||
*/
|
||||
|
||||
void yyerror(char *s)
|
||||
{
|
||||
syntax_error(s);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unfortunately, my DOS version of FLEX
|
||||
* requires yywrap to be #def'ed, whereas
|
||||
* the UNIX flex expects a proper function.
|
||||
*/
|
||||
|
||||
/* Not sure if __SC__ is the appropriate thing
|
||||
* to test
|
||||
*/
|
||||
|
||||
#ifndef __SC__
|
||||
#ifdef USE_DEFINE
|
||||
#ifndef yywrap
|
||||
#define yywrap() 1
|
||||
#endif
|
||||
#else
|
||||
int yywrap() { return 1; }
|
||||
#endif
|
||||
#endif
|
||||
#line 247 "y_tab.c"
|
||||
#define YYABORT goto yyabort
|
||||
#define YYACCEPT goto yyaccept
|
||||
#define YYERROR goto yyerrlab
|
||||
int
|
||||
yyparse()
|
||||
{
|
||||
register int yym, yyn, yystate;
|
||||
#if YYDEBUG
|
||||
register char *yys;
|
||||
extern char *getenv();
|
||||
|
||||
if (yys = getenv("YYDEBUG"))
|
||||
{
|
||||
yyn = *yys;
|
||||
if (yyn >= '0' && yyn <= '9')
|
||||
yydebug = yyn - '0';
|
||||
}
|
||||
#endif
|
||||
|
||||
yynerrs = 0;
|
||||
yyerrflag = 0;
|
||||
yychar = (-1);
|
||||
|
||||
yyssp = yyss;
|
||||
yyvsp = yyvs;
|
||||
*yyssp = yystate = 0;
|
||||
|
||||
yyloop:
|
||||
if (yyn = yydefred[yystate]) goto yyreduce;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = yylex()) < 0) yychar = 0;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = 0;
|
||||
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
||||
if (!yys) yys = "illegal-symbol";
|
||||
printf("yydebug: state %d, reading %d (%s)\n", yystate,
|
||||
yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: state %d, shifting to state %d\n",
|
||||
yystate, yytable[yyn]);
|
||||
#endif
|
||||
if (yyssp >= yyss + yystacksize - 1)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
*++yyssp = yystate = yytable[yyn];
|
||||
*++yyvsp = yylval;
|
||||
yychar = (-1);
|
||||
if (yyerrflag > 0) --yyerrflag;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
|
||||
{
|
||||
yyn = yytable[yyn];
|
||||
goto yyreduce;
|
||||
}
|
||||
if (yyerrflag) goto yyinrecovery;
|
||||
#ifdef lint
|
||||
goto yynewerror;
|
||||
#endif
|
||||
yynewerror:
|
||||
yyerror("syntax error");
|
||||
#ifdef lint
|
||||
goto yyerrlab;
|
||||
#endif
|
||||
yyerrlab:
|
||||
++yynerrs;
|
||||
yyinrecovery:
|
||||
if (yyerrflag < 3)
|
||||
{
|
||||
yyerrflag = 3;
|
||||
for (;;)
|
||||
{
|
||||
if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: state %d, error recovery shifting\
|
||||
to state %d\n", *yyssp, yytable[yyn]);
|
||||
#endif
|
||||
if (yyssp >= yyss + yystacksize - 1)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
*++yyssp = yystate = yytable[yyn];
|
||||
*++yyvsp = yylval;
|
||||
goto yyloop;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: error recovery discarding state %d\n",
|
||||
*yyssp);
|
||||
#endif
|
||||
if (yyssp <= yyss) goto yyabort;
|
||||
--yyssp;
|
||||
--yyvsp;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (yychar == 0) goto yyabort;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = 0;
|
||||
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
||||
if (!yys) yys = "illegal-symbol";
|
||||
printf("yydebug: state %d, error recovery discards token %d (%s)\n",
|
||||
yystate, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
yychar = (-1);
|
||||
goto yyloop;
|
||||
}
|
||||
yyreduce:
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: state %d, reducing by rule %d (%s)\n",
|
||||
yystate, yyn, yyrule[yyn]);
|
||||
#endif
|
||||
yym = yylen[yyn];
|
||||
yyval = yyvsp[1-yym];
|
||||
switch (yyn)
|
||||
{
|
||||
case 3:
|
||||
#line 68 "parser.y"
|
||||
{process_command(proio_cons(make_word(yyvsp[-1].s), NULL)); free(yyvsp[-1].s);}
|
||||
break;
|
||||
case 4:
|
||||
#line 70 "parser.y"
|
||||
{process_command(yyvsp[-1].s);}
|
||||
break;
|
||||
case 5:
|
||||
#line 72 "parser.y"
|
||||
{syntax_error("Unrecognized command.");}
|
||||
break;
|
||||
case 6:
|
||||
#line 76 "parser.y"
|
||||
{yyval.s = proio_cons(make_word(yyvsp[-3].s), yyvsp[-1].s); free(yyvsp[-3].s);}
|
||||
break;
|
||||
case 7:
|
||||
#line 78 "parser.y"
|
||||
{yyval.s = proio_cons(NULL, NULL);}
|
||||
break;
|
||||
case 8:
|
||||
#line 80 "parser.y"
|
||||
{yyval.s = yyvsp[-1].s; }
|
||||
break;
|
||||
case 9:
|
||||
#line 84 "parser.y"
|
||||
{yyval.s = NULL;}
|
||||
break;
|
||||
case 10:
|
||||
#line 86 "parser.y"
|
||||
{yyval.s = proio_cons(yyvsp[0].s, NULL);}
|
||||
break;
|
||||
case 11:
|
||||
#line 89 "parser.y"
|
||||
{yyval.s = proio_cons(yyvsp[-2].s, yyvsp[0].s);}
|
||||
break;
|
||||
case 12:
|
||||
#line 93 "parser.y"
|
||||
{yyval.s = proio_cons(make_word("="), proio_cons(make_word(yyvsp[-2].s), proio_cons(yyvsp[0].s, NULL)));
|
||||
free(yyvsp[-2].s); }
|
||||
break;
|
||||
case 13:
|
||||
#line 96 "parser.y"
|
||||
{yyval.s = yyvsp[0].s; }
|
||||
break;
|
||||
case 14:
|
||||
#line 99 "parser.y"
|
||||
{yyval.s = make_word(yyvsp[0].s); free(yyvsp[0].s);}
|
||||
break;
|
||||
case 15:
|
||||
#line 101 "parser.y"
|
||||
{yyval.s = make_string(yyvsp[0].s); free(yyvsp[0].s);}
|
||||
break;
|
||||
case 16:
|
||||
#line 103 "parser.y"
|
||||
{yyval.s = make_integer(yyvsp[0].s); free(yyvsp[0].s);}
|
||||
break;
|
||||
case 17:
|
||||
#line 105 "parser.y"
|
||||
{yyval.s = make_real(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
|
||||
break;
|
||||
case 18:
|
||||
#line 107 "parser.y"
|
||||
{yyval.s = make_exp(yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-2].s); free(yyvsp[0].s); }
|
||||
break;
|
||||
case 19:
|
||||
#line 110 "parser.y"
|
||||
{yyval.s = make_exp2(yyvsp[-4].s, yyvsp[-2].s, yyvsp[0].s); free(yyvsp[-4].s); free(yyvsp[-2].s);
|
||||
free(yyvsp[0].s); }
|
||||
break;
|
||||
case 20:
|
||||
#line 114 "parser.y"
|
||||
{yyval.s = yyvsp[0].s;}
|
||||
break;
|
||||
#line 461 "y_tab.c"
|
||||
}
|
||||
yyssp -= yym;
|
||||
yystate = *yyssp;
|
||||
yyvsp -= yym;
|
||||
yym = yylhs[yyn];
|
||||
if (yystate == 0 && yym == 0)
|
||||
{
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: after reduction, shifting from state 0 to\
|
||||
state %d\n", YYFINAL);
|
||||
#endif
|
||||
yystate = YYFINAL;
|
||||
*++yyssp = YYFINAL;
|
||||
*++yyvsp = yyval;
|
||||
if (yychar < 0)
|
||||
{
|
||||
if ((yychar = yylex()) < 0) yychar = 0;
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
{
|
||||
yys = 0;
|
||||
if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
|
||||
if (!yys) yys = "illegal-symbol";
|
||||
printf("yydebug: state %d, reading %d (%s)\n",
|
||||
YYFINAL, yychar, yys);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (yychar == 0) goto yyaccept;
|
||||
goto yyloop;
|
||||
}
|
||||
if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
|
||||
yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
|
||||
yystate = yytable[yyn];
|
||||
else
|
||||
yystate = yydgoto[yym];
|
||||
#if YYDEBUG
|
||||
if (yydebug)
|
||||
printf("yydebug: after reduction, shifting from state %d \
|
||||
to state %d\n", *yyssp, yystate);
|
||||
#endif
|
||||
if (yyssp >= yyss + yystacksize - 1)
|
||||
{
|
||||
goto yyoverflow;
|
||||
}
|
||||
*++yyssp = yystate;
|
||||
*++yyvsp = yyval;
|
||||
goto yyloop;
|
||||
yyoverflow:
|
||||
yyerror("yacc stack overflow");
|
||||
yyabort:
|
||||
return (1);
|
||||
yyaccept:
|
||||
return (0);
|
||||
}
|
15
src/cygnus.bat
Normal file
@@ -0,0 +1,15 @@
|
||||
rem Cygnus Gnu-Win32 environment variables
|
||||
rem Assumes that compiler and wxWindows are installed on the g: drive.
|
||||
rem
|
||||
set WXWIN=d:\wx2
|
||||
path C:\WINDOWS;C:\WINDOWS\COMMAND;g:\gnuwin32\b19\H-i386-cygwin32\bin;g:\gnuwin32\b19\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2-970404;c:\bin;g:\gnuwin32\b19\tcl\bin
|
||||
set GCC_EXEC_PREFIX=G:\gnuwin32\b19\H-i386-cygwin32\lib\gcc-lib\
|
||||
set RCINCLUDE=%WXWIN\include
|
||||
set CPLUS_INCLUDE_PATH=/g/gnuwin32/b19/h-i386-cygwin32/i386-cygwin32/include:/g/gnuwin32/b19/include/g++:/g/gnuwin32/b19/H-i386-cygwin32/lib/gcc-lib/i386-cygwin32/cygnus-2.7.2-970404/include:/d/wx2/include:/g/gnuwin32/b19/include/g++
|
||||
set MAKE_MODE=unix
|
||||
mount G: /g
|
||||
mount D: /d
|
||||
|
||||
rem 4DOS users only...
|
||||
unalias make
|
||||
alias makegnu make -f makefile.g95
|
36
src/makeb32.env
Normal file
@@ -0,0 +1,36 @@
|
||||
# Common settings for Borland 32-bit compilation (makefile.b32 files)
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
CFG = $(WXDIR)\src\msw\wxwin32.cfg
|
||||
WXLIBDIR = $(WXDIR)\lib
|
||||
WXINC = $(WXDIR)\include
|
||||
WIN95FLAG = -D__WIN95__
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
!ifndef DEBUG
|
||||
DEBUG=1
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v -DDEBUG=$(DEBUG) -DUSE_DEFINE
|
||||
!else
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS = -DDEBUG=$(DEBUG) -DUSE_DEFINE
|
||||
!endif
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
LIBTARGET= $(WXLIBDIR)\wx32.lib
|
||||
DUMMY=dummy
|
||||
|
||||
SRCSUFF = cpp
|
||||
OBJSUFF = obj
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc32 $(CPPFLAGS) -c {$< }
|
||||
|
||||
.c.obj:
|
||||
bcc32 $(CPPFLAGS) -P- -c {$< }
|
37
src/makebcc.env
Normal file
@@ -0,0 +1,37 @@
|
||||
# Common settings for Borland 16-bit compilation (makefile.bcc files)
|
||||
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
CFG = $(WXDIR)\src\wxwin.cfg
|
||||
WXLIB = $(WXDIR)\lib
|
||||
WXINC = $(WXDIR)\include\msw
|
||||
WXBASEINC = $(WXDIR)\include\base
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
!ifndef DEBUG
|
||||
DEBUG=0
|
||||
!endif
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
LINKFLAGS=/v/Vt /Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v
|
||||
!else
|
||||
LINKFLAGS=/Twe /L$(WXDIR)\lib;$(BCCDIR)\lib
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS =
|
||||
!endif
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
CPPFLAGS=$(DEBUG_FLAGS) $(OPT) @$(CFG)
|
||||
|
||||
LIBTARGET= $(WXLIB)\wx.lib
|
||||
|
||||
SRCSUFF = cpp
|
||||
OBJSUFF = obj
|
||||
|
||||
.$(SRCSUFF).obj:
|
||||
bcc $(CPPFLAGS) -c {$< }
|
97
src/makefile.bcc
Normal file
@@ -0,0 +1,97 @@
|
||||
#
|
||||
# File: makefile.bcc
|
||||
# Author: Julian Smart
|
||||
# Created: 1993
|
||||
# Updated:
|
||||
# Copyright: (c) 1993, AIAI, University of Edinburgh
|
||||
#
|
||||
# "%W% %G%"
|
||||
#
|
||||
# Makefile : Builds wxWindows library wx.lib for Windows 3.1
|
||||
# and Borland C++ 3.1. This makefile calls makefile.bcc in msw and
|
||||
# base subdirectories.
|
||||
|
||||
!if "$(BCCDIR)" == ""
|
||||
!error You must define the BCCDIR variable in autoexec.bat, e.g. BCCDIR=d:\bc4
|
||||
!endif
|
||||
|
||||
!if "$(WXWIN)" == ""
|
||||
!error You must define the WXWIN variable in autoexec.bat, e.g. WXWIN=c:\wx
|
||||
!endif
|
||||
|
||||
!ifndef DEBUG
|
||||
DEBUG=0
|
||||
!endif
|
||||
|
||||
!ifndef FINAL
|
||||
FINAL=0
|
||||
!endif
|
||||
|
||||
# Change these if needed.
|
||||
WXDIR = $(WXWIN)
|
||||
|
||||
!include $(WXDIR)\src\makebcc.env
|
||||
|
||||
!if "$(FINAL)" == "0"
|
||||
OPT = -Od
|
||||
DEBUG_FLAGS= -v /DDEBUG=$(DEBUG) # -v # -v for debugging info
|
||||
!else
|
||||
OPT = -O2
|
||||
DEBUG_FLAGS = /DDEBUG=$(DEBUG)
|
||||
!endif
|
||||
|
||||
BOR_VER = 4
|
||||
|
||||
#!if "$(BOR_VER)" == "3.1"
|
||||
#BCCDIR = d:\bc3
|
||||
#!elif "$(BOR_VER)" == "4"
|
||||
#BCCDIR = d:\bc4
|
||||
#!endif
|
||||
|
||||
WXBASEINC = $(WXDIR)\include\base
|
||||
WXINC = $(WXDIR)\include\msw
|
||||
PROLOGIOINC = $(WXDIR)\utils\prologio\src
|
||||
XPMINC=$(WXDIR)\contrib\wxxpm\libxpm.34b\lib
|
||||
|
||||
all: wxwin.cfg
|
||||
cd $(WXDIR)\src\msw
|
||||
make -f makefile.bcc -DCFG=$(CFG) -DWXDIR=$(WXDIR) DEBUG=$(DEBUG) -DDEBUG_FLAGS=$(DEBUG_FLAGS) -DOPT=$(OPT) -DFINAL=$(FINAL)
|
||||
cd $(WXDIR)\src
|
||||
|
||||
clean:
|
||||
erase wxwin.cfg
|
||||
cd $(WXDIR)\src\msw
|
||||
make -f makefile.bcc clean
|
||||
cd $(WXDIR)\src
|
||||
|
||||
wxwin.cfg: makefile.bcc
|
||||
copy &&!
|
||||
-H=$(WXDIR)\src\borland.pch
|
||||
-2
|
||||
-P
|
||||
-d
|
||||
-w-hid
|
||||
-w-par
|
||||
-w-pia
|
||||
-w-aus
|
||||
-w-rch
|
||||
-ml
|
||||
-Od
|
||||
-WE
|
||||
-Fs-
|
||||
-Vf
|
||||
-I$(WXBASEINC);$(WXINC);$(PROLOGIOINC);$(XPMINC);$(BCCDIR)\include;$(WXDIR)\contrib\fafa;$(WXDIR)\contrib\itsybits;$(WXDIR)\utils\rcparser\src
|
||||
|
||||
-L$(BCCDIR)\lib
|
||||
-Dwx_msw
|
||||
! wxwin.cfg
|
||||
!if "$(BOR_VER)" == "3.1"
|
||||
echo -Ff=4 >>wxwin.cfg
|
||||
!elif "$(BOR_VER)" == "4"
|
||||
echo -Ff=512 >>wxwin.cfg
|
||||
echo -dc >>wxwin.cfg
|
||||
!endif
|
||||
|
||||
|
||||
# -O was: -Oxt
|
||||
|