wxToolBar API changes; now frames manage their toolbar & statusbar properly;

client area position is used in SetSize; changes for BC++ & VC++ 1.5;
wxWindow::GetUpdateRegion added; removed wxUpdateIterator; some missing functions
added to process.cpp; bad navigation key event cast fixed; MDI and toolbar samples
updated; new wxMSW wxRegion constructor (WXHRGN)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@376 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-07-27 09:47:57 +00:00
parent e6688c3fd2
commit 81d66cf39f
57 changed files with 1372 additions and 867 deletions

View File

@@ -84,6 +84,7 @@ utils/wxhelp/src/*.cpp
utils/wxhelp/src/*.h utils/wxhelp/src/*.h
utils/wxhelp/src/makefile.* utils/wxhelp/src/makefile.*
utils/wxhelp/src/*.xbm utils/wxhelp/src/*.xbm
utils/wxhelp/src/*.xpm
utils/wxhelp/src/*.txt utils/wxhelp/src/*.txt
utils/wxhelp/src/*.ico utils/wxhelp/src/*.ico
utils/wxhelp/src/*.def utils/wxhelp/src/*.def
@@ -94,6 +95,7 @@ utils/tex2rtf/src/*.cpp
utils/tex2rtf/src/*.h utils/tex2rtf/src/*.h
utils/tex2rtf/src/make*.* utils/tex2rtf/src/make*.*
utils/tex2rtf/src/*.xbm utils/tex2rtf/src/*.xbm
utils/tex2rtf/src/*.xpm
utils/tex2rtf/src/*.sty utils/tex2rtf/src/*.sty
utils/tex2rtf/src/*.ini utils/tex2rtf/src/*.ini
utils/tex2rtf/src/*.inf utils/tex2rtf/src/*.inf
@@ -111,6 +113,7 @@ utils/wxtree/src/*.cpp
utils/wxtree/src/*.h utils/wxtree/src/*.h
utils/wxtree/src/makefile.* utils/wxtree/src/makefile.*
utils/wxtree/src/*.xbm utils/wxtree/src/*.xbm
utils/wxtree/src/*.xpm
utils/wxtree/lib/dummy utils/wxtree/lib/dummy
utils/wxtree/src/*.ico utils/wxtree/src/*.ico
utils/wxtree/src/*.def utils/wxtree/src/*.def
@@ -121,6 +124,7 @@ utils/wxgraph/src/*.c
utils/wxgraph/src/*.h utils/wxgraph/src/*.h
utils/wxgraph/src/makefile.* utils/wxgraph/src/makefile.*
utils/wxgraph/src/*.xbm utils/wxgraph/src/*.xbm
utils/wxgraph/src/*.xpm
utils/wxgraph/lib/dummy utils/wxgraph/lib/dummy
utils/wxgraph/src/*.ico utils/wxgraph/src/*.ico
utils/wxgraph/src/*.def utils/wxgraph/src/*.def
@@ -143,6 +147,7 @@ utils/rcparser/src/*.c
utils/rcparser/src/*.h utils/rcparser/src/*.h
utils/rcparser/src/makefile.* utils/rcparser/src/makefile.*
utils/rcparser/src/*.xbm utils/rcparser/src/*.xbm
utils/rcparser/src/*.xpm
utils/rcparser/lib/dummy utils/rcparser/lib/dummy
utils/rcparser/src/*.ico utils/rcparser/src/*.ico
utils/rcparser/src/*.def utils/rcparser/src/*.def
@@ -155,6 +160,7 @@ utils/colours/*.def
utils/colours/*.rc utils/colours/*.rc
utils/colours/makefile.* utils/colours/makefile.*
utils/colours/*.xbm utils/colours/*.xbm
utils/colours/*.xpm
utils/colours/*.txt utils/colours/*.txt
utils/wxprop/src/*.h utils/wxprop/src/*.h
@@ -163,18 +169,21 @@ utils/wxprop/src/*.def
utils/wxprop/src/*.rc utils/wxprop/src/*.rc
utils/wxprop/src/makefile.* utils/wxprop/src/makefile.*
utils/wxprop/src/*.xbm utils/wxprop/src/*.xbm
utils/wxprop/src/*.xpm
utils/wxprop/src/*.txt utils/wxprop/src/*.txt
utils/wxprop/src/*.ico utils/wxprop/src/*.ico
utils/wxprop/src/*.bmp utils/wxprop/src/*.bmp
utils/wxprop/lib/dummy utils/wxprop/lib/dummy
utils/dialoged/src/bitmaps/*.xbm utils/dialoged/src/bitmaps/*.xbm
utils/dialoged/src/bitmaps/*.xpm
utils/dialoged/src/*.h utils/dialoged/src/*.h
utils/dialoged/src/*.cpp utils/dialoged/src/*.cpp
utils/dialoged/src/*.def utils/dialoged/src/*.def
utils/dialoged/src/*.rc utils/dialoged/src/*.rc
utils/dialoged/src/makefile.* utils/dialoged/src/makefile.*
utils/dialoged/src/*.xbm utils/dialoged/src/*.xbm
utils/dialoged/src/*.xpm
utils/dialoged/src/*.txt utils/dialoged/src/*.txt
utils/dialoged/src/*.inf utils/dialoged/src/*.inf
utils/dialoged/test/*.h utils/dialoged/test/*.h
@@ -200,6 +209,7 @@ samples/hello/*.h
samples/hello/*.def samples/hello/*.def
samples/hello/makefile.* samples/hello/makefile.*
samples/hello/*.xbm samples/hello/*.xbm
samples/hello/*.xpm
samples/hello/*.txt samples/hello/*.txt
samples/hello/*.ico samples/hello/*.ico
samples/hello/*.bmp samples/hello/*.bmp
@@ -211,6 +221,7 @@ samples/dynamic/*.h
samples/dynamic/*.def samples/dynamic/*.def
samples/dynamic/makefile.* samples/dynamic/makefile.*
samples/dynamic/*.xbm samples/dynamic/*.xbm
samples/dynamic/*.xpm
samples/dynamic/*.txt samples/dynamic/*.txt
samples/dynamic/*.ico samples/dynamic/*.ico
samples/dynamic/*.bmp samples/dynamic/*.bmp
@@ -222,6 +233,7 @@ samples/bombs/*.h
samples/bombs/*.def samples/bombs/*.def
samples/bombs/makefile.* samples/bombs/makefile.*
samples/bombs/*.xbm samples/bombs/*.xbm
samples/bombs/*.xpm
samples/bombs/*.txt samples/bombs/*.txt
samples/bombs/*.ico samples/bombs/*.ico
samples/bombs/*.bmp samples/bombs/*.bmp
@@ -232,6 +244,7 @@ samples/ipc/*.h
samples/ipc/*.def samples/ipc/*.def
samples/ipc/makefile.* samples/ipc/makefile.*
samples/ipc/*.xbm samples/ipc/*.xbm
samples/ipc/*.xpm
samples/ipc/*.ico samples/ipc/*.ico
samples/ipc/*.rc samples/ipc/*.rc
@@ -242,6 +255,7 @@ samples/types/*.rc
samples/types/*.txt samples/types/*.txt
samples/types/makefile.* samples/types/makefile.*
samples/types/*.xbm samples/types/*.xbm
samples/types/*.xpm
samples/types/*.ico samples/types/*.ico
samples/resource/*.cpp samples/resource/*.cpp
@@ -252,6 +266,7 @@ samples/resource/*.txt
samples/resource/*.wxr samples/resource/*.wxr
samples/resource/makefile.* samples/resource/makefile.*
samples/resource/*.xbm samples/resource/*.xbm
samples/resource/*.xpm
samples/resource/*.ico samples/resource/*.ico
samples/animate/*.cpp samples/animate/*.cpp
@@ -259,6 +274,7 @@ samples/animate/*.h
samples/animate/*.def samples/animate/*.def
samples/animate/makefile.* samples/animate/makefile.*
samples/animate/*.xbm samples/animate/*.xbm
samples/animate/*.xpm
samples/animate/*.ico samples/animate/*.ico
samples/animate/*.rc samples/animate/*.rc
@@ -267,6 +283,7 @@ samples/mdi/*.h
samples/mdi/*.def samples/mdi/*.def
samples/mdi/makefile.* samples/mdi/makefile.*
samples/mdi/*.xbm samples/mdi/*.xbm
samples/mdi/*.xpm
samples/mdi/*.ico samples/mdi/*.ico
samples/mdi/*.rc samples/mdi/*.rc
samples/mdi/bitmaps/*.bmp samples/mdi/bitmaps/*.bmp
@@ -277,6 +294,7 @@ samples/minimal/*.h
samples/minimal/*.def samples/minimal/*.def
samples/minimal/makefile.* samples/minimal/makefile.*
samples/minimal/*.xbm samples/minimal/*.xbm
samples/minimal/*.xpm
samples/minimal/*.ico samples/minimal/*.ico
samples/minimal/*.rc samples/minimal/*.rc
@@ -285,6 +303,7 @@ samples/controls/*.h
samples/controls/*.def samples/controls/*.def
samples/controls/makefile.* samples/controls/makefile.*
samples/controls/*.xbm samples/controls/*.xbm
samples/controls/*.xpm
samples/controls/*.ico samples/controls/*.ico
samples/controls/*.bmp samples/controls/*.bmp
samples/controls/*.rc samples/controls/*.rc
@@ -294,6 +313,7 @@ samples/fractal/*.h
samples/fractal/*.def samples/fractal/*.def
samples/fractal/makefile.* samples/fractal/makefile.*
samples/fractal/*.xbm samples/fractal/*.xbm
samples/fractal/*.xpm
samples/fractal/*.ico samples/fractal/*.ico
samples/fractal/*.rc samples/fractal/*.rc
@@ -302,56 +322,36 @@ samples/layout/*.h
samples/layout/*.def samples/layout/*.def
samples/layout/makefile.* samples/layout/makefile.*
samples/layout/*.xbm samples/layout/*.xbm
samples/layout/*.xpm
samples/layout/*.ico samples/layout/*.ico
samples/layout/*.rc samples/layout/*.rc
samples/layout/*.bmp samples/layout/*.bmp
samples/layout/*.xpm
samples/printing/*.cpp samples/printing/*.cpp
samples/printing/*.h samples/printing/*.h
samples/printing/*.def samples/printing/*.def
samples/printing/makefile.* samples/printing/makefile.*
samples/printing/*.xbm samples/printing/*.xbm
samples/printing/*.xpm
samples/printing/*.txt samples/printing/*.txt
samples/printing/*.ico samples/printing/*.ico
samples/printing/*.bmp samples/printing/*.bmp
samples/printing/*.rc samples/printing/*.rc
samples/printing/*.afm
samples/tbarsmpl/*.cpp samples/toolbar/*.cpp
samples/tbarsmpl/*.h samples/toolbar/*.h
samples/tbarsmpl/*.def samples/toolbar/*.def
samples/tbarsmpl/makefile.* samples/toolbar/makefile.*
samples/tbarsmpl/*.txt samples/toolbar/*.txt
samples/tbarsmpl/*.xbm samples/toolbar/*.xbm
samples/tbarsmpl/bitmaps/*.xbm samples/toolbar/*.xpm
samples/tbarsmpl/*.ico samples/toolbar/bitmaps/*.xbm
samples/tbarsmpl/*.bmp samples/toolbar/bitmaps/*.xpm
samples/tbarsmpl/*.rc samples/toolbar/*.ico
samples/tbarsmpl/bitmaps/*.bmp samples/toolbar/*.bmp
samples/toolbar/*.rc
samples/tbar95/*.cpp samples/toolbar/bitmaps/*.bmp
samples/tbar95/*.h
samples/tbar95/*.def
samples/tbar95/makefile.*
samples/tbar95/*.txt
samples/tbar95/*.xbm
samples/tbar95/bitmaps/*.xbm
samples/tbar95/*.ico
samples/tbar95/*.bmp
samples/tbar95/*.rc
samples/tbar95/bitmaps/*.bmp
samples/tbarmsw/*.cpp
samples/tbarmsw/*.h
samples/tbarmsw/*.def
samples/tbarmsw/makefile.*
samples/tbarmsw/*.txt
samples/tbarmsw/*.xbm
samples/tbarmsw/bitmaps/*.xbm
samples/tbarmsw/*.ico
samples/tbarmsw/*.bmp
samples/tbarmsw/*.rc
samples/tbarmsw/bitmaps/*.bmp
samples/docview/*.h samples/docview/*.h
samples/docview/*.cpp samples/docview/*.cpp
@@ -359,6 +359,7 @@ samples/docview/*.def
samples/docview/*.rc samples/docview/*.rc
samples/docview/makefile.* samples/docview/makefile.*
samples/docview/*.xbm samples/docview/*.xbm
samples/docview/*.xpm
samples/docview/*.txt samples/docview/*.txt
samples/docview/*.ico samples/docview/*.ico
samples/docview/*.bmp samples/docview/*.bmp
@@ -369,6 +370,7 @@ samples/memcheck/*.def
samples/memcheck/*.rc samples/memcheck/*.rc
samples/memcheck/makefile.* samples/memcheck/makefile.*
samples/memcheck/*.xbm samples/memcheck/*.xbm
samples/memcheck/*.xpm
samples/memcheck/*.txt samples/memcheck/*.txt
samples/memcheck/*.ico samples/memcheck/*.ico
samples/memcheck/*.bmp samples/memcheck/*.bmp
@@ -380,11 +382,11 @@ samples/odbc/*.rc
samples/odbc/makefile.* samples/odbc/makefile.*
samples/odbc/*.inf samples/odbc/*.inf
samples/odbc/*.xbm samples/odbc/*.xbm
samples/odbc/*.xpm
samples/odbc/*.ico samples/odbc/*.ico
samples/odbc/*.bmp samples/odbc/*.bmp
samples/odbc/*.dbf samples/odbc/*.dbf
samples/odbc/*.cdx samples/odbc/*.cdx
samples/odbc/odbc32.lib
samples/dialogs/*.h samples/dialogs/*.h
samples/dialogs/*.cpp samples/dialogs/*.cpp
@@ -392,6 +394,7 @@ samples/dialogs/*.def
samples/dialogs/*.rc samples/dialogs/*.rc
samples/dialogs/makefile.* samples/dialogs/makefile.*
samples/dialogs/*.xbm samples/dialogs/*.xbm
samples/dialogs/*.xpm
samples/dialogs/*.txt samples/dialogs/*.txt
samples/dialogs/*.bmp samples/dialogs/*.bmp
samples/dialogs/*.ico samples/dialogs/*.ico
@@ -404,6 +407,7 @@ samples/wxpoem/*.inf
samples/wxpoem/*.txt samples/wxpoem/*.txt
samples/wxpoem/makefile.* samples/wxpoem/makefile.*
samples/wxpoem/*.xbm samples/wxpoem/*.xbm
samples/wxpoem/*.xpm
samples/wxpoem/*.ico samples/wxpoem/*.ico
samples/wxpoem/*.bmp samples/wxpoem/*.bmp
samples/wxpoem/*.dat samples/wxpoem/*.dat
@@ -417,6 +421,7 @@ samples/pressup/*.inf
samples/pressup/*.txt samples/pressup/*.txt
samples/pressup/makefile.* samples/pressup/makefile.*
samples/pressup/*.xbm samples/pressup/*.xbm
samples/pressup/*.xpm
samples/pressup/*.ico samples/pressup/*.ico
samples/pressup/*.bmp samples/pressup/*.bmp
@@ -428,6 +433,7 @@ samples/validate/*.inf
samples/validate/*.txt samples/validate/*.txt
samples/validate/makefile.* samples/validate/makefile.*
samples/validate/*.xbm samples/validate/*.xbm
samples/validate/*.xpm
samples/validate/*.ico samples/validate/*.ico
samples/validate/*.bmp samples/validate/*.bmp
@@ -439,6 +445,7 @@ samples/events/*.inf
samples/events/*.txt samples/events/*.txt
samples/events/makefile.* samples/events/makefile.*
samples/events/*.xbm samples/events/*.xbm
samples/events/*.xpm
samples/events/*.ico samples/events/*.ico
samples/events/*.bmp samples/events/*.bmp
@@ -449,7 +456,9 @@ samples/treectrl/*.rc
samples/treectrl/*.txt samples/treectrl/*.txt
samples/treectrl/makefile.* samples/treectrl/makefile.*
samples/treectrl/*.xbm samples/treectrl/*.xbm
samples/treectrl/*.xpm
samples/treectrl/bitmaps/*.xbm samples/treectrl/bitmaps/*.xbm
samples/treectrl/bitmaps/*.xpm
samples/treectrl/*.ico samples/treectrl/*.ico
samples/treectrl/*.bmp samples/treectrl/*.bmp
samples/treectrl/bitmaps/*.bmp samples/treectrl/bitmaps/*.bmp
@@ -462,7 +471,9 @@ samples/listctrl/*.rc
samples/listctrl/*.txt samples/listctrl/*.txt
samples/listctrl/makefile.* samples/listctrl/makefile.*
samples/listctrl/*.xbm samples/listctrl/*.xbm
samples/listctrl/*.xpm
samples/listctrl/bitmaps/*.xbm samples/listctrl/bitmaps/*.xbm
samples/listctrl/bitmaps/*.xpm
samples/listctrl/*.ico samples/listctrl/*.ico
samples/listctrl/*.bmp samples/listctrl/*.bmp
samples/listctrl/bitmaps/*.bmp samples/listctrl/bitmaps/*.bmp
@@ -475,6 +486,7 @@ samples/splitter/*.rc
samples/splitter/*.txt samples/splitter/*.txt
samples/splitter/makefile.* samples/splitter/makefile.*
samples/splitter/*.xbm samples/splitter/*.xbm
samples/splitter/*.xpm
samples/splitter/*.ico samples/splitter/*.ico
samples/splitter/*.bmp samples/splitter/*.bmp
@@ -485,6 +497,7 @@ samples/grid/*.rc
samples/grid/*.txt samples/grid/*.txt
samples/grid/makefile.* samples/grid/makefile.*
samples/grid/*.xbm samples/grid/*.xbm
samples/grid/*.xpm
samples/grid/*.ico samples/grid/*.ico
samples/grid/*.bmp samples/grid/*.bmp
@@ -495,6 +508,7 @@ samples/internat/*.rc
samples/internat/*.txt samples/internat/*.txt
samples/internat/makefile.* samples/internat/makefile.*
samples/internat/*.xbm samples/internat/*.xbm
samples/internat/*.xpm
samples/internat/*.po samples/internat/*.po
samples/internat/*.ico samples/internat/*.ico
samples/internat/*.bmp samples/internat/*.bmp
@@ -507,6 +521,7 @@ samples/checklst/*.rc
samples/checklst/*.txt samples/checklst/*.txt
samples/checklst/makefile.* samples/checklst/makefile.*
samples/checklst/*.xbm samples/checklst/*.xbm
samples/checklst/*.xpm
samples/checklst/*.ico samples/checklst/*.ico
samples/checklst/*.bmp samples/checklst/*.bmp
@@ -516,6 +531,8 @@ samples/dnd/makefile.*
samples/dnd/*.rc samples/dnd/*.rc
samples/dnd/*.def samples/dnd/*.def
samples/dnd/*.bmp samples/dnd/*.bmp
samples/dnd/*.xbm
samples/dnd/*.xpm
samples/dnd/*.ico samples/dnd/*.ico
samples/dnd/*.txt samples/dnd/*.txt
@@ -525,6 +542,8 @@ samples/tab/makefile.*
samples/tab/*.rc samples/tab/*.rc
samples/tab/*.def samples/tab/*.def
samples/tab/*.bmp samples/tab/*.bmp
samples/tab/*.xbm
samples/tab/*.xpm
samples/tab/*.ico samples/tab/*.ico
samples/tab/*.txt samples/tab/*.txt
@@ -534,6 +553,8 @@ samples/png/makefile.*
samples/png/*.rc samples/png/*.rc
samples/png/*.def samples/png/*.def
samples/png/*.bmp samples/png/*.bmp
samples/png/*.xpm
samples/png/*.xbm
samples/png/*.ico samples/png/*.ico
samples/png/*.txt samples/png/*.txt
samples/png/*.png samples/png/*.png

View File

@@ -32,21 +32,9 @@ The following are a variety of windows that are derived from wxWindow.
\twocolitem{\helpref{wxScrolledWindow}{wxscrolledwindow}}{Window with automatically managed scrollbars} \twocolitem{\helpref{wxScrolledWindow}{wxscrolledwindow}}{Window with automatically managed scrollbars}
\twocolitem{\helpref{wxSplitterWindow}{wxsplitterwindow}}{Window which can be split vertically or horizontally} \twocolitem{\helpref{wxSplitterWindow}{wxsplitterwindow}}{Window which can be split vertically or horizontally}
\twocolitem{\helpref{wxStatusBar}{wxstatusbar}}{Implements the status bar on a frame} \twocolitem{\helpref{wxStatusBar}{wxstatusbar}}{Implements the status bar on a frame}
\twocolitem{\helpref{wxStatusBar95}{wxstatusbar95}}{Implements a Windows 95 status bar on a frame} \twocolitem{\helpref{wxToolBar}{wxtoolbar}}{Toolbar class}
\twocolitem{\helpref{wxTabbedPanel}{wxtabbedpanel}}{Tabbed panel} \twocolitem{\helpref{wxTabbedPanel}{wxtabbedpanel}}{Tabbed panel (to be replaced with wxNotebook)}
\end{twocollist} \twocolitem{\helpref{wxNotebook}{wxnotebook}}{Notebook class (undocumented)}
{\large {\bf Toolbar classes}}
\overview{Overview}{wxtoolbaroverview}
These are the toolbar classes.
\begin{twocollist}\itemsep=0pt
\twocolitem{\helpref{wxToolBarBase}{wxtoolbarbase}}{Toolbar base class}
\twocolitem{\helpref{wxToolBarSimple}{wxtoolbarsimple}}{A simple, cross-platform toolbar class}
\twocolitem{\helpref{wxToolBarMSW}{wxtoolbarmsw}}{A Windows-only toolbar class}
\twocolitem{\helpref{wxToolBar95}{wxtoolbar95}}{A Windows 95-only toolbar class}
\end{twocollist} \end{twocollist}
{\large {\bf Common dialogs}} {\large {\bf Common dialogs}}

View File

@@ -48,12 +48,16 @@ which is generated by a wxScrollBar control. This is provided for compatibility
more specific scrollbar event macros should be used instead (see \helpref{wxScrollEvent}{wxscrollevent}).} more specific scrollbar event macros should be used instead (see \helpref{wxScrollEvent}{wxscrollevent}).}
\twocolitem{{\bf EVT\_COMBOBOX(id, func)}}{Process a wxEVT\_COMMAND\_COMBOBOX\_SELECTED command, \twocolitem{{\bf EVT\_COMBOBOX(id, func)}}{Process a wxEVT\_COMMAND\_COMBOBOX\_SELECTED command,
which is generated by a wxComboBox control.} which is generated by a wxComboBox control.}
\twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED command, \twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
which is generated by a toobar button.} (a synonym for wxEVT\_COMMAND\_MENU\_SELECTED). Pass the id of the tool.}
\twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED command, \twocolitem{{\bf EVT\_TOOL\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
which is generated by a toobar button.} for a range id identifiers. Pass the ids of the tools.}
\twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER command, \twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event.
which is generated by a toobar button.} Pass the id of the tool.}
\twocolitem{{\bf EVT\_TOOL\_RCLICKED\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event
for a range of ids. Pass the ids of the tools.}
\twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER event.
Pass the id of the toolbar itself. The value of wxCommandEvent::GetSelection is the tool id, or -1 if the mouse cursor has moved off a tool.}
\twocolitem{{\bf EVT\_COMMAND\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_CLICK command, \twocolitem{{\bf EVT\_COMMAND\_LEFT\_CLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_CLICK command,
which is generated by a control (Windows 95 and NT only).} which is generated by a control (Windows 95 and NT only).}
\twocolitem{{\bf EVT\_COMMAND\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_DCLICK command, \twocolitem{{\bf EVT\_COMMAND\_LEFT\_DCLICK(id, func)}}{Process a wxEVT\_COMMAND\_LEFT\_DCLICK command,

View File

@@ -4,6 +4,10 @@ A frame is a window whose size and position can (usually) be changed by the user
thick borders and a title bar, and can optionally contain a menu bar, toolbar and thick borders and a title bar, and can optionally contain a menu bar, toolbar and
status bar. A frame can contain any window that is not a frame or dialog. status bar. A frame can contain any window that is not a frame or dialog.
A frame that has a status bar and toolbar created via the CreateStatusBar/CreateToolBar functions
manages these windows, and adjusts the value returned by GetClientSize to reflect
the remaining size available to application windows.
\wxheading{Derived from} \wxheading{Derived from}
\helpref{wxWindow}{wxwindow}\\ \helpref{wxWindow}{wxwindow}\\
@@ -122,7 +126,9 @@ for further details.
\membersection{wxFrame::CreateStatusBar}\label{wxframecreatestatusbar} \membersection{wxFrame::CreateStatusBar}\label{wxframecreatestatusbar}
\func{virtual bool}{CreateStatusBar}{\param{int}{ number = 1}} \func{virtual wxStatusBar*}{CreateStatusBar}{\param{int}{ number = 1},
\param{long}{ style = 0},
\param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "statusBar"}}
Creates a status bar at the bottom of the frame. Creates a status bar at the bottom of the frame.
@@ -131,9 +137,17 @@ Creates a status bar at the bottom of the frame.
\docparam{number}{The number of fields to create. Specify a \docparam{number}{The number of fields to create. Specify a
value greater than 1 to create a multi-field status bar.} value greater than 1 to create a multi-field status bar.}
\docparam{style}{The status bar style. See \helpref{wxStatusBar}{wxstatusbar} for a list
of valid styles.}
\docparam{id}{The status bar window identifier. If -1, an identifier will be chosen by
wxWindows.}
\docparam{name}{The status bar window name.}
\wxheading{Return value} \wxheading{Return value}
TRUE if the status bar was created successfully. A pointer to the the status bar if it was created successfully, NULL otherwise.
\wxheading{Remarks} \wxheading{Remarks}
@@ -151,6 +165,45 @@ Note that you can put controls and other windows on the status bar if you wish.
\helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar},\rtfsp \helpref{wxFrame::OnCreateStatusBar}{wxframeoncreatestatusbar},\rtfsp
\helpref{wxFrame::GetStatusBar}{wxframegetstatusbar} \helpref{wxFrame::GetStatusBar}{wxframegetstatusbar}
\membersection{wxFrame::CreateToolBar}\label{wxframecreatetoolbar}
\func{virtual wxToolBar*}{CreateToolBar}{\param{long}{ style = wxNO\_BORDER \pipe wxTB\_HORIZONTAL},
\param{wxWindowID}{ id = -1}, \param{const wxString\&}{ name = "toolBar"}}
Creates a toolbar at the top or left of the frame.
\wxheading{Parameters}
\docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list
of valid styles.}
\docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by
wxWindows.}
\docparam{name}{The toolbar window name.}
\wxheading{Return value}
A pointer to the the toolbar if it was created successfully, NULL otherwise.
\wxheading{Remarks}
By default, the toolbar is an instance of wxToolBar (which is defined to be
a suitable toolbar class on each platform, such as wxToolBar95). To use a different class,
override \helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar}.
When a toolbar has been created with this function, or made known to the frame
with \helpref{wxFrame::SetToolBar}{wxframesettoolbar}, the frame will manage the toolbar
position and adjust the return value from \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} to
reflect the available space for application windows.
\wxheading{See also}
\helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar},\rtfsp
\helpref{wxFrame::OnCreateToolBar}{wxframeoncreatetoolbar},\rtfsp
\helpref{wxFrame::SetToolBar}{wxframesettoolbar},\rtfsp
\helpref{wxFrame::GetToolBar}{wxframegettoolbar}
\membersection{wxFrame::GetMenuBar}\label{wxframegetmenubar} \membersection{wxFrame::GetMenuBar}\label{wxframegetmenubar}
\constfunc{wxMenuBar*}{GetMenuBar}{\void} \constfunc{wxMenuBar*}{GetMenuBar}{\void}
@@ -178,6 +231,17 @@ Returns a pointer to the status bar currently associated with the frame (if any)
Gets a temporary pointer to the frame title. See Gets a temporary pointer to the frame title. See
\helpref{wxFrame::SetTitle}{wxframesettitle}. \helpref{wxFrame::SetTitle}{wxframesettitle}.
\membersection{wxFrame::GetToolBar}\label{wxframegettoolbar}
\func{wxToolBar*}{GetToolBar}{\void}
Returns a pointer to the toolbar currently associated with the frame (if any).
\wxheading{See also}
\helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp
\helpref{wxFrame::SetToolBar}{wxframesettoolbar}
\membersection{wxFrame::Iconize}\label{wxframeiconize} \membersection{wxFrame::Iconize}\label{wxframeiconize}
\func{void}{Iconize}{\param{const bool}{ iconize}} \func{void}{Iconize}{\param{const bool}{ iconize}}
@@ -269,7 +333,9 @@ If you call wxFrame::LoadAccelerators, you need to override this function e.g.
\membersection{wxFrame::OnCreateStatusBar}\label{wxframeoncreatestatusbar} \membersection{wxFrame::OnCreateStatusBar}\label{wxframeoncreatestatusbar}
\func{virtual wxStatusBar*}{OnCreateStatusBar}{\param{int }{number}} \func{virtual wxStatusBar*}{OnCreateStatusBar}{\param{int }{number}
\param{long}{ style},
\param{wxWindowID}{ id}, \param{const wxString\&}{ name}}
Virtual function called when a status bar is requested by \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}. Virtual function called when a status bar is requested by \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}.
@@ -277,6 +343,14 @@ Virtual function called when a status bar is requested by \helpref{wxFrame::Crea
\docparam{number}{The number of fields to create.} \docparam{number}{The number of fields to create.}
\docparam{style}{The window style. See \helpref{wxStatusBar}{wxstatusbar} for a list
of valid styles.}
\docparam{id}{The window identifier. If -1, an identifier will be chosen by
wxWindows.}
\docparam{name}{The window name.}
\wxheading{Return value} \wxheading{Return value}
A status bar object. A status bar object.
@@ -290,6 +364,36 @@ implementation returns an instance of \helpref{wxStatusBar}{wxstatusbar}.
\helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar}. \helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar}.
\membersection{wxFrame::OnCreateToolBar}\label{wxframeoncreatetoolbar}
\func{virtual wxToolBar*}{OnCreateToolBar}{\param{long}{ style},
\param{wxWindowID}{ id}, \param{const wxString\&}{ name}}
Virtual function called when a toolbar is requested by \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}.
\wxheading{Parameters}
\docparam{style}{The toolbar style. See \helpref{wxToolBar}{wxtoolbar} for a list
of valid styles.}
\docparam{id}{The toolbar window identifier. If -1, an identifier will be chosen by
wxWindows.}
\docparam{name}{The toolbar window name.}
\wxheading{Return value}
A toolbar object.
\wxheading{Remarks}
An application can override this function to return a different kind of toolbar. The default
implementation returns an instance of \helpref{wxToolBar}{wxtoolbar}.
\wxheading{See also}
\helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar}.
\membersection{wxFrame::OnMenuCommand}\label{wxframeonmenucommand} \membersection{wxFrame::OnMenuCommand}\label{wxframeonmenucommand}
\func{void}{OnMenuCommand}{\param{wxCommandEvent\&}{ event}} \func{void}{OnMenuCommand}{\param{wxCommandEvent\&}{ event}}
@@ -388,6 +492,17 @@ Note that it is not possible to call this function twice for the same frame obje
\helpref{wxFrame::GetMenuBar}{wxframegetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}. \helpref{wxFrame::GetMenuBar}{wxframegetmenubar}, \helpref{wxMenuBar}{wxmenubar}, \helpref{wxMenu}{wxmenu}.
\membersection{wxFrame::SetStatusBar}\label{wxframesetstatusbar}
\func{void}{SetStatusBar}{\param{wxStatusBar*}{ statusBar}}
Associates a status bar with the frame.
\wxheading{See also}
\helpref{wxFrame::CreateStatusBar}{wxframecreatestatusbar}, \helpref{wxStatusBar}{wxstatusbar},\rtfsp
\helpref{wxFrame::GetStatusBar}{wxframegetstatusbar}
\membersection{wxFrame::SetStatusText}\label{wxframesetstatustext} \membersection{wxFrame::SetStatusText}\label{wxframesetstatustext}
\func{virtual void}{SetStatusText}{\param{const wxString\& }{ text}, \param{int}{ number = 0}} \func{virtual void}{SetStatusText}{\param{const wxString\& }{ text}, \param{int}{ number = 0}}
@@ -429,6 +544,17 @@ The widths of the variable fields are calculated from the total width of all fie
minus the sum of widths of the non-variable fields, divided by the number of minus the sum of widths of the non-variable fields, divided by the number of
variable fields. variable fields.
\membersection{wxFrame::SetToolBar}\label{wxframesettoolbar}
\func{void}{SetToolBar}{\param{wxToolBar*}{ toolBar}}
Associates a toolbar with the frame.
\wxheading{See also}
\helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}, \helpref{wxToolBar}{wxtoolbar},\rtfsp
\helpref{wxFrame::GetToolBar}{wxframegettoolbar}
\membersection{wxFrame::SetTitle}\label{wxframesettitle} \membersection{wxFrame::SetTitle}\label{wxframesettitle}
\func{virtual void}{SetTitle}{\param{const wxString\& }{ title}} \func{virtual void}{SetTitle}{\param{const wxString\& }{ title}}

View File

@@ -1,10 +1,12 @@
\documentstyle[a4,11pt,makeidx,verbatim,texhelp,fancyheadings,palatino]{thesis} \documentstyle[a4,11pt,makeidx,verbatim,texhelp,fancyheadings,palatino]{thesis}
% JACS: doesn't make it through Tex2RTF, sorry.I'll put it into texhelp.sty
% since Tex2RTF doesn't parse it.
%KB: %KB:
\addtolength{\textwidth}{1in} %\addtolength{\textwidth}{1in}
\addtolength{\oddsidemargin}{-0.5in} %\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\topmargin}{-0.5in} %\addtolength{\topmargin}{-0.5in}
\addtolength{\textheight}{1in} %\addtolength{\textheight}{1in}
\sloppy %\sloppy
%end of my changes %end of my changes
\newcommand{\indexit}[1]{#1\index{#1}}% \newcommand{\indexit}[1]{#1\index{#1}}%
\newcommand{\pipe}[0]{$\|$\ }% \newcommand{\pipe}[0]{$\|$\ }%

View File

@@ -10,7 +10,11 @@ be variable length according to the size of the window.
\wxheading{Window styles} \wxheading{Window styles}
There are no special styles for this window. \twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxSB\_SIZEGRIP}}{On Windows 95, displays a gripper at right-hand side of
the status bar.}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}. See also \helpref{window styles overview}{windowstyles}.

View File

@@ -290,3 +290,9 @@
\newcommand{\constfunc}[3]{{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}} \newcommand{\constfunc}[3]{{\bf #1} {\bf #2}(#3) {\bf const}\index{#2}}
\newcommand{\windowstyle}[1]{{\bf #1}\index{#1}} \newcommand{\windowstyle}[1]{{\bf #1}\index{#1}}
\addtolength{\textwidth}{1in}
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\topmargin}{-0.5in}
\addtolength{\textheight}{1in}
\sloppy

View File

@@ -1,12 +1,23 @@
\section{\class{wxToolBarBase}}\label{wxtoolbarbase} \section{\class{wxToolBar}}\label{wxtoolbar}
{\bf wxToolBarBase} is the base class for a number of toolbar classes. The most portable The name wxToolBar is defined to be a synonym for one of the following classes:
one of these is the generic \helpref{wxToolBarSimple}{wxtoolbarsimple} class. {\bf wxToolBarBase} defines
automatic scrolling management functionality which is identical to \helpref{wxScrolledWindow}{wxscrolledwindow}, \begin{itemize}\itemsep=0pt
so please refer to this class also. \item {\bf wxToolBar95} The native Windows 95 toolbar. Used on Windows 95, NT 4 and above.
\item {\bf wxToolBarMSW} A Windows implementation. Used on 16-bit Windows.
\item {\bf wxToolBarGTK} The GTK toolbar.
\item {\bf wxToolBarSimple} A simple implementation, with scrolling.
Used on platforms with no native toolbar control, or where scrolling is required.
\end{itemize}
Note that the base class {\bf wxToolBarBase} defines
automatic scrolling management functionality which is identical
to \helpref{wxScrolledWindow}{wxscrolledwindow}, so please refer to this class also.
Not all toolbars support scrolling, but wxToolBarSimple does.
\wxheading{Derived from} \wxheading{Derived from}
wxToolBarBase\\
\helpref{wxControl}{wxcontrol}\\ \helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\ \helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\ \helpref{wxEvtHandler}{wxevthandler}\\
@@ -14,58 +25,107 @@ so please refer to this class also.
\wxheading{Remarks} \wxheading{Remarks}
Because there is a variety of toolbar classes, you may wish to choose which class You may also create a toolbar that is managed by the frame, by
is best for your application on each platform, and define {\bf wxToolBar} appropriately. For example: calling \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}.
\begin{verbatim} {\bf wxToolBar95:} Note that this toolbar paints tools to reflect user-selected colours.
#if WIN95 The toolbar orientation must always be {\bf wxVERTICAL}.
class wxToolBar: public wxToolBar95
#elif defined(wx_msw)
class wxToolBar: public wxToolBarMSW
#else
class wxToolBar: public wxToolBarSimple
#endif
{
};
\end{verbatim}
TODO: maybe change the confusing names: GetDefaultSize becomes GetToolBitmapSize, and \wxheading{Window styles}
GetDefaultButtonSize becomes GetToolSize. Document SetRows for wxToolBar95, and make it
part of the base API? \twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxTB\_FLAT}}{Gives the toolbar a flat look ('coolbar' or 'flatbar' style). Windows 95 only.}
\twocolitem{\windowstyle{wxTB\_HORIZONTAL}}{Specifies horizontal layout.}
\twocolitem{\windowstyle{wxTB\_VERTICAL}}{Specifies vertical layout (not available for the Windows 95
toolbar).}
\twocolitem{\windowstyle{wxTB\_3DBUTTONS}}{Gives wxToolBarSimple a mild 3D look to its buttons.}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
\wxheading{Event handling} \wxheading{Event handling}
Derive a new class from an existing toolbar class, and override appropriate virtual functions. The toolbar class emits menu commands in the same was that a frame menubar does,
so you can use one EVT\_MENU macro for both a menu item and a toolbar button.
The event handler functions take a wxCommandEvent argument. For most event macros,
the identifier of the tool is passed, but for EVT\_TOOL\_ENTER the toolbar
window is passed and the tool id is retrieved from the wxCommandEvent.
This is because the id may be -1 when the mouse moves off a tool, and -1 is not
allowed as an identifier in the event system.
TODO: make consistent with other event handling; have wxToolBarEvent and appropriate macros. \twocolwidtha{7cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_TOOL(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
(a synonym for wxEVT\_COMMAND\_MENU\_SELECTED). Pass the id of the tool.}
\twocolitem{{\bf EVT\_MENU(id, func)}}{The same as EVT\_TOOL.}
\twocolitem{{\bf EVT\_TOOL\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_CLICKED event
for a range id identifiers. Pass the ids of the tools.}
\twocolitem{{\bf EVT\_MENU\_RANGE(id1, id2, func)}}{The same as EVT\_TOOL\_RANGE.}
\twocolitem{{\bf EVT\_TOOL\_RCLICKED(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event.
Pass the id of the tool.}
\twocolitem{{\bf EVT\_TOOL\_RCLICKED\_RANGE(id1, id2, func)}}{Process a wxEVT\_COMMAND\_TOOL\_RCLICKED event
for a range of ids. Pass the ids of the tools.}
\twocolitem{{\bf EVT\_TOOL\_ENTER(id, func)}}{Process a wxEVT\_COMMAND\_TOOL\_ENTER event.
Pass the id of the toolbar itself. The value of wxCommandEvent::GetSelection is the tool id, or -1 if the mouse cursor has moved off a tool.}
\end{twocollist}
\wxheading{See also} \wxheading{See also}
\overview{Toolbar overview}{wxtoolbaroverview},\rtfsp \overview{Toolbar overview}{wxtoolbaroverview},\rtfsp
\helpref{wxToolBarSimple}{wxtoolbarsimple},\rtfsp
\helpref{wxToolBarMSW}{wxtoolbarmsw},\rtfsp
\helpref{wxToolBar95}{wxtoolbar95},\rtfsp
\helpref{wxScrolledWindow}{wxscrolledwindow} \helpref{wxScrolledWindow}{wxscrolledwindow}
\latexignore{\rtfignore{\wxheading{Members}}} \latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxToolBarBase::wxToolBarBase}\label{wxtoolbarbaseconstr} \membersection{wxToolBar::wxToolBar}\label{wxtoolbarconstr}
\func{}{wxToolBarBase}{\void} \func{}{wxToolBar}{\void}
Default constructor. Default constructor.
%\wxheading{See also} \func{}{wxToolBar}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},
% \param{const wxPoint\& }{pos = wxDefaultPosition},
%\helpref{wxToolBarBase::Create}{wxtoolbarbasecreate} \param{const wxSize\& }{size = wxDefaultSize},
% \param{long }{style = wxTB\_HORIZONTAL \pipe wxNO\_BORDER},
\membersection{wxToolBarBase::\destruct{wxToolBarBase}} \param{const wxString\& }{name = wxPanelNameStr}}
\func{void}{\destruct{wxToolBarBase}}{\void} Constructs a toolbar.
\wxheading{Parameters}
\docparam{parent}{Pointer to a parent window.}
\docparam{id}{Window identifier. If -1, will automatically create an identifier.}
\docparam{pos}{Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows
should generate a default position for the window. If using the wxWindow class directly, supply
an actual position.}
\docparam{size}{Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows
should generate a default size for the window.}
\docparam{style}{Window style. See \helpref{wxToolBar}{wxtoolbar} for details.}
\docparam{name}{Window name.}
\wxheading{Remarks}
After a toolbar is created, you use \helpref{wxToolBar::AddTool}{wxtoolbaraddtool} and
perhaps \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator}, and then you
must call \helpref{wxToolBar::Realize}{wxtoolbarrealize} to construct and display the toolbar
tools.
You may also create a toolbar that is managed by the frame, by
calling \helpref{wxFrame::CreateToolBar}{wxframecreatetoolbar}.
\membersection{wxToolBar::\destruct{wxToolBar}}
\func{void}{\destruct{wxToolBar}}{\void}
Toolbar destructor. Toolbar destructor.
\membersection{wxToolBarBase::AddSeparator}\label{wxtoolbarbaseaddseparator} \membersection{wxToolBar::AddSeparator}\label{wxtoolbaraddseparator}
\func{void}{AddSeparator}{\void} \func{void}{AddSeparator}{\void}
@@ -73,14 +133,14 @@ Adds a separator for spacing groups of tools.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}, \helpref{wxToolBarBase::SetToolSeparation}{wxtoolbarbasesettoolseparation} \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}, \helpref{wxToolBar::SetToolSeparation}{wxtoolbarsettoolseparation}
\membersection{wxToolBarBase::AddTool}\label{wxtoolbarbaseaddtool} \membersection{wxToolBar::AddTool}\label{wxtoolbaraddtool}
\func{wxToolBarBaseTool*}{AddTool}{\param{int}{ toolIndex}, \param{const wxBitmap\&}{ bitmap1},\rtfsp \func{wxToolBarTool*}{AddTool}{\param{int}{ toolIndex}, \param{const wxBitmap\&}{ bitmap1},\rtfsp
\param{const wxBitmap\&}{ bitmap2 = (wxBitmap *)NULL}, \param{const bool}{ isToggle = FALSE},\rtfsp \param{const wxBitmap\&}{ bitmap2 = wxNullBitmap}, \param{bool}{ isToggle = FALSE},\rtfsp
\param{const float}{ xPos = -1}, \param{const float}{ yPos = -1},\rtfsp \param{long}{ xPos = -1}, \param{long}{ yPos = -1},\rtfsp
\param{wxObject *}{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}} \param{wxObject* }{clientData = NULL}, \param{const wxString\& }{shortHelpString = ""}, \param{const wxString\& }{longHelpString = ""}}
Adds a tool to the toolbar. Adds a tool to the toolbar.
@@ -106,7 +166,7 @@ wxBitmap object.}
\docparam{yPos}{Specifies the y position of the tool if automatic layout is not suitable.} \docparam{yPos}{Specifies the y position of the tool if automatic layout is not suitable.}
\docparam{clientData}{An optional pointer to client data which can be \docparam{clientData}{An optional pointer to client data which can be
retrieved later using \helpref{wxToolBarBase::GetToolClientData}{wxtoolbarbasegettoolclientdata}.} retrieved later using \helpref{wxToolBar::GetToolClientData}{wxtoolbargettoolclientdata}.}
\docparam{shortHelpString}{Used for displaying a tooltip for the tool in the \docparam{shortHelpString}{Used for displaying a tooltip for the tool in the
Windows 95 implementation of wxButtonBar. Pass the empty string if this is not required.} Windows 95 implementation of wxButtonBar. Pass the empty string if this is not required.}
@@ -114,29 +174,31 @@ Windows 95 implementation of wxButtonBar. Pass the empty string if this is not r
\docparam{longHelpString}{Used to displayer longer help, such as status line help. \docparam{longHelpString}{Used to displayer longer help, such as status line help.
Pass the empty string if this is not required.} Pass the empty string if this is not required.}
\wxheading{Remarks}
After you have added tools to a toolbar, you must call \helpref{wxToolBar::Realize}{wxtoolbarrealize} in
order to have the tools appear.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::AddSeparator}{wxtoolbarbaseaddseparator} \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator},
\helpref{wxToolBar::Realize}{wxtoolbarrealize},
\membersection{wxToolBarBase::CreateTools}\label{wxtoolbarbasecreatetools} \membersection{wxToolBar::CreateTools}\label{wxtoolbarcreatetools}
\func{bool}{CreateTools}{\void} \func{bool}{CreateTools}{\void}
Call this function after all tools have been added to the toolbar, to actually This function is implemented for some toolbar classes to create the tools and display them.
create the tools. The portable way of calling it is to call \helpref{wxToolBar::Realize}{wxtoolbarrealize} after
you have added tools and separators.
\wxheading{Remarks}
Strictly speaking, this is required only for the Windows 95 version of wxButtonBar,
but for portability it should be called anyway.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool} \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}, \helpref{wxToolBar::Realize}{wxtoolbarrealize}
\membersection{wxToolBarBase::DrawTool}\label{wxtoolbarbasedrawtool} \membersection{wxToolBar::DrawTool}\label{wxtoolbardrawtool}
\func{void}{DrawTool}{\param{wxMemoryDC\& }{memDC}, \param{wxToolBarBaseTool* }{tool}} \func{void}{DrawTool}{\param{wxMemoryDC\& }{memDC}, \param{wxToolBarTool* }{tool}}
Draws the specified tool onto the window using the given memory device context. Draws the specified tool onto the window using the given memory device context.
@@ -150,7 +212,7 @@ Draws the specified tool onto the window using the given memory device context.
For internal use only. For internal use only.
\membersection{wxToolBarBase::EnableTool}\label{wxtoolbarbaseenabletool} \membersection{wxToolBar::EnableTool}\label{wxtoolbarenabletool}
\func{void}{EnableTool}{\param{int }{toolIndex}, \param{const bool}{ enable}} \func{void}{EnableTool}{\param{int }{toolIndex}, \param{const bool}{ enable}}
@@ -169,13 +231,13 @@ will change the visible state of the tool to indicate that it is disabled.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolEnabled}{wxtoolbarbasegettoolenabled},\rtfsp \helpref{wxToolBar::GetToolEnabled}{wxtoolbargettoolenabled},\rtfsp
%\helpref{wxToolBarBase::SetToolState}{wxtoolbarbasesettoolstate},\rtfsp %\helpref{wxToolBar::SetToolState}{wxtoolbarsettoolstate},\rtfsp
\helpref{wxToolBarBase::ToggleTool}{wxtoolbarbasetoggletool} \helpref{wxToolBar::ToggleTool}{wxtoolbartoggletool}
\membersection{wxToolBarBase::FindToolForPosition}\label{wxtoolbarbasefindtoolforposition} \membersection{wxToolBar::FindToolForPosition}\label{wxtoolbarfindtoolforposition}
\constfunc{wxToolBarBaseTool*}{FindToolForPosition}{\param{const float}{ x}, \param{const float}{ y}} \constfunc{wxToolBarTool*}{FindToolForPosition}{\param{const float}{ x}, \param{const float}{ y}}
Finds a tool for the given mouse position. Finds a tool for the given mouse position.
@@ -193,35 +255,35 @@ A pointer to a tool if a tool is found, or NULL otherwise.
Used internally, and should not need to be used by the programmer. Used internally, and should not need to be used by the programmer.
\membersection{wxToolBarBase::GetDefaultButtonSize}\label{wxtoolbarbasegetdefaultbuttonsize} \membersection{wxToolBar::GetToolSize}\label{wxtoolbargettoolsize}
\func{wxSize}{GetDefaultButtonSize}{\void} \func{wxSize}{GetToolSize}{\void}
Returns the size of a whole button, which is usually larger than a tool bitmap because Returns the size of a whole button, which is usually larger than a tool bitmap because
of added 3D effects. of added 3D effects.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetDefaultSize}{wxtoolbarbasesetdefaultsize},\rtfsp \helpref{wxToolBar::SetToolBitmapSize}{wxtoolbarsettoolbitmapsize},\rtfsp
\helpref{wxToolBarBase::GetDefaultSize}{wxtoolbarbasegetdefaultsize} \helpref{wxToolBar::GetToolBitmapSize}{wxtoolbargettoolbitmapsize}
\membersection{wxToolBarBase::GetDefaultSize}\label{wxtoolbarbasegetdefaultsize} \membersection{wxToolBar::GetToolBitmapSize}\label{wxtoolbargettoolbitmapsize}
\func{wxSize}{GetDefaultSize}{\void} \func{wxSize}{GetToolBitmapSize}{\void}
Returns the size of bitmap that the toolbar expects to have. The default bitmap size is 16 by 15 pixels. Returns the size of bitmap that the toolbar expects to have. The default bitmap size is 16 by 15 pixels.
\wxheading{Remarks} \wxheading{Remarks}
Note that this is the size of the bitmap you pass to \helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}, Note that this is the size of the bitmap you pass to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool},
and not the eventual size of the tool button. and not the eventual size of the tool button.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetDefaultSize}{wxtoolbarbasesetdefaultsize},\rtfsp \helpref{wxToolBar::SetToolBitmapSize}{wxtoolbarsettoolbitmapsize},\rtfsp
\helpref{wxToolBarBase::GetDefaultButtonSize}{wxtoolbarbasegetdefaultbuttonsize} \helpref{wxToolBar::GetToolSize}{wxtoolbargettoolsize}
\membersection{wxToolBarBase::GetMargins}\label{wxtoolbarbasegetmargins} \membersection{wxToolBar::GetMargins}\label{wxtoolbargetmargins}
\constfunc{wxSize}{GetMargins}{\void} \constfunc{wxSize}{GetMargins}{\void}
@@ -229,9 +291,9 @@ Returns the left/right and top/bottom margins, which are also used for inter-too
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetMargins}{wxtoolbarbasesetmargins} \helpref{wxToolBar::SetMargins}{wxtoolbarsetmargins}
\membersection{wxToolBarBase::GetMaxSize}\label{wxtoolbarbasegetmaxsize} \membersection{wxToolBar::GetMaxSize}\label{wxtoolbargetmaxsize}
\constfunc{void}{GetMaxSize}{\param{float*}{ w}, \param{float*}{ h}} \constfunc{void}{GetMaxSize}{\param{float*}{ w}, \param{float*}{ h}}
@@ -244,7 +306,7 @@ This can be used to size a frame around the toolbar window.
\docparam{h}{Receives the maximum vertical size.} \docparam{h}{Receives the maximum vertical size.}
\membersection{wxToolBarBase::GetToolClientData}\label{wxtoolbarbasegettoolclientdata} \membersection{wxToolBar::GetToolClientData}\label{wxtoolbargettoolclientdata}
\constfunc{wxObject*}{GetToolClientData}{\param{int }{toolIndex}} \constfunc{wxObject*}{GetToolClientData}{\param{int }{toolIndex}}
@@ -252,13 +314,13 @@ Get any client data associated with the tool.
\wxheading{Parameters} \wxheading{Parameters}
\docparam{toolIndex}{Index of the tool, as passed to \helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}.} \docparam{toolIndex}{Index of the tool, as passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
\wxheading{Return value} \wxheading{Return value}
Client data, or NULL if there is none. Client data, or NULL if there is none.
\membersection{wxToolBarBase::GetToolEnabled}\label{wxtoolbarbasegettoolenabled} \membersection{wxToolBar::GetToolEnabled}\label{wxtoolbargettoolenabled}
\constfunc{bool}{GetToolEnabled}{\param{int }{toolIndex}} \constfunc{bool}{GetToolEnabled}{\param{int }{toolIndex}}
@@ -274,9 +336,9 @@ TRUE if the tool is enabled, FALSE otherwise.
%\wxheading{See also} %\wxheading{See also}
% %
%\helpref{wxToolBarBase::SetToolEnabled}{wxtoolbarbasesettoolenabled} %\helpref{wxToolBar::SetToolEnabled}{wxtoolbarsettoolenabled}
% %
\membersection{wxToolBarBase::GetToolLongHelp}\label{wxtoolbarbasegettoollonghelp} \membersection{wxToolBar::GetToolLongHelp}\label{wxtoolbargettoollonghelp}
\constfunc{wxString}{GetToolLongHelp}{\param{int }{toolIndex}} \constfunc{wxString}{GetToolLongHelp}{\param{int }{toolIndex}}
@@ -288,10 +350,10 @@ Returns the long help for the given tool.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetToolLongHelp}{wxtoolbarbasesettoollonghelp},\rtfsp \helpref{wxToolBar::SetToolLongHelp}{wxtoolbarsettoollonghelp},\rtfsp
\helpref{wxToolBarBase::SetToolShortHelp}{wxtoolbarbasesettoolshorthelp}\rtfsp \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp}\rtfsp
\membersection{wxToolBarBase::GetToolPacking}\label{wxtoolbarbasegettoolpacking} \membersection{wxToolBar::GetToolPacking}\label{wxtoolbargettoolpacking}
\constfunc{int}{GetToolPacking}{\void} \constfunc{int}{GetToolPacking}{\void}
@@ -299,9 +361,9 @@ Returns the value used for packing tools.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetToolPacking}{wxtoolbarbasesettoolpacking} \helpref{wxToolBar::SetToolPacking}{wxtoolbarsettoolpacking}
\membersection{wxToolBarBase::GetToolSeparation}\label{wxtoolbarbasegettoolseparation} \membersection{wxToolBar::GetToolSeparation}\label{wxtoolbargettoolseparation}
\constfunc{int}{GetToolSeparation}{\void} \constfunc{int}{GetToolSeparation}{\void}
@@ -309,9 +371,9 @@ Returns the default separator size.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::SetToolSeparation}{wxtoolbarbasesettoolseparation} \helpref{wxToolBar::SetToolSeparation}{wxtoolbarsettoolseparation}
\membersection{wxToolBarBase::GetToolShortHelp}\label{wxtoolbarbasegettoolshorthelp} \membersection{wxToolBar::GetToolShortHelp}\label{wxtoolbargettoolshorthelp}
\constfunc{wxString}{GetToolShortHelp}{\param{int }{toolIndex}} \constfunc{wxString}{GetToolShortHelp}{\param{int }{toolIndex}}
@@ -325,10 +387,10 @@ Returns the long help for the given tool.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolLongHelp}{wxtoolbarbasegettoollonghelp},\rtfsp \helpref{wxToolBar::GetToolLongHelp}{wxtoolbargettoollonghelp},\rtfsp
\helpref{wxToolBarBase::SetToolShortHelp}{wxtoolbarbasesettoolshorthelp}\rtfsp \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp}\rtfsp
\membersection{wxToolBarBase::GetToolState}\label{wxtoolbarbasegettoolstate} \membersection{wxToolBar::GetToolState}\label{wxtoolbargettoolstate}
\constfunc{bool}{GetToolState}{\param{int }{toolIndex}} \constfunc{bool}{GetToolState}{\param{int }{toolIndex}}
@@ -344,9 +406,9 @@ TRUE if the tool is toggled on, FALSE otherwise.
%\wxheading{See also} %\wxheading{See also}
% %
%\helpref{wxToolBarBase::SetToolState}{wxtoolbarbasesettoolstate} %\helpref{wxToolBar::SetToolState}{wxtoolbarsettoolstate}
% %
\membersection{wxToolBarBase::Layout}\label{wxtoolbarbaselayout} \membersection{wxToolBar::Layout}\label{wxtoolbarlayout}
\func{void}{Layout}{\void} \func{void}{Layout}{\void}
@@ -354,16 +416,26 @@ Called by the application after the tools have been added to
automatically lay the tools out on the window. If you have given automatically lay the tools out on the window. If you have given
absolute positions when adding the tools, do not call this. absolute positions when adding the tools, do not call this.
\membersection{wxToolBarBase::OnLeftClick}\label{wxtoolbarbaseonleftclick} This function is only implemented for some toolbar classes.
The portable way of calling it is to call \helpref{wxToolBar::Realize}{wxtoolbarrealize} after
you have added tools and separators.
\wxheading{See also}
\helpref{wxToolBar::AddTool}{wxtoolbaraddtool}, \helpref{wxToolBar::Realize}{wxtoolbarrealize}
\membersection{wxToolBar::OnLeftClick}\label{wxtoolbaronleftclick}
\func{bool}{OnLeftClick}{\param{int}{ toolIndex}, \param{bool}{ toggleDown}} \func{bool}{OnLeftClick}{\param{int}{ toolIndex}, \param{bool}{ toggleDown}}
Called when the user clicks on a tool with the left mouse button. The Called when the user clicks on a tool with the left mouse button.
programmer should override this function to detect left tool clicks.
This is the old way of detecting tool clicks; although it will still work,
you should use the EVT\_MENU or EVT\_TOOL macro instead.
\wxheading{Parameters} \wxheading{Parameters}
\docparam{toolIndex}{The identifier passed to \helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}.} \docparam{toolIndex}{The identifier passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
\docparam{toggleDown}{TRUE if the tool is a toggle and the toggle is down, otherwise is FALSE.} \docparam{toggleDown}{TRUE if the tool is a toggle and the toggle is down, otherwise is FALSE.}
@@ -375,16 +447,19 @@ specifying that toggle operations are not permitted in some circumstances.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::OnMouseEnter}{wxtoolbarbaseonmouseenter},\rtfsp \helpref{wxToolBar::OnMouseEnter}{wxtoolbaronmouseenter},\rtfsp
\helpref{wxToolBarBase::OnRightClick}{wxtoolbarbaseonrightclick} \helpref{wxToolBar::OnRightClick}{wxtoolbaronrightclick}
\membersection{wxToolBarBase::OnMouseEnter}\label{wxtoolbarbaseonmouseenter} \membersection{wxToolBar::OnMouseEnter}\label{wxtoolbaronmouseenter}
\func{void}{OnMouseEnter}{\param{int}{ toolIndex}} \func{void}{OnMouseEnter}{\param{int}{ toolIndex}}
This is called when the mouse cursor moves into a tool or out of This is called when the mouse cursor moves into a tool or out of
the toolbar. the toolbar.
This is the old way of detecting mouse enter events; although it will still work,
you should use the EVT\_TOOL\_ENTER macro instead.
\wxheading{Parameters} \wxheading{Parameters}
\docparam{toolIndex}{Greater than -1 if the mouse cursor has moved into the tool, \docparam{toolIndex}{Greater than -1 if the mouse cursor has moved into the tool,
@@ -397,16 +472,19 @@ such as a short description on the status line.}
With some derived toolbar classes, if the mouse moves quickly out of the toolbar, wxWindows may not be able to With some derived toolbar classes, if the mouse moves quickly out of the toolbar, wxWindows may not be able to
detect it. Therefore this function may not always be called when expected. detect it. Therefore this function may not always be called when expected.
\membersection{wxToolBarBase::OnRightClick}\label{wxtoolbarbaseonrightclick} \membersection{wxToolBar::OnRightClick}\label{wxtoolbaronrightclick}
\func{void}{OnRightClick}{\param{int}{ toolIndex}, \param{float}{ x}, \param{float}{ y}} \func{void}{OnRightClick}{\param{int}{ toolIndex}, \param{float}{ x}, \param{float}{ y}}
Called when the user clicks on a tool with the right mouse button. The Called when the user clicks on a tool with the right mouse button. The
programmer should override this function to detect right tool clicks. programmer should override this function to detect right tool clicks.
This is the old way of detecting tool right clicks; although it will still work,
you should use the EVT\_TOOL\_RCLICKED macro instead.
\wxheading{Parameters} \wxheading{Parameters}
\docparam{toolIndex}{The identifier passed to \helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}.} \docparam{toolIndex}{The identifier passed to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool}.}
\docparam{x}{The x position of the mouse cursor.} \docparam{x}{The x position of the mouse cursor.}
@@ -418,12 +496,24 @@ A typical use of this member might be to pop up a menu.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::OnMouseEnter}{wxtoolbarbaseonmouseenter},\rtfsp \helpref{wxToolBar::OnMouseEnter}{wxtoolbaronmouseenter},\rtfsp
\helpref{wxToolBarBase::OnLeftClick}{wxtoolbarbaseonleftclick} \helpref{wxToolBar::OnLeftClick}{wxtoolbaronleftclick}
\membersection{wxToolBarBase::SetDefaultSize}\label{wxtoolbarbasesetdefaultsize} \membersection{wxToolBar::Realize}\label{wxtoolbarrealize}
\func{void}{SetDefaultSize}{\param{const wxSize\&}{ size}} \func{bool}{Realize}{\void}
This function should be called after you have added tools. It
calls, according to the implementation,
either \helpref{wxToolBar::CreateTools}{wxtoolbarcreatetools} or
\helpref{wxToolBar::Layout}{wxtoolbarlayout}.
If you are using absolute positions for your tools when using a wxToolBarSimple object,
do not call this function. You must call it at all other times.
\membersection{wxToolBar::SetToolBitmapSize}\label{wxtoolbarsettoolbitmapsize}
\func{void}{SetToolBitmapSize}{\param{const wxSize\&}{ size}}
Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels. Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 pixels.
@@ -436,15 +526,15 @@ Sets the default size of each tool bitmap. The default bitmap size is 16 by 15 p
This should be called to tell the toolbar what the tool bitmap size is. Call This should be called to tell the toolbar what the tool bitmap size is. Call
it before you add tools. it before you add tools.
Note that this is the size of the bitmap you pass to \helpref{wxToolBarBase::AddTool}{wxtoolbarbaseaddtool}, Note that this is the size of the bitmap you pass to \helpref{wxToolBar::AddTool}{wxtoolbaraddtool},
and not the eventual size of the tool button. and not the eventual size of the tool button.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetDefaultSize}{wxtoolbarbasegetdefaultsize},\rtfsp \helpref{wxToolBar::GetToolBitmapSize}{wxtoolbargettoolbitmapsize},\rtfsp
\helpref{wxToolBarBase::GetDefaultButtonSize}{wxtoolbarbasegetdefaultbuttonsize} \helpref{wxToolBar::GetToolSize}{wxtoolbargettoolsize}
\membersection{wxToolBarBase::SetMargins}\label{wxtoolbarbasesetmargins} \membersection{wxToolBar::SetMargins}\label{wxtoolbarsetmargins}
\func{void}{SetMargins}{\param{const wxSize\&}{ size}} \func{void}{SetMargins}{\param{const wxSize\&}{ size}}
@@ -467,9 +557,9 @@ default (zero-size) margins are to be overridden.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetMargins}{wxtoolbarbasegetmargins}, \helpref{wxSize}{wxsize} \helpref{wxToolBar::GetMargins}{wxtoolbargetmargins}, \helpref{wxSize}{wxsize}
\membersection{wxToolBarBase::SetToolLongHelp}\label{wxtoolbarbasesettoollonghelp} \membersection{wxToolBar::SetToolLongHelp}\label{wxtoolbarsettoollonghelp}
\func{void}{SetToolLongHelp}{\param{int }{toolIndex}, \param{const wxString\& }{helpString}} \func{void}{SetToolLongHelp}{\param{int }{toolIndex}, \param{const wxString\& }{helpString}}
@@ -487,10 +577,10 @@ You might use the long help for displaying the tool purpose on the status line.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolLongHelp}{wxtoolbarbasegettoollonghelp},\rtfsp \helpref{wxToolBar::GetToolLongHelp}{wxtoolbargettoollonghelp},\rtfsp
\helpref{wxToolBarBase::SetToolShortHelp}{wxtoolbarbasesettoolshorthelp},\rtfsp \helpref{wxToolBar::SetToolShortHelp}{wxtoolbarsettoolshorthelp},\rtfsp
\membersection{wxToolBarBase::SetToolPacking}\label{wxtoolbarbasesettoolpacking} \membersection{wxToolBar::SetToolPacking}\label{wxtoolbarsettoolpacking}
\func{void}{SetToolPacking}{\param{int}{ packing}} \func{void}{SetToolPacking}{\param{int}{ packing}}
@@ -507,9 +597,9 @@ and for spacing in the horizontal direction if the toolbar is vertical.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolPacking}{wxtoolbarbasegettoolpacking} \helpref{wxToolBar::GetToolPacking}{wxtoolbargettoolpacking}
\membersection{wxToolBarBase::SetToolShortHelp}\label{wxtoolbarbasesettoolshorthelp} \membersection{wxToolBar::SetToolShortHelp}\label{wxtoolbarsettoolshorthelp}
\func{void}{SetToolShortHelp}{\param{int }{toolIndex}, \param{const wxString\& }{helpString}} \func{void}{SetToolShortHelp}{\param{int }{toolIndex}, \param{const wxString\& }{helpString}}
@@ -527,9 +617,9 @@ An application might use short help for identifying the tool purpose in a toolti
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolShortHelp}{wxtoolbarbasegettoolshorthelp}, \helpref{wxToolBarBase::SetToolLongHelp}{wxtoolbarbasesettoollonghelp} \helpref{wxToolBar::GetToolShortHelp}{wxtoolbargettoolshorthelp}, \helpref{wxToolBar::SetToolLongHelp}{wxtoolbarsettoollonghelp}
\membersection{wxToolBarBase::SetToolSeparation}\label{wxtoolbarbasesettoolseparation} \membersection{wxToolBar::SetToolSeparation}\label{wxtoolbarsettoolseparation}
\func{void}{SetToolSeparation}{\param{int}{ separation}} \func{void}{SetToolSeparation}{\param{int}{ separation}}
@@ -541,9 +631,9 @@ Sets the default separator size. The default value is 5.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::AddSeparator}{wxtoolbarbaseaddseparator} \helpref{wxToolBar::AddSeparator}{wxtoolbaraddseparator}
\membersection{wxToolBarBase::ToggleTool}\label{wxtoolbarbasetoggletool} \membersection{wxToolBar::ToggleTool}\label{wxtoolbartoggletool}
\func{void}{ToggleTool}{\param{int }{toolIndex}, \param{const bool}{ toggle}} \func{void}{ToggleTool}{\param{int }{toolIndex}, \param{const bool}{ toggle}}
@@ -561,213 +651,6 @@ Only applies to a tool that has been specified as a toggle tool.
\wxheading{See also} \wxheading{See also}
\helpref{wxToolBarBase::GetToolState}{wxtoolbarbasegettoolstate} \helpref{wxToolBar::GetToolState}{wxtoolbargettoolstate}
\section{\class{wxToolBar95}}\label{wxtoolbar95}
This class should be used when a 3D-effect toolbar is required under Windows 95.
It uses the native toolbar control.
\wxheading{Derived from}
\helpref{wxToolBarBase}{wxtoolbarbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Window styles}
\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxTB\_FLAT}}{Gives the toolbar a flat look ('coolbar' or 'flatbar' style).}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
\wxheading{Remarks}
Note that this toolbar paints tools to reflect user-selected colours.
The toolbar orientation must always be {\bf wxVERTICAL}.
For member functions, see the documentation for \helpref{wxToolBarBase}{wxtoolbarbase}.
\wxheading{See also}
\overview{Toolbar overview}{wxtoolbaroverview},\rtfsp
\helpref{wxToolBarBase}{wxtoolbarbase},\rtfsp
\helpref{wxToolBarSimple}{wxtoolbarsimple},\rtfsp
\helpref{wxToolBarMSW}{wxtoolbarmsw}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxToolBar95::wxToolBar95}\label{wxtoolbar95constr}
\func{}{wxToolBar95}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long }{style = 0}, \param{int }{orientation = wxVERTICAL},\rtfsp
\param{int }{nRowsOrColumns = 1}, \param{const wxString\& }{name = ``toolBar"}}
Constructs a toolbar.
\wxheading{Parameters}
\docparam{parent}{Parent window. Must not be NULL.}
\docparam{id}{Window identifier. A value of -1 indicates a default value.}
\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
\docparam{orientation}{Specifies a wxVERTICAL or wxHORIZONTAL orientation for laying out
the toolbar.}
\docparam{nRowsOrColumns}{Specifies the number of rows or
columns, whose meaning depends on {\it orientation}. If laid out
vertically, {\it nRowsOrColumns} specifies the number of rows to draw
before the next column is started; if horizontal, it refers to the
number of columns to draw before the next row is started.}
\docparam{style}{Window style. See \helpref{wxToolBar95}{wxtoolbar95}.}
\docparam{name}{Window name.}
\section{\class{wxToolBarMSW}}\label{wxtoolbarmsw}
This class should be used when a 3D-effect toolbar is required for Windows versions earlier
than Windows 95.
\wxheading{Derived from}
\helpref{wxToolBarBase}{wxtoolbarbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Window styles}
There are no specific styles for this class.
See also \helpref{window styles overview}{windowstyles}.
\wxheading{Remarks}
Note that this toolbar does not paint tools to reflect user-selected colours: grey shading is used.
For member functions, see the documentation for \helpref{wxToolBarBase}{wxtoolbarbase}.
\wxheading{See also}
\overview{Toolbar overview}{wxtoolbaroverview},\rtfsp
\helpref{wxToolBarBase}{wxtoolbarbase},\rtfsp
\helpref{wxToolBarSimple}{wxtoolbarsimple},\rtfsp
\helpref{wxToolBar95}{wxtoolbar95}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxToolBarMSW::wxToolBarMSW}\label{wxtoolbarmswconstr}
\func{}{wxToolBarMSW}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long }{style = 0}, \param{int }{orientation = wxVERTICAL},\rtfsp
\param{int }{nRowsOrColumns = 1}, \param{const wxString\& }{name = ``toolBar"}}
Constructs a toolbar.
\wxheading{Parameters}
\docparam{parent}{Parent window. Must not be NULL.}
\docparam{id}{Window identifier. A value of -1 indicates a default value.}
\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
\docparam{orientation}{Specifies a wxVERTICAL or wxHORIZONTAL orientation for laying out
the toolbar.}
\docparam{nRowsOrColumns}{Specifies the number of rows or
columns, whose meaning depends on {\it orientation}. If laid out
vertically, {\it nRowsOrColumns} specifies the number of rows to draw
before the next column is started; if horizontal, it refers to the
number of columns to draw before the next row is started.}
\docparam{style}{Window style. See \helpref{wxToolBarMSW}{wxtoolbarmsw}.}
\docparam{name}{Window name.}
\section{\class{wxToolBarSimple}}\label{wxtoolbarsimple}
This is the generic toolbar class which has an identical appearance
on all platforms.
\wxheading{Derived from}
\helpref{wxToolBarBase}{wxtoolbarbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Window styles}
\twocolwidtha{5cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxTB\_3DBUTTONS}}{Gives the simple toolbar a mild 3D look to its buttons.}
\end{twocollist}
See also \helpref{window styles overview}{windowstyles}.
\wxheading{Remarks}
In this class, disabling a toolbar tool does not change its appearance.
For member functions, see the documentation for \helpref{wxToolBarBase}{wxtoolbarbase}.
\wxheading{See also}
\overview{Toolbar overview}{wxtoolbaroverview},\rtfsp
\helpref{wxToolBarBase}{wxtoolbarbase},\rtfsp
\helpref{wxToolBarSimple}{wxtoolbarsimple},\rtfsp
\helpref{wxToolBar95}{wxtoolbar95}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxToolBarSimple::wxToolBarSimple}\label{wxtoolbarsimpleconstr}
\func{}{wxToolBarSimple}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long }{style = 0}, \param{int }{orientation = wxVERTICAL},\rtfsp
\param{int }{nRowsOrColumns = 1}, \param{const wxString\& }{name = ``toolBar"}}
Constructs a toolbar.
\wxheading{Parameters}
\docparam{parent}{Parent window. Must not be NULL.}
\docparam{id}{Window identifier. A value of -1 indicates a default value.}
\docparam{pos}{Window position. If the position (-1, -1) is specified then a default position is chosen.}
\docparam{size}{Window size. If the default size (-1, -1) is specified then a default size is chosen.}
\docparam{orientation}{Specifies a wxVERTICAL or wxHORIZONTAL orientation for laying out
the toolbar.}
\docparam{nRowsOrColumns}{Specifies the number of rows or
columns, whose meaning depends on {\it orientation}. If laid out
vertically, {\it nRowsOrColumns} specifies the number of rows to draw
before the next column is started; if horizontal, it refers to the
number of columns to draw before the next row is started.}
\docparam{style}{Window style. See \helpref{wxToolBarSimple}{wxtoolbarsimple}.}
\docparam{name}{Window name.}

View File

@@ -1,7 +1,6 @@
\section{Toolbar overview}\label{wxtoolbaroverview} \section{Toolbar overview}\label{wxtoolbaroverview}
Classes: \helpref{wxToolBarBase}{wxtoolbarbase}, \helpref{wxToolBarSimple}{wxtoolbarsimple},\rtfsp Classes: \helpref{wxToolBar}{wxtoolbar}
\helpref{wxToolBarMSW}{wxtoolbarmsw}, \helpref{wxToolBar95}{wxtoolbar95}
The toolbar family of classes allows an application to use toolbars The toolbar family of classes allows an application to use toolbars
in a variety of configurations and styles. in a variety of configurations and styles.
@@ -16,21 +15,10 @@ out the classes. This is because there are a number of different toolbar
styles that you may wish to use simultaneously, and also, future styles that you may wish to use simultaneously, and also, future
toolbar implementations will emerge (for example, using the toolbar implementations will emerge (for example, using the
new-style Windows `coolbar' as seen in Microsoft applications) which new-style Windows `coolbar' as seen in Microsoft applications) which
cannot be shoe-horned into the one class. cannot all be shoe-horned into the one class.
This does mean that if you wish to use a more sophisticated toolbar For each platform, the symbol {\bf wxToolBar} is defined to be one of the
on one platform (say, wxToolBar95) and a simple toolbar on another specific toolbar classes.
platform (wxToolBarSimple), then you will need some simple ifdefing, such as:
\begin{verbatim}
#ifdef wx_msw
# define wxToolBar wxToolBar95
#else
# define wxToolBar wxToolBarSimple
#endif
\end{verbatim}
Fortunately, the APIs of the toolbar classes are virtually identical.
The following is a summary of the toolbar classes and their differences. The following is a summary of the toolbar classes and their differences.
@@ -43,15 +31,15 @@ with the Windows look and feel. This toolbar can scroll, and you can have arbitr
numbers of rows and columns. numbers of rows and columns.
\item {\bf wxToolBarMSW.} This class implements an old-style Windows toolbar, only on \item {\bf wxToolBarMSW.} This class implements an old-style Windows toolbar, only on
Windows. There are small, three-dimensional buttons, which do not (currently) reflect Windows. There are small, three-dimensional buttons, which do not (currently) reflect
the current Windows colour settings: the buttons are grey. the current Windows colour settings: the buttons are grey. This is the default wxToolBar
on 16-bit windows.
\item {\bf wxToolBar95.} Uses the native Windows 95 toolbar class. It dynamically adjusts its \item {\bf wxToolBar95.} Uses the native Windows 95 toolbar class. It dynamically adjusts its
background and button colours according to user colour settings. background and button colours according to user colour settings.
CreateTools must be called after the tools have been added. CreateTools must be called after the tools have been added.
No absolute positioning is supported but you can specify the number No absolute positioning is supported but you can specify the number
of rows, and add tool separators with {\bf AddSeparator}. {\bf Layout} does nothing. of rows, and add tool separators with {\bf AddSeparator}.
Tooltips are supported. {\bf OnRightClick} is not supported. Tooltips are supported. {\bf OnRightClick} is not supported. This is the default wxToolBar
For some reason, a wxToolBar95 control cannot be moved to any on Windows 95, Windows NT 4 and above.
position other than the top-left of the frame.
\end{itemize} \end{itemize}
A toolbar might appear as a single row of images under A toolbar might appear as a single row of images under
@@ -73,56 +61,224 @@ as the demo shows, before adding tools to the button bar. Don't supply more than
one bitmap for each tool, because the toolbar generates all three images (normal, one bitmap for each tool, because the toolbar generates all three images (normal,
depressed and checked) from the single bitmap you give it. depressed and checked) from the single bitmap you give it.
Mouse click events for a given button are sent to a member called To intercept
\rtfsp{\bf OnLeftClick}, and so an application must derive from wxToolBar in order
to use it. The application can also handle {\bf OnMouseEnter} events for
the tools, to give the user extra feedback about the tools as the mouse
moves over them.
\subsection{Using the toolbar library} \subsection{Using the toolbar library}
Include one of the files {\tt tbarsmpl.h, tbar95.h, tbarmsw.h}. Include {\tt "wx/toolbar.h"}, or if using a class directly, one of:
Example of toolbar use are given in the sample programs tbarsmpl, \begin{itemize}\itemsep=0pt
tbarmsw and tbar95. \item {\tt "wx/msw/tbarmsw.h} for wxToolBarMSW
\item {\tt "wx/msw/tbar95.h} for wxToolBar95
\item {\tt "wx/tbarsmpl.h} for wxToolBarSimple
\end{itemize}
Each sample creates a main window, and two toolbars: a floating toolbar Example of toolbar use are given in the sample program ``toolbar''. The
with 24 tools, and a toolbar along the top of the main drawing window, divided into groups. source is given below.
The test program defines a general-purpose derived frame called
\rtfsp{\bf wxFrameWithToolBar} which can manage a frame with one main subwindow
and one horizontal toolbar.
Note that one of the bitmaps on the floating toolbar is a small version of the
main graphic: this demonstrates how a memory device context can be used to
draw into a bitmap. An application which allowed the user to build up a symbol
library dynamically might create this kind of bitmap.
Left clicks and movements over the toolbars are intercepted and information
is displayed on the status line.
The following fragment illustrates the essence of creating a toolbar.
{\small
\begin{verbatim} \begin{verbatim}
/////////////////////////////////////////////////////////////////////////////
// Name: test.cpp
// Purpose: wxToolBar sample
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#include "wx/toolbar.h"
#include "test.h"
IMPLEMENT_APP(MyApp)
#ifdef __X__
// TODO: include XBM or XPM icons for X apps
#endif
// The `main program' equivalent, creating the windows and returning the
// main frame
bool MyApp::OnInit(void)
{
// Create the main frame window
MyFrame* frame = new MyFrame(NULL, -1, "wxToolBar Sample",
wxPoint(100, 100), wxSize(450, 300));
// Give it a status line
frame->CreateStatusBar();
// Give it an icon
#ifdef __WXMSW__
frame->SetIcon(wxIcon("mondrian"));
#endif
#ifdef __X__
frame->SetIcon(wxIcon("mondrian.xbm"));
#endif
// Make a menubar
wxMenu *fileMenu = new wxMenu;
fileMenu->Append(wxID_EXIT, "E&xit");
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP, "&About");
wxMenuBar* menuBar = new wxMenuBar;
menuBar->Append(fileMenu, "&File");
menuBar->Append(helpMenu, "&Help");
// Associate the menu bar with the frame
frame->SetMenuBar(menuBar);
// Create the toolbar
frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
InitToolbar(frame->GetToolBar());
// Force a resize. This should probably be replaced by a call to a wxFrame
// function that lays out default decorations and the remaining content window.
frame->OnSize(wxSizeEvent(wxSize(-1, -1), frame->GetId()));
frame->Show(TRUE);
frame->SetStatusText("Hello, wxWindows");
SetTopWindow(frame);
return TRUE;
}
bool MyApp::InitToolbar(wxToolBar* toolBar)
{
toolBar->SetMargins(5, 5);
// Set up toolbar
wxBitmap* toolBarBitmaps[8];
#ifdef __WXMSW__
toolBarBitmaps[0] = new wxBitmap("icon1"); toolBarBitmaps[0] = new wxBitmap("icon1");
toolBarBitmaps[1] = new wxBitmap("icon2"); toolBarBitmaps[1] = new wxBitmap("icon2");
toolBarBitmaps[2] = new wxBitmap("icon3"); toolBarBitmaps[2] = new wxBitmap("icon3");
... toolBarBitmaps[3] = new wxBitmap("icon4");
toolBarBitmaps[4] = new wxBitmap("icon5");
toolBarBitmaps[5] = new wxBitmap("icon6");
toolBarBitmaps[6] = new wxBitmap("icon7");
toolBarBitmaps[7] = new wxBitmap("icon8");
#endif
#ifdef __X__
// TODO
toolBarBitmaps[0] = new wxBitmap(...);
toolBarBitmaps[1] = new wxBitmap(...);
toolBarBitmaps[2] = new wxBitmap(...);
toolBarBitmaps[3] = new wxBitmap(...);
toolBarBitmaps[4] = new wxBitmap(...);
toolBarBitmaps[5] = new wxBitmap(...);
toolBarBitmaps[6] = new wxBitmap(...);
toolBarBitmaps[7] = new wxBitmap(...);
#endif
toolBarFrame = new wxFrame(NULL, "Tools", -1, wxPoint(0, 0), wxSize(300, 200), #ifdef __WXMSW__
wxDEFAULT_FRAME_STYLE | wxSTAY_ON_TOP); int width = 24;
#else
int width = 16;
#endif
int offX = 5;
int currentX = 5;
// 5 rows toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "New file");
toolBar = new TestToolBar(toolBarFrame, -1, wxPoint(10, 10), wxSize(-1, -1), 0, wxVERTICAL, 5); currentX += width + 5;
toolBar->SetMargins(2, 2); toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Open file");
currentX += width + 5;
toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Save file");
currentX += width + 5;
toolBar->AddSeparator();
toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Copy");
currentX += width + 5;
toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Cut");
currentX += width + 5;
toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Paste");
currentX += width + 5;
toolBar->AddSeparator();
toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, NULL, "Print");
currentX += width + 5;
toolBar->AddSeparator();
toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, NULL, "Help");
for (int i = 10; i < 25; i++) toolBar->Realize();
toolBar->AddTool(i, toolBarBitmaps[i], NULL, TRUE);
toolBar->Layout(); // Can delete the bitmaps since they're reference counted
float maxWidth, maxHeight; int i;
wxSize size(toolBar->GetMaxSize()); for (i = 0; i < 8; i++)
toolBarFrame->SetClientSize(maxSize.x, maxSize.y); delete toolBarBitmaps[i];
toolBarFrame->Show(TRUE);
return TRUE;
}
// wxID_HELP will be processed for the 'About' menu and the toolbar help button.
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_EXIT, MyFrame::OnQuit)
EVT_MENU(wxID_HELP, MyFrame::OnAbout)
EVT_CLOSE(MyFrame::OnCloseWindow)
EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick)
EVT_TOOL_ENTER(ID_TOOLBAR, MyFrame::OnToolEnter)
END_EVENT_TABLE()
// Define my frame constructor
MyFrame::MyFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos,
const wxSize& size, long style):
wxFrame(parent, id, title, pos, size, style)
{
m_textWindow = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE);
}
void MyFrame::OnQuit(wxCommandEvent& event)
{
Close(TRUE);
}
void MyFrame::OnAbout(wxCommandEvent& event)
{
(void)wxMessageBox("wxWindows wxToolBar demo\n", "About wxToolBar");
}
// Define the behaviour for the frame closing
// - must delete all frames except for the main one.
void MyFrame::OnCloseWindow(wxCloseEvent& event)
{
Destroy();
}
void MyFrame::OnToolLeftClick(wxCommandEvent& event)
{
wxString str;
str.Printf("Clicked on tool %d", event.GetId());
SetStatusText(str);
}
void MyFrame::OnToolEnter(wxCommandEvent& event)
{
if (event.GetSelection() > -1)
{
wxString str;
str.Printf("This is tool number %d", event.GetSelection());
SetStatusText(str);
}
else
SetStatusText("");
}
\end{verbatim} \end{verbatim}
}

View File

@@ -1,15 +1,9 @@
; This file is maintained by HCW. Do not modify this file directly.
[OPTIONS] [OPTIONS]
HCW=0 COMPRESS=HIGH
COMPRESS=60 Hall Zeck
LCID=0x809 0x0 0x0 ;English (United Kingdom)
REPORT=Yes
CONTENTS=Contents CONTENTS=Contents
TITLE=wxWindows Manual TITLE=wxWindows Manual
BMROOT=..\..\..\..\wxwind~1\docs\latex\wx BMROOT=..\..\..\..\wxwind~1\docs\latex\wx
BMROOT=Assume that bitmaps are where the source is
HLP=.\wx.hlp
[FILES] [FILES]
wx.rtf wx.rtf

View File

@@ -161,7 +161,14 @@ public:
void SetExpandEnvVars(bool bDoIt = TRUE) { m_bExpandEnvVars = bDoIt; } void SetExpandEnvVars(bool bDoIt = TRUE) { m_bExpandEnvVars = bDoIt; }
// does expansion only if needed // does expansion only if needed
wxString ExpandEnvVars(const wxString& str) const wxString ExpandEnvVars(const wxString& str) const
{ return IsExpandingEnvVars() ? wxExpandEnvVars(str) : str; } {
wxString tmp; // Required for BC++
if (IsExpandingEnvVars())
tmp = wxExpandEnvVars(str);
else
tmp = str;
return tmp;
}
protected: protected:
static bool IsImmutable(const char *szKey) static bool IsImmutable(const char *szKey)

View File

@@ -367,8 +367,10 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
*/ */
#define wxTB_3DBUTTONS 0x8000 #define wxTB_3DBUTTONS 0x8000
#define wxTB_HORIZONTAL 0x0002
#define wxTB_VERTICAL 0x0004
// Flatbar/Coolbar under Win98 // Flatbar/Coolbar under Win98
#define wxTB_FLAT 0x0002 #define wxTB_FLAT 0x0008
/* /*
* Apply to all panel items * Apply to all panel items
@@ -665,16 +667,18 @@ typedef enum {
// Possible SetSize flags // Possible SetSize flags
// Use internally-calculated width if -1 // Use internally-calculated width if -1
#define wxSIZE_AUTO_WIDTH 1 #define wxSIZE_AUTO_WIDTH 0x0001
// Use internally-calculated height if -1 // Use internally-calculated height if -1
#define wxSIZE_AUTO_HEIGHT 2 #define wxSIZE_AUTO_HEIGHT 0x0002
// Use internally-calculated width and height if each is -1 // Use internally-calculated width and height if each is -1
#define wxSIZE_AUTO 3 #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT)
// Ignore missing (-1) dimensions (use existing). // Ignore missing (-1) dimensions (use existing).
// For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. // For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code.
#define wxSIZE_USE_EXISTING 0 #define wxSIZE_USE_EXISTING 0x0000
// Allow -1 as a valid position // Allow -1 as a valid position
#define wxSIZE_ALLOW_MINUS_ONE 4 #define wxSIZE_ALLOW_MINUS_ONE 0x0004
// Don't do parent client adjustments (for implementation only)
#define wxSIZE_NO_ADJUSTMENTS 0x0008
// Clipboard formats // Clipboard formats
// Numbers as per winuser.h // Numbers as per winuser.h
@@ -858,7 +862,6 @@ typedef unsigned short WXWORD;
typedef unsigned int WXWPARAM; typedef unsigned int WXWPARAM;
typedef long WXLPARAM; typedef long WXLPARAM;
typedef unsigned long WXCOLORREF; typedef unsigned long WXCOLORREF;
typedef void * WXRGN;
typedef void * WXRGNDATA; typedef void * WXRGNDATA;
typedef void * WXMSG; typedef void * WXMSG;
typedef unsigned long WXHCONV; typedef unsigned long WXHCONV;

View File

@@ -1047,6 +1047,7 @@ typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&);
typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&);
typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxShowEvent&);
typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&);
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
// N.B. In GNU-WIN32, you *have* to take the address of a member function // N.B. In GNU-WIN32, you *have* to take the address of a member function
// (use &) or the compiler crashes... // (use &) or the compiler crashes...
@@ -1097,7 +1098,7 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, NULL }, #define EVT_SHOW(func) { wxEVT_SHOW, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxShowEventFunction) & func, NULL },
#define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, NULL }, #define EVT_MAXIMIZE(func) { wxEVT_MAXIMIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMaximizeEventFunction) & func, NULL },
#define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, NULL }, #define EVT_ICONIZE(func) { wxEVT_ICONIZE, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxIconizeEventFunction) & func, NULL },
#define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & func, NULL }, #define EVT_NAVIGATION_KEY(func) { wxEVT_NAVIGATION_KEY, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) (wxNavigationKeyEventFunction) & func, NULL },
// Mouse events // Mouse events
#define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, NULL }, #define EVT_LEFT_DOWN(func) { wxEVT_LEFT_DOWN, -1, -1, (wxObjectEventFunction) (wxEventFunction) (wxMouseEventFunction) & func, NULL },
@@ -1190,7 +1191,6 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
#define EVT_TOOL_RCLICKED(id, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL }, #define EVT_TOOL_RCLICKED(id, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL },
#define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL }, #define EVT_TOOL_RCLICKED_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_RCLICKED, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL },
#define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL }, #define EVT_TOOL_ENTER(id, fn) { wxEVT_COMMAND_TOOL_ENTER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL },
#define EVT_TOOL_ENTER_RANGE(id1, id2, fn) { wxEVT_COMMAND_TOOL_ENTER, id1, id2, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL },
#define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL }, #define EVT_CHECKLISTBOX(id, fn) { wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) & fn, NULL },
// Generic command events // Generic command events

View File

@@ -17,8 +17,10 @@
#endif #endif
#include "wx/window.h" #include "wx/window.h"
#include "wx/toolbar.h"
WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr; WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr;
class WXDLLEXPORT wxMenuBar; class WXDLLEXPORT wxMenuBar;
class WXDLLEXPORT wxStatusBar; class WXDLLEXPORT wxStatusBar;
@@ -58,10 +60,6 @@ public:
void GetPosition(int *x, int *y) const ; void GetPosition(int *x, int *y) const ;
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
// Toolbar: if made known to the frame, the frame will manage it automatically.
virtual inline void SetToolBar(wxWindow *toolbar) { m_frameToolBar = toolbar; }
virtual inline wxWindow *GetToolBar(void) const { return m_frameToolBar; }
virtual bool OnClose(void); virtual bool OnClose(void);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
@@ -90,8 +88,20 @@ public:
virtual void SetIcon(const wxIcon& icon); virtual void SetIcon(const wxIcon& icon);
// Create status line // Create status line
virtual bool CreateStatusBar(int number=1); virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
const wxString& name = "statusBar");
inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
virtual void PositionStatusBar(void);
virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name);
// Create toolbar
virtual wxToolBar* CreateToolBar(long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, const wxString& name = wxToolBarNameStr);
virtual wxToolBar *OnCreateToolBar(long style, wxWindowID id, const wxString& name);
// If made known to the frame, the frame will manage it automatically.
virtual inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
virtual inline wxToolBar *GetToolBar(void) const { return m_frameToolBar; }
virtual void PositionToolBar(void);
// Set status line text // Set status line text
virtual void SetStatusText(const wxString& text, int number = 0); virtual void SetStatusText(const wxString& text, int number = 0);
@@ -118,8 +128,8 @@ public:
virtual void Maximize(bool maximize); virtual void Maximize(bool maximize);
virtual bool LoadAccelerators(const wxString& table); virtual bool LoadAccelerators(const wxString& table);
virtual void PositionStatusBar(void); // Responds to colour changes
virtual wxStatusBar *OnCreateStatusBar(int number); void OnSysColourChanged(wxSysColourChangedEvent& event);
// Query app for menu item updates (called from OnIdle) // Query app for menu item updates (called from OnIdle)
void DoMenuUpdates(void); void DoMenuUpdates(void);
@@ -127,8 +137,8 @@ public:
WXHMENU GetWinMenu(void) const ; WXHMENU GetWinMenu(void) const ;
// Responds to colour changes // Checks if there is a toolbar, and returns the first free client position
void OnSysColourChanged(wxSysColourChangedEvent& event); virtual wxPoint GetClientAreaOrigin() const;
// Handlers // Handlers
bool MSWOnPaint(void); bool MSWOnPaint(void);
@@ -148,7 +158,7 @@ protected:
bool m_iconized; bool m_iconized;
WXHICON m_defaultIcon; WXHICON m_defaultIcon;
static bool m_useNativeStatusBar; static bool m_useNativeStatusBar;
wxWindow * m_frameToolBar ; wxToolBar * m_frameToolBar ;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@@ -43,8 +43,12 @@ wxFont WXDLLEXPORT wxCreateFontFromLogFont(LOGFONT *logFont); // , bool createNe
# ifdef __BORLANDC__ # ifdef __BORLANDC__
# define CASTWNDPROC # define CASTWNDPROC
# else # else
typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long); # ifdef __WIN32__
# define CASTWNDPROC (WndProcCast) typedef long (_stdcall * WndProcCast) (HWND, unsigned int, unsigned int, long);
# define CASTWNDPROC (WndProcCast)
# else
# define CASTWNDPROC
# endif
# endif # endif
#endif #endif

View File

@@ -42,6 +42,7 @@ public:
wxRegion(long x, long y, long w, long h); wxRegion(long x, long y, long w, long h);
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegion(const wxRect& rect); wxRegion(const wxRect& rect);
wxRegion(WXHRGN hRegion); // Hangs on to this region
wxRegion(void); wxRegion(void);
~wxRegion(void); ~wxRegion(void);

View File

@@ -21,12 +21,6 @@
WXDLLEXPORT_DATA(extern const char*) wxToolBarNameStr; 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 class WXDLLEXPORT wxToolBar95: public wxToolBarBase
{ {
DECLARE_DYNAMIC_CLASS(wxToolBar95) DECLARE_DYNAMIC_CLASS(wxToolBar95)
@@ -37,25 +31,17 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
wxToolBar95(void); 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, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, inline wxToolBar95(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, long style = wxNO_BORDER|wxTB_HORIZONTAL,
int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr) const wxString& name = wxToolBarNameStr)
{ {
Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); Create(parent, id, pos, size, style, name);
} }
~wxToolBar95(void); ~wxToolBar95(void);
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, long style = wxNO_BORDER|wxTB_HORIZONTAL,
int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); const wxString& name = wxToolBarNameStr);
// Call default behaviour // Call default behaviour
void OnPaint(wxPaintEvent& event) { Default() ; } void OnPaint(wxPaintEvent& event) { Default() ; }
@@ -72,15 +58,14 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL, bool toggle = FALSE, long xPos = -1, long yPos = -1, wxObject *clientData = NULL,
const wxString& helpString1 = "", const wxString& helpString2 = ""); const wxString& helpString1 = "", const wxString& helpString2 = "");
// New members
// Set default bitmap size // Set default bitmap size
void SetDefaultSize(const wxSize& size); void SetToolBitmapSize(const wxSize& size);
void EnableTool(int toolIndex, bool enable); // additional drawing on enabling void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
void ClearTools(void); void ClearTools(void);
// The button size is bigger than the bitmap size // The button size is bigger than the bitmap size
wxSize GetDefaultButtonSize(void) const; wxSize GetToolSize(void) const;
wxSize GetMaxSize(void) const; wxSize GetMaxSize(void) const;
void GetSize(int *w, int *y) const; void GetSize(int *w, int *y) const;
@@ -90,6 +75,9 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
virtual void SetRows(int nRows); virtual void SetRows(int nRows);
virtual void Layout(void) {} virtual void Layout(void) {}
// The post-tool-addition call
bool Realize() { return CreateTools(); };
// IMPLEMENTATION // IMPLEMENTATION
bool MSWCommand(WXUINT param, WXWORD id); bool MSWCommand(WXUINT param, WXWORD id);
bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam); bool MSWNotify(WXWPARAM wParam, WXLPARAM lParam);

View File

@@ -21,6 +21,8 @@
WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr; WXDLLEXPORT_DATA(extern const char*) wxButtonBarNameStr;
class WXDLLEXPORT wxMemoryDC;
// Non-Win95 (WIN32, WIN16, UNIX) version // Non-Win95 (WIN32, WIN16, UNIX) version
class WXDLLEXPORT wxToolBarMSW: public wxToolBarBase class WXDLLEXPORT wxToolBarMSW: public wxToolBarBase
@@ -32,23 +34,13 @@ public:
*/ */
wxToolBarMSW(void); 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, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, inline wxToolBarMSW(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, long style = wxNO_BORDER|wxTB_HORIZONTAL, const wxString& name = wxButtonBarNameStr)
int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr)
{ {
Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); Create(parent, id, pos, size, style, name);
} }
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, long style = wxNO_BORDER|wxTB_HORIZONTAL, const wxString& name = wxButtonBarNameStr);
int RowsOrColumns = 2, const wxString& name = wxButtonBarNameStr);
~wxToolBarMSW(void); ~wxToolBarMSW(void);
@@ -66,13 +58,18 @@ public:
void DrawTool(wxDC& dc, wxMemoryDC& memDc, wxToolBarTool *tool); void DrawTool(wxDC& dc, wxMemoryDC& memDc, wxToolBarTool *tool);
// New members
// Set default bitmap size // Set default bitmap size
virtual void SetDefaultSize(const wxSize& size); virtual void SetToolBitmapSize(const wxSize& size);
void EnableTool(int toolIndex, bool enable); // additional drawing on enabling void EnableTool(int toolIndex, bool enable); // additional drawing on enabling
// The button size is bigger than the bitmap size // The button size is bigger than the bitmap size
wxSize GetDefaultButtonSize(void) const; wxSize GetToolSize(void) const;
void Layout(void);
// The post-tool-addition call
bool Realize() { Layout(); return TRUE; };
protected: protected:
void DrawTool(wxDC& dc, wxToolBarTool *tool, int state); void DrawTool(wxDC& dc, wxToolBarTool *tool, int state);
@@ -89,7 +86,9 @@ public:
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo); WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, void *lpBitmapInfo);
WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap); WXHBITMAP CreateMappedBitmap(WXHINSTANCE hInstance, WXHBITMAP hBitmap);
protected: protected:
int m_currentRowsOrColumns;
long m_lastX, m_lastY;
WXHBRUSH m_hbrDither; WXHBRUSH m_hbrDither;
WXDWORD m_rgbFace; WXDWORD m_rgbFace;
@@ -110,12 +109,6 @@ public:
DECLARE_EVENT_TABLE() 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) // States (not all of them currently used)
// //

