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
This commit is contained in:
Julian Smart 1998-11-28 13:38:40 +00:00
parent f2b0391116
commit 4fabb57533
70 changed files with 875 additions and 308 deletions

View File

@ -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

View File

@ -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

View File

@ -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}
Deletes all the items in the control.
\membersection{wxTreeCtrl::DeleteItem}\label{wxtreectrldeleteitem}
\func{bool}{DeleteItem}{\param{long }{item}}
\func{void}{Delete}{\param{const wxTreeItemId\&}{ item}}
Deletes the specified item.
\membersection{wxTreeCtrl::DeleteAllItems}\label{wxtreectrldeleteallitems}
\func{void}{DeleteAllItems}{\void}
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}}
\membersection{wxTreeCtrl::GetChild}\label{wxtreectrlgetchild}
Returns the position and size of the rectangle bounding the item.
\constfunc{long}{GetChild}{\param{long }{item}}
\membersection{wxTreeCtrl::GetChildrenCount}\label{wxtreectrlgetchildrencount}
Call this function to retrieve the tree view item that is the first child of the item specified by {\it item}.
\constfunc{size\_t}{GetChildrenCount}{\param{const wxTreeItemId\&}{ item}, \param{bool}{ recursively = TRUE}}
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}
\constfunc{bool}{GetItem}{\param{wxTreeItem\& }{info}}
Gets information about the item. See \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem} for more
information.
\membersection{wxTreeCtrl::GetItemData}\label{wxtreectrlgetitemdata}
\constfunc{long}{GetItemData}{\param{long }{item}}
\constfunc{wxTreeItemData*}{GetItemData}{\param{const wxTreeItemId\&}{ item}}
Returns the client data associated with the item, if any.
Returns the tree item data associated with the item.
\membersection{wxTreeCtrl::GetItemRect}\label{wxtreectrlgetitemrect}
\wxheading{See also}
\constfunc{bool}{GetItemRect}{\param{long }{item}, \param{wxRect\& }{rect}, \param{bool }{textOnly = FALSE}}
\helpref{wxTreeItemData}{wxtreeitemdata}
Returns the position and size of the rectangle bounding the item.
\membersection{wxTreeCtrl::GetItemImage}\label{wxtreectrlgetitemimage}
\membersection{wxTreeCtrl::GetItemState}\label{wxtreectrlgetitemstate}
\constfunc{int}{GetItemImage}{\param{const wxTreeItemId\& }{item}}
\constfunc{int}{GetItemState}{\param{long }{item}, \param{long }{stateMask}}
Gets the item state. For a list of state flags, see \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem}.
Gets the normal item image.
\membersection{wxTreeCtrl::GetItemText}\label{wxtreectrlgetitemtext}
\constfunc{wxString}{GetItemText}{\param{long }{item}}
\constfunc{wxString}{GetItemText}{\param{const wxTreeItemId\&}{ item}}
Returns the item label.
\membersection{wxTreeCtrl::GetNextItem}\label{wxtreectrlgetnextitem}
\membersection{wxTreeCtrl::GetNextChild}\label{wxtreectrlgetnextchild}
\constfunc{long}{GetNextItem}{\param{long }{item}, \param{int }{code}}
\constfunc{wxTreeItemId}{GetNextChild}{\param{const wxTreeItemId\&}{ item}, \param{long\& }{cookie}}
Searches for an item using the given criterion, starting from {\it item}.
Returns the next child; call \helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild} for the first child.
Returns the item or 0 if unsuccessful.
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.
{\it code} can be one of:
Returns 0 if there are no further children.
\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}
\wxheading{See also}
\membersection{wxTreeCtrl::GetNextVisibleItem}\label{wxtreectrlgetnextvisibleitem}
\helpref{wxTreeCtrl::GetFirstChild}{wxtreectrlgetfirstchild}
\constfunc{long}{GetNextVisibleItem}{\param{long }{item}}
\membersection{wxTreeCtrl::GetNextSibling}\label{wxtreectrlgetnextsibling}
\constfunc{wxTreeItemId}{GetNextSibling}{\param{const wxTreeItemId\&}{ item}}
Returns the next sibling of the specified item; call \helpref{wxTreeCtrl::GetPrevSibling}{wxtreectrlgetprevsibling} for the previous sibling.
Returns 0 if there are no further siblings.
\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:
\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}
Valid mask flags are:
\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}
Valid state and state mask flags are:
\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}
\membersection{wxTreeCtrl::SetItemImage}\label{wxtreectrlsetitemimage}
\func{bool}{SetItemImage}{\param{long }{item}, \param{int }{image}, \param{int }{selImage}}
Sets the item image and selected image. These are indices into the assciated image list.
\membersection{wxTreeCtrl::SetItemState}\label{wxtreectrlsetitemstate}
\func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}}
Sets the item state. See \helpref{wxTreeCtrl::SetItem}{wxtreectrlsetitem} for valid state and state mask flags.
\membersection{wxTreeCtrl::SetItemText}\label{wxtreectrlsetitemtext}
\func{void}{SetItemText}{\param{long }{item}, \param{const wxString\& }{text}}
Sets the item label.
\membersection{wxTreeCtrl::SetItemData}\label{wxtreectrlsetitemdata}
\func{bool}{SetItemData}{\param{long }{item}, \param{long }{data}}
\func{void}{SetItemData}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemData* }{data}}
Sets the item client data.
\membersection{wxTreeCtrl::SetItemHasChildren}\label{wxtreectrlsetitemhaschildren}
\func{void}{SetItemHasChildren}{\param{const wxTreeItemId\&}{ item}, \param{bool }{hasChildren = TRUE}}
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{void}{SetItemImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{image}}
Sets the normal item image. This is an index into the assciated image list.
\membersection{wxTreeCtrl::SetItemSelectedImage}\label{wxtreectrlsetitemselectedimage}
\func{void}{SetItemSelectedImage}{\param{const wxTreeItemId\&}{ item}, \param{int }{selImage}}
Sets the item selected image. This is an index into the assciated image list.
\membersection{wxTreeCtrl::SetItemText}\label{wxtreectrlsetitemtext}
\func{void}{SetItemText}{\param{const wxTreeItemId\&}{ item}, \param{const wxString\& }{text}}
Sets the item label.
\membersection{wxTreeCtrl::SortChildren}\label{wxtreectrlsortchildren}
\func{bool}{SortChildren}{\param{long }{item}}
\func{void}{SortChildren}{\param{const wxTreeItemId\&}{ item}, \param{wxTreeItemCmpFunc*}{ cmpFunction = NULL}}
Sorts the children of the given item in ascending alphabetical order.
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:
{\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{void}{SetId}{\param{const wxTreeItemId\&}{ id}}
Sets the item associated with this node.

View File

@ -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.

View File

@ -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.

View File

@ -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 );

