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
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
\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}.
\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}}}
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
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.
\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.
\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}
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.
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.
\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.
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.
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.
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.
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
- 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.
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.
+
+
+
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 );
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 );
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(); }
// 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
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
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);
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);
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();
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();
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)) {} ;
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.
// 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 ;
// 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);
~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);
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;
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);
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);
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; }
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;
// 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();
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);
#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
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 ;
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);
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
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);
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 ;
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);
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);
#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)) {} ;
#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)) {} ;
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.
// 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 ;
// 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);
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) ;
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; }
#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
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);
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);
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; }
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);
// 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
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;
// 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();
// 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();
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);
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);
#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"
// 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)
"examples.",
};
+#ifdef USE_XPM
// image ids and names
enum
{
};
// 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;
// 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;
// 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)
{
#include <string.h>
#include <stdlib.h>
+// 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 <wchar.h> // for wcsrtombs(), see comments where it's used
#endif // GNU
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
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.
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;
m_vScrollBar->SetPageSize(pageSizeY);
*/
- m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), pageSizeY, objectSizeY, viewLengthY);
+ m_vScrollBar->SetScrollbar(m_vScrollBar->GetThumbPosition(), pageSizeY, objectSizeY, viewLengthY);
AdjustScrollbars();
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);
{
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);
}
return TRUE;
}
-int wxScrollBar::GetPosition(void) const
+int wxScrollBar::GetThumbPosition(void) const
{
return (int)(m_adjust->value+0.5);
}
return (int)(m_adjust->upper+0.5);
}
-void wxScrollBar::SetPosition( int viewStart )
+void wxScrollBar::SetThumbPosition( int viewStart )
{
if (m_isScrolling) return;
(fabs(fthumb-m_adjust->page_size) < 0.2) &&
(fabs(fpage-m_adjust->page_increment) < 0.2))
{
- SetPosition( position );
+ SetThumbPosition( position );
return;
}
// 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
return TRUE;
}
-int wxScrollBar::GetPosition(void) const
+int wxScrollBar::GetThumbPosition(void) const
{
return (int)(m_adjust->value+0.5);
}
return (int)(m_adjust->upper+0.5);
}
-void wxScrollBar::SetPosition( int viewStart )
+void wxScrollBar::SetThumbPosition( int viewStart )
{
if (m_isScrolling) return;
(fabs(fthumb-m_adjust->page_size) < 0.2) &&
(fabs(fpage-m_adjust->page_increment) < 0.2))
{
- SetPosition( position );
+ SetThumbPosition( position );
return;
}
// 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
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);
// 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
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())
// 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();
wxTheApp->DeletePendingObjects();
wxTheApp->OnExit();
-
wxApp::CleanUp();
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();
}
{
}
-void wxScrollBar::SetPosition(int pos)
+void wxScrollBar::SetThumbPosition(int pos)
{
if (m_mainWidget)
{
}
}
-int wxScrollBar::GetPosition() const
+int wxScrollBar::GetThumbPosition() const
{
if (m_mainWidget)
{
{
WXWidget widget = (WXWidget) node->Data();
if (widget == w)
- return (int) node->key.integer;
+ return (int) node->GetKeyInteger();
node = node->Next();
}
return -1;
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);
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)
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())
#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"
#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);
}
#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
#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
GENDIR=../generic
COMMDIR=../common
+XPMDIR=../xpm
OLEDIR=ole
MSWDIR=.
$(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) \
# $(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)
# 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
$(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)
$(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
MSWOnVScroll(wParam, pos, control);
}
-void wxScrollBar::SetPosition(int viewStart)
+void wxScrollBar::SetThumbPosition(int viewStart)
{
#if defined(__WIN95__)
SCROLLINFO info;
#endif
}
-int wxScrollBar::GetPosition(void) const
+int wxScrollBar::GetThumbPosition(void) const
{
return ::GetScrollPos((HWND)m_hWnd, SB_CTL);
}
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);
tvIns.item.mask = mask;
- HTREEITEM id = TreeView_InsertItem(wxhWnd, &tvIns);
+ HTREEITEM id = (HTREEITEM) TreeView_InsertItem(wxhWnd, &tvIns);
if ( id == 0 )
{
wxLogLastError("TreeView_InsertItem");
}
}
+// TODO
+size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
+{
+ return 0;
+}
+
// ----------------------------------------------------------------------------
// implementation
// ----------------------------------------------------------------------------
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)
{
{
}
-void wxScrollBar::SetPosition(int viewStart)
+void wxScrollBar::SetThumbPosition(int viewStart)
{
// TODO
}
-int wxScrollBar::GetPosition() const
+int wxScrollBar::GetThumbPosition() const
{
// TODO
return 0;