View File

@@ -25,6 +25,7 @@
#include "wx/event.h" #include "wx/event.h"
#include "wx/string.h" #include "wx/string.h"
#include "wx/list.h" #include "wx/list.h"
#include "wx/region.h"
#define wxKEY_SHIFT 1 #define wxKEY_SHIFT 1
#define wxKEY_CTRL 2 #define wxKEY_CTRL 2
@@ -202,6 +203,12 @@ public:
// Accept files for dragging // Accept files for dragging
virtual void DragAcceptFiles(bool accept); virtual void DragAcceptFiles(bool accept);
// Update region access
virtual wxRegion GetUpdateRegion() const;
virtual bool IsExposed(int x, int y, int w, int h) const;
virtual bool IsExposed(const wxPoint& pt) const;
virtual bool IsExposed(const wxRect& rect) const;
// Set/get the window title // Set/get the window title
virtual inline void SetTitle(const wxString& WXUNUSED(title)) {}; virtual inline void SetTitle(const wxString& WXUNUSED(title)) {};
inline virtual wxString GetTitle(void) const { return wxString(""); }; inline virtual wxString GetTitle(void) const { return wxString(""); };
@@ -398,6 +405,14 @@ public:
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION //// IMPLEMENTATION
// For implementation purposes - sometimes decorations make the client area
// smaller
virtual wxPoint GetClientAreaOrigin() const;
// Makes an adjustment to the window position (for example, a frame that has
// a toolbar that it manages itself).
virtual void AdjustForParentClientOrigin(int& x, int& y, int sizeFlags);
// Windows subclassing // Windows subclassing
void SubclassWin(WXHWND hWnd); void SubclassWin(WXHWND hWnd);
void UnsubclassWin(void); void UnsubclassWin(void);
@@ -639,10 +654,15 @@ public:
WXUINT m_lastMsg; WXUINT m_lastMsg;
WXWPARAM m_lastWParam; WXWPARAM m_lastWParam;
WXLPARAM m_lastLParam; WXLPARAM m_lastLParam;
wxRegion m_updateRegion;
/*
wxRectangle m_updateRect; // Bounding box for screen damage area wxRectangle m_updateRect; // Bounding box for screen damage area
#ifdef __WIN32__ #ifdef __WIN32__
WXHRGN m_updateRgn; // NT allows access to the rectangle list WXHRGN m_updateRgn; // NT allows access to the rectangle list
#endif #endif
*/
WXHANDLE m_acceleratorTable; WXHANDLE m_acceleratorTable;
WXHMENU m_hMenu; // Menu, if any WXHMENU m_hMenu; // Menu, if any
wxList * m_children; // Window's children wxList * m_children; // Window's children
@@ -706,6 +726,8 @@ inline bool wxWindow::IsBeingDeleted(void) { return m_isBeingDeleted; }
// Window specific (so far) // Window specific (so far)
wxWindow* WXDLLEXPORT wxGetActiveWindow(void); wxWindow* WXDLLEXPORT wxGetActiveWindow(void);
// OBSOLETE
#if 0
// Allows iteration through damaged rectangles in OnPaint // Allows iteration through damaged rectangles in OnPaint
class WXDLLEXPORT wxUpdateIterator class WXDLLEXPORT wxUpdateIterator
{ {
@@ -728,6 +750,7 @@ class WXDLLEXPORT wxUpdateIterator
int GetW(); int GetW();
int GetH(); int GetH();
}; };
#endif
WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows; WXDLLEXPORT_DATA(extern wxList) wxTopLevelWindows;