View File

@ -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 );

View File

@ -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(); }

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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();

View File

@ -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();

View File

@ -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)) {} ;

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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; }

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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 ;

View File

@ -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

View File

@ -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);

View File

@ -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 ;

View File

@ -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);

View File

@ -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);

View File

@ -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)) {} ;

View File

@ -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)) {} ;

View File

@ -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.

View File

@ -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);

View File

@ -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) ;

View File

@ -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; }

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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; }

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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();

View File

@ -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);

View File

@ -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);

View File

@ -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
wxImageList *imagelist = new wxImageList(32, 32);
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;

View File

@ -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;

View File

@ -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)
{

View File

@ -41,6 +41,12 @@
#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

View File

@ -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.

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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();
}

View File

@ -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)
{

View File

@ -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;

View File

@ -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);

View File

@ -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())

View File

@ -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);
}

View File

@ -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

View File

@ -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

View File

@ -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)
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)
OBJECTS = $(MSWOBJS) $(COMMONOBJS) $(GENERICOBJS) # $(XPMOBJECTS)
all: $(OBJECTS) $(WXLIB)

View File

@ -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,11 +1142,118 @@ $(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$@
<<
$(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
png:

View File

@ -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);
}

View File

@ -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);

View File

@ -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
// ----------------------------------------------------------------------------

View File

@ -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)
{

View File

@ -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;