From 4fabb57533169f2f75367e0d120c762518548890 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 28 Nov 1998 13:38:40 +0000 Subject: [PATCH] wxSize/wxPoint/wxRect versions of functions added to wxMSW, wxMotif; wxScrollBar::Set/GetPosition changed to Set/GetThumbPosition to avoid clash; various other portability changes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- distrib/msw/generic.rsp | 1 - distrib/msw/msw.rsp | 8 + docs/latex/wx/treectrl.tex | 386 ++++++++++++++++++++++------------ docs/msw/install.txt | 18 +- docs/msw/issues.txt | 9 + include/wx/gtk/scrolbar.h | 4 +- include/wx/gtk1/scrolbar.h | 4 +- include/wx/list.h | 4 + include/wx/memory.h | 2 +- include/wx/motif/checkbox.h | 6 + include/wx/motif/choice.h | 5 + include/wx/motif/combobox.h | 3 + include/wx/motif/dialog.h | 6 + include/wx/motif/frame.h | 15 ++ include/wx/motif/gauge.h | 3 + include/wx/motif/listbox.h | 4 + include/wx/motif/mdi.h | 23 ++ include/wx/motif/radiobox.h | 3 + include/wx/motif/scrolbar.h | 4 +- include/wx/motif/slider.h | 5 + include/wx/motif/statbmp.h | 3 + include/wx/motif/statbox.h | 4 + include/wx/motif/window.h | 20 +- include/wx/msw/bitmap.h | 2 +- include/wx/msw/button.h | 4 + include/wx/msw/checkbox.h | 8 + include/wx/msw/choice.h | 3 + include/wx/msw/control.h | 2 + include/wx/msw/dialog.h | 8 + include/wx/msw/frame.h | 15 ++ include/wx/msw/gauge95.h | 3 + include/wx/msw/gaugemsw.h | 3 + include/wx/msw/listbox.h | 3 + include/wx/msw/mdi.h | 5 + include/wx/msw/radiobox.h | 9 + include/wx/msw/scrolbar.h | 8 +- include/wx/msw/setup.h | 4 +- include/wx/msw/slider95.h | 9 + include/wx/msw/slidrmsw.h | 9 + include/wx/msw/statbmp.h | 3 + include/wx/msw/statbox.h | 3 + include/wx/msw/stattext.h | 3 + include/wx/msw/tbar95.h | 2 + include/wx/msw/textctrl.h | 3 + include/wx/msw/window.h | 24 ++- include/wx/stubs/scrolbar.h | 4 +- samples/controls/controls.cpp | 112 +++++----- src/common/log.cpp | 2 + src/common/memory.cpp | 10 +- src/common/string.cpp | 6 + src/common/variant.cpp | 5 +- src/generic/gridg.cpp | 8 +- src/gtk/scrolbar.cpp | 10 +- src/gtk1/scrolbar.cpp | 10 +- src/motif/app.cpp | 33 ++- src/motif/listbox.cpp | 4 +- src/motif/scrolbar.cpp | 4 +- src/motif/toolbar.cpp | 2 +- src/motif/utils.cpp | 2 +- src/motif/window.cpp | 17 ++ src/msw/bitmap.cpp | 4 +- src/msw/cursor.cpp | 2 +- src/msw/icon.cpp | 2 +- src/msw/makefile.g95 | 39 ++-- src/msw/makefile.nt | 137 ++++++++++-- src/msw/scrolbar.cpp | 4 +- src/msw/textctrl.cpp | 16 ++ src/msw/treectrl.cpp | 8 +- src/msw/window.cpp | 29 +++ src/stubs/scrolbar.cpp | 4 +- 70 files changed, 857 insertions(+), 290 deletions(-) diff --git a/distrib/msw/generic.rsp b/distrib/msw/generic.rsp index c9381aa6a5..c550dcd5bf 100644 --- a/distrib/msw/generic.rsp +++ b/distrib/msw/generic.rsp @@ -55,7 +55,6 @@ src/zlib/*.mms include/wx/*.h include/wx/*.cpp include/wx/protocol/*.h -include/wx/*.cpp include/wx/wx_setup.vms include/wx/common/*.h include/wx/generic/*.h diff --git a/distrib/msw/msw.rsp b/distrib/msw/msw.rsp index 2f7894e335..88c7fa821a 100644 --- a/distrib/msw/msw.rsp +++ b/distrib/msw/msw.rsp @@ -35,6 +35,14 @@ src/msw/ctl3d/borland/*.* src/msw/ole/*.cpp src/msw/*.prj +src/xpm/*.c +src/xpm/*.h +src/xpm/changes +src/xpm/readme +src/xpm/readme.msw +src/xpm/copyrigh.t +src/xpm/files + include/wx/msw/*.h include/wx/msw/*.rc include/wx/msw/ctl3d/*.h diff --git a/docs/latex/wx/treectrl.tex b/docs/latex/wx/treectrl.tex index 2c2ac8ac38..c831025d97 100644 --- a/docs/latex/wx/treectrl.tex +++ b/docs/latex/wx/treectrl.tex @@ -1,7 +1,7 @@ \section{\class{wxTreeCtrl}}\label{wxtreectrl} A tree control presents information as a hierarchy, with items that may be expanded -to show further items. Items in a tree control are referenced by long integer handles. +to show further items. Items in a tree control are referenced by wxTreeItemId handles. To intercept events from a tree control, use the event table macros described in \helpref{wxTreeEvent}{wxtreeevent}. @@ -47,7 +47,7 @@ functions that take a \helpref{wxTreeEvent}{wxtreeevent} argument. \wxheading{See also} -\helpref{wxTreeCtrl overview}{wxtreectrloverview}, \helpref{wxListBox}{wxlistbox}, \helpref{wxListCtrl}{wxlistctrl},\rtfsp +\helpref{wxTreeItemData}{wxtreeitemdata}, \helpref{wxTreeCtrl overview}{wxtreectrloverview}, \helpref{wxListBox}{wxlistbox}, \helpref{wxListCtrl}{wxlistctrl},\rtfsp \helpref{wxImageList}{wximagelist}, \helpref{wxTreeEvent}{wxtreeevent} \latexignore{\rtfignore{\wxheading{Members}}} @@ -91,6 +91,38 @@ appropriately.} Destructor, destroying the list control. +\membersection{wxTreeCtrl::AddRoot}\label{wxtreectrladdroot} + +\func{wxTreeItemId}{AddRoot}{\param{const wxString\&}{ text}, + \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} + +Adds the root node to the tree, returning the new item. + +If {\it image} > -1 and {\it selImage} is -1, the same image is used for +both selected and unselected items. + +\membersection{wxTreeCtrl::AppendItem}\label{wxtreectrlappenditem} + +\func{wxTreeItemId}{AppendItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text}, + \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} + +Appends an item to the end of the branch identified by {\it parent}, return a new item id. + +If {\it image} > -1 and {\it selImage} is -1, the same image is used for +both selected and unselected items. + +\membersection{wxTreeCtrl::Collapse}\label{wxtreectrlcollapse} + +\func{void}{Collapse}{\param{const wxTreeItemId\&}{ item}} + +Collapses the given item. + +\membersection{wxTreeCtrl::CollapseAndReset}\label{wxtreectrlcollapseandreset} + +\func{void}{CollapseAndReset}{\param{const wxTreeItemId\&}{ item}} + +Collapses the given item and removes all children. + \membersection{wxTreeCtrl::Create}\label{wxtreectrlcreate} \func{bool}{wxTreeCtrl}{\param{wxWindow*}{ parent}, \param{wxWindowID}{ id},\rtfsp @@ -99,21 +131,21 @@ Destructor, destroying the list control. Creates the tree control. See \helpref{wxTreeCtrl::wxTreeCtrl}{wxtreectrlconstr} for further details. -\membersection{wxTreeCtrl::DeleteAllItems}\label{wxtreectrldeleteallitems} +\membersection{wxTreeCtrl::Delete}\label{wxtreectrldelete} -\func{bool}{DeleteAllItems}{\void} +\func{void}{Delete}{\param{const wxTreeItemId\&}{ item}} -Deletes all the items in the control. +Deletes the specified item. -\membersection{wxTreeCtrl::DeleteItem}\label{wxtreectrldeleteitem} +\membersection{wxTreeCtrl::DeleteAllItems}\label{wxtreectrldeleteallitems} -\func{bool}{DeleteItem}{\param{long }{item}} +\func{void}{DeleteAllItems}{\void} -Deletes the specified item. +Deletes all the items in the control. \membersection{wxTreeCtrl::EditLabel}\label{wxtreectrleditlabel} -\func{wxTextCtrl*}{EditLabel}{\param{long }{item}, \param{wxClassInfo*}{ textControlClass = CLASSINFO(wxTextCtrl)}} +\func{wxTextCtrl*}{EditLabel}{\param{const wxTreeItemId\&}{ item}, \param{wxClassInfo*}{ textControlClass = CLASSINFO(wxTextCtrl)}} Starts editing the label of the given item, returning the text control that the tree control uses for editing. @@ -130,7 +162,7 @@ This function is currently supported under Windows only. \membersection{wxTreeCtrl::EndEditLabel}\label{wxtreectrlendeditlabel} -\func{bool}{EndEditLabel}{\param{bool }{cancelEdit}} +\func{void}{EndEditLabel}{\param{bool }{cancelEdit}} Ends label editing. If {\it cancelEdit} is TRUE, the edit will be cancelled. @@ -142,31 +174,28 @@ This function is currently supported under Windows only. \membersection{wxTreeCtrl::EnsureVisible}\label{wxtreectrlensurevisible} -\func{bool}{EnsureVisible}{\param{long }{item}} +\func{void}{EnsureVisible}{\param{const wxTreeItemId\&}{ item}} Scrolls and/or expands items to ensure that the given item is visible. -\membersection{wxTreeCtrl::ExpandItem}\label{wxtreectrlexpanditem} +\membersection{wxTreeCtrl::Expand}\label{wxtreectrlexpand} -\func{bool}{ExpandItem}{\param{long }{item}, \param{int }{action}} +\func{void}{Expand}{\param{const wxTreeItemId\&}{ item}} Expands the given item. -{\it action} may be one of: +\membersection{wxTreeCtrl::GetBoundingRect}\label{wxtreectrlgetitemrect} -\twocolwidtha{5cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{\windowstyle{wxTREE\_EXPAND\_EXPAND}}{Expands the item.} -\twocolitem{\windowstyle{wxTREE\_EXPAND\_COLLAPSE}}{Collapses the item.} -\twocolitem{\windowstyle{wxTREE\_EXPAND\_COLLAPSE\_RESET}}{Collapses the item and removes the child items.} -\twocolitem{\windowstyle{wxTREE\_EXPAND\_TOGGLE}}{Expands if the item is collapsed, collapses if the item is expanded.} -\end{twocollist} +\constfunc{void}{GetBoundingRect}{\param{const wxTreeItemId\&}{ item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = FALSE}} + +Returns the position and size of the rectangle bounding the item. -\membersection{wxTreeCtrl::GetChild}\label{wxtreectrlgetchild} +\membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount} -\constfunc{long}{GetChild}{\param{long }{item}} +\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = TRUE}} -Call this function to retrieve the tree view item that is the first child of the item specified by {\it item}. +Returns the number of items in the branch. If {\it recursively} is TRUE, returns the total number +of descendants, otherwise only one level of children is counted. \membersection{wxTreeCtrl::GetCount}\label{wxtreectrlgetcount} @@ -180,9 +209,27 @@ Returns the number of items in the control. Returns the edit control used to edit a label. +\membersection{wxTreeCtrl::GetFirstChild}\label{wxtreectrlgetfirstchild} + +\constfunc{wxTreeItemId}{GetFirstChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} + +Returns the first child; call \helpref{wxTreeCtrl::GetNextChild}{wxtreectrlgetnextchild} for the next child. + +For this enumeration function you must pass in a `cookie' parameter +which is opaque for the application but is necessary for the library +to make these functions reentrant (i.e. allow more than one +enumeration on one and the same object simultaneously). The cookie passed to +GetFirstChild and GetNextChild should be the same. + +Returns 0 if there are no further children. + +\wxheading{See also} + +\helpref{wxTreeCtrl::GetNextChild}{wxtreectrlgetnextchild} + \membersection{wxTreeCtrl::GetFirstVisibleItem}\label{wxtreectrlgetfirstvisibleitem} -\constfunc{long}{GetFirstVisibleItem}{\void} +\constfunc{wxTreeItemId}{GetFirstVisibleItem}{\void} Returns the first visible item. @@ -205,82 +252,103 @@ Returns the specified image list. {\it which} may be one of: Returns the current tree control indentation. -\membersection{wxTreeCtrl::GetItem}\label{wxtreectrlgetitem} +\membersection{wxTreeCtrl::GetItemData}\label{wxtreectrlgetitemdata} -\constfunc{bool}{GetItem}{\param{wxTreeItem\& }{info}} +\constfunc{wxTreeItemData*}{GetItemData}{\param{const wxTreeItemId\&}{ item}} -Gets information about the item. See \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem} for more -information. +Returns the tree item data associated with the item. -\membersection{wxTreeCtrl::GetItemData}\label{wxtreectrlgetitemdata} +\wxheading{See also} -\constfunc{long}{GetItemData}{\param{long }{item}} +\helpref{wxTreeItemData}{wxtreeitemdata} -Returns the client data associated with the item, if any. +\membersection{wxTreeCtrl::GetItemImage}\label{wxtreectrlgetitemimage} -\membersection{wxTreeCtrl::GetItemRect}\label{wxtreectrlgetitemrect} +\constfunc{int}{GetItemImage}{\param{const wxTreeItemId\& }{item}} -\constfunc{bool}{GetItemRect}{\param{long }{item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = FALSE}} +Gets the normal item image. -Returns the position and size of the rectangle bounding the item. +\membersection{wxTreeCtrl::GetItemText}\label{wxtreectrlgetitemtext} -\membersection{wxTreeCtrl::GetItemState}\label{wxtreectrlgetitemstate} +\constfunc{wxString}{GetItemText}{\param{const wxTreeItemId\&}{ item}} -\constfunc{int}{GetItemState}{\param{long }{item}, \param{long }{stateMask}} +Returns the item label. -Gets the item state. For a list of state flags, see \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem}. +\membersection{wxTreeCtrl::GetNextChild}\label{wxtreectrlgetnextchild} -\membersection{wxTreeCtrl::GetItemText}\label{wxtreectrlgetitemtext} +\constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}} -\constfunc{wxString}{GetItemText}{\param{long }{item}} +Returns the next child; call \helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild} for the first child. -Returns the item label. +For this enumeration function you must pass in a `cookie' parameter +which is opaque for the application but is necessary for the library +to make these functions reentrant (i.e. allow more than one +enumeration on one and the same object simultaneously). The cookie passed to +GetFirstChild and GetNextChild should be the same. -\membersection{wxTreeCtrl::GetNextItem}\label{wxtreectrlgetnextitem} +Returns 0 if there are no further children. -\constfunc{long}{GetNextItem}{\param{long }{item}, \param{int }{code}} +\wxheading{See also} -Searches for an item using the given criterion, starting from {\it item}. +\helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild} -Returns the item or 0 if unsuccessful. +\membersection{wxTreeCtrl::GetNextSibling}\label{wxtreectrlgetnextsibling} -{\it code} can be one of: +\constfunc{wxTreeItemId}{GetNextSibling}{\param{const wxTreeItemId\&}{ item}} -\twocolwidtha{5cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{wxTREE\_NEXT\_CARET}{Retrieves the currently selected item.} -\twocolitem{wxTREE\_NEXT\_CHILD}{Retrieves the first child item. The hItem parameter must be NULL.} -\twocolitem{wxTREE\_NEXT\_DROPHILITE}{Retrieves the item that is the target of a drag-and-drop operation.} -\twocolitem{wxTREE\_NEXT\_FIRSTVISIBLE}{Retrieves the first visible item.} -\twocolitem{wxTREE\_NEXT\_NEXT}{Retrieves the next sibling item.} -\twocolitem{wxTREE\_NEXT\_NEXTVISIBLE}{Retrieves the next visible item that follows the specified item.} -\twocolitem{wxTREE\_NEXT\_PARENT}{Retrieves the parent of the specified item.} -\twocolitem{wxTREE\_NEXT\_PREVIOUS}{Retrieves the previous sibling item.} -\twocolitem{wxTREE\_NEXT\_PREVIOUSVISIBLE}{Retrieves the first visible item that precedes the specified item.} -\twocolitem{wxTREE\_NEXT\_ROOT}{Retrieves the first child item of the root item of which the specified item is a part.} -\end{twocollist} +Returns the next sibling of the specified item; call \helpref{wxTreeCtrl::GetPrevSibling}{wxtreectrlgetprevsibling} for the previous sibling. -\membersection{wxTreeCtrl::GetNextVisibleItem}\label{wxtreectrlgetnextvisibleitem} +Returns 0 if there are no further siblings. -\constfunc{long}{GetNextVisibleItem}{\param{long }{item}} +\wxheading{See also} + +\helpref{wxTreeCtrl::GetPrevSibling}{wxtreectrlgetprevsibling} + +\membersection{wxTreeCtrl::GetNextVisible}\label{wxtreectrlgetnextvisible} + +\constfunc{wxTreeItemId}{GetNextVisible}{\param{const wxTreeItemId\&}{ item}} Returns the next visible item. \membersection{wxTreeCtrl::GetParent}\label{wxtreectrlgetparent} -\constfunc{long}{GetParent}{\param{long }{item}} +\constfunc{wxTreeItemId}{GetParent}{\param{const wxTreeItemId\&}{ item}} Returns the item's parent. +\membersection{wxTreeCtrl::GetPrevSibling}\label{wxtreectrlgetprevsibling} + +\constfunc{wxTreeItemId}{GetPrevSibling}{\param{const wxTreeItemId\&}{ item}} + +Returns the previous sibling of the specified item; call \helpref{wxTreeCtrl::GetNextSibling}{wxtreectrlgetnextsibling} for the next sibling. + +Returns 0 if there are no further children. + +\wxheading{See also} + +\helpref{wxTreeCtrl::GetNextSibling}{wxtreectrlgetnextsibling} + +\membersection{wxTreeCtrl::GetPrevVisible}\label{wxtreectrlgetprevvisible} + +\constfunc{wxTreeItemId}{GetPrevVisible}{\param{const wxTreeItemId\&}{ item}} + +Returns the previous visible item. + \membersection{wxTreeCtrl::GetRootItem}\label{wxtreectrlgetrootitem} -\constfunc{long}{GetRootItem}{\void} +\constfunc{wxTreeItemId}{GetRootItem}{\void} Returns the root item for the tree control. +\membersection{wxTreeCtrl::GetSelectedItemImage}\label{wxtreectrlgetselecteditemimage} + +\constfunc{int}{GetSelectedItemImage}{\param{const wxTreeItemId\& }{item}} + +Gets the selected item image. + \membersection{wxTreeCtrl::GetSelection}\label{wxtreectrlgetselection} -\constfunc{long}{GetSelection}{\void} +\constfunc{wxTreeItemId}{GetSelection}{\void} Returns the selection, or 0 if there is no selection. @@ -308,32 +376,57 @@ in {\it flags}. {\it flags} is a bitlist of the following: \membersection{wxTreeCtrl::InsertItem}\label{wxtreectrlinsertitem} -\func{long}{InsertItem}{\param{long }{parent}, \param{wxTreeItem\& }{info}, \param{long }{insertAfter = wxTREE\_INSERT\_LAST}} +\func{wxTreeItemId}{InsertItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxTreeItemId\& }{previous}, \param{const wxString\&}{ text}, + \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} -Inserts an item. For more information on {\it info}, see \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem}. - -\func{long}{InsertItem}{\param{long }{parent}, \param{const wxString\& }{label}, \param{int }{image = -1}, \param{int }{selImage = -1}, \param{long }{insertAfter = wxTREE\_INSERT\_LAST}} - -Inserts an item. +Inserts an item after a given one. If {\it image} > -1 and {\it selImage} is -1, the same image is used for both selected and unselected items. +\membersection{wxTreeCtrl::IsExpanded}\label{wxtreectrlisexpanded} + +\constfunc{bool}{IsExpanded}{\param{const wxTreeItemId\&}{ item}} + +Returns TRUE if the item is expanded (only makes sense if it has children). + +\membersection{wxTreeCtrl::IsSelected}\label{wxtreectrlisselected} + +\constfunc{bool}{IsSelected}{\param{const wxTreeItemId\&}{ item}} + +Returns TRUE if the item is selected. + +\membersection{wxTreeCtrl::IsVisible}\label{wxtreectrlisvisible} + +\constfunc{bool}{IsVisible}{\param{const wxTreeItemId\&}{ item}} + +Returns TRUE if the item is visible (it might be outside the view, or not expanded). + \membersection{wxTreeCtrl::ItemHasChildren}\label{wxtreectrlitemhaschildren} -\constfunc{bool}{ItemHasChildren}{\param{long }{item}} +\constfunc{bool}{ItemHasChildren}{\param{const wxTreeItemId\&}{ item}} Returns TRUE if the item has children. +\membersection{wxTreeCtrl::PrependItem}\label{wxtreectrlprependitem} + +\func{wxTreeItemId}{PrependItem}{\param{const wxTreeItemId\& }{parent}, \param{const wxString\&}{ text}, + \param{int}{ image = -1}, \param{int}{ selImage = -1}, \param{wxTreeItemData*}{ data = NULL}} + +Appends an item as the first child of {\it parent}, return a new item id. + +If {\it image} > -1 and {\it selImage} is -1, the same image is used for +both selected and unselected items. + \membersection{wxTreeCtrl::ScrollTo}\label{wxtreectrlscrollto} -\func{bool}{ScrollTo}{\param{long }{item}} +\func{void}{ScrollTo}{\param{const wxTreeItemId\&}{ item}} -selects the specified item and scrolls the item into view, +Scrolls the specified item into view. \membersection{wxTreeCtrl::SelectItem}\label{wxtreectrlselectitem} -\func{bool}{SelectItem}{\param{long }{item}} +\func{bool}{SelectItem}{\param{const wxTreeItemId\&}{ item}} Selects the given item. @@ -350,82 +443,117 @@ Sets the indentation for the tree control. Sets the image list. {\it which} should be one of wxIMAGE\_LIST\_NORMAL, wxIMAGE\_LIST\_SMALL and wxIMAGE\_LIST\_STATE. -\membersection{wxTreeCtrl::SetItem}\label{wxtreectrlsetitem} - -\func{bool}{SetItem}{\param{wxTreeItem\& }{info}} - -Sets the properties of the item. - -The members of wxTreeItem are as follows: +\membersection{wxTreeCtrl::SetItemData}\label{wxtreectrlsetitemdata} -\twocolwidtha{5cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{m\_mask}{A bitlist specifying the valid members. See below for mask flags.} -\twocolitem{m\_itemId}{The item identifier.} -\twocolitem{m\_state}{The item state. See below for state flags.} -\twocolitem{m\_stateMask}{A bitlist specifying the valid contents of {\it m\_state}. These flags -are taken from the same set of symbols as {\it m\_state}.} -\twocolitem{m\_text}{The item label.} -\twocolitem{m\_image}{The item image index (an index into the appropriate image list).} -\twocolitem{m\_selectedImage}{The item selected index (an index into the appropriate image list).} -\twocolitem{m\_children}{The number of child items that this item has.} -\twocolitem{m\_data}{The application-defined data associated with this item.} -\end{twocollist} +\func{void}{SetItemData}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemData* }{data}} -Valid mask flags are: +Sets the item client data. -\twocolwidtha{5cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{wxTREE\_MASK\_HANDLE}{The {\it m\_itemId} member is valid.} -\twocolitem{wxTREE\_MASK\_STATE}{The {\it m\_state} member is valid.} -\twocolitem{wxTREE\_MASK\_TEXT}{The {\it m\_text} member is valid.} -\twocolitem{wxTREE\_MASK\_IMAGE}{The {\it m\_image} member is valid.} -\twocolitem{wxTREE\_MASK\_SELECTED\_IMAGE}{The {\it m\_selectedImage} member is valid.} -\twocolitem{wxTREE\_MASK\_CHILDREN}{The {\it m\_children} member is valid.} -\twocolitem{wxTREE\_MASK\_DATA}{The {\it m\_data} member is valid.} -\end{twocollist} +\membersection{wxTreeCtrl::SetItemHasChildren}\label{wxtreectrlsetitemhaschildren} -Valid state and state mask flags are: +\func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool }{hasChildren = TRUE}} -\twocolwidtha{5cm} -\begin{twocollist}\itemsep=0pt -\twocolitem{wxTREE\_STATE\_BOLD}{The label is emboldened.} -\twocolitem{wxTREE\_STATE\_DROPHILITED}{The item indicates it is a drop target.} -\twocolitem{wxTREE\_STATE\_EXPANDED}{The item is expanded.} -\twocolitem{wxTREE\_STATE\_EXPANDEDONCE}{The item's list of child items has been expanded at least once.} -\twocolitem{wxTREE\_STATE\_FOCUSED}{The item has the focus, so it is surrounded by a standard focus rectangle. -Only one item can have the focus.} -\twocolitem{wxTREE\_STATE\_SELECTED}{The item is selected.} -\twocolitem{wxTREE\_STATE\_CUT}{The item is selected as part of a cut and paste operation.} -\end{twocollist} +Force appearance of the button next to the item. This is useful to +allow the user to expand the items which don't have any children now, +but instead adding them only when needed, thus minimizing memory +usage and loading time. \membersection{wxTreeCtrl::SetItemImage}\label{wxtreectrlsetitemimage} -\func{bool}{SetItemImage}{\param{long }{item}, \param{int }{image}, \param{int }{selImage}} +\func{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{image}} -Sets the item image and selected image. These are indices into the assciated image list. +Sets the normal item image. This is an index into the assciated image list. -\membersection{wxTreeCtrl::SetItemState}\label{wxtreectrlsetitemstate} +\membersection{wxTreeCtrl::SetItemSelectedImage}\label{wxtreectrlsetitemselectedimage} -\func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}} +\func{void}{SetItemSelectedImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{selImage}} -Sets the item state. See \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem} for valid state and state mask flags. +Sets the item selected image. This is an index into the assciated image list. \membersection{wxTreeCtrl::SetItemText}\label{wxtreectrlsetitemtext} -\func{void}{SetItemText}{\param{long }{item}, \param{const wxString\& }{text}} +\func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{const wxString\& }{text}} Sets the item label. -\membersection{wxTreeCtrl::SetItemData}\label{wxtreectrlsetitemdata} +\membersection{wxTreeCtrl::SortChildren}\label{wxtreectrlsortchildren} -\func{bool}{SetItemData}{\param{long }{item}, \param{long }{data}} +\func{void}{SortChildren}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemCmpFunc*}{ cmpFunction = NULL}} -Sets the item client data. +Sorts the children of the given item. If {\it cmpFunction} is NULL, sorts in ascending alphabetical order; +otherwise the custom sort function is used, as follows: -\membersection{wxTreeCtrl::SortChildren}\label{wxtreectrlsortchildren} +{\small +\begin{verbatim} +// a callback function used for sorting tree items, it should return -1 if the +// first item precedes the second, +1 if the second precedes the first or 0 if +// they're equivalent +class wxTreeItemData; +typedef int (*wxTreeItemCmpFunc)(wxTreeItemData *item1, wxTreeItemData *item2); +\end{verbatim} +} + +\wxheading{See also} + +\helpref{wxTreeItemData}{wxtreeitemdata} + +\membersection{wxTreeCtrl::Toggle}\label{wxtreectrltoggle} + +\func{void}{Toggle}{\param{const wxTreeItemId\&}{ item}} + +Toggles the given item between collapsed and expanded states. + +\membersection{wxTreeCtrl::Unselect}\label{wxtreectrlunselect} + +\func{void}{Unselect}{\void} + +Removes the selection from the currently selected item (if any). + +\section{\class{wxTreeItemData}}\label{wxtreeitemdata} + +wxTreeItemData is some (arbitrary) user class associated with some item. The +main advantage of having this class (compared to the old untyped interface) is +that wxTreeItemData's are destroyed automatically by the tree and, as this +class has virtual dtor, it means that the memory will be automatically +freed. We don't just use wxObject instead of wxTreeItemData because +the size of this class is critical: in any real application, each tree leaf +will have wxTreeItemData associated with it and number of leaves may be +quite big. + +Because the objects of this class are deleted by the tree, they should +always be allocated on the heap. + +\wxheading{Derived from} + +wxTreeItemId + +\wxheading{See also} + +\helpref{wxTreeCtrl}{wxtreectrl} + +\latexignore{\rtfignore{\wxheading{Members}}} + +\membersection{wxTreeItemData::wxTreeItemData}\label{wxtreeitemdataconstr} + +\func{}{wxTreeItemData}{\void} + +Default constructor. + +\membersection{wxTreeItemData::\destruct{wxTreeItemData}} + +\func{void}{\destruct{wxTreeItemData}}{\void} + +Virtual destructor. + +\membersection{wxTreeItemData::GetId}\label{wxtreeitemdatagetid} + +\func{const wxTreeItem\&}{GetId}{\void} + +Returns the item associated with this node. + +\membersection{wxTreeItemData::SetId}\label{wxtreeitemdatasetid} -\func{bool}{SortChildren}{\param{long }{item}} +\func{void}{SetId}{\param{const wxTreeItemId\&}{ id}} -Sorts the children of the given item in ascending alphabetical order. +Sets the item associated with this node. diff --git a/docs/msw/install.txt b/docs/msw/install.txt index 3a2834a09a..145b099a59 100644 --- a/docs/msw/install.txt +++ b/docs/msw/install.txt @@ -26,11 +26,13 @@ WXWIN environment variable to point to this directory. Compilation ----------- -At present, wxWindows compiles with VC++ 1.5, VC++ 4.0, VC++ 5.0, -BC++ 4.5/5.0, Gnu-Win32 b19, and Mingw32. +At present, wxWindows compiles with VC++ 4.0/5.0/6.0, +BC++ 4.5/5.0, Gnu-Win32 b19/b20, and Mingw32. It may compile +with 16-bit compilers (BC++ and VC++ 1.5) but this hasn't +been tested lately. -Visual C++ 4.0/5.0 compilation ------------------------------- +Visual C++ 4.0/5.0/6.0 compilation +---------------------------------- 1. Change directory to wx\src\msw. Type 'nmake -f makefile.nt' to make the wxWindows core library. @@ -58,7 +60,7 @@ Borland C++ 4.5/5.0 compilation minimal, docview, mdi. The utils makefile does not yet work. Gnu-Win32 b19/b20/Mingw32 compilation ---------------------------------- +------------------------------------- wxWindows 2.0 supports Gnu-Win32/Cygwin b19, b20, Mingw32, and Mingw32/EGCS. @@ -91,6 +93,9 @@ Here are the steps required: to OPTIONS for Mingw32, or removing it for Cygnus Gnu-Win32. For Mingw32/EGCS, add both __MINGW32__ and __EGCS__. +- Mingw32 may not support winsock.h, so comment out + socket-related files in src/msw/makefile.g95. + - Use the makefile.g95 files for compiling wxWindows and samples, e.g.: > cd c:\wx\src\msw @@ -101,7 +106,8 @@ Here are the steps required: - Use the 'strip' command to reduce executable size. - With Cygnus Gnu-Win32, you can invoke gdb --nw myfile.exe to - debug an executable. + debug an executable. If there are memory leaks, they will be + flagged when the program quits. - If using GnuWin32 b18, you will need to copy windres.exe from e.g. the Mingw32 distribution, to a directory in your path. diff --git a/docs/msw/issues.txt b/docs/msw/issues.txt index 25655ae98d..73e607511f 100644 --- a/docs/msw/issues.txt +++ b/docs/msw/issues.txt @@ -7,3 +7,12 @@ Owner-draw menus If USE_OWNER_DRAWN = 1 and you create a wxMenu, you get 'all bets are off' memory checking warnings from wxWindows. +Memory-checking subsystem +------------------------- + +This conflicts with wxUSE_IOSTREAMSH = 0 using MS VC++ 5.0 +(crashes the template code). It should be switched off if you +wish to use wxUSE_IOSTREAMSH = 0. + + + diff --git a/include/wx/gtk/scrolbar.h b/include/wx/gtk/scrolbar.h index 5bb14787bf..98a3da43b1 100644 --- a/include/wx/gtk/scrolbar.h +++ b/include/wx/gtk/scrolbar.h @@ -58,11 +58,11 @@ class wxScrollBar: public wxControl const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr ); ~wxScrollBar(void); - int GetPosition(void) const; + int GetThumbPosition(void) const; int GetThumbSize() const; int GetPageSize() const; int GetRange() const; - virtual void SetPosition( int viewStart ); + virtual void SetThumbPosition( int viewStart ); virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize, bool refresh = TRUE ); diff --git a/include/wx/gtk1/scrolbar.h b/include/wx/gtk1/scrolbar.h index 5bb14787bf..98a3da43b1 100644 --- a/include/wx/gtk1/scrolbar.h +++ b/include/wx/gtk1/scrolbar.h @@ -58,11 +58,11 @@ class wxScrollBar: public wxControl const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr ); ~wxScrollBar(void); - int GetPosition(void) const; + int GetThumbPosition(void) const; int GetThumbSize() const; int GetPageSize() const; int GetRange() const; - virtual void SetPosition( int viewStart ); + virtual void SetThumbPosition( int viewStart ); virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize, bool refresh = TRUE ); diff --git a/include/wx/list.h b/include/wx/list.h index 696162ab44..625387f67e 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -144,6 +144,10 @@ public: const char *GetKeyString() const { return m_key.string; } long GetKeyInteger() const { return m_key.integer; } + // Necessary for some existing code + void SetKeyString(char* s) { m_key.string = s; } + void SetKeyInteger(long i) { m_key.integer = i; } + #ifdef wxLIST_COMPATIBILITY // compatibility methods wxNode *Next() const { return (wxNode *)GetNext(); } diff --git a/include/wx/memory.h b/include/wx/memory.h index 1f2b25d19d..c6ee00a4e0 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -251,7 +251,7 @@ public: // Count the number of non-wxDebugContext-related objects // that are outstanding - static int CountObjectsLeft(void); + static int CountObjectsLeft(bool sinceCheckpoint = FALSE); private: // Store these here to allow access to the list without diff --git a/include/wx/motif/checkbox.h b/include/wx/motif/checkbox.h index 6dfd1d9d18..6a159d5295 100644 --- a/include/wx/motif/checkbox.h +++ b/include/wx/motif/checkbox.h @@ -75,9 +75,15 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxCheckBoxNameStr); + virtual void SetValue(bool); virtual bool GetValue() const ; + virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetLabel(const wxBitmap *bitmap); }; #endif diff --git a/include/wx/motif/choice.h b/include/wx/motif/choice.h index e3cf3d1cc7..1e3c872c5d 100644 --- a/include/wx/motif/choice.h +++ b/include/wx/motif/choice.h @@ -55,7 +55,12 @@ class WXDLLEXPORT wxChoice: public wxControl virtual void SetSelection(int n); virtual int FindString(const wxString& s) const; virtual wxString GetString(int n) const ; + virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual wxString GetStringSelection() const ; virtual bool SetStringSelection(const wxString& sel); diff --git a/include/wx/motif/combobox.h b/include/wx/motif/combobox.h index d0ccd9e884..890acc3fc0 100644 --- a/include/wx/motif/combobox.h +++ b/include/wx/motif/combobox.h @@ -52,6 +52,9 @@ class WXDLLEXPORT wxComboBox: public wxChoice const wxString& name = wxComboBoxNameStr); virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } // List functions virtual void Append(const wxString& item); diff --git a/include/wx/motif/dialog.h b/include/wx/motif/dialog.h index 7c7ffdd345..36994eccb5 100644 --- a/include/wx/motif/dialog.h +++ b/include/wx/motif/dialog.h @@ -61,7 +61,13 @@ public: virtual bool Destroy(); void SetClientSize(int width, int height); + void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + bool Show(bool show); void Iconize(bool iconize); void Raise(); diff --git a/include/wx/motif/frame.h b/include/wx/motif/frame.h index 0614b627ba..945ecbc5a8 100644 --- a/include/wx/motif/frame.h +++ b/include/wx/motif/frame.h @@ -54,14 +54,29 @@ public: const wxString& name = wxFrameNameStr); virtual bool Destroy(); + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); } + void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } void GetSize(int *width, int *height) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void ClientToScreen(int *x, int *y) const; + wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); } + void ScreenToClient(int *x, int *y) const; + wxPoint ScreenToClient(const wxPoint& pt) const { return wxWindow::ScreenToClient(pt); } virtual bool OnClose(); diff --git a/include/wx/motif/gauge.h b/include/wx/motif/gauge.h index ff8dfa00ad..30381c04e8 100644 --- a/include/wx/motif/gauge.h +++ b/include/wx/motif/gauge.h @@ -57,6 +57,9 @@ class WXDLLEXPORT wxGauge: public wxControl int GetValue() const ; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; diff --git a/include/wx/motif/listbox.h b/include/wx/motif/listbox.h index 50954e53dd..0a7ccee86f 100644 --- a/include/wx/motif/listbox.h +++ b/include/wx/motif/listbox.h @@ -74,7 +74,11 @@ class WXDLLEXPORT wxListBox: public wxControl virtual int GetSelections(wxArrayInt& aSelections) const; virtual bool Selected(int n) const ; virtual wxString GetString(int n) const ; + virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } // Set the specified item at the first visible item // or scroll to max range. diff --git a/include/wx/motif/mdi.h b/include/wx/motif/mdi.h index 73138a679a..74b483d5fa 100644 --- a/include/wx/motif/mdi.h +++ b/include/wx/motif/mdi.h @@ -72,6 +72,7 @@ public: // and status bar size have been subtracted. If you want to manage your own // toolbar(s), don't call SetToolBar. void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } // Get the active MDI child window wxMDIChildFrame *GetActiveChild() const ; @@ -143,11 +144,23 @@ public: // Set menu bar void SetMenuBar(wxMenuBar *menu_bar); void SetTitle(const wxString& title); + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); } + void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + virtual void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void GetSize(int *width, int *height) const; + wxSize GetSize() const { return wxWindow::GetSize(); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } // Set icon virtual void SetIcon(const wxIcon& icon); @@ -206,11 +219,21 @@ class WXDLLEXPORT wxMDIClientWindow: public wxNotebook ~wxMDIClientWindow(); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& size) { wxWindow::SetClientSize(size); } + void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } void GetSize(int *width, int *height) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } // Note: this is virtual, to allow overridden behaviour. virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); diff --git a/include/wx/motif/radiobox.h b/include/wx/motif/radiobox.h index 3b30067d9f..78168c845f 100644 --- a/include/wx/motif/radiobox.h +++ b/include/wx/motif/radiobox.h @@ -51,6 +51,9 @@ public: int GetSelection() const; wxString GetString(int N) const; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } void SetLabel(const wxString& label) { wxControl::SetLabel(label); }; void SetLabel(int item, const wxString& label) ; wxString GetLabel(int item) const; diff --git a/include/wx/motif/scrolbar.h b/include/wx/motif/scrolbar.h index e7881e617d..2cda645071 100644 --- a/include/wx/motif/scrolbar.h +++ b/include/wx/motif/scrolbar.h @@ -45,12 +45,12 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr); - int GetPosition() const ; + int GetThumbPosition() const ; inline int GetThumbSize() const { return m_pageSize; } inline int GetPageSize() const { return m_viewSize; } inline int GetRange() const { return m_objectSize; } - virtual void SetPosition(int viewStart); + virtual void SetThumbPosition(int viewStart); virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, bool refresh = TRUE); diff --git a/include/wx/motif/slider.h b/include/wx/motif/slider.h index adb5433418..d0448159f1 100644 --- a/include/wx/motif/slider.h +++ b/include/wx/motif/slider.h @@ -52,7 +52,12 @@ public: virtual int GetValue() const ; virtual void SetValue(int); void GetSize(int *x, int *y) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } void SetRange(int minValue, int maxValue); diff --git a/include/wx/motif/statbmp.h b/include/wx/motif/statbmp.h index 600168a84e..ccc1c0e86c 100644 --- a/include/wx/motif/statbmp.h +++ b/include/wx/motif/statbmp.h @@ -50,6 +50,9 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } inline wxBitmap& GetBitmap() const { return (wxBitmap&) m_messageBitmap; } diff --git a/include/wx/motif/statbox.h b/include/wx/motif/statbox.h index 375c000195..90069cea8e 100644 --- a/include/wx/motif/statbox.h +++ b/include/wx/motif/statbox.h @@ -48,6 +48,10 @@ class WXDLLEXPORT wxStaticBox: public wxControl virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void SetLabel(const wxString& label); wxString GetLabel() const; diff --git a/include/wx/motif/window.h b/include/wx/motif/window.h index 06f9f56d99..d9010156f4 100644 --- a/include/wx/motif/window.h +++ b/include/wx/motif/window.h @@ -189,26 +189,40 @@ public: // Get overall window size virtual void GetSize(int *width, int *height) const; + virtual wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); } + virtual wxRect GetRect() const { int w, h; int x, y; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); } // Get window position, relative to parent (or screen if no parent) virtual void GetPosition(int *x, int *y) const; + virtual wxPoint GetPosition() const { int x, y; GetPosition(&x, &y); return wxPoint(x, y); } // Get client (application-useable) size virtual void GetClientSize(int *width, int *height) const; + virtual wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); } // Set overall size and position virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } - inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); } + virtual void SetSize(const wxSize& size) { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); } + + virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); } // Set client size virtual void SetClientSize(int width, int size); + virtual void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); } // Convert client to screen coordinates virtual void ClientToScreen(int *x, int *y) const; + virtual wxPoint ClientToScreen(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } // Convert screen to client coordinates virtual void ScreenToClient(int *x, int *y) const; + virtual wxPoint ScreenToClient(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } // Set the focus to this window virtual void SetFocus(); @@ -297,6 +311,8 @@ public: inline void SetParent(wxWindow *p) ; inline wxWindow *GetGrandParent() const; inline wxList *GetChildren() const; + // Reparents this window to have the new parent. + virtual bool Reparent(wxWindow* parent); // Set/get the window's font virtual void SetFont(const wxFont& f); diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 2f01821ed7..e40cc207e2 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -133,7 +133,7 @@ public: #if wxUSE_XPM_IN_MSW class wxItem; // Initialize with XPM data - wxBitmap(const char **data, wxItem *anItem = NULL); + wxBitmap(char **data, wxItem *anItem = NULL); #endif // Load a file or resource diff --git a/include/wx/msw/button.h b/include/wx/msw/button.h index 34e0824d6d..12352beb39 100644 --- a/include/wx/msw/button.h +++ b/include/wx/msw/button.h @@ -43,6 +43,10 @@ class WXDLLEXPORT wxButton: public wxControl const wxString& name = wxButtonNameStr); virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetDefault(void); virtual void SetLabel(const wxString& label); virtual wxString GetLabel(void) const ; diff --git a/include/wx/msw/checkbox.h b/include/wx/msw/checkbox.h index e5ddc460f6..f693730f5c 100644 --- a/include/wx/msw/checkbox.h +++ b/include/wx/msw/checkbox.h @@ -45,6 +45,10 @@ class WXDLLEXPORT wxCheckBox: public wxControl virtual void SetValue(bool); virtual bool GetValue(void) const ; virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual bool MSWCommand(WXUINT param, WXWORD id); virtual void SetLabel(const wxString& label); virtual void Command(wxCommandEvent& event); @@ -78,6 +82,10 @@ class WXDLLEXPORT wxBitmapCheckBox: public wxCheckBox virtual void SetValue(bool); virtual bool GetValue(void) const ; virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + virtual void SetLabel(const wxBitmap *bitmap); }; #endif diff --git a/include/wx/msw/choice.h b/include/wx/msw/choice.h index e3fd471b6d..c7518c79b8 100644 --- a/include/wx/msw/choice.h +++ b/include/wx/msw/choice.h @@ -55,6 +55,9 @@ class WXDLLEXPORT wxChoice: public wxControl virtual int FindString(const wxString& s) const; virtual wxString GetString(int n) const ; virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } virtual wxString GetStringSelection(void) const ; virtual bool SetStringSelection(const wxString& sel); diff --git a/include/wx/msw/control.h b/include/wx/msw/control.h index f6ab16ee18..3738d445e0 100644 --- a/include/wx/msw/control.h +++ b/include/wx/msw/control.h @@ -32,6 +32,8 @@ public: virtual void ProcessCommand(wxCommandEvent& event); // Calls the callback and // appropriate event handlers virtual void SetClientSize(int width, int height); + virtual void SetClientSize(const wxSize& sz) { wxWindow::SetClientSize(sz); } + virtual void SetLabel(const wxString& label); virtual wxString GetLabel(void) const ; diff --git a/include/wx/msw/dialog.h b/include/wx/msw/dialog.h index d4a19e94e8..b502600039 100644 --- a/include/wx/msw/dialog.h +++ b/include/wx/msw/dialog.h @@ -63,8 +63,16 @@ public: virtual bool Destroy(void); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& sz) { wxWindow::SetClientSize(sz); } + void GetPosition(int *x, int *y) const; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + bool Show(bool show); bool IsShown(void) const ; void Iconize(bool iconize); diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 33dfa21c1d..68ca0aa702 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -54,14 +54,29 @@ public: const wxString& name = wxFrameNameStr); virtual bool Destroy(void); + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& sz) { wxWindow::SetClientSize(sz); } + void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } void GetSize(int *width, int *height) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void ClientToScreen(int *x, int *y) const; + wxPoint ClientToScreen(const wxPoint& pt) const { return wxWindow::ClientToScreen(pt); } + void ScreenToClient(int *x, int *y) const; + wxPoint ScreenToClient(const wxPoint& pt) const { return wxWindow::ScreenToClient(pt); } virtual bool OnClose(void); diff --git a/include/wx/msw/gauge95.h b/include/wx/msw/gauge95.h index 362a758654..99635c2669 100644 --- a/include/wx/msw/gauge95.h +++ b/include/wx/msw/gauge95.h @@ -65,6 +65,9 @@ class WXDLLEXPORT wxGauge95: public wxControl #endif void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; diff --git a/include/wx/msw/gaugemsw.h b/include/wx/msw/gaugemsw.h index c3c5954ff4..b21b098c66 100644 --- a/include/wx/msw/gaugemsw.h +++ b/include/wx/msw/gaugemsw.h @@ -65,6 +65,9 @@ class WXDLLEXPORT wxGaugeMSW: public wxControl #endif void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ; diff --git a/include/wx/msw/listbox.h b/include/wx/msw/listbox.h index ac0efc056f..f64c4741e2 100644 --- a/include/wx/msw/listbox.h +++ b/include/wx/msw/listbox.h @@ -101,6 +101,9 @@ class WXDLLEXPORT wxListBox: public wxControl virtual bool Selected(int n) const ; virtual wxString GetString(int n) const ; virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } // Set the specified item at the first visible item // or scroll to max range. diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 658aa6c63d..35879cd380 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -69,6 +69,7 @@ class WXDLLEXPORT wxMDIParentFrame: public wxFrame // and status bar size have been subtracted. If you want to manage your own // toolbar(s), don't call SetToolBar. void GetClientSize(int *width, int *height) const; + wxSize GetClientSize() const { return wxWindow::GetClientSize(); } // Get the active MDI child window (Windows only) wxMDIChildFrame *GetActiveChild(void) const ; @@ -146,8 +147,12 @@ class WXDLLEXPORT wxMDIChildFrame: public wxFrame // Set menu bar void SetMenuBar(wxMenuBar *menu_bar); + void SetClientSize(int width, int height); + void SetClientSize(const wxSize& sz) { wxWindow::SetClientSize(sz); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } // MDI operations virtual void Maximize(void); diff --git a/include/wx/msw/radiobox.h b/include/wx/msw/radiobox.h index ba988b1022..6d86bed742 100644 --- a/include/wx/msw/radiobox.h +++ b/include/wx/msw/radiobox.h @@ -93,9 +93,18 @@ public: void SetSelection(int N); int GetSelection(void) const; wxString GetString(int N) const; + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void GetSize(int *x, int *y) const; + wxSize GetSize() const { return wxWindow::GetSize(); } + void GetPosition(int *x, int *y) const; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + wxString GetLabel(void) const; void SetLabel(const wxString& label); void SetLabel(int item, const wxString& label) ; diff --git a/include/wx/msw/scrolbar.h b/include/wx/msw/scrolbar.h index cf461ecd59..588d3d1321 100644 --- a/include/wx/msw/scrolbar.h +++ b/include/wx/msw/scrolbar.h @@ -45,19 +45,19 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr); - int GetPosition(void) const ; + int GetThumbPosition(void) const ; inline int GetThumbSize() const { return m_pageSize; } inline int GetPageSize() const { return m_viewSize; } inline int GetRange() const { return m_objectSize; } - virtual void SetPosition(int viewStart); + virtual void SetThumbPosition(int viewStart); virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, bool refresh = TRUE); #if WXWIN_COMPATIBILITY // Backward compatibility - inline int GetValue(void) const { return GetPosition(); } - inline void SetValue(int viewStart) { SetPosition(viewStart); } + inline int GetValue(void) const { return GetThumbPosition(); } + inline void SetValue(int viewStart) { SetThumbPosition(viewStart); } void GetValues(int *viewStart, int *viewLength, int *objectLength, int *pageLength) const ; inline int GetViewLength() const { return m_viewSize; } diff --git a/include/wx/msw/setup.h b/include/wx/msw/setup.h index 1b96a7e26e..ba62f86390 100644 --- a/include/wx/msw/setup.h +++ b/include/wx/msw/setup.h @@ -79,9 +79,7 @@ #define wxUSE_SCROLLBAR 1 // Define 1 to compile contributed wxScrollBar class #define wxUSE_XPM_IN_MSW 0 - // Define 1 to support the XPM package in wxBitmap, - // separated by platform. If 1, you must link in - // the XPM library to your applications. + // Define 1 to support the XPM package in wxBitmap. #define wxUSE_IMAGE_LOADING_IN_MSW 1 // Use dynamic DIB loading/saving code in utils/dib under MSW. #define wxUSE_RESOURCE_LOADING_IN_MSW 1 diff --git a/include/wx/msw/slider95.h b/include/wx/msw/slider95.h index ed8c6523c3..d5adce947d 100644 --- a/include/wx/msw/slider95.h +++ b/include/wx/msw/slider95.h @@ -51,9 +51,18 @@ public: virtual int GetValue(void) const ; virtual void SetValue(int); + void GetSize(int *x, int *y) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + bool Show(bool show); void SetRange(int minValue, int maxValue); diff --git a/include/wx/msw/slidrmsw.h b/include/wx/msw/slidrmsw.h index 8384086d1e..9363bd4660 100644 --- a/include/wx/msw/slidrmsw.h +++ b/include/wx/msw/slidrmsw.h @@ -51,9 +51,18 @@ public: virtual int GetValue(void) const ; virtual void SetValue(int); + void GetSize(int *x, int *y) const ; + wxSize GetSize() const { return wxWindow::GetSize(); } + void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } + void GetPosition(int *x, int *y) const ; + wxPoint GetPosition() const { return wxWindow::GetPosition(); } + bool Show(bool show); void SetRange(int minValue, int maxValue); diff --git a/include/wx/msw/statbmp.h b/include/wx/msw/statbmp.h index b6aca08bb1..e4b0253978 100644 --- a/include/wx/msw/statbmp.h +++ b/include/wx/msw/statbmp.h @@ -49,6 +49,9 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl virtual void ProcessCommand(wxCommandEvent& WXUNUSED(event)) {}; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } inline wxBitmap& GetBitmap(void) const { return (wxBitmap&) m_messageBitmap; } diff --git a/include/wx/msw/statbox.h b/include/wx/msw/statbox.h index 97e3722a70..3f15d25e37 100644 --- a/include/wx/msw/statbox.h +++ b/include/wx/msw/statbox.h @@ -52,6 +52,9 @@ class WXDLLEXPORT wxStaticBox: public wxControl virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } void SetLabel(const wxString& label); virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, WXUINT message, WXWPARAM wParam, WXLPARAM lParam); diff --git a/include/wx/msw/stattext.h b/include/wx/msw/stattext.h index dbb3646a0a..432987cf5e 100644 --- a/include/wx/msw/stattext.h +++ b/include/wx/msw/stattext.h @@ -45,6 +45,9 @@ class WXDLLEXPORT wxStaticText: public wxControl // accessors void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } void SetLabel(const wxString&); // operations diff --git a/include/wx/msw/tbar95.h b/include/wx/msw/tbar95.h index 4aae20d62a..009e629290 100644 --- a/include/wx/msw/tbar95.h +++ b/include/wx/msw/tbar95.h @@ -68,7 +68,9 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase wxSize GetToolSize(void) const; wxSize GetMaxSize(void) const; + void GetSize(int *w, int *y) const; + wxSize GetSize() const { return wxWindow::GetSize(); } virtual bool GetToolState(int toolIndex) const; diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index edc0de5b32..5a3c475644 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -81,6 +81,9 @@ public: // operations // ---------- virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); + void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { wxWindow::SetSize(rect, sizeFlags); } + void SetSize(const wxSize& size) { wxWindow::SetSize(size); } // Clipboard operations virtual void Copy(); diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index 66e3dfc9ce..f688f4fe1d 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -161,26 +161,40 @@ public: // Get overall window size virtual void GetSize(int *width, int *height) const; + virtual wxSize GetSize() const { int w, h; GetSize(& w, & h); return wxSize(w, h); } + virtual wxRect GetRect() const { int w, h; int x, y; GetPosition(& x, & y); GetSize(& w, & h); return wxRect(x, y, w, h); } // Get window position, relative to parent (or screen if no parent) virtual void GetPosition(int *x, int *y) const; + virtual wxPoint GetPosition() const { int x, y; GetPosition(&x, &y); return wxPoint(x, y); } // Get client (application-useable) size virtual void GetClientSize(int *width, int *height) const; + virtual wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); } // Set overall size and position virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } - inline virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void SetSize(int width, int height) { SetSize(-1, -1, width, height, wxSIZE_USE_EXISTING); } + virtual void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO) + { SetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); } + virtual void SetSize(const wxSize& size) { SetSize(-1, -1, size.x, size.y, wxSIZE_USE_EXISTING); } + + virtual void Move(int x, int y) { SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); } + virtual void Move(const wxPoint& pt) { SetSize(pt.x, pt.y, -1, -1, wxSIZE_USE_EXISTING); } // Set client size - virtual void SetClientSize(int width, int size); + virtual void SetClientSize(int width, int height); + virtual void SetClientSize(const wxSize& sz) { SetClientSize(sz.x, sz.y); } // Convert client to screen coordinates virtual void ClientToScreen(int *x, int *y) const; + virtual wxPoint ClientToScreen(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ClientToScreen(& x, & y); return wxPoint(x, y); } // Convert screen to client coordinates virtual void ScreenToClient(int *x, int *y) const; + virtual wxPoint ScreenToClient(const wxPoint& pt) const + { int x = pt.x; int y = pt.y; ScreenToClient(& x, & y); return wxPoint(x, y); } // Set the focus to this window virtual void SetFocus(); @@ -274,6 +288,10 @@ public: inline void SetParent(wxWindow *p) ; inline wxWindow *GetGrandParent() const; inline wxList *GetChildren() const; + // Set this window to be the child of 'parent'. + // Returns FALSE it's not possible (some systems + // won't allow it) + virtual bool Reparent(wxWindow *parent); // Set/get the window's font virtual void SetFont(const wxFont& f); diff --git a/include/wx/stubs/scrolbar.h b/include/wx/stubs/scrolbar.h index eeef6727c5..3ec992e78e 100644 --- a/include/wx/stubs/scrolbar.h +++ b/include/wx/stubs/scrolbar.h @@ -45,12 +45,12 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxScrollBarNameStr); - int GetPosition() const ; + int GetThumbPosition() const ; inline int GetThumbSize() const { return m_pageSize; } inline int GetPageSize() const { return m_viewSize; } inline int GetRange() const { return m_objectSize; } - virtual void SetPosition(int viewStart); + virtual void SetThumbPosition(int viewStart); virtual void SetScrollbar(int position, int thumbSize, int range, int pageSize, bool refresh = TRUE); diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 6dac92b7d3..0d198eb43e 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -21,13 +21,21 @@ #ifndef WX_PRECOMP #include "wx/wx.h" -#include "wx/spinbutt.h" #endif +#include "wx/spinbutt.h" #include "wx/notebook.h" #include "wx/imaglist.h" +// XPM doesn't seem to work under Windows at present. Or, wxNotebook images +// aren't working. +// Uncomment this line and comment out the next to try it. +// #if defined(__WXGTK__) || defined(__WXMOTIF__) || (defined(__WXMSW__) && wxUSE_XPM_IN_MSW) #if defined(__WXGTK__) || defined(__WXMOTIF__) +#define USE_XPM +#endif + +#ifdef USE_XPM #include "mondrian.xpm" #include "icons/choice.xpm" #include "icons/combo.xpm" @@ -143,49 +151,49 @@ bool MyApp::OnInit(void) // MyPanel //---------------------------------------------------------------------- -const ID_NOTEBOOK = 1000; +const int ID_NOTEBOOK = 1000; -const ID_LISTBOX = 130; -const ID_LISTBOX_SEL_NUM = 131; -const ID_LISTBOX_SEL_STR = 132; -const ID_LISTBOX_CLEAR = 133; -const ID_LISTBOX_APPEND = 134; -const ID_LISTBOX_DELETE = 135; -const ID_LISTBOX_FONT = 136; -const ID_LISTBOX_ENABLE = 137; +const int ID_LISTBOX = 130; +const int ID_LISTBOX_SEL_NUM = 131; +const int ID_LISTBOX_SEL_STR = 132; +const int ID_LISTBOX_CLEAR = 133; +const int ID_LISTBOX_APPEND = 134; +const int ID_LISTBOX_DELETE = 135; +const int ID_LISTBOX_FONT = 136; +const int ID_LISTBOX_ENABLE = 137; -const ID_CHOICE = 120; -const ID_CHOICE_SEL_NUM = 121; -const ID_CHOICE_SEL_STR = 122; -const ID_CHOICE_CLEAR = 123; -const ID_CHOICE_APPEND = 124; -const ID_CHOICE_DELETE = 125; -const ID_CHOICE_FONT = 126; -const ID_CHOICE_ENABLE = 127; +const int ID_CHOICE = 120; +const int ID_CHOICE_SEL_NUM = 121; +const int ID_CHOICE_SEL_STR = 122; +const int ID_CHOICE_CLEAR = 123; +const int ID_CHOICE_APPEND = 124; +const int ID_CHOICE_DELETE = 125; +const int ID_CHOICE_FONT = 126; +const int ID_CHOICE_ENABLE = 127; -const ID_COMBO = 140; -const ID_COMBO_SEL_NUM = 141; -const ID_COMBO_SEL_STR = 142; -const ID_COMBO_CLEAR = 143; -const ID_COMBO_APPEND = 144; -const ID_COMBO_DELETE = 145; -const ID_COMBO_FONT = 146; -const ID_COMBO_ENABLE = 147; +const int ID_COMBO = 140; +const int ID_COMBO_SEL_NUM = 141; +const int ID_COMBO_SEL_STR = 142; +const int ID_COMBO_CLEAR = 143; +const int ID_COMBO_APPEND = 144; +const int ID_COMBO_DELETE = 145; +const int ID_COMBO_FONT = 146; +const int ID_COMBO_ENABLE = 147; -const ID_TEXT = 150; +const int ID_TEXT = 150; -const ID_RADIOBOX = 160; -const ID_RADIOBOX_SEL_NUM = 161; -const ID_RADIOBOX_SEL_STR = 162; -const ID_RADIOBOX_FONT = 163; -const ID_RADIOBOX_ENABLE = 164; +const int ID_RADIOBOX = 160; +const int ID_RADIOBOX_SEL_NUM = 161; +const int ID_RADIOBOX_SEL_STR = 162; +const int ID_RADIOBOX_FONT = 163; +const int ID_RADIOBOX_ENABLE = 164; -const ID_SET_FONT = 170; +const int ID_SET_FONT = 170; -const ID_GAUGE = 180; -const ID_SLIDER = 181; +const int ID_GAUGE = 180; +const int ID_SLIDER = 181; -const ID_SPIN = 182; +const int ID_SPIN = 182; BEGIN_EVENT_TABLE(MyPanel, wxPanel) @@ -244,6 +252,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : "examples.", }; +#ifdef USE_XPM // image ids and names enum { @@ -251,35 +260,30 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : }; // fill the image list -#ifdef __WXMSW__ - const char *aIconNames[] = - { - "list.xpm", "choice.xpm", "combo.xpm", "text.xpm", "radio.xpm", "gauge.txt" - }; - - wxASSERT( WXSIZEOF(aIconNames) == Image_Max ); // keep in sync - - wxString strIconDir = "icons/"; - - wxImageList *imagelist = new wxImageList(32, 32); - for ( size_t n = 0; n < Image_Max; n++ ) - { - imagelist->Add(wxBitmap(strIconDir + aIconNames[n])); - } -#else wxImageList *imagelist = new wxImageList(32, 32); - + imagelist-> Add( wxBitmap( list_xpm )); imagelist-> Add( wxBitmap( choice_xpm )); imagelist-> Add( wxBitmap( combo_xpm )); imagelist-> Add( wxBitmap( text_xpm )); imagelist-> Add( wxBitmap( radio_xpm )); imagelist-> Add( wxBitmap( gauge_xpm )); + m_notebook->SetImageList(imagelist); +#else + +// No images for now +#define Image_List -1 +#define Image_Choice -1 +#define Image_Combo -1 +#define Image_Text -1 +#define Image_Radio -1 +#define Image_Gauge -1 +#define Image_Max -1 + #endif wxButton *button = (wxButton*)NULL; - m_notebook->SetImageList(imagelist); m_notebook->SetBackgroundColour("cadet blue"); wxPanel *panel = (wxPanel*) NULL; diff --git a/src/common/log.cpp b/src/common/log.cpp index 3fbaa26c99..f91d104547 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -256,6 +256,8 @@ wxLog *wxLog::GetActiveTarget() // ask the application to create a log target for us if ( wxTheApp != NULL ) ms_pLogger = wxTheApp->CreateLogTarget(); + else + ms_pLogger = new wxLogStderr; #endif s_bInGetActiveTarget = FALSE; diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 8f9b0d0ac3..602a295bb8 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -902,11 +902,15 @@ int wxDebugContext::Check(bool checkAll) // Count the number of non-wxDebugContext-related objects // that are outstanding -int wxDebugContext::CountObjectsLeft(void) +int wxDebugContext::CountObjectsLeft(bool sinceCheckpoint) { int n = 0; - - wxMemStruct *from = wxDebugContext::GetHead (); + + wxMemStruct *from = NULL; + if (sinceCheckpoint && checkPoint) + from = checkPoint->m_next; + if (from == (wxMemStruct*) NULL) + from = wxDebugContext::GetHead () ; for (wxMemStruct * st = from; st != 0; st = st->m_next) { diff --git a/src/common/string.cpp b/src/common/string.cpp index e9e906d49b..c4fdd0bb18 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -41,6 +41,12 @@ #include #include +// This probably isn't right, what should it be Vadim? +// Otherwise we end up with no wxVsprintf defined. +#ifdef __WXMOTIF__ +#define HAVE_VPRINTF +#endif + #ifdef wxUSE_WCSRTOMBS #include // for wcsrtombs(), see comments where it's used #endif // GNU diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 02fa477273..e24b8a4b2b 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -768,6 +768,8 @@ wxVariant::wxVariant(const wxVariant& variant) m_data = (wxVariantData*) variant.GetData()->GetClassInfo()->CreateObject(); variant.m_data->Copy(*m_data); } + else + m_data = (wxVariantData*) NULL; } wxVariant::wxVariant(wxVariantData* data) // User-defined data @@ -804,7 +806,8 @@ void wxVariant::operator= (const wxVariant& variant) delete m_data; m_data = (wxVariantData*) variant.GetData()->GetClassInfo()->CreateObject(); } - GetData()->Copy(* variant.GetData()); +// GetData()->Copy(* variant.GetData()); + variant.GetData()->Copy(* GetData()); } // Assignment using data, e.g. diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index f1bc33d6df..2ae8945c95 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -331,7 +331,7 @@ bool wxGenericGrid::CreateGrid(int nRows, int nCols, wxString **cellValues, shor m_hScrollBar->SetObjectLength(objectSizeX); m_hScrollBar->SetPageSize(pageSizeX); */ - m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), pageSizeX, objectSizeX, viewLengthX); + m_hScrollBar->SetScrollbar(m_hScrollBar->GetThumbPosition(), pageSizeX, objectSizeX, viewLengthX); int objectSizeY = m_totalRows; int pageSizeY = 1; @@ -343,7 +343,7 @@ bool wxGenericGrid::CreateGrid(int nRows, int nCols, wxString **cellValues, shor m_vScrollBar->SetPageSize(pageSizeY); */ - m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), pageSizeY, objectSizeY, viewLengthY); + m_vScrollBar->SetScrollbar(m_vScrollBar->GetThumbPosition(), pageSizeY, objectSizeY, viewLengthY); AdjustScrollbars(); @@ -1027,7 +1027,7 @@ void wxGenericGrid::AdjustScrollbars(void) if (m_hScrollBar) { int nCols = GetCols(); - m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), wxMax(noHorizSteps, 1), (noHorizSteps == 0) ? 1 : nCols, wxMax(noHorizSteps, 1)); + m_hScrollBar->SetScrollbar(m_hScrollBar->GetThumbPosition(), wxMax(noHorizSteps, 1), (noHorizSteps == 0) ? 1 : nCols, wxMax(noHorizSteps, 1)); m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth -2, cw - vertScrollBarWidth - m_leftOfSheet, m_scrollWidth); @@ -1037,7 +1037,7 @@ void wxGenericGrid::AdjustScrollbars(void) { int nRows = GetRows(); - m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), wxMax(noVertSteps, 1), (noVertSteps == 0) ? 1 : nRows, wxMax(noVertSteps, 1)); + m_vScrollBar->SetScrollbar(m_vScrollBar->GetThumbPosition(), wxMax(noVertSteps, 1), (noVertSteps == 0) ? 1 : nRows, wxMax(noVertSteps, 1)); m_vScrollBar->SetSize(cw - m_scrollWidth, m_topOfSheet, m_scrollWidth, ch - m_topOfSheet - horizScrollBarHeight); } diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index b0987af6b3..32a9168bc2 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -152,7 +152,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, return TRUE; } -int wxScrollBar::GetPosition(void) const +int wxScrollBar::GetThumbPosition(void) const { return (int)(m_adjust->value+0.5); } @@ -172,7 +172,7 @@ int wxScrollBar::GetRange() const return (int)(m_adjust->upper+0.5); } -void wxScrollBar::SetPosition( int viewStart ) +void wxScrollBar::SetThumbPosition( int viewStart ) { if (m_isScrolling) return; @@ -196,7 +196,7 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page (fabs(fthumb-m_adjust->page_size) < 0.2) && (fabs(fpage-m_adjust->page_increment) < 0.2)) { - SetPosition( position ); + SetThumbPosition( position ); return; } @@ -215,12 +215,12 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page // Backward compatibility int wxScrollBar::GetValue(void) const { - return GetPosition(); + return GetThumbPosition(); } void wxScrollBar::SetValue( int viewStart ) { - SetPosition( viewStart ); + SetThumbPosition( viewStart ); } void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index b0987af6b3..32a9168bc2 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -152,7 +152,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, return TRUE; } -int wxScrollBar::GetPosition(void) const +int wxScrollBar::GetThumbPosition(void) const { return (int)(m_adjust->value+0.5); } @@ -172,7 +172,7 @@ int wxScrollBar::GetRange() const return (int)(m_adjust->upper+0.5); } -void wxScrollBar::SetPosition( int viewStart ) +void wxScrollBar::SetThumbPosition( int viewStart ) { if (m_isScrolling) return; @@ -196,7 +196,7 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page (fabs(fthumb-m_adjust->page_size) < 0.2) && (fabs(fpage-m_adjust->page_increment) < 0.2)) { - SetPosition( position ); + SetThumbPosition( position ); return; } @@ -215,12 +215,12 @@ void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int page // Backward compatibility int wxScrollBar::GetValue(void) const { - return GetPosition(); + return GetThumbPosition(); } void wxScrollBar::SetValue( int viewStart ) { - SetPosition( viewStart ); + SetThumbPosition( viewStart ); } void wxScrollBar::GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength ) const diff --git a/src/motif/app.cpp b/src/motif/app.cpp index e0f7726e4a..1d34942d06 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -67,16 +67,6 @@ bool wxApp::Initialize() wxBuffer = new char[BUFSIZ + 512]; #endif -/* No longer used -#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT - - streambuf* sBuf = new wxDebugStreamBuf; - ostream* oStr = new ostream(sBuf) ; - wxDebugContext::SetStream(oStr, sBuf); - -#endif -*/ - wxClassInfo::InitializeClasses(); wxTheColourDatabase = new wxColourDatabase(wxKEY_STRING); @@ -161,13 +151,12 @@ void wxApp::CleanUp() // blocks that aren't part of the wxDebugContext itself, // as a special case. Then when dumping we need to ignore // wxDebugContext, too. - if (wxDebugContext::CountObjectsLeft() > 0) + if (wxDebugContext::CountObjectsLeft(TRUE) > 0) { wxLogDebug("There were memory leaks.\n"); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } -// wxDebugContext::SetStream(NULL, NULL); #endif // do it as the very last thing because everything else can log messages @@ -178,8 +167,19 @@ void wxApp::CleanUp() int wxEntry( int argc, char *argv[] ) { +#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT + // This seems to be necessary since there are 'rogue' + // objects present at this point (perhaps global objects?) + // Setting a checkpoint will ignore them as far as the + // memory checking facility is concerned. + // Of course you may argue that memory allocated in globals should be + // checked, but this is a reasonable compromise. + wxDebugContext::SetCheckpoint(); +#endif + if (!wxApp::Initialize()) return FALSE; + if (!wxTheApp) { if (!wxApp::GetInitializerFunction()) @@ -210,11 +210,11 @@ int wxEntry( int argc, char *argv[] ) // into wxTopLevelWindows by getting created // in OnInit(). - if (!wxTheApp->OnInit()) return 0; - int retValue = 0; - - if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun(); + if (wxTheApp->OnInit()) + { + if (wxTheApp->Initialized()) retValue = wxTheApp->OnRun(); + } // flush the logged messages if any wxLog *pLog = wxLog::GetActiveTarget(); @@ -233,7 +233,6 @@ int wxEntry( int argc, char *argv[] ) wxTheApp->DeletePendingObjects(); wxTheApp->OnExit(); - wxApp::CleanUp(); diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp index 3d864f49d5..13fca3d66d 100644 --- a/src/motif/listbox.cpp +++ b/src/motif/listbox.cpp @@ -171,8 +171,8 @@ void wxListBox::Delete(int N) if (node) m_clientDataList.DeleteNode(node); // if existed then delete from list node = m_clientDataList.First(); // we now have to adjust all keys that while (node) // are >=N+1 - { if (node->key.integer >= (long)(N+1)) // very ugly C++ wise but no other way - node->key.integer--; // to look at or change key value + { if (node->GetKeyInteger() >= (long)(N+1)) + node->SetKeyInteger(node->GetKeyInteger() - 1); node = node->Next(); } diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 52ef32cc55..10b670d400 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -102,7 +102,7 @@ wxScrollBar::~wxScrollBar() { } -void wxScrollBar::SetPosition(int pos) +void wxScrollBar::SetThumbPosition(int pos) { if (m_mainWidget) { @@ -112,7 +112,7 @@ void wxScrollBar::SetPosition(int pos) } } -int wxScrollBar::GetPosition() const +int wxScrollBar::GetThumbPosition() const { if (m_mainWidget) { diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 451b10f774..071f4f030b 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -616,7 +616,7 @@ int wxToolBar::FindIndexForWidget(WXWidget w) { WXWidget widget = (WXWidget) node->Data(); if (widget == w) - return (int) node->key.integer; + return (int) node->GetKeyInteger(); node = node->Next(); } return -1; diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 63278446f8..07ac707905 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -275,7 +275,7 @@ wxFlushResources (void) wxNode *node = wxResourceCache.First (); while (node) { - char *file = node->key.string; + const char *file = node->GetKeyString(); // If file doesn't exist, create it first. (void)GetResourcePath(nameBuffer, file, TRUE); diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 7863f36b76..58aaf97fe9 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -1320,6 +1320,16 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRectangle *rect) node = node->Next(); } + + // Delete the update rects + node = updateRects.First(); + while (node) + { + wxRect* rect = (wxRect*) node->Data(); + delete rect; + node = node->Next(); + } + } void wxWindow::OnChar(wxKeyEvent& event) @@ -1427,6 +1437,13 @@ void wxWindow::RemoveChild(wxWindow *child) child->m_windowParent = NULL; } +// Reparents this window to have the new parent. +bool wxWindow::Reparent(wxWindow* WXUNUSED(parent)) +{ + // For now, we indicate that this isn't implemented. + return FALSE; +} + void wxWindow::DestroyChildren() { if (GetChildren()) diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 67d698f32b..5847586476 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -38,7 +38,7 @@ #if wxUSE_XPM_IN_MSW #define FOR_MSW 1 -#include "../../contrib/wxxpm/libxpm.34b/lib/xpm34.h" +#include "../src/xpm/xpm34.h" #endif #include "wx/msw/dib.h" @@ -170,7 +170,7 @@ wxBitmap::wxBitmap(const wxString& filename, long type) #if wxUSE_XPM_IN_MSW // Create from data -wxBitmap::wxBitmap(const char **data, wxItem *WXUNUSED(anItem)) +wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem)) { (void) Create((void *)data, wxBITMAP_TYPE_XPM_DATA, 0, 0, 0); } diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index 3a3c09aa70..144c728fae 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -36,7 +36,7 @@ #if wxUSE_XPM_IN_MSW #define FOR_MSW 1 -#include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h" +#include "../src/xpm/xpm34.h" #endif #if wxUSE_RESOURCE_LOADING_IN_MSW diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 17d2703d59..bd69394f9a 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -34,7 +34,7 @@ #if wxUSE_XPM_IN_MSW #define FOR_MSW 1 -#include "..\..\contrib\wxxpm\libxpm.34b\lib\xpm34.h" +#include "../src/xpm/xpm34.h" #endif #if wxUSE_RESOURCE_LOADING_IN_MSW diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index eb06cd8071..db437e0f3e 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -49,6 +49,7 @@ EXTRAOBJS= GENDIR=../generic COMMDIR=../common +XPMDIR=../xpm OLEDIR=ole MSWDIR=. @@ -123,21 +124,22 @@ COMMONOBJS = \ $(COMMDIR)/datstrm.$(OBJSUFF) \ $(COMMDIR)/objstrm.$(OBJSUFF) \ $(COMMDIR)/extended.$(OBJSUFF) \ - $(COMMDIR)/socket.$(OBJSUFF) \ - $(COMMDIR)/sckaddr.$(OBJSUFF) \ - $(COMMDIR)/sckfile.$(OBJSUFF) \ - $(COMMDIR)/sckipc.$(OBJSUFF) \ - $(COMMDIR)/sckstrm.$(OBJSUFF) \ - $(COMMDIR)/protocol.$(OBJSUFF) \ - $(COMMDIR)/http.$(OBJSUFF) \ - $(COMMDIR)/ftp.$(OBJSUFF) \ - $(COMMDIR)/url.$(OBJSUFF) \ $(COMMDIR)/wincmn.$(OBJSUFF) # $(COMMDIR)/postscrp.$(OBJSUFF) \ -# NOTE: if the socket-related files above fail with a syntax error in Sockets.h, -# remove the files (probably all GnuWin32 releases < b20). +# NOTE: if the socket-related files fail with a syntax error in Sockets.h, +# remove the files (probably all GnuWin32 releases < b20). Cygwin b20 is OK, +# Mingw32 may still have problems. +# $(COMMDIR)/socket.$(OBJSUFF) \ +# $(COMMDIR)/sckaddr.$(OBJSUFF) \ +# $(COMMDIR)/sckfile.$(OBJSUFF) \ +# $(COMMDIR)/sckipc.$(OBJSUFF) \ +# $(COMMDIR)/sckstrm.$(OBJSUFF) \ +# $(COMMDIR)/protocol.$(OBJSUFF) \ +# $(COMMDIR)/http.$(OBJSUFF) \ +# $(COMMDIR)/ftp.$(OBJSUFF) \ +# $(COMMDIR)/url.$(OBJSUFF) \ MSWOBJS = \ accel.$(OBJSUFF) \ @@ -228,8 +230,19 @@ MSWOBJS = \ # $(OLEDIR)/oleutils.$(OBJSUFF) \ # $(OLEDIR)/uuid.$(OBJSUFF) - -OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) +XPMOBJECTS = $(XPMDIR)/crbuffri.o\ + $(XPMDIR)/crdatfri.o\ + $(XPMDIR)/create.o $(XPMDIR)/crifrbuf.o\ + $(XPMDIR)/crifrdat.o\ + $(XPMDIR)/data.o\ + $(XPMDIR)/hashtab.o $(XPMDIR)/misc.o\ + $(XPMDIR)/parse.o $(XPMDIR)/rdftodat.o\ + $(XPMDIR)/rdftoi.o\ + $(XPMDIR)/rgb.o $(XPMDIR)/scan.o\ + $(XPMDIR)/simx.o $(XPMDIR)/wrffrdat.o\ + $(XPMDIR)/wrffrp.o $(XPMDIR)/wrffri.o + +OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) # $(XPMOBJECTS) all: $(OBJECTS) $(WXLIB) diff --git a/src/msw/makefile.nt b/src/msw/makefile.nt index efc18040c8..36bbc16889 100644 --- a/src/msw/makefile.nt +++ b/src/msw/makefile.nt @@ -32,28 +32,17 @@ DUMMYOBJ=dummy.obj # This one overrides the others, to be consistent with the settings in wx_setup.h MINIMAL_WXWINDOWS_SETUP=0 -USE_XPM_IN_MSW=0 - -!if "$(MINIMAL_WXWINDOWS_SETUP)" == "1" -USE_XPM_IN_MSW=0 -!endif - PERIPH_LIBS= PERIPH_TARGET= PERIPH_CLEAN_TARGET= -!if "$(USE_XPM_IN_MSW)" == "1" -PERIPH_LIBS=$(WXDIR)\contrib\wxxpm\xpm.lib $(PERIPH_LIBS) -PERIPH_TARGET=xpm $(PERIPH_TARGET) -PERIPH_CLEAN_TARGET=clean_xpm $(PERIPH_CLEAN_TARGET) -!endif - # These are absolute paths, so that the compiler # generates correct __FILE__ symbols for debugging. # Otherwise you don't be able to double-click on a memory # error to load that file. GENDIR=$(WXDIR)\src\generic COMMDIR=$(WXDIR)\src\common +XPMDIR=$(WXDIR)\src\xpm OLEDIR=ole MSWDIR=$(WXDIR)\src\msw @@ -232,9 +221,20 @@ MSWOBJS = \ $(OLEDIR)\oleutils.obj \ $(OLEDIR)\uuid.obj +XPMOBJECTS = $(XPMDIR)\crbuffri.obj\ + $(XPMDIR)\crdatfri.obj\ + $(XPMDIR)\create.obj $(XPMDIR)\crifrbuf.obj\ + $(XPMDIR)\crifrdat.obj\ + $(XPMDIR)\data.obj\ + $(XPMDIR)\hashtab.obj $(XPMDIR)\misc.obj\ + $(XPMDIR)\parse.obj $(XPMDIR)\rdftodat.obj\ + $(XPMDIR)\rdftoi.obj\ + $(XPMDIR)\rgb.obj $(XPMDIR)\scan.obj\ + $(XPMDIR)\simx.obj $(XPMDIR)\wrffrdat.obj\ + $(XPMDIR)\wrffrp.obj $(XPMDIR)\wrffri.obj # Add $(NONESSENTIALOBJS) if wanting generic dialogs, PostScript etc. -OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) +OBJECTS = $(COMMONOBJS) $(GENERICOBJS) $(MSWOBJS) # $(XPMOBJECTS) # Normal, static library all: $(DUMMYOBJ) $(OBJECTS) $(PERIPH_TARGET) png zlib $(LIBTARGET) @@ -1142,10 +1142,117 @@ $(GENDIR)/textdlgg.obj: $*.$(SRCSUFF) $(CPPFLAGS) /c /Tp $*.$(SRCSUFF) /Fo$@ << -#test: $(DUMMYOBJ) $(COMMDIR)/string.obj +$(OBJECTS): $(WXDIR)/include/wx/setup.h +$(XPMDIR)\crbuffri.obj: $(XPMDIR)\crbuffri.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< -$(OBJECTS): $(WXDIR)/include/wx/setup.h +$(XPMDIR)\crbuffrp.obj: $(XPMDIR)\crbuffrp.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crdatfri.obj: $(XPMDIR)\crdatfri.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crdatfrp.obj: $(XPMDIR)\crdatfrp.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\create.obj: $(XPMDIR)\create.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crifrbuf.obj: $(XPMDIR)\crifrbuf.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crifrdat.obj: $(XPMDIR)\crifrdat.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crpfrbuf.obj: $(XPMDIR)\crpfrbuf.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\crpfrdat.obj: $(XPMDIR)\crpfrdat.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\data.obj: $(XPMDIR)\data.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\hashtab.obj: $(XPMDIR)\hashtab.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\misc.obj: $(XPMDIR)\misc.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\parse.obj: $(XPMDIR)\parse.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\rdftodat.obj: $(XPMDIR)\rdftodat.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\rdftoi.obj: $(XPMDIR)\rdftoi.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\rdftop.obj: $(XPMDIR)\rdftop.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\rgb.obj: $(XPMDIR)\rgb.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\scan.obj: $(XPMDIR)\scan.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\simx.obj: $(XPMDIR)\simx.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\wrffrdat.obj: $(XPMDIR)\wrffrdat.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\wrffri.obj: $(XPMDIR)\wrffri.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< + +$(XPMDIR)\wrffrp.obj: $(XPMDIR)\wrffrp.c + cl @<< +$(CPPFLAGS2) /c $*.c /Fo$@ +<< # Peripheral components diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index a34df24e6e..d111e08563 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -196,7 +196,7 @@ void wxScrollBar::MSWOnHScroll(WXWORD wParam, WXWORD pos, WXHWND control) MSWOnVScroll(wParam, pos, control); } -void wxScrollBar::SetPosition(int viewStart) +void wxScrollBar::SetThumbPosition(int viewStart) { #if defined(__WIN95__) SCROLLINFO info; @@ -212,7 +212,7 @@ void wxScrollBar::SetPosition(int viewStart) #endif } -int wxScrollBar::GetPosition(void) const +int wxScrollBar::GetThumbPosition(void) const { return ::GetScrollPos((HWND)m_hWnd, SB_CTL); } diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 210c08d785..623a803942 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -937,6 +937,22 @@ WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor, void wxTextCtrl::OnChar(wxKeyEvent& event) { + // Fix by Marcel Rasche to allow Alt-Ctrl insertion of special characters + switch(event.KeyCode()) + { + case '{': + case '}': + case '[': + case ']': + case '|': + case '~': + case '\\': + { + char c=(char)event.KeyCode(); + *this << c; + } + break; + } if ( (event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) { wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 7a5c6af4f2..496e1f3863 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -490,7 +490,7 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent, tvIns.item.mask = mask; - HTREEITEM id = TreeView_InsertItem(wxhWnd, &tvIns); + HTREEITEM id = (HTREEITEM) TreeView_InsertItem(wxhWnd, &tvIns); if ( id == 0 ) { wxLogLastError("TreeView_InsertItem"); @@ -740,6 +740,12 @@ void wxTreeCtrl::SortChildren(const wxTreeItemId& item, } } +// TODO +size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively) +{ + return 0; +} + // ---------------------------------------------------------------------------- // implementation // ---------------------------------------------------------------------------- diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 65ffdccfe9..32eb0c46bf 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -4342,6 +4342,35 @@ bool wxWindow::IsExposed(const wxRect& rect) const return (m_updateRegion.Contains(rect) != wxOutRegion); } +// Set this window to be the child of 'parent'. +bool wxWindow::Reparent(wxWindow *parent) +{ + if (parent == GetParent()) + return TRUE; + + // Unlink this window from the existing parent. + if (GetParent()) + { + GetParent()->RemoveChild(this); + } + else + wxTopLevelWindows.DeleteObject(this); + + HWND hWndParent = 0; + HWND hWndChild = (HWND) GetHWND(); + if (parent != (wxWindow*) NULL) + { + parent->AddChild(this); + hWndParent = (HWND) parent->GetHWND(); + } + else + wxTopLevelWindows.Append(this); + + ::SetParent(hWndChild, hWndParent); + + return TRUE; +} + #ifdef __WXDEBUG__ const char *wxGetMessageName(int message) { diff --git a/src/stubs/scrolbar.cpp b/src/stubs/scrolbar.cpp index 307cdefc13..a602748157 100644 --- a/src/stubs/scrolbar.cpp +++ b/src/stubs/scrolbar.cpp @@ -48,12 +48,12 @@ wxScrollBar::~wxScrollBar() { } -void wxScrollBar::SetPosition(int viewStart) +void wxScrollBar::SetThumbPosition(int viewStart) { // TODO } -int wxScrollBar::GetPosition() const +int wxScrollBar::GetThumbPosition() const { // TODO return 0; -- 2.45.2