View File

@@ -47,10 +47,10 @@ public:
int m_toolStyle; int m_toolStyle;
wxObject * m_clientData; wxObject * m_clientData;
int m_index; int m_index;
long m_x; long m_x;
long m_y; long m_y;
long m_width; long m_width;
long m_height; long m_height;
bool m_toggleState; bool m_toggleState;
bool m_isToggle; bool m_isToggle;
bool m_deleteSecondBitmap; bool m_deleteSecondBitmap;
@@ -64,7 +64,7 @@ public:
class WXDLLEXPORT wxToolBarBase : public wxControl class WXDLLEXPORT wxToolBarBase : public wxControl
{ {
DECLARE_DYNAMIC_CLASS(wxToolBarBase) DECLARE_ABSTRACT_CLASS(wxToolBarBase)
public: public:
wxToolBarBase(void); wxToolBarBase(void);
@@ -114,7 +114,7 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
virtual wxString GetToolLongHelp(int toolIndex) const; virtual wxString GetToolLongHelp(int toolIndex) const;
virtual void SetMargins(int x, int y); virtual void SetMargins(int x, int y);
inline void SetMargins(const wxSize& size) { SetMargins(size.x, size.y); } inline void SetMargins(const wxSize& size) { SetMargins((int) size.x, (int) size.y); }
virtual void SetToolPacking(int packing); virtual void SetToolPacking(int packing);
virtual void SetToolSeparation(int separation); virtual void SetToolSeparation(int separation);
@@ -122,29 +122,35 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
inline virtual int GetToolPacking(void) { return m_toolPacking; } inline virtual int GetToolPacking(void) { return m_toolPacking; }
inline virtual int GetToolSeparation(void) { return m_toolSeparation; } inline virtual int GetToolSeparation(void) { return m_toolSeparation; }
virtual void SetDefaultSize(const wxSize& size) { m_defaultWidth = size.x; m_defaultHeight = size.y; }; virtual void SetToolBitmapSize(const wxSize& size) { m_defaultWidth = size.x; m_defaultHeight = size.y; };
virtual wxSize GetDefaultSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); } virtual wxSize GetToolBitmapSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); }
// The button size (in some implementations) is bigger than the bitmap size: this returns // The button size (in some implementations) is bigger than the bitmap size: this returns
// the total button size. // the total button size.
virtual wxSize GetDefaultButtonSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); } ; virtual wxSize GetToolSize(void) const { return wxSize(m_defaultWidth, m_defaultHeight); } ;
// Compatibility // Compatibility
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
inline void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); } inline void SetDefaultSize(int w, int h) { SetDefaultSize(wxSize(w, h)); }
inline long GetDefaultWidth(void) const { return m_defaultWidth; } inline long GetDefaultWidth(void) const { return m_defaultWidth; }
inline long GetDefaultHeight(void) const { return m_defaultHeight; } inline long GetDefaultHeight(void) const { return m_defaultHeight; }
inline int GetDefaultButtonWidth(void) const { return GetDefaultButtonSize().x; }; inline int GetDefaultButtonWidth(void) const { return (int) GetDefaultButtonSize().x; };
inline int GetDefaultButtonHeight(void) const { return GetDefaultButtonSize().y; }; inline int GetDefaultButtonHeight(void) const { return (int) GetDefaultButtonSize().y; };
virtual void SetDefaultSize(const wxSize& size) { SetToolBitmapSize(size); }
virtual wxSize GetDefaultSize(void) const { return GetToolBitmapSize(); }
virtual wxSize GetDefaultButtonSize(void) const { return GetToolSize(); }
#endif #endif
// Lay the tools out // Lay the tools out
virtual void Layout(void); virtual void Layout(void);
// Add all the buttons: required for Win95. // Add all the buttons: required for Win95.
// TODO: unify API so there's no ambiguity
virtual bool CreateTools(void) { return TRUE; } virtual bool CreateTools(void) { return TRUE; }
// Calls the appropriate function after tools have been created.
// E.g. Layout, or CreateTools.
virtual bool Realize() = 0;
void Command(wxCommandEvent& event); void Command(wxCommandEvent& event);
// SCROLLING: this has to be copied from wxScrolledWindow since wxToolBarBase // SCROLLING: this has to be copied from wxScrolledWindow since wxToolBarBase
@@ -178,10 +184,9 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
// Do the toolbar button updates (check for EVT_UPDATE_UI handlers) // Do the toolbar button updates (check for EVT_UPDATE_UI handlers)
virtual void DoToolbarUpdates(void); virtual void DoToolbarUpdates(void);
/* inline void SetMaxRowsCols(int rows, int cols) { m_maxRows = rows; m_maxCols = cols; }
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const ; inline int GetMaxRows() const { return m_maxRows; }
virtual void CalcUnscrolledPosition(int x, int y, long *xx, long *yy) const ; inline int GetMaxCols() const { return m_maxCols; }
*/
void OnScroll(wxScrollEvent& event); void OnScroll(wxScrollEvent& event);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
@@ -194,10 +199,10 @@ class WXDLLEXPORT wxToolBarBase : public wxControl
protected: protected:
wxList m_tools; wxList m_tools;
int m_tilingDirection; // int m_tilingDirection;
int m_rowsOrColumns; // int m_rowsOrColumns;
int m_currentRowsOrColumns; int m_maxRows;
long m_lastX, m_lastY; int m_maxCols;
long m_maxWidth, m_maxHeight; long m_maxWidth, m_maxHeight;
int m_currentTool; // Tool where mouse currently is int m_currentTool; // Tool where mouse currently is
int m_pressedTool; // Tool where mouse pressed int m_pressedTool; // Tool where mouse pressed

View File

@@ -37,24 +37,16 @@ class WXDLLEXPORT wxToolBarSimple : public wxToolBarBase
public: public:
wxToolBarSimple(void); wxToolBarSimple(void);
#if WXWIN_COMPATIBILITY > 0
inline wxToolBarSimple(wxWindow *parent, int x, int y, int w, int h,
long style = wxNO_BORDER, int orientation = wxVERTICAL, int RowsOrColumns = 1,
const char *name = wxToolBarNameStr)
{
Create(parent, -1, wxPoint(x, y), wxSize(w, h), style, orientation, RowsOrColumns, name);
}
#endif
inline wxToolBarSimple(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, inline wxToolBarSimple(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, long style = wxNO_BORDER|wxTB_HORIZONTAL,
int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr) const wxString& name = wxToolBarNameStr)
{ {
Create(parent, id, pos, size, style, orientation, RowsOrColumns, name); Create(parent, id, pos, size, style, name);
} }
~wxToolBarSimple(void); ~wxToolBarSimple(void);
bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER, int orientation = wxVERTICAL, int RowsOrColumns = 1, const wxString& name = wxToolBarNameStr); long style = wxNO_BORDER|wxTB_HORIZONTAL, const wxString& name = wxToolBarNameStr);
void OnPaint(wxPaintEvent& event); void OnPaint(wxPaintEvent& event);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
@@ -68,7 +60,17 @@ class WXDLLEXPORT wxToolBarSimple : public wxToolBarBase
virtual void SpringUpButton(int index); virtual void SpringUpButton(int index);
DECLARE_EVENT_TABLE() void Layout(void);
// The post-tool-addition call
bool Realize() { Layout(); return TRUE; };
protected:
int m_currentRowsOrColumns;
long m_lastX, m_lastY;
DECLARE_EVENT_TABLE()
}; };
#endif // USE_TOOLBAR #endif // USE_TOOLBAR

View File

@@ -4,11 +4,11 @@
// the application code should use only wxToolBar which is #define'd to be the // the application code should use only wxToolBar which is #define'd to be the
// native implementation for each platform // native implementation for each platform
#if defined(__WXMSW__) && defined(__WIN95__) #if defined(__WXMSW__) && defined(__WIN95__)
# include "wx/tbar95.h" # include "wx/msw/tbar95.h"
# define wxToolBar wxToolBar95 # define wxToolBar wxToolBar95
# define classwxToolBar classwxToolBar95 # define classwxToolBar classwxToolBar95
#elif defined(__WXMSW__) #elif defined(__WXMSW__)
# include "wx/tbarmsw.h" # include "wx/msw/tbarmsw.h"
# define wxToolBar wxToolBarMSW # define wxToolBar wxToolBarMSW
# define classwxToolBar classwxToolBarMSW # define classwxToolBar classwxToolBarMSW
#elif defined(__WXGTK__) #elif defined(__WXGTK__)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 B

After

Width:  |  Height:  |  Size: 370 B

View File

@@ -98,8 +98,8 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c
wxTE_MULTILINE|wxSUNKEN_BORDER); wxTE_MULTILINE|wxSUNKEN_BORDER);
textWindow->SetValue("A help window"); textWindow->SetValue("A help window");
toolBar = new TestRibbon(this, 0, 0, 100, 30, wxNO_BORDER, wxVERTICAL, 1); CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL);
SetToolBar(toolBar); InitToolBar(GetToolBar());
} }
void MyFrame::OnQuit(wxCommandEvent& event) void MyFrame::OnQuit(wxCommandEvent& event)
@@ -248,15 +248,8 @@ void MyFrame::OnSize(wxSizeEvent& event)
int tw = 0; int tw = 0;
int th = 0; int th = 0;
wxWindow* tbar = GetToolBar(); textWindow->SetSize(0, 0, 200, h);
if (tbar) GetClientWindow()->SetSize(200, 0, w - 200, h);
{
tbar->GetSize(&tw, &th);
tbar->SetSize(w, th);
}
textWindow->SetSize(0, th, 200, h-th);
GetClientWindow()->SetSize(200, th, w - 200, h-th);
} }
// Note that MDI_NEW_WINDOW and MDI_ABOUT commands get passed // Note that MDI_NEW_WINDOW and MDI_ABOUT commands get passed
@@ -264,7 +257,6 @@ void MyFrame::OnSize(wxSizeEvent& event)
// duplicate event handlers here. // duplicate event handlers here.
BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame) BEGIN_EVENT_TABLE(MyChild, wxMDIChildFrame)
EVT_SIZE( MyChild::OnSize)
EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit) EVT_MENU(MDI_CHILD_QUIT, MyChild::OnQuit)
END_EVENT_TABLE() END_EVENT_TABLE()
@@ -281,14 +273,6 @@ MyChild::~MyChild(void)
my_children.DeleteObject(this); my_children.DeleteObject(this);
} }
void MyChild::OnSize(wxSizeEvent& WXUNUSED(event))
{
int x = 0;
int y = 0;
GetClientSize( &x, &y );
if (canvas) canvas->SetSize( x, y );
}
void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(TRUE);
@@ -305,13 +289,7 @@ bool MyChild::OnClose(void)
return TRUE; return TRUE;
} }
BEGIN_EVENT_TABLE(TestRibbon, wxToolBar) void MyFrame::InitToolBar(wxToolBar* toolBar)
EVT_PAINT(TestRibbon::OnPaint)
END_EVENT_TABLE()
TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
long style, int direction, int RowsOrColumns):
wxToolBar(frame, -1, wxPoint(x, y), wxSize(w, h), style, direction, RowsOrColumns)
{ {
wxBitmap* bitmaps[8]; wxBitmap* bitmaps[8];
@@ -343,61 +321,29 @@ TestRibbon::TestRibbon(wxFrame *frame, int x, int y, int w, int h,
int offX = 5; int offX = 5;
int currentX = 5; int currentX = 5;
AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file"); toolBar->AddTool(0, *bitmaps[0], wxNullBitmap, FALSE, currentX, -1, NULL, "New file");
currentX += width + 5; currentX += width + 5;
AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file"); toolBar->AddTool(1, *bitmaps[1], wxNullBitmap, FALSE, currentX, -1, NULL, "Open file");
currentX += width + 5; currentX += width + 5;
AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, NULL, "Save file"); toolBar->AddTool(2, *bitmaps[2], wxNullBitmap, FALSE, currentX, -1, NULL, "Save file");
currentX += width + 5; currentX += width + 5;
AddSeparator(); toolBar->AddSeparator();
AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, NULL, "Copy"); toolBar->AddTool(3, *bitmaps[3], wxNullBitmap, FALSE, currentX, -1, NULL, "Copy");
currentX += width + 5; currentX += width + 5;
AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, NULL, "Cut"); toolBar->AddTool(4, *bitmaps[4], wxNullBitmap, FALSE, currentX, -1, NULL, "Cut");
currentX += width + 5; currentX += width + 5;
AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, NULL, "Paste"); toolBar->AddTool(5, *bitmaps[5], wxNullBitmap, FALSE, currentX, -1, NULL, "Paste");
currentX += width + 5; currentX += width + 5;
AddSeparator(); toolBar->AddSeparator();
AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, NULL, "Print"); toolBar->AddTool(6, *bitmaps[6], wxNullBitmap, FALSE, currentX, -1, NULL, "Print");
currentX += width + 5; currentX += width + 5;
AddSeparator(); toolBar->AddSeparator();
AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help"); toolBar->AddTool(7, *bitmaps[7], wxNullBitmap, TRUE, currentX, -1, NULL, "Help");
CreateTools(); toolBar->Realize();
int i; int i;
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
delete bitmaps[i]; delete bitmaps[i];
} }
bool TestRibbon::OnLeftClick(int toolIndex, bool toggled)
{
char buf[200];
sprintf(buf, "Clicked on tool %d", toolIndex);
frame->SetStatusText(buf);
return TRUE;
}
void TestRibbon::OnMouseEnter(int toolIndex)
{
char buf[200];
if (toolIndex > -1)
{
sprintf(buf, "This is tool number %d", toolIndex);
frame->SetStatusText(buf);
}
else frame->SetStatusText("");
}
void TestRibbon::OnPaint(wxPaintEvent& event)
{
wxToolBar::OnPaint(event);
wxPaintDC dc(this);
int w, h;
GetSize(&w, &h);
dc.SetPen(*wxBLACK_PEN);
dc.SetBrush(*wxTRANSPARENT_BRUSH);
dc.DrawLine(0, h-1, w, h-1);
}

View File

@@ -28,27 +28,16 @@ class MyCanvas: public wxScrolledWindow
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
class TestRibbon: public wxToolBar
{
public:
TestRibbon(wxFrame *frame, int x = 0, int y = 0, int w = -1, int h = -1,
long style = wxNO_BORDER, int direction = wxVERTICAL, int RowsOrColumns = 2);
bool OnLeftClick(int toolIndex, bool toggled);
void OnMouseEnter(int toolIndex);
void OnPaint(wxPaintEvent& event);
DECLARE_EVENT_TABLE()
};
// Define a new frame // Define a new frame
class MyFrame: public wxMDIParentFrame class MyFrame: public wxMDIParentFrame
{ {
public: public:
wxTextCtrl *textWindow; wxTextCtrl *textWindow;
TestRibbon* toolBar;
MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
void InitToolBar(wxToolBar* toolBar);
bool OnClose(void); bool OnClose(void);
void OnSize(wxSizeEvent& event); void OnSize(wxSizeEvent& event);
void OnAbout(wxCommandEvent& event); void OnAbout(wxCommandEvent& event);
@@ -65,7 +54,6 @@ class MyChild: public wxMDIChildFrame
MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style); MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
~MyChild(void); ~MyChild(void);
bool OnClose(void); bool OnClose(void);
void OnSize(wxSizeEvent& event);
void OnActivate(wxActivateEvent& event); void OnActivate(wxActivateEvent& event);
void OnQuit(wxCommandEvent& event); void OnQuit(wxCommandEvent& event);

View File

@@ -34,7 +34,8 @@ IMPLEMENT_APP(MyApp)
bool MyApp::OnInit(void) bool MyApp::OnInit(void)
{ {
// Create the main frame window // Create the main frame window
MyFrame* frame = new MyFrame(NULL, -1, "wxToolBar Sample", wxPoint(100, 100), wxSize(450, 300)); MyFrame* frame = new MyFrame(NULL, -1, "wxToolBar Sample",
wxPoint(100, 100), wxSize(450, 300));
// Give it a status line // Give it a status line
frame->CreateStatusBar(); frame->CreateStatusBar();
@@ -63,14 +64,9 @@ bool MyApp::OnInit(void)
frame->SetMenuBar(menuBar); frame->SetMenuBar(menuBar);
// Create the toolbar // Create the toolbar
wxToolBar* toolBar = new wxToolBar(frame, -1, wxPoint(0, 0), wxSize(100, 30), frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
wxNO_BORDER|wxTB_FLAT, wxVERTICAL, 1);
toolBar->SetMargins(5, 5);
InitToolbar(toolBar); InitToolbar(frame->GetToolBar());
// Tell the frame about it
frame->SetToolBar(toolBar);
// Force a resize. This should probably be replaced by a call to a wxFrame // Force a resize. This should probably be replaced by a call to a wxFrame
// function that lays out default decorations and the remaining content window. // function that lays out default decorations and the remaining content window.
@@ -86,6 +82,8 @@ bool MyApp::OnInit(void)
bool MyApp::InitToolbar(wxToolBar* toolBar) bool MyApp::InitToolbar(wxToolBar* toolBar)
{ {
toolBar->SetMargins(5, 5);
// Set up toolbar // Set up toolbar
wxBitmap* toolBarBitmaps[8]; wxBitmap* toolBarBitmaps[8];
@@ -138,7 +136,7 @@ bool MyApp::InitToolbar(wxToolBar* toolBar)
toolBar->AddSeparator(); toolBar->AddSeparator();
toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, NULL, "Help"); toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, NULL, "Help");
toolBar->CreateTools(); toolBar->Realize();
// Can delete the bitmaps since they're reference counted // Can delete the bitmaps since they're reference counted
int i; int i;
@@ -155,7 +153,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_MENU(wxID_HELP, MyFrame::OnAbout) EVT_MENU(wxID_HELP, MyFrame::OnAbout)
EVT_CLOSE(MyFrame::OnCloseWindow) EVT_CLOSE(MyFrame::OnCloseWindow)
EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick) EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick)
EVT_TOOL_ENTER_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolEnter) EVT_TOOL_ENTER(ID_TOOLBAR, MyFrame::OnToolEnter)
END_EVENT_TABLE() END_EVENT_TABLE()
// Define my frame constructor // Define my frame constructor
@@ -192,10 +190,10 @@ void MyFrame::OnToolLeftClick(wxCommandEvent& event)
void MyFrame::OnToolEnter(wxCommandEvent& event) void MyFrame::OnToolEnter(wxCommandEvent& event)
{ {
if (event.GetId() > -1) if (event.GetSelection() > -1)
{ {
wxString str; wxString str;
str.Printf("This is tool number %d", event.GetId()); str.Printf("This is tool number %d", event.GetSelection());
SetStatusText(str); SetStatusText(str);
} }
else else

View File

@@ -37,3 +37,5 @@ private:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
#define ID_TOOLBAR 500

View File

@@ -102,6 +102,9 @@
#include <wx/file.h> #include <wx/file.h>
#include <wx/log.h> #include <wx/log.h>
#ifndef MAX_PATH
#define MAX_PATH 512
#endif
// ============================================================================ // ============================================================================
// implementation of wxFile // implementation of wxFile
@@ -401,7 +404,12 @@ bool wxTempFile::Open(const wxString& strName)
wxSplitPath(strName, &strPath, NULL, NULL); wxSplitPath(strName, &strPath, NULL, NULL);
if ( strPath.IsEmpty() ) if ( strPath.IsEmpty() )
strPath = '.'; // GetTempFileName will fail if we give it empty string strPath = '.'; // GetTempFileName will fail if we give it empty string
#ifdef __WIN32__
if ( !GetTempFileName(strPath, "wx_",0, m_strTemp.GetWriteBuf(MAX_PATH)) ) if ( !GetTempFileName(strPath, "wx_",0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#else
// Not sure why MSVC++ 1.5 header defines first param as BYTE - bug?
if ( !GetTempFileName((BYTE) (const char*) strPath, "wx_",0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#endif
wxLogLastError("GetTempFileName"); wxLogLastError("GetTempFileName");
m_strTemp.UngetWriteBuf(); m_strTemp.UngetWriteBuf();
#endif // Windows/Unix #endif // Windows/Unix

View File

@@ -40,6 +40,7 @@
#include <wx/file.h> #include <wx/file.h>
#include <wx/textfile.h> #include <wx/textfile.h>
#include <wx/utils.h>
#include <wx/log.h> #include <wx/log.h>
// other standard headers // other standard headers
@@ -786,7 +787,7 @@ const char *wxSysErrorMsg(unsigned long nErrCode)
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
// returned string is capitalized and ended with '\r\n' - bad // returned string is capitalized and ended with '\r\n' - bad
s_szBuf[0] = (char)tolower(s_szBuf[0]); s_szBuf[0] = (char)wxToLower(s_szBuf[0]);
size_t len = strlen(s_szBuf); size_t len = strlen(s_szBuf);
if ( len > 0 ) { if ( len > 0 ) {
// truncate string // truncate string

View File

@@ -39,9 +39,19 @@ wxProcess::wxProcess(wxEvtHandler *parent, int id)
m_id = id; m_id = id;
} }
wxProcess::~wxProcess()
{
}
void wxProcess::OnTerminate(int pid) void wxProcess::OnTerminate(int pid)
{ {
wxProcessEvent event(m_id, pid); wxProcessEvent event(m_id, pid);
ProcessEvent(event); ProcessEvent(event);
} }
wxProcessEvent::wxProcessEvent(int id, int pid):
wxEvent(id), m_pid(pid)
{
}

View File

@@ -34,7 +34,7 @@
#include "wx/tbarbase.h" #include "wx/tbarbase.h"
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxToolBarBase, wxControl) IMPLEMENT_ABSTRACT_CLASS(wxToolBarBase, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxToolBarTool, wxObject)
BEGIN_EVENT_TABLE(wxToolBarBase, wxControl) BEGIN_EVENT_TABLE(wxToolBarBase, wxControl)
@@ -88,8 +88,8 @@ wxToolBarBase::wxToolBarBase(void) : m_tools(wxKEY_INTEGER)
{ {
gs_ToolBars.Append(this); gs_ToolBars.Append(this);
m_tilingDirection = wxVERTICAL; m_maxRows = 1;
m_rowsOrColumns = 0; m_maxCols = 32000;
m_maxWidth = 0; m_maxWidth = 0;
m_maxHeight = 0; m_maxHeight = 0;
m_defaultWidth = 16; m_defaultWidth = 16;
@@ -148,9 +148,12 @@ void wxToolBarBase::OnRightClick(int toolIndex, long x, long y)
// Called when the mouse cursor enters a tool bitmap (no button pressed). // Called when the mouse cursor enters a tool bitmap (no button pressed).
// Argument is -1 if mouse is exiting the toolbar. // Argument is -1 if mouse is exiting the toolbar.
// Note that for this event, the id of the window is used,
// and the integer parameter of wxCommandEvent is used to retrieve
// the tool id.
void wxToolBarBase::OnMouseEnter ( int toolIndex ) void wxToolBarBase::OnMouseEnter ( int toolIndex )
{ {
wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex); wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, GetId());
event.SetEventObject(this); event.SetEventObject(this);
event.SetInt(toolIndex); event.SetInt(toolIndex);
@@ -369,94 +372,6 @@ void wxToolBarBase::Command(wxCommandEvent& event)
void wxToolBarBase::Layout(void) void wxToolBarBase::Layout(void)
{ {
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY = m_yMargin;
int maxToolWidth = 0;
int maxToolHeight = 0;
m_maxWidth = 0;
m_maxHeight = 0;
// Find the maximum tool width and height
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->GetWidth() > maxToolWidth)
maxToolWidth = (int)tool->GetWidth();
if (tool->GetHeight() > maxToolHeight)
maxToolHeight = (int)tool->GetHeight();
node = node->Next();
}
int separatorSize = m_toolSeparation;
node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->m_toolStyle == wxTOOL_STYLE_SEPARATOR)
{
if (m_tilingDirection == wxHORIZONTAL)
{
if (m_currentRowsOrColumns >= m_rowsOrColumns)
m_lastY += separatorSize;
else
m_lastX += separatorSize;
}
else
{
if (m_currentRowsOrColumns >= m_rowsOrColumns)
m_lastX += separatorSize;
else
m_lastY += separatorSize;
}
}
else if (tool->m_toolStyle == wxTOOL_STYLE_BUTTON)
{
if (m_tilingDirection == wxHORIZONTAL)
{
if (m_currentRowsOrColumns >= m_rowsOrColumns)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY += maxToolHeight + m_toolPacking;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastX += maxToolWidth + m_toolPacking;
}
else
{
if (m_currentRowsOrColumns >= m_rowsOrColumns)
{
m_currentRowsOrColumns = 0;
m_lastX += (maxToolWidth + m_toolPacking);
m_lastY = m_yMargin;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastY += maxToolHeight + m_toolPacking;
}
m_currentRowsOrColumns ++;
}
if (m_lastX > m_maxWidth)
m_maxWidth = m_lastX;
if (m_lastY > m_maxHeight)
m_maxHeight = m_lastY;
node = node->Next();
}
if (m_tilingDirection == wxVERTICAL)
m_maxWidth += maxToolWidth;
else
m_maxHeight += maxToolHeight;
m_maxWidth += m_xMargin;
m_maxHeight += m_yMargin;
} }
@@ -781,20 +696,6 @@ void wxToolBarBase::ViewStart (int *x, int *y) const
*y = m_yScrollPosition; *y = m_yScrollPosition;
} }
/*
void wxToolBarBase::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{
*xx = (m_calcScrolledOffset ? (x - m_xScrollPosition * m_xScrollPixelsPerLine) : x);
*yy = (m_calcScrolledOffset ? (y - m_yScrollPosition * m_yScrollPixelsPerLine) : y);
}
void wxToolBarBase::CalcUnscrolledPosition(int x, int y, float *xx, float *yy) const
{
*xx = (float)(m_calcScrolledOffset ? (x + m_xScrollPosition * m_xScrollPixelsPerLine) : x);
*yy = (float)(m_calcScrolledOffset ? (y + m_yScrollPosition * m_yScrollPixelsPerLine) : y);
}
*/
void wxToolBarBase::OnIdle(wxIdleEvent& event) void wxToolBarBase::OnIdle(wxIdleEvent& event)
{ {
wxWindow::OnIdle(event); wxWindow::OnIdle(event);

View File

@@ -47,10 +47,13 @@ static wxPen * white_pen = NULL,
wxToolBarSimple::wxToolBarSimple(void) wxToolBarSimple::wxToolBarSimple(void)
{ {
m_currentRowsOrColumns = 0;
m_lastX = 0;
m_lastY = 0;
} }
bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style,
int direction, int RowsOrColumns, const wxString& name ) const wxString& name )
{ {
if ( ! wxWindow::Create(parent, id, pos, size, style, name) ) if ( ! wxWindow::Create(parent, id, pos, size, style, name) )
return FALSE; return FALSE;
@@ -79,12 +82,10 @@ bool wxToolBarSimple::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos
{ {
thick_black_pen = new wxPen("BLACK", 3, wxSOLID); thick_black_pen = new wxPen("BLACK", 3, wxSOLID);
} }
m_tilingDirection = direction; if ( GetWindowStyleFlag() & wxTB_VERTICAL )
m_rowsOrColumns = RowsOrColumns;
if ( m_tilingDirection == wxVERTICAL )
{ m_lastX = 3; m_lastY = 7; }
else
{ m_lastX = 7; m_lastY = 3; } { m_lastX = 7; m_lastY = 3; }
else
{ m_lastX = 3; m_lastY = 7; }
m_maxWidth = m_maxHeight = 0; m_maxWidth = m_maxHeight = 0;
m_pressedTool = m_currentTool = -1; m_pressedTool = m_currentTool = -1;
m_xMargin = 0; m_xMargin = 0;
@@ -356,4 +357,97 @@ void wxToolBarSimple::SpringUpButton(int index)
} }
} }
void wxToolBarSimple::Layout(void)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY = m_yMargin;
int maxToolWidth = 0;
int maxToolHeight = 0;
m_maxWidth = 0;
m_maxHeight = 0;
// Find the maximum tool width and height
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->GetWidth() > maxToolWidth)
maxToolWidth = (int)tool->GetWidth();
if (tool->GetHeight() > maxToolHeight)
maxToolHeight = (int)tool->GetHeight();
node = node->Next();
}
int separatorSize = m_toolSeparation;
node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->m_toolStyle == wxTOOL_STYLE_SEPARATOR)
{
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
{
if (m_currentRowsOrColumns >= m_maxCols)
m_lastY += separatorSize;
else
m_lastX += separatorSize;
}
else
{
if (m_currentRowsOrColumns >= m_maxRows)
m_lastX += separatorSize;
else
m_lastY += separatorSize;
}
}
else if (tool->m_toolStyle == wxTOOL_STYLE_BUTTON)
{
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
{
if (m_currentRowsOrColumns >= m_maxCols)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY += maxToolHeight + m_toolPacking;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastX += maxToolWidth + m_toolPacking;
}
else
{
if (m_currentRowsOrColumns >= m_maxRows)
{
m_currentRowsOrColumns = 0;
m_lastX += (maxToolWidth + m_toolPacking);
m_lastY = m_yMargin;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastY += maxToolHeight + m_toolPacking;
}
m_currentRowsOrColumns ++;
}
if (m_lastX > m_maxWidth)
m_maxWidth = m_lastX;
if (m_lastY > m_maxHeight)
m_maxHeight = m_lastY;
node = node->Next();
}
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
m_maxWidth += maxToolWidth;
else
m_maxHeight += maxToolHeight;
m_maxWidth += m_xMargin;
m_maxHeight += m_yMargin;
}
#endif #endif

View File

@@ -106,6 +106,8 @@ void wxButton::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
int actualWidth = width; int actualWidth = width;
int actualHeight = height; int actualHeight = height;
int ww, hh; int ww, hh;

View File

@@ -130,6 +130,8 @@ void wxCheckBox::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
char buf[300]; char buf[300];
int current_width, cyf; int current_width, cyf;
@@ -280,6 +282,8 @@ void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlag
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
HWND button = (HWND) GetHWND(); HWND button = (HWND) GetHWND();
/* /*
if (w1<0) if (w1<0)

View File

@@ -192,6 +192,8 @@ void wxChoice::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
// If we're prepared to use the existing size, then... // If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{ {

View File

@@ -117,12 +117,6 @@ wxPaintDC::wxPaintDC(wxWindow *the_canvas)
} }
m_canvas = the_canvas; m_canvas = the_canvas;
RECT updateRect1 = g_paintStruct.rcPaint;
m_canvas->m_updateRect.x = updateRect1.left;
m_canvas->m_updateRect.y = updateRect1.top;
m_canvas->m_updateRect.width = updateRect1.right - updateRect1.left;
m_canvas->m_updateRect.height = updateRect1.bottom - updateRect1.top;
// m_canvas->m_paintHDC = m_staticPaintHDC ;
} }
wxPaintDC::~wxPaintDC(void) wxPaintDC::~wxPaintDC(void)
@@ -131,8 +125,6 @@ wxPaintDC::~wxPaintDC(void)
if (m_staticPaintCount == 0) if (m_staticPaintCount == 0)
{ {
// m_canvas->m_paintHDC = 0;
if ( m_hDC && m_canvas) if ( m_hDC && m_canvas)
{ {
::EndPaint((HWND) m_canvas->GetHWND(), &g_paintStruct); ::EndPaint((HWND) m_canvas->GetHWND(), &g_paintStruct);
@@ -149,3 +141,4 @@ wxPaintDC::~wxPaintDC(void)
wxDebugMsg("~wxPaintDC: Did not release HDC\n"); wxDebugMsg("~wxPaintDC: Did not release HDC\n");
} }
} }

View File

@@ -33,6 +33,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/statusbr.h" #include "wx/statusbr.h"
#include "wx/toolbar.h"
#include "wx/menuitem.h" #include "wx/menuitem.h"
#ifdef LoadAccelerators #ifdef LoadAccelerators
@@ -154,19 +155,23 @@ WXHMENU wxFrame::GetWinMenu(void) const
return m_hMenu; return m_hMenu;
} }
// Get size *available for subwindows* i.e. excluding menu bar etc. // Get size *available for subwindows* i.e. excluding menu bar, toolbar etc.
// For XView, this is the same as GetSize
void wxFrame::GetClientSize(int *x, int *y) const void wxFrame::GetClientSize(int *x, int *y) const
{ {
RECT rect; RECT rect;
GetClientRect((HWND) GetHWND(), &rect); GetClientRect((HWND) GetHWND(), &rect);
if ( m_frameStatusBar ) if ( GetStatusBar() )
{ {
int statusX, statusY; int statusX, statusY;
m_frameStatusBar->GetClientSize(&statusX, &statusY); GetStatusBar()->GetClientSize(&statusX, &statusY);
rect.bottom -= statusY; rect.bottom -= statusY;
} }
wxPoint pt(GetClientAreaOrigin());
rect.bottom -= pt.y;
rect.right -= pt.x;
*x = rect.right; *x = rect.right;
*y = rect.bottom; *y = rect.bottom;
} }
@@ -189,13 +194,17 @@ void wxFrame::SetClientSize(int width, int height)
int actual_width = rect2.right - rect2.left - rect.right + width; int actual_width = rect2.right - rect2.left - rect.right + width;
int actual_height = rect2.bottom - rect2.top - rect.bottom + height; int actual_height = rect2.bottom - rect2.top - rect.bottom + height;
if ( m_frameStatusBar ) if ( GetStatusBar() )
{ {
int statusX, statusY; int statusX, statusY;
m_frameStatusBar->GetClientSize(&statusX, &statusY); GetStatusBar()->GetClientSize(&statusX, &statusY);
actual_height += statusY; actual_height += statusY;
} }
wxPoint pt(GetClientAreaOrigin());
actual_width += pt.y;
actual_height += pt.x;
POINT point; POINT point;
point.x = rect2.left; point.x = rect2.left;
point.y = rect2.top; point.y = rect2.top;
@@ -339,19 +348,21 @@ void wxFrame::SetIcon(const wxIcon& icon)
#endif #endif
} }
wxStatusBar *wxFrame::OnCreateStatusBar(int number) wxStatusBar *wxFrame::OnCreateStatusBar(int number, long style, wxWindowID id,
const wxString& name)
{ {
wxStatusBar *statusBar = NULL; wxStatusBar *statusBar = NULL;
#if USE_NATIVE_STATUSBAR #if USE_NATIVE_STATUSBAR
if (UsesNativeStatusBar()) if (UsesNativeStatusBar())
{ {
statusBar = new wxStatusBar95(this); statusBar = new wxStatusBar95(this, id, style);
} }
else else
#endif #endif
{ {
statusBar = new wxStatusBar(this, -1, wxPoint(0, 0), wxSize(100, 20)); statusBar = new wxStatusBar(this, id, wxPoint(0, 0), wxSize(100, 20),
style, name);
// Set the height according to the font and the border size // Set the height according to the font and the border size
wxClientDC dc(statusBar); wxClientDC dc(statusBar);
@@ -369,20 +380,22 @@ wxStatusBar *wxFrame::OnCreateStatusBar(int number)
return statusBar; return statusBar;
} }
bool wxFrame::CreateStatusBar(int number) wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id,
const wxString& name)
{ {
// VZ: calling CreateStatusBar twice is an error - why anyone would do it? // VZ: calling CreateStatusBar twice is an error - why anyone would do it?
wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, wxCHECK_MSG( m_frameStatusBar == NULL, FALSE,
"recreating status bar in wxFrame" ); "recreating status bar in wxFrame" );
m_frameStatusBar = OnCreateStatusBar(number); m_frameStatusBar = OnCreateStatusBar(number, style, id,
name);
if ( m_frameStatusBar ) if ( m_frameStatusBar )
{ {
PositionStatusBar(); PositionStatusBar();
return TRUE; return m_frameStatusBar;
} }
else else
return FALSE; return NULL;
} }
void wxFrame::SetStatusText(const wxString& text, int number) void wxFrame::SetStatusText(const wxString& text, int number)
@@ -413,6 +426,9 @@ void wxFrame::PositionStatusBar(void)
GetClientSize(&w, &h); GetClientSize(&w, &h);
int sw, sh; int sw, sh;
m_frameStatusBar->GetSize(&sw, &sh); m_frameStatusBar->GetSize(&sw, &sh);
// Since we wish the status bar to be directly under the client area,
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
m_frameStatusBar->SetSize(0, h, w, sh); m_frameStatusBar->SetSize(0, h, w, sh);
} }
} }
@@ -683,6 +699,8 @@ void wxFrame::MSWOnSize(int x, int y, WXUINT id)
#endif #endif
PositionStatusBar(); PositionStatusBar();
PositionToolBar();
wxSizeEvent event(wxSize(x, y), m_windowId); wxSizeEvent event(wxSize(x, y), m_windowId);
event.SetEventObject( this ); event.SetEventObject( this );
if (!GetEventHandler()->ProcessEvent(event)) if (!GetEventHandler()->ProcessEvent(event))
@@ -783,16 +801,6 @@ void wxFrame::OnSize(wxSizeEvent& event)
int x = 0; int x = 0;
int y = 0; int y = 0;
// Manage the toolbar if there is one
if ( GetToolBar() )
{
int wt, ht;
GetToolBar()->GetSize(&wt, &ht);
clientH -= ht;
y += ht;
GetToolBar()->SetSize(0, 0, clientW, ht);
}
child->SetSize(x, y, clientW, clientH); child->SetSize(x, y, clientW, clientH);
} }
} }
@@ -907,3 +915,79 @@ void wxFrame::ProcessCommand(int id)
GetEventHandler()->ProcessEvent(commandEvent); GetEventHandler()->ProcessEvent(commandEvent);
} }
// Checks if there is a toolbar, and returns the first free client position
wxPoint wxFrame::GetClientAreaOrigin() const
{
wxPoint pt(0, 0);
if (GetToolBar())
{
int w, h;
GetToolBar()->GetSize(& w, & h);
if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
{
pt.x += w;
}
else
{
pt.y += h;
}
}
return pt;
}
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
"recreating toolbar in wxFrame" );
wxToolBar* toolBar = OnCreateToolBar(style, id, name);
if (toolBar)
{
SetToolBar(toolBar);
PositionToolBar();
return toolBar;
}
else
{
return NULL;
}
}
wxToolBar* wxFrame::OnCreateToolBar(long style, wxWindowID id, const wxString& name)
{
return new wxToolBar(this, id, wxDefaultPosition, wxDefaultSize, style, name);
}
void wxFrame::PositionToolBar(void)
{
int cw, ch;
RECT rect;
::GetClientRect((HWND) GetHWND(), &rect);
if ( GetStatusBar() )
{
int statusX, statusY;
GetStatusBar()->GetClientSize(&statusX, &statusY);
rect.bottom -= statusY;
}
if (GetToolBar())
{
int tw, th;
GetToolBar()->GetSize(& tw, & th);
if (GetToolBar()->GetWindowStyleFlag() & wxTB_VERTICAL)
{
// Use the 'real' MSW position
GetToolBar()->SetSize(0, 0, tw, rect.bottom, wxSIZE_NO_ADJUSTMENTS);
}
else
{
// Use the 'real' MSW position
GetToolBar()->SetSize(0, 0, rect.right, th, wxSIZE_NO_ADJUSTMENTS);
}
}
}

View File

@@ -107,6 +107,8 @@ void wxGauge95::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
// If we're prepared to use the existing size, then... // If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{ {

View File

@@ -154,6 +154,8 @@ void wxGaugeMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
// If we're prepared to use the existing size, then... // If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{ {

View File

@@ -484,6 +484,8 @@ void wxListBox::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
// If we're prepared to use the existing size, then... // If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{ {

View File

@@ -78,7 +78,6 @@ COMMONOBJS = \
$(COMMDIR)\event.obj \ $(COMMDIR)\event.obj \
$(COMMDIR)\file.obj \ $(COMMDIR)\file.obj \
$(COMMDIR)\filefn.obj \ $(COMMDIR)\filefn.obj \
$(COMMDIR)\fileconf.obj \
$(COMMDIR)\framecmn.obj \ $(COMMDIR)\framecmn.obj \
$(COMMDIR)\gdicmn.obj \ $(COMMDIR)\gdicmn.obj \
$(COMMDIR)\intl.obj \ $(COMMDIR)\intl.obj \
@@ -116,6 +115,8 @@ COMMONOBJS = \
$(COMMDIR)\extended.obj \ $(COMMDIR)\extended.obj \
$(COMMDIR)\wincmn.obj $(COMMDIR)\wincmn.obj
# $(COMMDIR)\fileconf.obj # Doens't compile (nested classes)
MSWOBJS = \ MSWOBJS = \
$(MSWDIR)\app.obj \ $(MSWDIR)\app.obj \
$(MSWDIR)\bitmap.obj \ $(MSWDIR)\bitmap.obj \
@@ -829,6 +830,26 @@ $(COMMDIR)/time.obj: $*.$(SRCSUFF)
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<< <<
$(COMMDIR)/stream.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/fstream.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/mstream.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/zstream.obj: $*.$(SRCSUFF)
cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)
<<
$(COMMDIR)/datstrm.obj: $*.$(SRCSUFF) $(COMMDIR)/datstrm.obj: $*.$(SRCSUFF)
cl @<< cl @<<
$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF)

View File

@@ -114,9 +114,9 @@ COMMONOBJS = \
$(COMMDIR)\mstream.obj \ $(COMMDIR)\mstream.obj \
$(COMMDIR)\zstream.obj \ $(COMMDIR)\zstream.obj \
$(COMMDIR)\stream.obj \ $(COMMDIR)\stream.obj \
$(COMMDIR)\datstrm.obj \
$(COMMDIR)\wincmn.obj $(COMMDIR)\wincmn.obj
# $(COMMDIR)\datstrm.obj
MSWOBJS = \ MSWOBJS = \
$(MSWDIR)\app.obj \ $(MSWDIR)\app.obj \

View File

@@ -174,14 +174,7 @@ void wxMDIParentFrame::GetClientSize(int *x, int *y) const
int cwidth = rect.right; int cwidth = rect.right;
int cheight = rect.bottom; int cheight = rect.bottom;
/*
if (m_frameToolBar)
{
int tw, th;
m_frameToolBar->GetSize(&tw, &th);
cheight -= th;
}
*/
if ( GetStatusBar() ) if ( GetStatusBar() )
{ {
int sw, sh; int sw, sh;
@@ -189,6 +182,10 @@ void wxMDIParentFrame::GetClientSize(int *x, int *y) const
cheight -= sh; cheight -= sh;
} }
wxPoint pt(GetClientAreaOrigin());
cheight -= pt.y;
cwidth -= pt.x;
*x = cwidth; *x = cwidth;
*y = cheight; *y = cheight;
} }
@@ -276,23 +273,18 @@ void wxMDIParentFrame::OnSize(wxSizeEvent& event)
int y = 0; int y = 0;
int width, height; int width, height;
GetClientSize(&width, &height); GetClientSize(&width, &height);
if ( GetToolBar() )
{
int wt, ht;
GetToolBar()->GetSize(&wt, &ht);
height -= ht;
y += ht;
GetToolBar()->SetSize(0, 0, width, ht);
}
if ( GetClientWindow() ) if ( GetClientWindow() )
GetClientWindow()->SetSize(x, y, width, height); GetClientWindow()->SetSize(x, y, width, height);
/* Already done in MSWOnSize
// forward WM_SIZE to status bar control // forward WM_SIZE to status bar control
#if USE_NATIVE_STATUSBAR #if USE_NATIVE_STATUSBAR
if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95))) if (m_frameStatusBar && m_frameStatusBar->IsKindOf(CLASSINFO(wxStatusBar95)))
((wxStatusBar95 *)m_frameStatusBar)->OnSize(event); ((wxStatusBar95 *)m_frameStatusBar)->OnSize(event);
#endif #endif
*/
} }
void wxMDIParentFrame::OnActivate(wxActivateEvent& event) void wxMDIParentFrame::OnActivate(wxActivateEvent& event)
@@ -461,6 +453,7 @@ void wxMDIParentFrame::MSWOnSize(int x, int y, WXUINT id)
#endif #endif
PositionStatusBar(); PositionStatusBar();
PositionToolBar();
wxSizeEvent event(wxSize(x, y), m_windowId); wxSizeEvent event(wxSize(x, y), m_windowId);
event.SetEventObject( this ); event.SetEventObject( this );
@@ -914,6 +907,7 @@ void wxMDIChildFrame::MSWOnSize(int x, int y, WXUINT id)
#endif #endif
PositionStatusBar(); PositionStatusBar();
PositionToolBar();
wxWindow::MSWOnSize(x, y, id); wxWindow::MSWOnSize(x, y, id);
} }

View File

@@ -35,7 +35,7 @@
#include <penwin.h> #include <penwin.h>
#endif #endif
HANDLE s_hPenWin = (HANDLE)NULL; HANDLE g_hPenWin = (HANDLE)NULL;
typedef void (CALLBACK * PENREGPROC)(WORD,BOOL); typedef void (CALLBACK * PENREGPROC)(WORD,BOOL);
// The routine below allows Windows applications (binaries) to // The routine below allows Windows applications (binaries) to
@@ -56,17 +56,17 @@ void wxEnablePenAppHooks (bool hook)
#ifndef __WIN32__ #ifndef __WIN32__
if (hook) if (hook)
{ {
if (s_hPenWin) if (g_hPenWin)
return; return;
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, register this app so all // If running on a Pen Windows system, register this app so all
// EDIT controls in dialogs are replaced by HEDIT controls. // EDIT controls in dialogs are replaced by HEDIT controls.
if ((s_hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL) if ((g_hPenWin = (HANDLE)GetSystemMetrics (SM_PENWINDOWS)) != (HANDLE) NULL)
{ {
// We do this fancy GetProcAddress simply because we don't // We do this fancy GetProcAddress simply because we don't
// know if we're running Pen Windows. // know if we're running Pen Windows.
if ((RegPenApp = (PENREGPROC)GetProcAddress (s_hPenWin, "RegisterPenApp")) != NULL) if ((RegPenApp = (PENREGPROC)GetProcAddress (g_hPenWin, "RegisterPenApp")) != NULL)
(*RegPenApp) (RPA_DEFAULT, TRUE); (*RegPenApp) (RPA_DEFAULT, TRUE);
} }
} }
@@ -74,12 +74,12 @@ void wxEnablePenAppHooks (bool hook)
{ {
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, unregister // If running on a Pen Windows system, unregister
if (s_hPenWin) if (g_hPenWin)
{ {
// Unregister this app // Unregister this app
if (RegPenApp != NULL) if (RegPenApp != NULL)
(*RegPenApp) (RPA_DEFAULT, FALSE); (*RegPenApp) (RPA_DEFAULT, FALSE);
s_hPenWin = (HANDLE) NULL; g_hPenWin = (HANDLE) NULL;
} }
} }
#endif /* ! Windows-NT */ #endif /* ! Windows-NT */
@@ -97,10 +97,10 @@ void wxRegisterPenWin(void)
// (Notice the CONTROL statement in the RC file is "EDIT", // (Notice the CONTROL statement in the RC file is "EDIT",
// RegisterPenApp will automatically change that control to // RegisterPenApp will automatically change that control to
// an HEDIT. // an HEDIT.
if ((s_hPenWin = (HANDLE)GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) { if ((g_hPenWin = (HANDLE)GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) {
// We do this fancy GetProcAddress simply because we don't // We do this fancy GetProcAddress simply because we don't
// know if we're running Pen Windows. // know if we're running Pen Windows.
if ( (RegPenApp = (void (CALLBACK *)(WORD, BOOL))GetProcAddress(s_hPenWin, "RegisterPenApp"))!= NULL) if ( (RegPenApp = (void (CALLBACK *)(WORD, BOOL))GetProcAddress(g_hPenWin, "RegisterPenApp"))!= NULL)
(*RegPenApp)(RPA_DEFAULT, TRUE); (*RegPenApp)(RPA_DEFAULT, TRUE);
} }
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
@@ -110,8 +110,8 @@ void wxRegisterPenWin(void)
void wxCleanUpPenWin(void) void wxCleanUpPenWin(void)
{ {
#if USE_PENWINDOWS #if USE_PENWINDOWS
if (s_hPenWin) { if (g_hPenWin) {
// Unregister this app // Unregister this app
if (RegPenApp != NULL) if (RegPenApp != NULL)
(*RegPenApp)(RPA_DEFAULT, FALSE); (*RegPenApp)(RPA_DEFAULT, FALSE);
} }

View File

@@ -172,7 +172,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt
wxWindow *win = CreateAbortWindow(parent, printout); wxWindow *win = CreateAbortWindow(parent, printout);
wxYield(); wxYield();
#if defined(__BORLANDC__) || defined(__GNUWIN32__) #if defined(__BORLANDC__) || defined(__GNUWIN32__) || !defined(__WIN32__)
::SetAbortProc((HDC) dc->GetHDC(), (FARPROC) lpAbortProc); ::SetAbortProc((HDC) dc->GetHDC(), (FARPROC) lpAbortProc);
#else #else
::SetAbortProc((HDC) dc->GetHDC(), (int (_stdcall *) ::SetAbortProc((HDC) dc->GetHDC(), (int (_stdcall *)

View File

@@ -410,6 +410,8 @@ void wxRadioBox::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
yy = currentY; yy = currentY;
AdjustForParentClientOrigin(xx, yy, sizeFlags);
char buf[400]; char buf[400];
int y_offset = yy; int y_offset = yy;
@@ -576,6 +578,15 @@ void wxRadioBox::GetPosition(int *x, int *y) const
{ {
::ScreenToClient((HWND) parent->GetHWND(), &point); ::ScreenToClient((HWND) parent->GetHWND(), &point);
} }
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
}
*x = point.x; *x = point.x;
*y = point.y; *y = point.y;

View File

@@ -77,6 +77,12 @@ wxRegion::wxRegion(void)
M_REGION = ::CreateRectRgn(0, 0, 0, 0); M_REGION = ::CreateRectRgn(0, 0, 0, 0);
} }
wxRegion::wxRegion(WXHRGN hRegion)
{
m_refData = new wxRegionRefData;
M_REGION = (HRGN) hRegion;
}
wxRegion::wxRegion(long x, long y, long w, long h) wxRegion::wxRegion(long x, long y, long w, long h)
{ {
m_refData = new wxRegionRefData; m_refData = new wxRegionRefData;

View File

@@ -328,6 +328,15 @@ void wxSlider95::GetPosition(int *x, int *y) const
if (parent) if (parent)
::ScreenToClient((HWND) parent->GetHWND(), &point); ::ScreenToClient((HWND) parent->GetHWND(), &point);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
}
*x = point.x; *x = point.x;
*y = point.y; *y = point.y;
} }
@@ -346,6 +355,8 @@ void wxSlider95::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
char buf[300]; char buf[300];
int x_offset = x; int x_offset = x;

View File

@@ -302,6 +302,15 @@ void wxSliderMSW::GetPosition(int *x, int *y) const
if (parent) if (parent)
::ScreenToClient((HWND) parent->GetHWND(), &point); ::ScreenToClient((HWND) parent->GetHWND(), &point);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
}
*x = point.x; *x = point.x;
*y = point.y; *y = point.y;
} }
@@ -320,6 +329,8 @@ void wxSliderMSW::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
char buf[300]; char buf[300];
int x_offset = x; int x_offset = x;

View File

@@ -93,6 +93,8 @@ void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
int actualWidth = width; int actualWidth = width;
int actualHeight = height; int actualHeight = height;

View File

@@ -117,6 +117,8 @@ void wxStaticBox::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
// If we're prepared to use the existing size, then... // If we're prepared to use the existing size, then...
if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO)) if (width == -1 && height == -1 && ((sizeFlags & wxSIZE_AUTO) != wxSIZE_AUTO))
{ {

View File

@@ -104,6 +104,8 @@ void wxStaticText::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
int actualWidth = width; int actualWidth = width;
int actualHeight = height; int actualHeight = height;

View File

@@ -64,6 +64,12 @@ Set the TBSTYLE_CUSTOMERASE style, then handle the
NM_CUSTOMDRAW message and do your custom drawing. NM_CUSTOMDRAW message and do your custom drawing.
*/ */
#define DEFAULTBITMAPX 16
#define DEFAULTBITMAPY 15
#define DEFAULTBUTTONX 24
#define DEFAULTBUTTONY 24
#define DEFAULTBARHEIGHT 27
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase) IMPLEMENT_DYNAMIC_CLASS(wxToolBar95, wxToolBarBase)
@@ -80,9 +86,6 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height);
wxToolBar95::wxToolBar95(void) wxToolBar95::wxToolBar95(void)
{ {
m_tilingDirection = wxVERTICAL ;
m_rowsOrColumns = 0;
m_currentRowsOrColumns = 0;
m_maxWidth = -1; m_maxWidth = -1;
m_maxHeight = -1; m_maxHeight = -1;
m_hBitmap = 0; m_hBitmap = 0;
@@ -91,8 +94,7 @@ wxToolBar95::wxToolBar95(void)
} }
bool wxToolBar95::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, bool wxToolBar95::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, int orientation, long style, const wxString& name)
int RowsOrColumns, const wxString& name)
{ {
m_backgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), m_backgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)),
GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE)));
@@ -102,11 +104,8 @@ bool wxToolBar95::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, co
m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)), m_defaultBackgroundColour = wxColour(GetRValue(GetSysColor(COLOR_BTNFACE)),
GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE))); GetGValue(GetSysColor(COLOR_BTNFACE)), GetBValue(GetSysColor(COLOR_BTNFACE)));
m_tilingDirection = orientation; if (style & wxTB_VERTICAL)
if (m_tilingDirection == wxHORIZONTAL) wxMessageBox("Sorry, wxToolBar95 under Windows 95 only supports vertical tiling.", "wxToolBar95 usage", wxOK);
wxMessageBox("Sorry, wxToolBar95 under Windows 95 only supports vertical tiling.\nPass the number of rows.", "wxToolBar95 usage", wxOK);
m_rowsOrColumns = RowsOrColumns;
m_currentRowsOrColumns = 0;
m_maxWidth = -1; m_maxWidth = -1;
m_maxHeight = -1; m_maxHeight = -1;
@@ -305,7 +304,7 @@ bool wxToolBar95::CreateTools(void)
ans = (int)::SendMessage((HWND) GetHWND(), TB_AUTOSIZE, (WPARAM)0, (LPARAM) 0); ans = (int)::SendMessage((HWND) GetHWND(), TB_AUTOSIZE, (WPARAM)0, (LPARAM) 0);
RECT rect; RECT rect;
::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_rowsOrColumns, TRUE), (LPARAM) & rect); ::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_maxRows, TRUE), (LPARAM) & rect);
m_maxWidth = (rect.right - rect.left + 2); m_maxWidth = (rect.right - rect.left + 2);
m_maxHeight = (rect.bottom - rect.top + 2); m_maxHeight = (rect.bottom - rect.top + 2);
@@ -368,7 +367,7 @@ bool wxToolBar95::MSWNotify(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam)
return TRUE; return TRUE;
} }
void wxToolBar95::SetDefaultSize(const wxSize& size) void wxToolBar95::SetToolBitmapSize(const wxSize& size)
{ {
m_defaultWidth = size.x; m_defaultHeight = size.y; m_defaultWidth = size.x; m_defaultHeight = size.y;
::SendMessage((HWND) GetHWND(), TB_SETBITMAPSIZE, 0, (LPARAM) MAKELONG ((int)size.x, (int)size.y)); ::SendMessage((HWND) GetHWND(), TB_SETBITMAPSIZE, 0, (LPARAM) MAKELONG ((int)size.x, (int)size.y));
@@ -387,7 +386,7 @@ wxSize wxToolBar95::GetMaxSize(void) const
if (m_maxWidth == -1 | m_maxHeight == -1) if (m_maxWidth == -1 | m_maxHeight == -1)
{ {
RECT rect; RECT rect;
::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_rowsOrColumns, TRUE), (LPARAM) & rect); ::SendMessage((HWND) GetHWND(), TB_SETROWS, MAKEWPARAM(m_maxRows, TRUE), (LPARAM) & rect);
((wxToolBar95 *)this)->m_maxWidth = (rect.right - rect.left + 2); // ??? ((wxToolBar95 *)this)->m_maxWidth = (rect.right - rect.left + 2); // ???
((wxToolBar95 *)this)->m_maxHeight = (rect.bottom - rect.top + 2); // ??? ((wxToolBar95 *)this)->m_maxHeight = (rect.bottom - rect.top + 2); // ???
} }
@@ -403,7 +402,7 @@ void wxToolBar95::GetSize(int *w, int *h) const
} }
// The button size is bigger than the bitmap size // The button size is bigger than the bitmap size
wxSize wxToolBar95::GetDefaultButtonSize(void) const wxSize wxToolBar95::GetToolSize(void) const
{ {
return wxSize(m_defaultWidth + 8, m_defaultHeight + 7); return wxSize(m_defaultWidth + 8, m_defaultHeight + 7);
} }

View File

@@ -38,6 +38,12 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#define DEFAULTBITMAPX 16
#define DEFAULTBITMAPY 15
#define DEFAULTBUTTONX 24
#define DEFAULTBUTTONY 22
#define DEFAULTBARHEIGHT 27
/////// Non-Windows 95 implementation /////// Non-Windows 95 implementation
#if !USE_IMAGE_LOADING_IN_MSW #if !USE_IMAGE_LOADING_IN_MSW
@@ -69,15 +75,12 @@ wxToolBarMSW::wxToolBarMSW(void)
} }
bool wxToolBarMSW::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, bool wxToolBarMSW::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
long style, int orientation, long style, const wxString& name)
int RowsOrColumns, const wxString& name)
{ {
if ( ! wxWindow::Create(parent, id, pos, size, style, name) ) if ( ! wxWindow::Create(parent, id, pos, size, style, name) )
return FALSE; return FALSE;
m_tilingDirection = orientation; if ( style & wxTB_HORIZONTAL )
m_rowsOrColumns = RowsOrColumns;
if ( m_tilingDirection == wxVERTICAL )
{ m_lastX = 3; m_lastY = 7; } { m_lastX = 3; m_lastY = 7; }
else else
{ m_lastX = 7; m_lastY = 3; } { m_lastX = 7; m_lastY = 3; }
@@ -112,7 +115,7 @@ wxToolBarMSW::~wxToolBarMSW(void)
FreeGlobalObjects(); FreeGlobalObjects();
} }
void wxToolBarMSW::SetDefaultSize(const wxSize& size) void wxToolBarMSW::SetToolBitmapSize(const wxSize& size)
{ {
m_defaultWidth = size.x; m_defaultHeight = size.y; m_defaultWidth = size.x; m_defaultHeight = size.y;
FreeGlobalObjects(); FreeGlobalObjects();
@@ -120,7 +123,7 @@ void wxToolBarMSW::SetDefaultSize(const wxSize& size)
} }
// The button size is bigger than the bitmap size // The button size is bigger than the bitmap size
wxSize wxToolBarMSW::GetDefaultButtonSize(void) const wxSize wxToolBarMSW::GetToolSize(void) const
{ {
return wxSize(m_defaultWidth + 8, m_defaultHeight + 7); return wxSize(m_defaultWidth + 8, m_defaultHeight + 7);
} }
@@ -361,7 +364,7 @@ wxToolBarTool *wxToolBarMSW::AddTool(int index, const wxBitmap& bitmap, const wx
tool->m_y = m_yMargin; tool->m_y = m_yMargin;
tool->m_deleteSecondBitmap = TRUE; tool->m_deleteSecondBitmap = TRUE;
tool->SetSize(GetDefaultButtonWidth(), GetDefaultButtonHeight()); tool->SetSize(GetToolSize().x, GetToolSize().y);
// Calculate reasonable max size in case Layout() not called // Calculate reasonable max size in case Layout() not called
if ((tool->m_x + bitmap.GetWidth() + m_xMargin) > m_maxWidth) if ((tool->m_x + bitmap.GetWidth() + m_xMargin) > m_maxWidth)
@@ -374,6 +377,99 @@ wxToolBarTool *wxToolBarMSW::AddTool(int index, const wxBitmap& bitmap, const wx
return tool; return tool;
} }
void wxToolBarMSW::Layout(void)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY = m_yMargin;
int maxToolWidth = 0;
int maxToolHeight = 0;
m_maxWidth = 0;
m_maxHeight = 0;
// Find the maximum tool width and height
wxNode *node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->GetWidth() > maxToolWidth)
maxToolWidth = (int)tool->GetWidth();
if (tool->GetHeight() > maxToolHeight)
maxToolHeight = (int)tool->GetHeight();
node = node->Next();
}
int separatorSize = m_toolSeparation;
node = m_tools.First();
while (node)
{
wxToolBarTool *tool = (wxToolBarTool *)node->Data();
if (tool->m_toolStyle == wxTOOL_STYLE_SEPARATOR)
{
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
{
if (m_currentRowsOrColumns >= m_maxCols)
m_lastY += separatorSize;
else
m_lastX += separatorSize;
}
else
{
if (m_currentRowsOrColumns >= m_maxRows)
m_lastX += separatorSize;
else
m_lastY += separatorSize;
}
}
else if (tool->m_toolStyle == wxTOOL_STYLE_BUTTON)
{
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
{
if (m_currentRowsOrColumns >= m_maxCols)
{
m_currentRowsOrColumns = 0;
m_lastX = m_xMargin;
m_lastY += maxToolHeight + m_toolPacking;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastX += maxToolWidth + m_toolPacking;
}
else
{
if (m_currentRowsOrColumns >= m_maxRows)
{
m_currentRowsOrColumns = 0;
m_lastX += (maxToolWidth + m_toolPacking);
m_lastY = m_yMargin;
}
tool->m_x = (long) (m_lastX + (maxToolWidth - tool->GetWidth())/2.0);
tool->m_y = (long) (m_lastY + (maxToolHeight - tool->GetHeight())/2.0);
m_lastY += maxToolHeight + m_toolPacking;
}
m_currentRowsOrColumns ++;
}
if (m_lastX > m_maxWidth)
m_maxWidth = m_lastX;
if (m_lastY > m_maxHeight)
m_maxHeight = m_lastY;
node = node->Next();
}
if ( GetWindowStyleFlag() & wxTB_HORIZONTAL )
m_maxWidth += maxToolWidth;
else
m_maxHeight += maxToolHeight;
m_maxWidth += m_xMargin;
m_maxHeight += m_yMargin;
}
bool wxToolBarMSW::InitGlobalObjects(void) bool wxToolBarMSW::InitGlobalObjects(void)
{ {
GetSysColors(); GetSysColors();
@@ -384,7 +480,7 @@ bool wxToolBarMSW::InitGlobalObjects(void)
if (!m_hdcMono) if (!m_hdcMono)
return FALSE; return FALSE;
m_hbmMono = (WXHBITMAP) CreateBitmap((int)GetDefaultButtonWidth(), (int)GetDefaultButtonHeight(), 1, 1, NULL); m_hbmMono = (WXHBITMAP) CreateBitmap((int)GetToolSize().x, (int)GetToolSize().y, 1, 1, NULL);
if (!m_hbmMono) if (!m_hbmMono)
return FALSE; return FALSE;
@@ -448,12 +544,12 @@ void wxToolBarMSW::CreateMask(WXHDC hdc, int xoffset, int yoffset, int dx, int d
// create mask based on color bitmap // create mask based on color bitmap
// convert this to 1's // convert this to 1's
SetBkColor(hdcGlyphs, m_rgbFace); SetBkColor(hdcGlyphs, m_rgbFace);
BitBlt((HDC) m_hdcMono, xoffset, yoffset, (int)GetDefaultWidth(), (int)GetDefaultHeight(), BitBlt((HDC) m_hdcMono, xoffset, yoffset, (int)GetToolBitmapSize().x, (int)GetToolBitmapSize().y,
hdcGlyphs, 0, 0, SRCCOPY); hdcGlyphs, 0, 0, SRCCOPY);
// convert this to 1's // convert this to 1's
SetBkColor(hdcGlyphs, m_rgbHilight); SetBkColor(hdcGlyphs, m_rgbHilight);
// OR in the new 1's // OR in the new 1's
BitBlt((HDC) m_hdcMono, xoffset, yoffset, (int)GetDefaultWidth(), (int)GetDefaultHeight(), BitBlt((HDC) m_hdcMono, xoffset, yoffset, (int)GetToolBitmapSize().x, (int)GetToolBitmapSize().y,
hdcGlyphs, 0, 0, SRCPAINT); hdcGlyphs, 0, 0, SRCPAINT);
SelectObject(hdcGlyphs, bitmapOld); SelectObject(hdcGlyphs, bitmapOld);
@@ -538,7 +634,7 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar
// calculate offset of face from (x,y). y is always from the top, // calculate offset of face from (x,y). y is always from the top,
// so the offset is easy. x needs to be centered in face. // so the offset is easy. x needs to be centered in face.
yOffset = 1; yOffset = 1;
xCenterOffset = (dxFace - (int)GetDefaultWidth())/2; xCenterOffset = (dxFace - (int)GetToolBitmapSize().x)/2;
if (state & (wxTBSTATE_PRESSED | wxTBSTATE_CHECKED)) if (state & (wxTBSTATE_PRESSED | wxTBSTATE_CHECKED))
{ {
// pressed state moves down and to the right // pressed state moves down and to the right
@@ -549,7 +645,7 @@ void wxToolBarMSW::DrawButton(WXHDC hdc, int x, int y, int dx, int dy, wxToolBar
// now put on the face // now put on the face
if (state & wxTBSTATE_ENABLED) { if (state & wxTBSTATE_ENABLED) {
// regular version // regular version
BitBlt((HDC) hdc, x+xCenterOffset, y + yOffset, (int)GetDefaultWidth(), (int)GetDefaultHeight(), BitBlt((HDC) hdc, x+xCenterOffset, y + yOffset, (int)GetToolBitmapSize().x, (int)GetToolBitmapSize().y,
hdcGlyphs, 0, 0, SRCCOPY); hdcGlyphs, 0, 0, SRCCOPY);
} else { } else {
// disabled version (or indeterminate) // disabled version (or indeterminate)

View File

@@ -314,6 +314,8 @@ void wxTextCtrl::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
y1 = currentY; y1 = currentY;
AdjustForParentClientOrigin(x1, y1, sizeFlags);
int cx; // button font dimensions int cx; // button font dimensions
int cy; int cy;

View File

@@ -189,8 +189,8 @@ bool wxGetUserName(char *buf, int maxSize)
// } // }
#else #else
#if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && USE_PENWINDOWS #if !defined(__WATCOMC__) && !defined(__GNUWIN32__) && USE_PENWINDOWS
extern HANDLE hPenWin; // PenWindows Running? extern HANDLE g_hPenWin; // PenWindows Running?
if (hPenWin) if (g_hPenWin)
{ {
// PenWindows Does have a user concept! // PenWindows Does have a user concept!
// Get the current owner of the recognizer // Get the current owner of the recognizer
@@ -365,9 +365,9 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn)
# ifdef __WINDOWS_386__ # ifdef __WINDOWS_386__
retValue = wxWIN386; retValue = wxWIN386;
# else # else
# if !defined(__WATCOMC__) && !defined(GNUWIN32) # if !defined(__WATCOMC__) && !defined(GNUWIN32) && USE_PENWINDOWS
extern HANDLE hPenWin; extern HANDLE g_hPenWin;
retValue = hPenWin ? wxPENWINDOWS : wxWINDOWS ; retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS ;
# endif # endif
# endif # endif
// @@@@ To be completed. I don't have the manual here... // @@@@ To be completed. I don't have the manual here...

View File

@@ -621,6 +621,16 @@ void wxWindow::GetPosition(int *x, int *y) const
{ {
::ScreenToClient(hParentWnd, &point); ::ScreenToClient(hParentWnd, &point);
} }
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
point.x -= pt.x;
point.y -= pt.y;
}
*x = point.x; *x = point.x;
*y = point.y; *y = point.y;
} }
@@ -633,6 +643,15 @@ void wxWindow::ScreenToClient(int *x, int *y) const
pt.y = *y; pt.y = *y;
::ScreenToClient(hWnd, &pt); ::ScreenToClient(hWnd, &pt);
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt1(GetParent()->GetClientAreaOrigin());
pt.x -= pt1.x;
pt.y -= pt1.y;
}
*x = pt.x; *x = pt.x;
*y = pt.y; *y = pt.y;
} }
@@ -643,6 +662,17 @@ void wxWindow::ClientToScreen(int *x, int *y) const
POINT pt; POINT pt;
pt.x = *x; pt.x = *x;
pt.y = *y; pt.y = *y;
// We may be faking the client origin.
// So a window that's really at (0, 30) may appear
// (to wxWin apps) to be at (0, 0).
if (GetParent())
{
wxPoint pt1(GetParent()->GetClientAreaOrigin());
pt.x += pt1.x;
pt.y += pt1.y;
}
::ClientToScreen(hWnd, &pt); ::ClientToScreen(hWnd, &pt);
*x = pt.x; *x = pt.x;
@@ -674,7 +704,6 @@ void wxWindow::SetCursor(const wxCursor& cursor)
// Get size *available for subwindows* i.e. excluding menu bar etc. // Get size *available for subwindows* i.e. excluding menu bar etc.
// For XView, this is the same as GetSize
void wxWindow::GetClientSize(int *x, int *y) const void wxWindow::GetClientSize(int *x, int *y) const
{ {
HWND hWnd = (HWND) GetHWND(); HWND hWnd = (HWND) GetHWND();
@@ -697,6 +726,8 @@ void wxWindow::SetSize(int x, int y, int width, int height, int sizeFlags)
if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE)) if (y == -1 || (sizeFlags & wxSIZE_ALLOW_MINUS_ONE))
actualY = currentY; actualY = currentY;
AdjustForParentClientOrigin(actualX, actualY, sizeFlags);
int currentW,currentH; int currentW,currentH;
GetSize(&currentW, &currentH); GetSize(&currentW, &currentH);
if (width == -1) if (width == -1)
@@ -745,6 +776,24 @@ void wxWindow::SetClientSize(int width, int height)
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
} }
// For implementation purposes - sometimes decorations make the client area
// smaller
wxPoint wxWindow::GetClientAreaOrigin() const
{
return wxPoint(0, 0);
}
// Makes an adjustment to the window position (for example, a frame that has
// a toolbar that it manages itself).
void wxWindow::AdjustForParentClientOrigin(int& x, int& y, int sizeFlags)
{
if (((sizeFlags & wxSIZE_NO_ADJUSTMENTS) == 0) && GetParent())
{
wxPoint pt(GetParent()->GetClientAreaOrigin());
x += pt.x; y += pt.y;
}
}
bool wxWindow::Show(bool show) bool wxWindow::Show(bool show)
{ {
HWND hWnd = (HWND) GetHWND(); HWND hWnd = (HWND) GetHWND();
@@ -1956,6 +2005,19 @@ void wxWindow::MSWDetachWindowMenu(void)
bool wxWindow::MSWOnPaint(void) bool wxWindow::MSWOnPaint(void)
{ {
#ifdef __WIN32__
HRGN hRegion = ::CreateRectRgn(0, 0, 0, 0); // Dummy call to get a handle
::GetUpdateRgn((HWND) GetHWND(), hRegion, FALSE);
m_updateRegion = wxRegion((WXHRGN) hRegion);
#else
RECT updateRect;
::GetUpdateRect((HWND) GetHWND(), & updateRect, FALSE);
m_updateRegion = wxRegion(updateRect.left, updateRect.top,
updateRect.right - updateRect.left, updateRect.bottom - updateRect.top);
#endif
wxPaintEvent event(m_windowId); wxPaintEvent event(m_windowId);
event.SetEventObject(this); event.SetEventObject(this);
if (!GetEventHandler()->ProcessEvent(event)) if (!GetEventHandler()->ProcessEvent(event))
@@ -2866,6 +2928,9 @@ void wxWindow::GetCaretPos(int *x, int *y) const
*y = point.y; *y = point.y;
} }
// OBSOLETE: use GetUpdateRegion instead.
#if 0
/* /*
* Update iterator. Use from within OnPaint. * Update iterator. Use from within OnPaint.
*/ */
@@ -2952,6 +3017,7 @@ int wxUpdateIterator::GetH()
{ {
return ((RECT *)rp)[current].bottom-GetY(); return ((RECT *)rp)[current].bottom-GetY();
} }
#endif
wxWindow *wxGetActiveWindow(void) wxWindow *wxGetActiveWindow(void)
{ {
@@ -4470,6 +4536,29 @@ bool wxWindow::AcceptsFocus() const
return IsShown() && IsEnabled(); return IsShown() && IsEnabled();
} }
// Update region access
wxRegion wxWindow::GetUpdateRegion() const
{
return m_updateRegion;
}
bool wxWindow::IsExposed(int x, int y, int w, int h) const
{
return (m_updateRegion.Contains(x, y, w, h) != wxOutRegion);
}
bool wxWindow::IsExposed(const wxPoint& pt) const
{
return (m_updateRegion.Contains(pt) != wxOutRegion);
}
bool wxWindow::IsExposed(const wxRect& rect) const
{
return (m_updateRegion.Contains(rect) != wxOutRegion);
}
#ifdef __WXDEBUG__ #ifdef __WXDEBUG__
static const char *GetMessageName(int message) static const char *GetMessageName(int message)
{ {