From: Julian Smart Date: Fri, 4 Aug 2000 13:59:45 +0000 (+0000) Subject: Modified generic wxTreeCtrl to work under non-Unix platforms simultaneously X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/484523cf522b02385cd47c432d50d117940b46b9 Modified generic wxTreeCtrl to work under non-Unix platforms simultaneously with the native control. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index 3b9311b7de..009ee6e7d9 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -101,7 +101,7 @@ numdlgg.cpp G tbarsmpl.cpp G textdlgg.cpp G tipdlg.cpp G -treectrl.cpp G 16 +treectlg.cpp G 16 treelay.cpp G wizard.cpp G @@ -193,6 +193,7 @@ textcmn.cpp C textfile.cpp C B timercmn.cpp C B tokenzr.cpp C B +treebase.cpp C B txtstrm.cpp C B unzip.c C B url.cpp C S,B @@ -722,6 +723,7 @@ tipdlg.h W tokenzr.h W B toolbar.h W tooltip.h W +treebase.h W treectrl.h W types.h W url.h W B @@ -1115,7 +1117,7 @@ splitter.h N statusbr.h N tabg.h N 16 textdlgg.h N -treectrl.h N 16 +treectlg.h N 16 wizard.h N # vi: set noet ts=16 nolist: diff --git a/distrib/msw/tmake/makeall.bat b/distrib/msw/tmake/makeall.bat index 498080c768..74c3b4168e 100755 --- a/distrib/msw/tmake/makeall.bat +++ b/distrib/msw/tmake/makeall.bat @@ -11,6 +11,9 @@ rem tmake. The environment variable WX or WXWIN should be defined and contain rem the root directory of wxWindows installation. TMAKE program should be in rem path or, alternatively, TMAKE environment variable should be set. +rem set tmakecmd=E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake +set tmakecmd=c:\progra~1\tmake\bin\tmake + if "x%WX%" == "x" goto skip set WXDIR=%WX% goto ok @@ -36,21 +39,21 @@ rem 4nt.exe, so I preferred to unroll it. rem for %%c in (b32 bcc dos g95 sc vc wat) %TM% -t %c% wxwin.pro -o %WXDIR%\src\msw\makefile.%c% echo Generating for Visual C++ 4.0... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t vc wxwin.pro -o %WXDIR%\src\msw\makefile.vc +%tmakecmd% -t vc wxwin.pro -o %WXDIR%\src\msw\makefile.vc echo Generating for Borland C++ (32 bits)... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t b32 wxwin.pro -o %WXDIR%\src\msw\makefile.b32 +%tmakecmd% -t b32 wxwin.pro -o %WXDIR%\src\msw\makefile.b32 echo Generating for Visual C++ 1.52... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t dos wxwin.pro -o %WXDIR%\src\msw\makefile.dos +%tmakecmd% -t dos wxwin.pro -o %WXDIR%\src\msw\makefile.dos echo Generating for Borland C++ (16 bits)... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t bcc wxwin.pro -o %WXDIR%\src\msw\makefile.bcc +%tmakecmd% -t bcc wxwin.pro -o %WXDIR%\src\msw\makefile.bcc echo Generating for Cygwin/Mingw32 -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t g95 wxwin.pro -o %WXDIR%\src\msw\makefile.g95 +%tmakecmd% -t g95 wxwin.pro -o %WXDIR%\src\msw\makefile.g95 echo Generating for Symantec C++... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t sc wxwin.pro -o %WXDIR%\src\msw\makefile.sc +%tmakecmd% -t sc wxwin.pro -o %WXDIR%\src\msw\makefile.sc echo Generating for Watcom C++... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t wat wxwin.pro -o %WXDIR%\src\msw\makefile.wat +%tmakecmd% -t wat wxwin.pro -o %WXDIR%\src\msw\makefile.wat echo Generating for Unix and Configure... -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t gtk wxwin.pro -o %WXDIR%\src\gtk\files.lst -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t motif wxwin.pro -o %WXDIR%\src\motif\files.lst -E:\Perl\5.00471\bin\MSWin32-x86\perl.exe g:\Unix\tmake\bin\tmake -t os2 wxwin.pro -o %WXDIR%\src\os2\files.lst +%tmakecmd% -t gtk wxwin.pro -o %WXDIR%\src\gtk\files.lst +%tmakecmd% -t motif wxwin.pro -o %WXDIR%\src\motif\files.lst +%tmakecmd% -t os2 wxwin.pro -o %WXDIR%\src\os2\files.lst :end diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h new file mode 100644 index 0000000000..4d48f81cde --- /dev/null +++ b/include/wx/generic/treectlg.h @@ -0,0 +1,398 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: treectrl.h +// Purpose: wxTreeCtrl class +// Author: Robert Roebling +// Modified by: +// Created: 01/02/97 +// RCS-ID: $Id$ +// Copyright: (c) 1997,1998 Robert Roebling +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + +#ifndef _GENERIC_TREECTRL_H_ +#define _GENERIC_TREECTRL_H_ + +#ifdef __GNUG__ + #pragma interface "treectrg.h" +#endif + +#include "wx/defs.h" +#include "wx/string.h" +#include "wx/object.h" +#include "wx/event.h" +#include "wx/scrolwin.h" +#include "wx/textctrl.h" +#include "wx/pen.h" +#include "wx/dynarray.h" +#include "wx/timer.h" +#include "wx/treebase.h" + +// ----------------------------------------------------------------------------- +// forward declaration +// ----------------------------------------------------------------------------- + +class WXDLLEXPORT wxImageList; +class WXDLLEXPORT wxGenericTreeItem; + +class WXDLLEXPORT wxTreeItemData; + +class WXDLLEXPORT wxTreeRenameTimer; +class WXDLLEXPORT wxTreeTextCtrl; + +// ----------------------------------------------------------------------------- +// wxGenericTreeCtrl - the tree control +// ----------------------------------------------------------------------------- + +class WXDLLEXPORT wxGenericTreeCtrl : public wxScrolledWindow +{ +public: + // creation + // -------- + wxGenericTreeCtrl() { Init(); } + + wxGenericTreeCtrl(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, + const wxValidator &validator = wxDefaultValidator, + const wxString& name = wxTreeCtrlNameStr) + { + Create(parent, id, pos, size, style, validator, name); + } + + virtual ~wxGenericTreeCtrl(); + + bool Create(wxWindow *parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, + const wxValidator &validator = wxDefaultValidator, + const wxString& name = wxTreeCtrlNameStr); + + // accessors + // --------- + + // get the total number of items in the control + size_t GetCount() const; + + // indent is the number of pixels the children are indented relative to + // the parents position. SetIndent() also redraws the control + // immediately. + unsigned int GetIndent() const { return m_indent; } + void SetIndent(unsigned int indent); + + // spacing is the number of pixels between the start and the Text + unsigned int GetSpacing() const { return m_spacing; } + void SetSpacing(unsigned int spacing); + + // image list: these functions allow to associate an image list with + // the control and retrieve it. Note that the control does _not_ delete + // the associated image list when it's deleted in order to allow image + // lists to be shared between different controls. + // + // The normal image list is for the icons which correspond to the + // normal tree item state (whether it is selected or not). + // Additionally, the application might choose to show a state icon + // which corresponds to an app-defined item state (for example, + // checked/unchecked) which are taken from the state image list. + wxImageList *GetImageList() const; + wxImageList *GetStateImageList() const; + + void SetImageList(wxImageList *imageList); + void SetStateImageList(wxImageList *imageList); + + // Functions to work with tree ctrl items. + + // accessors + // --------- + + // retrieve items label + wxString GetItemText(const wxTreeItemId& item) const; + // get one of the images associated with the item (normal by default) + int GetItemImage(const wxTreeItemId& item, + wxTreeItemIcon which = wxTreeItemIcon_Normal) const; + // get the data associated with the item + wxTreeItemData *GetItemData(const wxTreeItemId& item) const; + + // modifiers + // --------- + + // set items label + void SetItemText(const wxTreeItemId& item, const wxString& text); + // get one of the images associated with the item (normal by default) + void SetItemImage(const wxTreeItemId& item, int image, + wxTreeItemIcon which = wxTreeItemIcon_Normal); + // associate some data with the item + void SetItemData(const wxTreeItemId& item, wxTreeItemData *data); + + // force appearance of [+] button near the item. This is useful to + // allow the user to expand the items which don't have any children now + // - but instead add them only when needed, thus minimizing memory + // usage and loading time. + void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE); + + // the item will be shown in bold + void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); + + // set the items text colour + void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); + + // set the items background colour + void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col); + + // set the items font (should be of the same height for all items) + void SetItemFont(const wxTreeItemId& item, const wxFont& font); + + // item status inquiries + // --------------------- + + // is the item visible (it might be outside the view or not expanded)? + bool IsVisible(const wxTreeItemId& item) const; + // does the item has any children? + bool HasChildren(const wxTreeItemId& item) const + { return ItemHasChildren(item); } + bool ItemHasChildren(const wxTreeItemId& item) const; + // is the item expanded (only makes sense if HasChildren())? + bool IsExpanded(const wxTreeItemId& item) const; + // is this item currently selected (the same as has focus)? + bool IsSelected(const wxTreeItemId& item) const; + // is item text in bold font? + bool IsBold(const wxTreeItemId& item) const; + + // number of children + // ------------------ + + // if 'recursively' is FALSE, only immediate children count, otherwise + // the returned number is the number of all items in this branch + size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE); + + // navigation + // ---------- + + // wxTreeItemId.IsOk() will return FALSE if there is no such item + + // get the root tree item + wxTreeItemId GetRootItem() const { return m_anchor; } + + // get the item currently selected (may return NULL if no selection) + wxTreeItemId GetSelection() const { return m_current; } + + // get the items currently selected, return the number of such item + size_t GetSelections(wxArrayTreeItemIds&) const; + + // get the parent of this item (may return NULL if root) + wxTreeItemId GetParent(const wxTreeItemId& item) const; + + // 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). Of course, + // the "cookie" passed to GetFirstChild() and GetNextChild() should be + // the same! + + // get the first child of this item + wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const; + // get the next child + wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const; + // get the last child of this item - this method doesn't use cookies + wxTreeItemId GetLastChild(const wxTreeItemId& item) const; + + // get the next sibling of this item + wxTreeItemId GetNextSibling(const wxTreeItemId& item) const; + // get the previous sibling + wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const; + + // get first visible item + wxTreeItemId GetFirstVisibleItem() const; + // get the next visible item: item must be visible itself! + // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem() + wxTreeItemId GetNextVisible(const wxTreeItemId& item) const; + // get the previous visible item: item must be visible itself! + wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const; + + // operations + // ---------- + + // add the root node to the tree + wxTreeItemId AddRoot(const wxString& text, + int image = -1, int selectedImage = -1, + wxTreeItemData *data = NULL); + + // insert a new item in as the first child of the parent + wxTreeItemId PrependItem(const wxTreeItemId& parent, + const wxString& text, + int image = -1, int selectedImage = -1, + wxTreeItemData *data = NULL); + + // insert a new item after a given one + wxTreeItemId InsertItem(const wxTreeItemId& parent, + const wxTreeItemId& idPrevious, + const wxString& text, + int image = -1, int selectedImage = -1, + wxTreeItemData *data = NULL); + + // insert a new item before the one with the given index + wxTreeItemId InsertItem(const wxTreeItemId& parent, + size_t index, + const wxString& text, + int image = -1, int selectedImage = -1, + wxTreeItemData *data = NULL); + + // insert a new item in as the last child of the parent + wxTreeItemId AppendItem(const wxTreeItemId& parent, + const wxString& text, + int image = -1, int selectedImage = -1, + wxTreeItemData *data = NULL); + + // delete this item and associated data if any + void Delete(const wxTreeItemId& item); + // delete all children (but don't delete the item itself) + // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events + void DeleteChildren(const wxTreeItemId& item); + // delete all items from the tree + // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events + void DeleteAllItems(); + + // expand this item + void Expand(const wxTreeItemId& item); + // expand this item and all subitems recursively + void ExpandAll(const wxTreeItemId& item); + // collapse the item without removing its children + void Collapse(const wxTreeItemId& item); + // collapse the item and remove all children + void CollapseAndReset(const wxTreeItemId& item); + // toggles the current state + void Toggle(const wxTreeItemId& item); + + // remove the selection from currently selected item (if any) + void Unselect(); + void UnselectAll(); + // select this item + void SelectItem(const wxTreeItemId& item, bool unselect_others=TRUE, bool extended_select=FALSE); + // make sure this item is visible (expanding the parent item and/or + // scrolling to this item if necessary) + void EnsureVisible(const wxTreeItemId& item); + // scroll to this item (but don't expand its parent) + void ScrollTo(const wxTreeItemId& item); + + // The first function is more portable (because easier to implement + // on other platforms), but the second one returns some extra info. + wxTreeItemId HitTest(const wxPoint& point) + { int dummy; return HitTest(point, dummy); } + wxTreeItemId HitTest(const wxPoint& point, int& flags); + + // Start editing the item label: this (temporarily) replaces the item + // with a one line edit control. The item will be selected if it hadn't + // been before. + void EditLabel( const wxTreeItemId& item ) { Edit( item ); } + void Edit( const wxTreeItemId& item ); + + // sorting + // this function is called to compare 2 items and should return -1, 0 + // or +1 if the first item is less than, equal to or greater than the + // second one. The base class version performs alphabetic comparaison + // of item labels (GetText) + virtual int OnCompareItems(const wxTreeItemId& item1, + const wxTreeItemId& item2); + // sort the children of this item using OnCompareItems + // + // NB: this function is not reentrant and not MT-safe (FIXME)! + void SortChildren(const wxTreeItemId& item); + + // deprecated functions: use Set/GetItemImage directly + // get the selected item image + int GetItemSelectedImage(const wxTreeItemId& item) const + { return GetItemImage(item, wxTreeItemIcon_Selected); } + // set the selected item image + void SetItemSelectedImage(const wxTreeItemId& item, int image) + { SetItemImage(item, image, wxTreeItemIcon_Selected); } + + // implementation only from now on + + // callbacks + void OnPaint( wxPaintEvent &event ); + void OnSetFocus( wxFocusEvent &event ); + void OnKillFocus( wxFocusEvent &event ); + void OnChar( wxKeyEvent &event ); + void OnMouse( wxMouseEvent &event ); + void OnIdle( wxIdleEvent &event ); + + // implementation helpers + void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted); + + void DrawBorder(const wxTreeItemId& item); + void DrawLine(const wxTreeItemId& item, bool below); + +protected: + friend class wxGenericTreeItem; + friend class wxTreeRenameTimer; + friend class wxTreeTextCtrl; + + wxFont m_normalFont; + wxFont m_boldFont; + + wxGenericTreeItem *m_anchor; + wxGenericTreeItem *m_current, *m_key_current, *m_currentEdit; + bool m_hasFocus; + bool m_dirty; + int m_xScroll,m_yScroll; + unsigned int m_indent; + unsigned int m_spacing; + int m_lineHeight; + wxPen m_dottedPen; + wxBrush *m_hilightBrush; + wxImageList *m_imageListNormal, + *m_imageListState; + + int m_dragCount; + wxPoint m_dragStart; + bool m_isDragging; // true between BEGIN/END drag events + wxGenericTreeItem *m_dropTarget; + wxCursor m_oldCursor; // cursor is changed while dragging + wxGenericTreeItem *m_oldSelection; + + wxTimer *m_renameTimer; + bool m_renameAccept; + bool m_lastOnSame; // last click on the same item as prev + wxString m_renameRes; + + // the common part of all ctors + void Init(); + + // misc helpers + wxTreeItemId DoInsertItem(const wxTreeItemId& parent, + size_t previous, + const wxString& text, + int image, int selectedImage, + wxTreeItemData *data); + + void AdjustMyScrollbars(); + int GetLineHeight(wxGenericTreeItem *item) const; + void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y ); + void PaintItem( wxGenericTreeItem *item, wxDC& dc); + + void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y ); + void CalculatePositions(); + void CalculateSize( wxGenericTreeItem *item, wxDC &dc ); + + void RefreshSubtree( wxGenericTreeItem *item ); + void RefreshLine( wxGenericTreeItem *item ); + + void OnRenameTimer(); + void OnRenameAccept(); + + void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const; + void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 ); + bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); + bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); + void UnselectAllChildren( wxGenericTreeItem *item ); + + void DrawDropEffect(wxGenericTreeItem *item); + +private: + DECLARE_EVENT_TABLE() + DECLARE_DYNAMIC_CLASS(wxGenericTreeCtrl) +}; + +#endif // _GENERIC_TREECTRL_H_ + diff --git a/include/wx/generic/treectrl.h b/include/wx/generic/treectrl.h deleted file mode 100644 index 50d949b2b2..0000000000 --- a/include/wx/generic/treectrl.h +++ /dev/null @@ -1,455 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: treectrl.h -// Purpose: wxTreeCtrl class -// Author: Robert Roebling -// Modified by: -// Created: 01/02/97 -// RCS-ID: $Id$ -// Copyright: (c) 1997,1998 Robert Roebling -// Licence: wxWindows license -///////////////////////////////////////////////////////////////////////////// - -#ifndef _GENERIC_TREECTRL_H_ -#define _GENERIC_TREECTRL_H_ - -#ifdef __GNUG__ - #pragma interface "treectrl.h" -#endif - -#include "wx/defs.h" -#include "wx/string.h" -#include "wx/object.h" -#include "wx/event.h" -#include "wx/scrolwin.h" -#include "wx/textctrl.h" -#include "wx/pen.h" -#include "wx/dynarray.h" -#include "wx/timer.h" - -// ----------------------------------------------------------------------------- -// forward declaration -// ----------------------------------------------------------------------------- - -class WXDLLEXPORT wxImageList; -class WXDLLEXPORT wxGenericTreeItem; - -class WXDLLEXPORT wxTreeItemData; - -class WXDLLEXPORT wxTreeRenameTimer; -class WXDLLEXPORT wxTreeTextCtrl; - -// ----------------------------------------------------------------------------- -// wxTreeItemId - unique identifier of a tree element -// ----------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeItemId -{ -friend class wxTreeCtrl; -friend class wxTreeEvent; -public: - // ctors - // 0 is invalid value for HTREEITEM - wxTreeItemId() { m_pItem = 0; } - - // default copy ctor/assignment operator are ok for us - - // accessors - // is this a valid tree item? - bool IsOk() const { return m_pItem != 0; } - - // deprecated: only for compatibility - wxTreeItemId(long itemId) { m_pItem = (wxGenericTreeItem *)itemId; } - operator long() const { return (long)m_pItem; } - -//protected: // not for gcc - // for wxTreeCtrl usage only - wxTreeItemId(wxGenericTreeItem *pItem) { m_pItem = pItem; } - - wxGenericTreeItem *m_pItem; -}; - -WX_DECLARE_OBJARRAY(wxTreeItemId, wxArrayTreeItemIds); - -// ---------------------------------------------------------------------------- -// wxTreeItemData is some (arbitrary) user class associated with some item. -// -// Because the objects of this class are deleted by the tree, they should -// always be allocated on the heap! -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeItemData: public wxClientData -{ -friend class wxTreeCtrl; -public: - // creation/destruction - // -------------------- - // default ctor - wxTreeItemData() { } - - // default copy ctor/assignment operator are ok - - // accessor: get the item associated with us - const wxTreeItemId& GetId() const { return m_pItem; } - void SetId(const wxTreeItemId& id) { m_pItem = id; } - -protected: - wxTreeItemId m_pItem; -}; - -// ----------------------------------------------------------------------------- -// wxTreeCtrl - the tree control -// ----------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeCtrl : public wxScrolledWindow -{ -public: - // creation - // -------- - wxTreeCtrl() { Init(); } - - wxTreeCtrl(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, - const wxValidator &validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr) - { - Create(parent, id, pos, size, style, validator, name); - } - - virtual ~wxTreeCtrl(); - - bool Create(wxWindow *parent, wxWindowID id = -1, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT, - const wxValidator &validator = wxDefaultValidator, - const wxString& name = wxTreeCtrlNameStr); - - // accessors - // --------- - - // get the total number of items in the control - size_t GetCount() const; - - // indent is the number of pixels the children are indented relative to - // the parents position. SetIndent() also redraws the control - // immediately. - unsigned int GetIndent() const { return m_indent; } - void SetIndent(unsigned int indent); - - // spacing is the number of pixels between the start and the Text - unsigned int GetSpacing() const { return m_spacing; } - void SetSpacing(unsigned int spacing); - - // image list: these functions allow to associate an image list with - // the control and retrieve it. Note that the control does _not_ delete - // the associated image list when it's deleted in order to allow image - // lists to be shared between different controls. - // - // The normal image list is for the icons which correspond to the - // normal tree item state (whether it is selected or not). - // Additionally, the application might choose to show a state icon - // which corresponds to an app-defined item state (for example, - // checked/unchecked) which are taken from the state image list. - wxImageList *GetImageList() const; - wxImageList *GetStateImageList() const; - - void SetImageList(wxImageList *imageList); - void SetStateImageList(wxImageList *imageList); - - // Functions to work with tree ctrl items. - - // accessors - // --------- - - // retrieve items label - wxString GetItemText(const wxTreeItemId& item) const; - // get one of the images associated with the item (normal by default) - int GetItemImage(const wxTreeItemId& item, - wxTreeItemIcon which = wxTreeItemIcon_Normal) const; - // get the data associated with the item - wxTreeItemData *GetItemData(const wxTreeItemId& item) const; - - // modifiers - // --------- - - // set items label - void SetItemText(const wxTreeItemId& item, const wxString& text); - // get one of the images associated with the item (normal by default) - void SetItemImage(const wxTreeItemId& item, int image, - wxTreeItemIcon which = wxTreeItemIcon_Normal); - // associate some data with the item - void SetItemData(const wxTreeItemId& item, wxTreeItemData *data); - - // force appearance of [+] button near the item. This is useful to - // allow the user to expand the items which don't have any children now - // - but instead add them only when needed, thus minimizing memory - // usage and loading time. - void SetItemHasChildren(const wxTreeItemId& item, bool has = TRUE); - - // the item will be shown in bold - void SetItemBold(const wxTreeItemId& item, bool bold = TRUE); - - // set the items text colour - void SetItemTextColour(const wxTreeItemId& item, const wxColour& col); - - // set the items background colour - void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col); - - // set the items font (should be of the same height for all items) - void SetItemFont(const wxTreeItemId& item, const wxFont& font); - - // item status inquiries - // --------------------- - - // is the item visible (it might be outside the view or not expanded)? - bool IsVisible(const wxTreeItemId& item) const; - // does the item has any children? - bool HasChildren(const wxTreeItemId& item) const - { return ItemHasChildren(item); } - bool ItemHasChildren(const wxTreeItemId& item) const; - // is the item expanded (only makes sense if HasChildren())? - bool IsExpanded(const wxTreeItemId& item) const; - // is this item currently selected (the same as has focus)? - bool IsSelected(const wxTreeItemId& item) const; - // is item text in bold font? - bool IsBold(const wxTreeItemId& item) const; - - // number of children - // ------------------ - - // if 'recursively' is FALSE, only immediate children count, otherwise - // the returned number is the number of all items in this branch - size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = TRUE); - - // navigation - // ---------- - - // wxTreeItemId.IsOk() will return FALSE if there is no such item - - // get the root tree item - wxTreeItemId GetRootItem() const { return m_anchor; } - - // get the item currently selected (may return NULL if no selection) - wxTreeItemId GetSelection() const { return m_current; } - - // get the items currently selected, return the number of such item - size_t GetSelections(wxArrayTreeItemIds&) const; - - // get the parent of this item (may return NULL if root) - wxTreeItemId GetParent(const wxTreeItemId& item) const; - - // 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). Of course, - // the "cookie" passed to GetFirstChild() and GetNextChild() should be - // the same! - - // get the first child of this item - wxTreeItemId GetFirstChild(const wxTreeItemId& item, long& cookie) const; - // get the next child - wxTreeItemId GetNextChild(const wxTreeItemId& item, long& cookie) const; - // get the last child of this item - this method doesn't use cookies - wxTreeItemId GetLastChild(const wxTreeItemId& item) const; - - // get the next sibling of this item - wxTreeItemId GetNextSibling(const wxTreeItemId& item) const; - // get the previous sibling - wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const; - - // get first visible item - wxTreeItemId GetFirstVisibleItem() const; - // get the next visible item: item must be visible itself! - // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem() - wxTreeItemId GetNextVisible(const wxTreeItemId& item) const; - // get the previous visible item: item must be visible itself! - wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const; - - // operations - // ---------- - - // add the root node to the tree - wxTreeItemId AddRoot(const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - // insert a new item in as the first child of the parent - wxTreeItemId PrependItem(const wxTreeItemId& parent, - const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - // insert a new item after a given one - wxTreeItemId InsertItem(const wxTreeItemId& parent, - const wxTreeItemId& idPrevious, - const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - // insert a new item before the one with the given index - wxTreeItemId InsertItem(const wxTreeItemId& parent, - size_t index, - const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - // insert a new item in as the last child of the parent - wxTreeItemId AppendItem(const wxTreeItemId& parent, - const wxString& text, - int image = -1, int selectedImage = -1, - wxTreeItemData *data = NULL); - - // delete this item and associated data if any - void Delete(const wxTreeItemId& item); - // delete all children (but don't delete the item itself) - // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events - void DeleteChildren(const wxTreeItemId& item); - // delete all items from the tree - // NB: this won't send wxEVT_COMMAND_TREE_ITEM_DELETED events - void DeleteAllItems(); - - // expand this item - void Expand(const wxTreeItemId& item); - // expand this item and all subitems recursively - void ExpandAll(const wxTreeItemId& item); - // collapse the item without removing its children - void Collapse(const wxTreeItemId& item); - // collapse the item and remove all children - void CollapseAndReset(const wxTreeItemId& item); - // toggles the current state - void Toggle(const wxTreeItemId& item); - - // remove the selection from currently selected item (if any) - void Unselect(); - void UnselectAll(); - // select this item - void SelectItem(const wxTreeItemId& item, bool unselect_others=TRUE, bool extended_select=FALSE); - // make sure this item is visible (expanding the parent item and/or - // scrolling to this item if necessary) - void EnsureVisible(const wxTreeItemId& item); - // scroll to this item (but don't expand its parent) - void ScrollTo(const wxTreeItemId& item); - - // The first function is more portable (because easier to implement - // on other platforms), but the second one returns some extra info. - wxTreeItemId HitTest(const wxPoint& point) - { int dummy; return HitTest(point, dummy); } - wxTreeItemId HitTest(const wxPoint& point, int& flags); - - // Start editing the item label: this (temporarily) replaces the item - // with a one line edit control. The item will be selected if it hadn't - // been before. - void EditLabel( const wxTreeItemId& item ) { Edit( item ); } - void Edit( const wxTreeItemId& item ); - - // sorting - // this function is called to compare 2 items and should return -1, 0 - // or +1 if the first item is less than, equal to or greater than the - // second one. The base class version performs alphabetic comparaison - // of item labels (GetText) - virtual int OnCompareItems(const wxTreeItemId& item1, - const wxTreeItemId& item2); - // sort the children of this item using OnCompareItems - // - // NB: this function is not reentrant and not MT-safe (FIXME)! - void SortChildren(const wxTreeItemId& item); - - // deprecated functions: use Set/GetItemImage directly - // get the selected item image - int GetItemSelectedImage(const wxTreeItemId& item) const - { return GetItemImage(item, wxTreeItemIcon_Selected); } - // set the selected item image - void SetItemSelectedImage(const wxTreeItemId& item, int image) - { SetItemImage(item, image, wxTreeItemIcon_Selected); } - - // implementation only from now on - - // callbacks - void OnPaint( wxPaintEvent &event ); - void OnSetFocus( wxFocusEvent &event ); - void OnKillFocus( wxFocusEvent &event ); - void OnChar( wxKeyEvent &event ); - void OnMouse( wxMouseEvent &event ); - void OnIdle( wxIdleEvent &event ); - - // implementation helpers - void SendDeleteEvent(wxGenericTreeItem *itemBeingDeleted); - - void DrawBorder(const wxTreeItemId& item); - void DrawLine(const wxTreeItemId& item, bool below); - -protected: - friend class wxGenericTreeItem; - friend class wxTreeRenameTimer; - friend class wxTreeTextCtrl; - - wxFont m_normalFont; - wxFont m_boldFont; - - wxGenericTreeItem *m_anchor; - wxGenericTreeItem *m_current, *m_key_current, *m_currentEdit; - bool m_hasFocus; - bool m_dirty; - int m_xScroll,m_yScroll; - unsigned int m_indent; - unsigned int m_spacing; - int m_lineHeight; - wxPen m_dottedPen; - wxBrush *m_hilightBrush; - wxImageList *m_imageListNormal, - *m_imageListState; - - int m_dragCount; - wxPoint m_dragStart; - bool m_isDragging; // true between BEGIN/END drag events - wxGenericTreeItem *m_dropTarget; - wxCursor m_oldCursor; // cursor is changed while dragging - wxGenericTreeItem *m_oldSelection; - - wxTimer *m_renameTimer; - bool m_renameAccept; - bool m_lastOnSame; // last click on the same item as prev - wxString m_renameRes; - - // the common part of all ctors - void Init(); - - // misc helpers - wxTreeItemId DoInsertItem(const wxTreeItemId& parent, - size_t previous, - const wxString& text, - int image, int selectedImage, - wxTreeItemData *data); - - void AdjustMyScrollbars(); - int GetLineHeight(wxGenericTreeItem *item) const; - void PaintLevel( wxGenericTreeItem *item, wxDC& dc, int level, int &y ); - void PaintItem( wxGenericTreeItem *item, wxDC& dc); - - void CalculateLevel( wxGenericTreeItem *item, wxDC &dc, int level, int &y ); - void CalculatePositions(); - void CalculateSize( wxGenericTreeItem *item, wxDC &dc ); - - void RefreshSubtree( wxGenericTreeItem *item ); - void RefreshLine( wxGenericTreeItem *item ); - - void OnRenameTimer(); - void OnRenameAccept(); - - void FillArray(wxGenericTreeItem*, wxArrayTreeItemIds&) const; - void SelectItemRange( wxGenericTreeItem *item1, wxGenericTreeItem *item2 ); - bool TagAllChildrenUntilLast(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); - bool TagNextChildren(wxGenericTreeItem *crt_item, wxGenericTreeItem *last_item, bool select); - void UnselectAllChildren( wxGenericTreeItem *item ); - - void DrawDropEffect(wxGenericTreeItem *item); - -private: - DECLARE_EVENT_TABLE() - DECLARE_DYNAMIC_CLASS(wxTreeCtrl) -}; - -#endif // _GENERIC_TREECTRL_H_ - diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h index 91d4eea2ab..78c77e0714 100644 --- a/include/wx/msw/treectrl.h +++ b/include/wx/msw/treectrl.h @@ -22,6 +22,7 @@ #include "wx/textctrl.h" #include "wx/dynarray.h" +#include "wx/treebase.h" #ifdef __GNUWIN32__ // Cygwin windows.h defines these identifiers @@ -58,68 +59,6 @@ enum #define wxTREE_INSERT_FIRST 0xFFFF0001 #define wxTREE_INSERT_LAST 0xFFFF0002 -// ---------------------------------------------------------------------------- -// wxTreeItemId identifies an element of the tree. In this implementation, it's -// just a trivial wrapper around Win32 HTREEITEM. It's opaque for the -// application. -// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTreeItemId -{ -public: - // ctors - // 0 is invalid value for HTREEITEM - wxTreeItemId() { m_itemId = 0; } - - // default copy ctor/assignment operator are ok for us - - // accessors - // is this a valid tree item? - bool IsOk() const { return m_itemId != 0; } - - // conversion to/from either real (system-dependent) tree item id or - // to "long" which used to be the type for tree item ids in previous - // versions of wxWindows - - // for wxTreeCtrl usage only - wxTreeItemId(WXHTREEITEM itemId) { m_itemId = (long)itemId; } - operator WXHTREEITEM() const { return (WXHTREEITEM)m_itemId; } - - void operator=(WXHTREEITEM item) { m_itemId = (long) item; } - -protected: - long m_itemId; -}; - -WX_DEFINE_EXPORTED_ARRAY(WXHTREEITEM, wxArrayTreeItemIds); - -// ---------------------------------------------------------------------------- -// wxTreeItemData is some (arbitrary) user class associated with some item. The -// main advantage of having this class (compared to 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. OTOH, 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! -// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxTreeItemData : private wxTreeItemId -{ -public: - // default ctor/copy ctor/assignment operator are ok - - // dtor is virtual and all the items are deleted by the tree control when - // it's deleted, so you normally don't have to care about freeing memory - // allocated in your wxTreeItemData-derived class - virtual ~wxTreeItemData() { } - - // accessors: set/get the item associated with this node - void SetId(const wxTreeItemId& id) { m_itemId = id; } - const wxTreeItemId GetId() const { return *this; } -}; - // ---------------------------------------------------------------------------- // wxTreeCtrl // ---------------------------------------------------------------------------- diff --git a/include/wx/treebase.h b/include/wx/treebase.h new file mode 100644 index 0000000000..4d9320be93 --- /dev/null +++ b/include/wx/treebase.h @@ -0,0 +1,286 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: treectrl.h +// Purpose: wxTreeCtrl base classes and types +// Author: Julian Smart et al +// Modified by: +// Created: 01/02/97 +// RCS-ID: $Id$ +// Copyright: (c) 1997,1998 Robert Roebling +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +#ifndef _WX_TREEBASE_H_ +#define _WX_TREEBASE_H_ + +#ifdef __GNUG__ + #pragma interface "treebase.h" +#endif + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#include "wx/control.h" +#include "wx/event.h" + +// ---------------------------------------------------------------------------- +// wxTreeItemId identifies an element of the tree. In this implementation, it's +// just a trivial wrapper around Win32 HTREEITEM. It's opaque for the +// application. +// ---------------------------------------------------------------------------- + +// Using this typedef removes an ambiguity when calling Remove() +typedef unsigned long wxTreeItemIdValue; + +class WXDLLEXPORT wxTreeItemId +{ +friend class WXDLLEXPORT wxTreeCtrl; +friend class WXDLLEXPORT wxGenericTreeCtrl; +friend class WXDLLEXPORT wxTreeEvent; +public: + // ctors + // 0 is invalid value for HTREEITEM + wxTreeItemId() { m_pItem = 0; } + + // default copy ctor/assignment operator are ok for us + + // accessors + // is this a valid tree item? + bool IsOk() const { return m_pItem != 0; } + + // deprecated: only for compatibility + wxTreeItemId(long itemId) { m_pItem = itemId; } + //operator long() const { return m_pItem; } + operator wxTreeItemIdValue() const { return m_pItem; } + + void operator=(long item) { m_pItem = item; } + + wxTreeItemId(void *pItem) { m_pItem = (long) pItem; } + + wxTreeItemIdValue m_pItem; +}; + +// ---------------------------------------------------------------------------- +// wxTreeItemData is some (arbitrary) user class associated with some item. The +// main advantage of having this class (compared to 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. OTOH, 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! +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTreeItemData: public wxClientData +{ +friend class WXDLLEXPORT wxTreeCtrl; +friend class WXDLLEXPORT wxGenericTreeCtrl; +public: + // creation/destruction + // -------------------- + // default ctor + wxTreeItemData() { } + + // default copy ctor/assignment operator are ok + + // accessor: get the item associated with us + const wxTreeItemId& GetId() const { return m_pItem; } + void SetId(const wxTreeItemId& id) { m_pItem = id; } + +protected: + wxTreeItemId m_pItem; +}; + +WX_DEFINE_EXPORTED_ARRAY(wxTreeItemId, wxArrayTreeItemIds); + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// enum for different images associated with a treectrl item +enum wxTreeItemIcon +{ + wxTreeItemIcon_Normal, // not selected, not expanded + wxTreeItemIcon_Selected, // selected, not expanded + wxTreeItemIcon_Expanded, // not selected, expanded + wxTreeItemIcon_SelectedExpanded, // selected, expanded + wxTreeItemIcon_Max +}; + + +// values for the `flags' parameter of wxTreeCtrl::HitTest() which determine +// where exactly the specified point is situated: + +static const int wxTREE_HITTEST_ABOVE = 0x0001; +static const int wxTREE_HITTEST_BELOW = 0x0002; +static const int wxTREE_HITTEST_NOWHERE = 0x0004; + // on the button associated with an item. +static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0008; + // on the bitmap associated with an item. +static const int wxTREE_HITTEST_ONITEMICON = 0x0010; + // on the indent associated with an item. +static const int wxTREE_HITTEST_ONITEMINDENT = 0x0020; + // on the label (string) associated with an item. +static const int wxTREE_HITTEST_ONITEMLABEL = 0x0040; + // on the right of the label associated with an item. +static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0080; + // on the label (string) associated with an item. +static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0100; + // on the left of the wxTreeCtrl. +static const int wxTREE_HITTEST_TOLEFT = 0x0200; + // on the right of the wxTreeCtrl. +static const int wxTREE_HITTEST_TORIGHT = 0x0400; + // on the upper part (first half) of the item. +static const int wxTREE_HITTEST_ONITEMUPPERPART = 0x0800; + // on the lower part (second half) of the item. +static const int wxTREE_HITTEST_ONITEMLOWERPART = 0x1000; + + // anywhere on the item +static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON | + wxTREE_HITTEST_ONITEMLABEL; + +// tree ctrl default name +WXDLLEXPORT_DATA(extern const char*) wxTreeCtrlNameStr; + +// ---------------------------------------------------------------------------- +// wxTreeItemAttr: a structure containing the visual attributes of an item +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTreeItemAttr +{ +public: + // ctors + wxTreeItemAttr() { } + wxTreeItemAttr(const wxColour& colText, + const wxColour& colBack, + const wxFont& font) + : m_colText(colText), m_colBack(colBack), m_font(font) { } + + // setters + void SetTextColour(const wxColour& colText) { m_colText = colText; } + void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } + void SetFont(const wxFont& font) { m_font = font; } + + // accessors + bool HasTextColour() const { return m_colText.Ok(); } + bool HasBackgroundColour() const { return m_colBack.Ok(); } + bool HasFont() const { return m_font.Ok(); } + + const wxColour& GetTextColour() const { return m_colText; } + const wxColour& GetBackgroundColour() const { return m_colBack; } + const wxFont& GetFont() const { return m_font; } + +private: + wxColour m_colText, + m_colBack; + wxFont m_font; +}; + +// ---------------------------------------------------------------------------- +// wxTreeEvent is a special class for all events associated with tree controls +// +// NB: note that not all accessors make sense for all events, see the event +// descriptions below +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent +{ + friend class WXDLLEXPORT wxTreeCtrl; + friend class WXDLLEXPORT wxGenericTreeCtrl; + +public: + wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0); + + // accessors + // get the item on which the operation was performed or the newly + // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events + wxTreeItemId GetItem() const { return m_item; } + + // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously + // selected item + wxTreeItemId GetOldItem() const { return m_itemOld; } + + // the point where the mouse was when the drag operation started (for + // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) + wxPoint GetPoint() const { return m_pointDrag; } + + // keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only) + int GetCode() const { return m_code; } + + // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only) + const wxString& GetLabel() const { return m_label; } + +private: + // we could probably save some space by using union here + int m_code; + wxTreeItemId m_item, + m_itemOld; + wxPoint m_pointDrag; + wxString m_label; + + DECLARE_DYNAMIC_CLASS(wxTreeEvent) +}; + +typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); + +// ---------------------------------------------------------------------------- +// macros for handling tree control events +// ---------------------------------------------------------------------------- + +// GetItem() returns the item being dragged, GetPoint() the mouse coords +// +// if you call event.Allow(), the drag operation will start and a +// EVT_TREE_END_DRAG event will be sent when the drag is over. +#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, + +// GetItem() is the item on which the drop occured (if any) and GetPoint() the +// current mouse coords +#define EVT_TREE_END_DRAG(id, fn) { wxEVT_COMMAND_TREE_END_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, + +// GetItem() returns the itme whose label is being edited, GetLabel() returns +// the current item label for BEGIN and the would be new one for END. +// +// Vetoing BEGIN event means that label editing won't happen at all, +// vetoing END means that the new value is discarded and the old one kept +#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, + +// provide/update information about GetItem() item +#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, + +// GetItem() is the item being expanded/collapsed, the "ING" versions can use +#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, +#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, + +// GetOldItem() is the item which had the selection previously, GetItem() is +// the item which acquires selection +#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, +#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, + +// GetCode() returns the key code +// NB: this is the only message for which GetItem() is invalid (you may get the +// item from GetSelection()) +#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, + +// GetItem() returns the item being deleted, the associated data (if any) will +// be deleted just after the return of this event handler (if any) +#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, + +// GetItem() returns the item that was activated (double click, enter, space) +#define EVT_TREE_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, + +// GetItem() returns the item that was clicked on +#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, +#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) { wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, + +#endif + // _WX_TREEBASE_H_ + + diff --git a/include/wx/treectrl.h b/include/wx/treectrl.h index 278ea204f8..b30804c1e8 100644 --- a/include/wx/treectrl.h +++ b/include/wx/treectrl.h @@ -1,95 +1,7 @@ #ifndef _WX_TREECTRL_H_BASE_ #define _WX_TREECTRL_H_BASE_ -// ---------------------------------------------------------------------------- -// headers -// ---------------------------------------------------------------------------- - -#include "wx/control.h" -#include "wx/event.h" - -// ---------------------------------------------------------------------------- -// constants -// ---------------------------------------------------------------------------- - -// enum for different images associated with a treectrl item -enum wxTreeItemIcon -{ - wxTreeItemIcon_Normal, // not selected, not expanded - wxTreeItemIcon_Selected, // selected, not expanded - wxTreeItemIcon_Expanded, // not selected, expanded - wxTreeItemIcon_SelectedExpanded, // selected, expanded - wxTreeItemIcon_Max -}; - - -// values for the `flags' parameter of wxTreeCtrl::HitTest() which determine -// where exactly the specified point is situated: - -static const int wxTREE_HITTEST_ABOVE = 0x0001; -static const int wxTREE_HITTEST_BELOW = 0x0002; -static const int wxTREE_HITTEST_NOWHERE = 0x0004; - // on the button associated with an item. -static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0008; - // on the bitmap associated with an item. -static const int wxTREE_HITTEST_ONITEMICON = 0x0010; - // on the indent associated with an item. -static const int wxTREE_HITTEST_ONITEMINDENT = 0x0020; - // on the label (string) associated with an item. -static const int wxTREE_HITTEST_ONITEMLABEL = 0x0040; - // on the right of the label associated with an item. -static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0080; - // on the label (string) associated with an item. -static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0100; - // on the left of the wxTreeCtrl. -static const int wxTREE_HITTEST_TOLEFT = 0x0200; - // on the right of the wxTreeCtrl. -static const int wxTREE_HITTEST_TORIGHT = 0x0400; - // on the upper part (first half) of the item. -static const int wxTREE_HITTEST_ONITEMUPPERPART = 0x0800; - // on the lower part (second half) of the item. -static const int wxTREE_HITTEST_ONITEMLOWERPART = 0x1000; - - // anywhere on the item -static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON | - wxTREE_HITTEST_ONITEMLABEL; - -// tree ctrl default name -WXDLLEXPORT_DATA(extern const char*) wxTreeCtrlNameStr; - -// ---------------------------------------------------------------------------- -// wxTreeItemAttr: a structure containing the visual attributes of an item -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeItemAttr -{ -public: - // ctors - wxTreeItemAttr() { } - wxTreeItemAttr(const wxColour& colText, - const wxColour& colBack, - const wxFont& font) - : m_colText(colText), m_colBack(colBack), m_font(font) { } - - // setters - void SetTextColour(const wxColour& colText) { m_colText = colText; } - void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } - void SetFont(const wxFont& font) { m_font = font; } - - // accessors - bool HasTextColour() const { return m_colText.Ok(); } - bool HasBackgroundColour() const { return m_colBack.Ok(); } - bool HasFont() const { return m_font.Ok(); } - - const wxColour& GetTextColour() const { return m_colText; } - const wxColour& GetBackgroundColour() const { return m_colBack; } - const wxFont& GetFont() const { return m_font; } - -private: - wxColour m_colText, - m_colBack; - wxFont m_font; -}; +#include "wx/treebase.h" // ---------------------------------------------------------------------------- // include the platform-dependent wxTreeCtrl class @@ -97,123 +9,28 @@ private: #if defined(__WXMSW__) #ifdef __WIN16__ - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #else #include "wx/msw/treectrl.h" #endif #elif defined(__WXMOTIF__) - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #elif defined(__WXGTK__) - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #elif defined(__WXQT__) #include "wx/qt/treectrl.h" #elif defined(__WXMAC__) - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #elif defined(__WXPM__) - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #elif defined(__WXSTUBS__) - #include "wx/generic/treectrl.h" + #include "wx/generic/treectlg.h" #endif -// ---------------------------------------------------------------------------- -// wxTreeEvent is a special class for all events associated with tree controls -// -// NB: note that not all accessors make sense for all events, see the event -// descriptions below -// ---------------------------------------------------------------------------- - -class WXDLLEXPORT wxTreeEvent : public wxNotifyEvent -{ - friend class WXDLLEXPORT wxTreeCtrl; - -public: - wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0); - - // accessors - // get the item on which the operation was performed or the newly - // selected item for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events - wxTreeItemId GetItem() const { return m_item; } - - // for wxEVT_COMMAND_TREE_SEL_CHANGED/ING events, get the previously - // selected item - wxTreeItemId GetOldItem() const { return m_itemOld; } - - // the point where the mouse was when the drag operation started (for - // wxEVT_COMMAND_TREE_BEGIN_(R)DRAG events only) - wxPoint GetPoint() const { return m_pointDrag; } - - // keyboard code (for wxEVT_COMMAND_TREE_KEY_DOWN only) - int GetCode() const { return m_code; } - - // label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only) - const wxString& GetLabel() const { return m_label; } - -private: - // we could probably save some space by using union here - int m_code; - wxTreeItemId m_item, - m_itemOld; - wxPoint m_pointDrag; - wxString m_label; - - DECLARE_DYNAMIC_CLASS(wxTreeEvent) -}; - -typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); - -// ---------------------------------------------------------------------------- -// macros for handling tree control events -// ---------------------------------------------------------------------------- - -// GetItem() returns the item being dragged, GetPoint() the mouse coords -// -// if you call event.Allow(), the drag operation will start and a -// EVT_TREE_END_DRAG event will be sent when the drag is over. -#define EVT_TREE_BEGIN_DRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_BEGIN_RDRAG(id, fn) { wxEVT_COMMAND_TREE_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -// GetItem() is the item on which the drop occured (if any) and GetPoint() the -// current mouse coords -#define EVT_TREE_END_DRAG(id, fn) { wxEVT_COMMAND_TREE_END_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -// GetItem() returns the itme whose label is being edited, GetLabel() returns -// the current item label for BEGIN and the would be new one for END. -// -// Vetoing BEGIN event means that label editing won't happen at all, -// vetoing END means that the new value is discarded and the old one kept -#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_END_LABEL_EDIT(id, fn) { wxEVT_COMMAND_TREE_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -// provide/update information about GetItem() item -#define EVT_TREE_GET_INFO(id, fn) { wxEVT_COMMAND_TREE_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_SET_INFO(id, fn) { wxEVT_COMMAND_TREE_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -// GetItem() is the item being expanded/collapsed, the "ING" versions can use -#define EVT_TREE_ITEM_EXPANDED(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_EXPANDING(id, fn) { wxEVT_COMMAND_TREE_ITEM_EXPANDING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSED(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, -#define EVT_TREE_ITEM_COLLAPSING(id, fn) { wxEVT_COMMAND_TREE_ITEM_COLLAPSING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, - -// GetOldItem() is the item which had the selection previously, GetItem() is -// the item which acquires selection -#define EVT_TREE_SEL_CHANGED(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, -#define EVT_TREE_SEL_CHANGING(id, fn) { wxEVT_COMMAND_TREE_SEL_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, - -// GetCode() returns the key code -// NB: this is the only message for which GetItem() is invalid (you may get the -// item from GetSelection()) -#define EVT_TREE_KEY_DOWN(id, fn) { wxEVT_COMMAND_TREE_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, - -// GetItem() returns the item being deleted, the associated data (if any) will -// be deleted just after the return of this event handler (if any) -#define EVT_TREE_DELETE_ITEM(id, fn) { wxEVT_COMMAND_TREE_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, (wxObject *) NULL }, - -// GetItem() returns the item that was activated (double click, enter, space) -#define EVT_TREE_ITEM_ACTIVATED(id, fn) { wxEVT_COMMAND_TREE_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, - -// GetItem() returns the item that was clicked on -#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) { wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, -#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) { wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxTreeEventFunction) & fn, NULL }, +#if !defined(__WXMSW__) +#define wxTreeCtrl wxGenericTreeCtrl +#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl +#endif #endif // _WX_TREECTRL_H_BASE_ diff --git a/samples/treectrl/treectrl.cpp b/samples/treectrl/treectrl.cpp index 0ae0d46847..cb30f162d0 100644 --- a/samples/treectrl/treectrl.cpp +++ b/samples/treectrl/treectrl.cpp @@ -98,7 +98,11 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) EVT_MENU(TreeTest_ToggleIcon, MyFrame::OnToggleIcon) END_EVENT_TABLE() +#if USE_GENERIC_TREECTRL +BEGIN_EVENT_TABLE(MyTreeCtrl, wxGenericTreeCtrl) +#else BEGIN_EVENT_TABLE(MyTreeCtrl, wxTreeCtrl) +#endif EVT_TREE_BEGIN_DRAG(TreeTest_Ctrl, MyTreeCtrl::OnBeginDrag) EVT_TREE_BEGIN_RDRAG(TreeTest_Ctrl, MyTreeCtrl::OnBeginRDrag) EVT_TREE_END_DRAG(TreeTest_Ctrl, MyTreeCtrl::OnEndDrag) @@ -513,7 +517,11 @@ void MyFrame::OnToggleIcon(wxCommandEvent& WXUNUSED(event)) } // MyTreeCtrl implementation +#if USE_GENERIC_TREECTRL +IMPLEMENT_DYNAMIC_CLASS(MyTreeCtrl, wxGenericTreeCtrl) +#else IMPLEMENT_DYNAMIC_CLASS(MyTreeCtrl, wxTreeCtrl) +#endif MyTreeCtrl::MyTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, diff --git a/samples/treectrl/treectrl.h b/samples/treectrl/treectrl.h index 6a6dc6702f..fc3d5931b3 100644 --- a/samples/treectrl/treectrl.h +++ b/samples/treectrl/treectrl.h @@ -9,6 +9,16 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +#define USE_GENERIC_TREECTRL 0 + +#if USE_GENERIC_TREECTRL +#include "wx/generic/treectlg.h" +#ifndef wxTreeCtrl +#define wxTreeCtrl wxGenericTreeCtrl +#define sm_classwxTreeCtrl sm_classwxGenericTreeCtrl +#endif +#endif + // Define a new application type class MyApp : public wxApp { diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp new file mode 100644 index 0000000000..3925dcfcff --- /dev/null +++ b/src/common/treebase.cpp @@ -0,0 +1,53 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: treebase.cpp +// Purpose: Base wxTreeCtrl classes +// Author: Julian Smart +// Created: 01/02/97 +// Modified: +// Id: $Id$ +// Copyright: (c) 1998 Robert Roebling, Julian Smart et al +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================= +// declarations +// ============================================================================= + +// ----------------------------------------------------------------------------- +// headers +// ----------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "treebase.h" +#endif + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop +#endif + +#include "wx/treebase.h" +#include "wx/settings.h" +#include "wx/log.h" +#include "wx/intl.h" +#include "wx/dynarray.h" +#include "wx/arrimpl.cpp" +#include "wx/dcclient.h" +#include "wx/msgdlg.h" + +// ---------------------------------------------------------------------------- +// Tree event +// ---------------------------------------------------------------------------- + +IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent) + +wxTreeEvent::wxTreeEvent(wxEventType commandType, int id) + : wxNotifyEvent(commandType, id) +{ + m_code = 0; + m_itemOld = 0; +} + + diff --git a/src/gtk/files.lst b/src/gtk/files.lst index e0b5213fa2..f09570863b 100644 --- a/src/gtk/files.lst +++ b/src/gtk/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 17:10, 2000/07/27 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T! ALL_SOURCES = \ generic/busyinfo.cpp \ @@ -32,13 +32,14 @@ ALL_SOURCES = \ generic/proplist.cpp \ generic/sashwin.cpp \ generic/scrolwin.cpp \ + generic/splash.cpp \ generic/splitter.cpp \ generic/statusbr.cpp \ generic/tabg.cpp \ generic/tbarsmpl.cpp \ generic/textdlgg.cpp \ generic/tipdlg.cpp \ - generic/treectrl.cpp \ + generic/treectlg.cpp \ generic/treelay.cpp \ generic/wizard.cpp \ common/appcmn.cpp \ @@ -61,6 +62,7 @@ ALL_SOURCES = \ common/docview.cpp \ common/dynarray.cpp \ common/dynlib.cpp \ + common/effects.cpp \ common/encconv.cpp \ common/event.cpp \ common/extended.c \ @@ -109,6 +111,7 @@ ALL_SOURCES = \ common/prntbase.cpp \ common/process.cpp \ common/protocol.cpp \ + common/quantize.cpp \ common/resource.cpp \ common/sckaddr.cpp \ common/sckfile.cpp \ @@ -125,6 +128,7 @@ ALL_SOURCES = \ common/textfile.cpp \ common/timercmn.cpp \ common/tokenzr.cpp \ + common/treebase.cpp \ common/txtstrm.cpp \ common/unzip.c \ common/url.cpp \ @@ -410,6 +414,7 @@ ALL_HEADERS = \ tokenzr.h \ toolbar.h \ tooltip.h \ + treebase.h \ treectrl.h \ txtstrm.h \ types.h \ @@ -527,7 +532,7 @@ ALL_HEADERS = \ generic/statusbr.h \ generic/tabg.h \ generic/textdlgg.h \ - generic/treectrl.h \ + generic/treectlg.h \ generic/wizard.h \ unix/execute.h \ unix/fontutil.h \ @@ -573,6 +578,7 @@ COMMONOBJS = \ docview.o \ dynarray.o \ dynlib.o \ + effects.o \ encconv.o \ event.o \ extended.o \ @@ -621,6 +627,7 @@ COMMONOBJS = \ prntbase.o \ process.o \ protocol.o \ + quantize.o \ resource.o \ sckaddr.o \ sckfile.o \ @@ -637,6 +644,7 @@ COMMONOBJS = \ textfile.o \ timercmn.o \ tokenzr.o \ + treebase.o \ txtstrm.o \ unzip.o \ url.o \ @@ -674,6 +682,7 @@ COMMONDEPS = \ docview.d \ dynarray.d \ dynlib.d \ + effects.d \ encconv.d \ event.d \ extended.d \ @@ -722,6 +731,7 @@ COMMONDEPS = \ prntbase.d \ process.d \ protocol.d \ + quantize.d \ resource.d \ sckaddr.d \ sckfile.d \ @@ -738,6 +748,7 @@ COMMONDEPS = \ textfile.d \ timercmn.d \ tokenzr.d \ + treebase.d \ txtstrm.d \ unzip.d \ url.d \ @@ -785,13 +796,14 @@ GENERICOBJS = \ proplist.o \ sashwin.o \ scrolwin.o \ + splash.o \ splitter.o \ statusbr.o \ tabg.o \ tbarsmpl.o \ textdlgg.o \ tipdlg.o \ - treectrl.o \ + treectlg.o \ treelay.o \ wizard.o @@ -827,13 +839,14 @@ GENERICDEPS = \ proplist.d \ sashwin.d \ scrolwin.d \ + splash.d \ splitter.d \ statusbr.d \ tabg.d \ tbarsmpl.d \ textdlgg.d \ tipdlg.d \ - treectrl.d \ + treectlg.d \ treelay.d \ wizard.d diff --git a/src/gtk1/files.lst b/src/gtk1/files.lst index e0b5213fa2..f09570863b 100644 --- a/src/gtk1/files.lst +++ b/src/gtk1/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 17:10, 2000/07/27 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE GTK.T! ALL_SOURCES = \ generic/busyinfo.cpp \ @@ -32,13 +32,14 @@ ALL_SOURCES = \ generic/proplist.cpp \ generic/sashwin.cpp \ generic/scrolwin.cpp \ + generic/splash.cpp \ generic/splitter.cpp \ generic/statusbr.cpp \ generic/tabg.cpp \ generic/tbarsmpl.cpp \ generic/textdlgg.cpp \ generic/tipdlg.cpp \ - generic/treectrl.cpp \ + generic/treectlg.cpp \ generic/treelay.cpp \ generic/wizard.cpp \ common/appcmn.cpp \ @@ -61,6 +62,7 @@ ALL_SOURCES = \ common/docview.cpp \ common/dynarray.cpp \ common/dynlib.cpp \ + common/effects.cpp \ common/encconv.cpp \ common/event.cpp \ common/extended.c \ @@ -109,6 +111,7 @@ ALL_SOURCES = \ common/prntbase.cpp \ common/process.cpp \ common/protocol.cpp \ + common/quantize.cpp \ common/resource.cpp \ common/sckaddr.cpp \ common/sckfile.cpp \ @@ -125,6 +128,7 @@ ALL_SOURCES = \ common/textfile.cpp \ common/timercmn.cpp \ common/tokenzr.cpp \ + common/treebase.cpp \ common/txtstrm.cpp \ common/unzip.c \ common/url.cpp \ @@ -410,6 +414,7 @@ ALL_HEADERS = \ tokenzr.h \ toolbar.h \ tooltip.h \ + treebase.h \ treectrl.h \ txtstrm.h \ types.h \ @@ -527,7 +532,7 @@ ALL_HEADERS = \ generic/statusbr.h \ generic/tabg.h \ generic/textdlgg.h \ - generic/treectrl.h \ + generic/treectlg.h \ generic/wizard.h \ unix/execute.h \ unix/fontutil.h \ @@ -573,6 +578,7 @@ COMMONOBJS = \ docview.o \ dynarray.o \ dynlib.o \ + effects.o \ encconv.o \ event.o \ extended.o \ @@ -621,6 +627,7 @@ COMMONOBJS = \ prntbase.o \ process.o \ protocol.o \ + quantize.o \ resource.o \ sckaddr.o \ sckfile.o \ @@ -637,6 +644,7 @@ COMMONOBJS = \ textfile.o \ timercmn.o \ tokenzr.o \ + treebase.o \ txtstrm.o \ unzip.o \ url.o \ @@ -674,6 +682,7 @@ COMMONDEPS = \ docview.d \ dynarray.d \ dynlib.d \ + effects.d \ encconv.d \ event.d \ extended.d \ @@ -722,6 +731,7 @@ COMMONDEPS = \ prntbase.d \ process.d \ protocol.d \ + quantize.d \ resource.d \ sckaddr.d \ sckfile.d \ @@ -738,6 +748,7 @@ COMMONDEPS = \ textfile.d \ timercmn.d \ tokenzr.d \ + treebase.d \ txtstrm.d \ unzip.d \ url.d \ @@ -785,13 +796,14 @@ GENERICOBJS = \ proplist.o \ sashwin.o \ scrolwin.o \ + splash.o \ splitter.o \ statusbr.o \ tabg.o \ tbarsmpl.o \ textdlgg.o \ tipdlg.o \ - treectrl.o \ + treectlg.o \ treelay.o \ wizard.o @@ -827,13 +839,14 @@ GENERICDEPS = \ proplist.d \ sashwin.d \ scrolwin.d \ + splash.d \ splitter.d \ statusbr.d \ tabg.d \ tbarsmpl.d \ textdlgg.d \ tipdlg.d \ - treectrl.d \ + treectlg.d \ treelay.d \ wizard.d diff --git a/src/motif/files.lst b/src/motif/files.lst index bb16896e92..31fe9594dc 100644 --- a/src/motif/files.lst +++ b/src/motif/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 17:13, 2000/07/27 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE MOTIF.T! ALL_SOURCES = \ generic/busyinfo.cpp \ @@ -34,6 +34,7 @@ ALL_SOURCES = \ generic/proplist.cpp \ generic/sashwin.cpp \ generic/scrolwin.cpp \ + generic/splash.cpp \ generic/splitter.cpp \ generic/statline.cpp \ generic/statusbr.cpp \ @@ -41,7 +42,7 @@ ALL_SOURCES = \ generic/tbarsmpl.cpp \ generic/textdlgg.cpp \ generic/tipdlg.cpp \ - generic/treectrl.cpp \ + generic/treectlg.cpp \ generic/treelay.cpp \ generic/wizard.cpp \ common/appcmn.cpp \ @@ -64,6 +65,7 @@ ALL_SOURCES = \ common/docview.cpp \ common/dynarray.cpp \ common/dynlib.cpp \ + common/effects.cpp \ common/encconv.cpp \ common/event.cpp \ common/extended.c \ @@ -112,6 +114,7 @@ ALL_SOURCES = \ common/prntbase.cpp \ common/process.cpp \ common/protocol.cpp \ + common/quantize.cpp \ common/resource.cpp \ common/sckaddr.cpp \ common/sckfile.cpp \ @@ -128,6 +131,7 @@ ALL_SOURCES = \ common/textfile.cpp \ common/timercmn.cpp \ common/tokenzr.cpp \ + common/treebase.cpp \ common/txtstrm.cpp \ common/unzip.c \ common/url.cpp \ @@ -407,6 +411,7 @@ ALL_HEADERS = \ tokenzr.h \ toolbar.h \ tooltip.h \ + treebase.h \ treectrl.h \ txtstrm.h \ types.h \ @@ -524,7 +529,7 @@ ALL_HEADERS = \ generic/statusbr.h \ generic/tabg.h \ generic/textdlgg.h \ - generic/treectrl.h \ + generic/treectlg.h \ generic/wizard.h \ unix/execute.h \ unix/fontutil.h \ @@ -570,6 +575,7 @@ COMMONOBJS = \ docview.o \ dynarray.o \ dynlib.o \ + effects.o \ encconv.o \ event.o \ extended.o \ @@ -618,6 +624,7 @@ COMMONOBJS = \ prntbase.o \ process.o \ protocol.o \ + quantize.o \ resource.o \ sckaddr.o \ sckfile.o \ @@ -634,6 +641,7 @@ COMMONOBJS = \ textfile.o \ timercmn.o \ tokenzr.o \ + treebase.o \ txtstrm.o \ unzip.o \ url.o \ @@ -671,6 +679,7 @@ COMMONDEPS = \ docview.d \ dynarray.d \ dynlib.d \ + effects.d \ encconv.d \ event.d \ extended.d \ @@ -719,6 +728,7 @@ COMMONDEPS = \ prntbase.d \ process.d \ protocol.d \ + quantize.d \ resource.d \ sckaddr.d \ sckfile.d \ @@ -735,6 +745,7 @@ COMMONDEPS = \ textfile.d \ timercmn.d \ tokenzr.d \ + treebase.d \ txtstrm.d \ unzip.d \ url.d \ @@ -784,6 +795,7 @@ GENERICOBJS = \ proplist.o \ sashwin.o \ scrolwin.o \ + splash.o \ splitter.o \ statline.o \ statusbr.o \ @@ -791,7 +803,7 @@ GENERICOBJS = \ tbarsmpl.o \ textdlgg.o \ tipdlg.o \ - treectrl.o \ + treectlg.o \ treelay.o \ wizard.o @@ -829,6 +841,7 @@ GENERICDEPS = \ proplist.d \ sashwin.d \ scrolwin.d \ + splash.d \ splitter.d \ statline.d \ statusbr.d \ @@ -836,7 +849,7 @@ GENERICDEPS = \ tbarsmpl.d \ textdlgg.d \ tipdlg.d \ - treectrl.d \ + treectlg.d \ treelay.d \ wizard.d diff --git a/src/msw/makefile.b32 b/src/msw/makefile.b32 index eb6ddc589c..0e2ee37e3a 100644 --- a/src/msw/makefile.b32 +++ b/src/msw/makefile.b32 @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 09:26, 2000/06/19 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE B32.T! # @@ -81,6 +81,7 @@ DOCDIR = $(WXDIR)\docs GENERICOBJS= $(MSWDIR)\busyinfo.obj \ $(MSWDIR)\calctrl.obj \ $(MSWDIR)\choicdgg.obj \ + $(MSWDIR)\dirctrlg.obj \ $(MSWDIR)\dragimgg.obj \ $(MSWDIR)\grid.obj \ $(MSWDIR)\gridsel.obj \ @@ -95,6 +96,7 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \ $(MSWDIR)\proplist.obj \ $(MSWDIR)\sashwin.obj \ $(MSWDIR)\scrolwin.obj \ + $(MSWDIR)\splash.obj \ $(MSWDIR)\splitter.obj \ $(MSWDIR)\statusbr.obj \ $(MSWDIR)\tabg.obj \ @@ -137,6 +139,7 @@ COMMONOBJS = \ $(MSWDIR)\docview.obj \ $(MSWDIR)\dynarray.obj \ $(MSWDIR)\dynlib.obj \ + $(MSWDIR)\effects.obj \ $(MSWDIR)\encconv.obj \ $(MSWDIR)\event.obj \ $(MSWDIR)\extended.obj \ @@ -186,6 +189,7 @@ COMMONOBJS = \ $(MSWDIR)\prntbase.obj \ $(MSWDIR)\process.obj \ $(MSWDIR)\protocol.obj \ + $(MSWDIR)\quantize.obj \ $(MSWDIR)\resource.obj \ $(MSWDIR)\sckaddr.obj \ $(MSWDIR)\sckfile.obj \ @@ -202,6 +206,7 @@ COMMONOBJS = \ $(MSWDIR)\textfile.obj \ $(MSWDIR)\timercmn.obj \ $(MSWDIR)\tokenzr.obj \ + $(MSWDIR)\treebase.obj \ $(MSWDIR)\txtstrm.obj \ $(MSWDIR)\unzip.obj \ $(MSWDIR)\url.obj \ @@ -636,6 +641,8 @@ $(MSWDIR)\dynarray.obj: $(COMMDIR)\dynarray.$(SRCSUFF) $(MSWDIR)\dynlib.obj: $(COMMDIR)\dynlib.$(SRCSUFF) +$(MSWDIR)\effects.obj: $(COMMDIR)\effects.$(SRCSUFF) + $(MSWDIR)\encconv.obj: $(COMMDIR)\encconv.$(SRCSUFF) $(MSWDIR)\event.obj: $(COMMDIR)\event.$(SRCSUFF) @@ -734,6 +741,8 @@ $(MSWDIR)\process.obj: $(COMMDIR)\process.$(SRCSUFF) $(MSWDIR)\protocol.obj: $(COMMDIR)\protocol.$(SRCSUFF) +$(MSWDIR)\quantize.obj: $(COMMDIR)\quantize.$(SRCSUFF) + $(MSWDIR)\resource.obj: $(COMMDIR)\resource.$(SRCSUFF) $(MSWDIR)\sckaddr.obj: $(COMMDIR)\sckaddr.$(SRCSUFF) @@ -766,6 +775,8 @@ $(MSWDIR)\timercmn.obj: $(COMMDIR)\timercmn.$(SRCSUFF) $(MSWDIR)\tokenzr.obj: $(COMMDIR)\tokenzr.$(SRCSUFF) +$(MSWDIR)\treebase.obj: $(COMMDIR)\treebase.$(SRCSUFF) + $(MSWDIR)\txtstrm.obj: $(COMMDIR)\txtstrm.$(SRCSUFF) $(MSWDIR)\unzip.obj: $(COMMDIR)\unzip.c @@ -806,6 +817,8 @@ $(MSWDIR)\calctrl.obj: $(GENDIR)\calctrl.$(SRCSUFF) $(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF) +$(MSWDIR)\dirctrlg.obj: $(GENDIR)\dirctrlg.$(SRCSUFF) + $(MSWDIR)\dragimgg.obj: $(GENDIR)\dragimgg.$(SRCSUFF) $(MSWDIR)\grid.obj: $(GENDIR)\grid.$(SRCSUFF) @@ -834,6 +847,8 @@ $(MSWDIR)\sashwin.obj: $(GENDIR)\sashwin.$(SRCSUFF) $(MSWDIR)\scrolwin.obj: $(GENDIR)\scrolwin.$(SRCSUFF) +$(MSWDIR)\splash.obj: $(GENDIR)\splash.$(SRCSUFF) + $(MSWDIR)\splitter.obj: $(GENDIR)\splitter.$(SRCSUFF) $(MSWDIR)\statusbr.obj: $(GENDIR)\statusbr.$(SRCSUFF) diff --git a/src/msw/makefile.bcc b/src/msw/makefile.bcc index f45b412eaf..e3929fa7f9 100644 --- a/src/msw/makefile.bcc +++ b/src/msw/makefile.bcc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 20:13, 2000/03/31 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE BCC.T! # @@ -76,6 +76,7 @@ DOCDIR = $(WXDIR)\docs GENERICOBJS= $(MSWDIR)\busyinfo.obj \ $(MSWDIR)\calctrl.obj \ $(MSWDIR)\choicdgg.obj \ + $(MSWDIR)\dirctrlg.obj \ $(MSWDIR)\dirdlgg.obj \ $(MSWDIR)\dragimgg.obj \ $(MSWDIR)\grid.obj \ @@ -95,13 +96,14 @@ GENERICOBJS= $(MSWDIR)\busyinfo.obj \ $(MSWDIR)\proplist.obj \ $(MSWDIR)\sashwin.obj \ $(MSWDIR)\scrolwin.obj \ + $(MSWDIR)\splash.obj \ $(MSWDIR)\splitter.obj \ $(MSWDIR)\statusbr.obj \ $(MSWDIR)\tabg.obj \ $(MSWDIR)\tbarsmpl.obj \ $(MSWDIR)\textdlgg.obj \ $(MSWDIR)\tipdlg.obj \ - $(MSWDIR)\treectrl.obj \ + $(MSWDIR)\treectlg.obj \ $(MSWDIR)\treelay.obj \ $(MSWDIR)\wizard.obj @@ -127,6 +129,7 @@ COMMONOBJS = \ $(MSWDIR)\docview.obj \ $(MSWDIR)\dynarray.obj \ $(MSWDIR)\dynlib.obj \ + $(MSWDIR)\effects.obj \ $(MSWDIR)\encconv.obj \ $(MSWDIR)\event.obj \ $(MSWDIR)\extended.obj \ @@ -165,6 +168,7 @@ COMMONOBJS = \ $(MSWDIR)\objstrm.obj \ $(MSWDIR)\paper.obj \ $(MSWDIR)\prntbase.obj \ + $(MSWDIR)\quantize.obj \ $(MSWDIR)\resource.obj \ $(MSWDIR)\serbase.obj \ $(MSWDIR)\sizer.obj \ @@ -176,6 +180,7 @@ COMMONOBJS = \ $(MSWDIR)\textfile.obj \ $(MSWDIR)\timercmn.obj \ $(MSWDIR)\tokenzr.obj \ + $(MSWDIR)\treebase.obj \ $(MSWDIR)\txtstrm.obj \ $(MSWDIR)\unzip.obj \ $(MSWDIR)\utilscmn.obj \ @@ -515,6 +520,8 @@ $(MSWDIR)\dynarray.obj: $(COMMDIR)\dynarray.$(SRCSUFF) $(MSWDIR)\dynlib.obj: $(COMMDIR)\dynlib.$(SRCSUFF) +$(MSWDIR)\effects.obj: $(COMMDIR)\effects.$(SRCSUFF) + $(MSWDIR)\encconv.obj: $(COMMDIR)\encconv.$(SRCSUFF) $(MSWDIR)\event.obj: $(COMMDIR)\event.$(SRCSUFF) @@ -591,6 +598,8 @@ $(MSWDIR)\paper.obj: $(COMMDIR)\paper.$(SRCSUFF) $(MSWDIR)\prntbase.obj: $(COMMDIR)\prntbase.$(SRCSUFF) +$(MSWDIR)\quantize.obj: $(COMMDIR)\quantize.$(SRCSUFF) + $(MSWDIR)\resource.obj: $(COMMDIR)\resource.$(SRCSUFF) $(MSWDIR)\serbase.obj: $(COMMDIR)\serbase.$(SRCSUFF) @@ -613,6 +622,8 @@ $(MSWDIR)\timercmn.obj: $(COMMDIR)\timercmn.$(SRCSUFF) $(MSWDIR)\tokenzr.obj: $(COMMDIR)\tokenzr.$(SRCSUFF) +$(MSWDIR)\treebase.obj: $(COMMDIR)\treebase.$(SRCSUFF) + $(MSWDIR)\txtstrm.obj: $(COMMDIR)\txtstrm.$(SRCSUFF) $(MSWDIR)\unzip.obj: $(COMMDIR)\unzip.c @@ -653,6 +664,8 @@ $(MSWDIR)\calctrl.obj: $(GENDIR)\calctrl.$(SRCSUFF) $(MSWDIR)\choicdgg.obj: $(GENDIR)\choicdgg.$(SRCSUFF) +$(MSWDIR)\dirctrlg.obj: $(GENDIR)\dirctrlg.$(SRCSUFF) + $(MSWDIR)\dirdlgg.obj: $(GENDIR)\dirdlgg.$(SRCSUFF) $(MSWDIR)\dragimgg.obj: $(GENDIR)\dragimgg.$(SRCSUFF) @@ -691,6 +704,8 @@ $(MSWDIR)\sashwin.obj: $(GENDIR)\sashwin.$(SRCSUFF) $(MSWDIR)\scrolwin.obj: $(GENDIR)\scrolwin.$(SRCSUFF) +$(MSWDIR)\splash.obj: $(GENDIR)\splash.$(SRCSUFF) + $(MSWDIR)\splitter.obj: $(GENDIR)\splitter.$(SRCSUFF) $(MSWDIR)\statusbr.obj: $(GENDIR)\statusbr.$(SRCSUFF) @@ -703,7 +718,7 @@ $(MSWDIR)\textdlgg.obj: $(GENDIR)\textdlgg.$(SRCSUFF) $(MSWDIR)\tipdlg.obj: $(GENDIR)\tipdlg.$(SRCSUFF) -$(MSWDIR)\treectrl.obj: $(GENDIR)\treectrl.$(SRCSUFF) +$(MSWDIR)\treectlg.obj: $(GENDIR)\treectlg.$(SRCSUFF) $(MSWDIR)\treelay.obj: $(GENDIR)\treelay.$(SRCSUFF) diff --git a/src/msw/makefile.dos b/src/msw/makefile.dos index 8d399e3d49..8e5a133d13 100644 --- a/src/msw/makefile.dos +++ b/src/msw/makefile.dos @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 20:13, 2000/03/31 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE DOS.T! # @@ -60,6 +60,7 @@ MSWDIR=. GENERICOBJS= $(GENDIR)\busyinfo.obj \ $(GENDIR)\calctrl.obj \ $(GENDIR)\choicdgg.obj \ + $(GENDIR)\dirctrlg.obj \ $(GENDIR)\dirdlgg.obj \ $(GENDIR)\dragimgg.obj \ $(GENDIR)\grid.obj \ @@ -79,13 +80,14 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \ $(GENDIR)\proplist.obj \ $(GENDIR)\sashwin.obj \ $(GENDIR)\scrolwin.obj \ + $(GENDIR)\splash.obj \ $(GENDIR)\splitter.obj \ $(GENDIR)\statusbr.obj \ $(GENDIR)\tabg.obj \ $(GENDIR)\tbarsmpl.obj \ $(GENDIR)\textdlgg.obj \ $(GENDIR)\tipdlg.obj \ - $(GENDIR)\treectrl.obj \ + $(GENDIR)\treectlg.obj \ $(GENDIR)\treelay.obj \ $(GENDIR)\wizard.obj @@ -112,6 +114,7 @@ COMMONOBJS1 = \ $(COMMDIR)\docview.obj \ $(COMMDIR)\dynarray.obj \ $(COMMDIR)\dynlib.obj \ + $(COMMDIR)\effects.obj \ $(COMMDIR)\encconv.obj \ $(COMMDIR)\event.obj \ $(COMMDIR)\extended.obj \ @@ -153,6 +156,7 @@ COMMONOBJS1 = \ COMMONOBJS2 = \ $(COMMDIR)\paper.obj \ $(COMMDIR)\prntbase.obj \ + $(COMMDIR)\quantize.obj \ $(COMMDIR)\resource.obj \ $(COMMDIR)\serbase.obj \ $(COMMDIR)\sizer.obj \ @@ -164,6 +168,7 @@ COMMONOBJS2 = \ $(COMMDIR)\textfile.obj \ $(COMMDIR)\timercmn.obj \ $(COMMDIR)\tokenzr.obj \ + $(COMMDIR)\treebase.obj \ $(COMMDIR)\txtstrm.obj \ $(COMMDIR)\unzip.obj \ $(COMMDIR)\utilscmn.obj \ @@ -848,6 +853,11 @@ $(COMMDIR)/dynlib.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(COMMDIR)/effects.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(COMMDIR)/encconv.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -1043,6 +1053,11 @@ $(COMMDIR)/prntbase.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(COMMDIR)/quantize.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(COMMDIR)/resource.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -1098,6 +1113,11 @@ $(COMMDIR)/tokenzr.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(COMMDIR)/treebase.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(COMMDIR)/txtstrm.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -1178,6 +1198,11 @@ $(GENDIR)/choicdgg.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(GENDIR)/dirctrlg.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(GENDIR)/dirdlgg.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -1273,6 +1298,11 @@ $(GENDIR)/scrolwin.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << +$(GENDIR)/splash.obj: $*.$(SRCSUFF) + cl @<< +$(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) +<< + $(GENDIR)/splitter.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) @@ -1303,7 +1333,7 @@ $(GENDIR)/tipdlg.obj: $*.$(SRCSUFF) $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << -$(GENDIR)/treectrl.obj: $*.$(SRCSUFF) +$(GENDIR)/treectlg.obj: $*.$(SRCSUFF) cl @<< $(CPPFLAGS) /Fo$@ /c /Tp $*.$(SRCSUFF) << diff --git a/src/msw/makefile.g95 b/src/msw/makefile.g95 index 0748398440..449b21200b 100644 --- a/src/msw/makefile.g95 +++ b/src/msw/makefile.g95 @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 20:13, 2000/03/31 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE G95.T! # @@ -72,6 +72,7 @@ GENERICOBJS = \ $(GENDIR)/busyinfo.$(OBJSUFF) \ $(GENDIR)/calctrl.$(OBJSUFF) \ $(GENDIR)/choicdgg.$(OBJSUFF) \ + $(GENDIR)/dirctrlg.$(OBJSUFF) \ $(GENDIR)/dragimgg.$(OBJSUFF) \ $(GENDIR)/grid.$(OBJSUFF) \ $(GENDIR)/gridsel.$(OBJSUFF) \ @@ -86,8 +87,10 @@ GENERICOBJS = \ $(GENDIR)/proplist.$(OBJSUFF) \ $(GENDIR)/sashwin.$(OBJSUFF) \ $(GENDIR)/scrolwin.$(OBJSUFF) \ + $(GENDIR)/splash.$(OBJSUFF) \ $(GENDIR)/splitter.$(OBJSUFF) \ $(GENDIR)/statusbr.$(OBJSUFF) \ + $(GENDIR)/tabg.$(OBJSUFF) \ $(GENDIR)/tbarsmpl.$(OBJSUFF) \ $(GENDIR)/textdlgg.$(OBJSUFF) \ $(GENDIR)/tipdlg.$(OBJSUFF) \ @@ -116,6 +119,7 @@ COMMONOBJS = \ $(COMMDIR)/docview.$(OBJSUFF) \ $(COMMDIR)/dynarray.$(OBJSUFF) \ $(COMMDIR)/dynlib.$(OBJSUFF) \ + $(COMMDIR)/effects.$(OBJSUFF) \ $(COMMDIR)/encconv.$(OBJSUFF) \ $(COMMDIR)/event.$(OBJSUFF) \ $(COMMDIR)/extended.$(OBJSUFF) \ @@ -164,6 +168,7 @@ COMMONOBJS = \ $(COMMDIR)/prntbase.$(OBJSUFF) \ $(COMMDIR)/process.$(OBJSUFF) \ $(COMMDIR)/protocol.$(OBJSUFF) \ + $(COMMDIR)/quantize.$(OBJSUFF) \ $(COMMDIR)/resource.$(OBJSUFF) \ $(COMMDIR)/sckaddr.$(OBJSUFF) \ $(COMMDIR)/sckfile.$(OBJSUFF) \ @@ -180,6 +185,7 @@ COMMONOBJS = \ $(COMMDIR)/textfile.$(OBJSUFF) \ $(COMMDIR)/timercmn.$(OBJSUFF) \ $(COMMDIR)/tokenzr.$(OBJSUFF) \ + $(COMMDIR)/treebase.$(OBJSUFF) \ $(COMMDIR)/txtstrm.$(OBJSUFF) \ $(COMMDIR)/unzip.$(OBJSUFF) \ $(COMMDIR)/url.$(OBJSUFF) \ diff --git a/src/msw/makefile.sc b/src/msw/makefile.sc index 91fdd854c5..b98c93941b 100644 --- a/src/msw/makefile.sc +++ b/src/msw/makefile.sc @@ -1,6 +1,6 @@ -# This file was automatically generated by tmake at 20:13, 2000/03/31 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE SC.T! # Symantec C++ makefile for the msw objects @@ -29,6 +29,7 @@ MSWDIR=$(WXDIR)\src\msw GENERICOBJS= $(GENDIR)\busyinfo.obj \ $(GENDIR)\calctrl.obj \ $(GENDIR)\choicdgg.obj \ + $(GENDIR)\dirctrlg.obj \ $(GENDIR)\dragimgg.obj \ $(GENDIR)\grid.obj \ $(GENDIR)\gridsel.obj \ @@ -43,8 +44,10 @@ GENERICOBJS= $(GENDIR)\busyinfo.obj \ $(GENDIR)\proplist.obj \ $(GENDIR)\sashwin.obj \ $(GENDIR)\scrolwin.obj \ + $(GENDIR)\splash.obj \ $(GENDIR)\splitter.obj \ $(GENDIR)\statusbr.obj \ + $(GENDIR)\tabg.obj \ $(GENDIR)\tbarsmpl.obj \ $(GENDIR)\textdlgg.obj \ $(GENDIR)\tipdlg.obj \ @@ -73,6 +76,7 @@ COMMONOBJS = \ $(COMMDIR)\docview.obj \ $(COMMDIR)\dynarray.obj \ $(COMMDIR)\dynlib.obj \ + $(COMMDIR)\effects.obj \ $(COMMDIR)\encconv.obj \ $(COMMDIR)\event.obj \ $(COMMDIR)\extended.obj \ @@ -122,6 +126,7 @@ COMMONOBJS = \ $(COMMDIR)\prntbase.obj \ $(COMMDIR)\process.obj \ $(COMMDIR)\protocol.obj \ + $(COMMDIR)\quantize.obj \ $(COMMDIR)\resource.obj \ $(COMMDIR)\sckaddr.obj \ $(COMMDIR)\sckfile.obj \ @@ -138,6 +143,7 @@ COMMONOBJS = \ $(COMMDIR)\textfile.obj \ $(COMMDIR)\timercmn.obj \ $(COMMDIR)\tokenzr.obj \ + $(COMMDIR)\treebase.obj \ $(COMMDIR)\txtstrm.obj \ $(COMMDIR)\unzip.obj \ $(COMMDIR)\url.obj \ @@ -202,6 +208,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\glcanvas.obj \ $(MSWDIR)\gsocket.obj \ $(MSWDIR)\gsockmsw.obj \ + $(MSWDIR)\helpchm.obj \ $(MSWDIR)\helpwin.obj \ $(MSWDIR)\icon.obj \ $(MSWDIR)\iniconf.obj \ @@ -246,6 +253,7 @@ MSWOBJS = $(MSWDIR)\accel.obj \ $(MSWDIR)\thread.obj \ $(MSWDIR)\timer.obj \ $(MSWDIR)\tooltip.obj \ + $(MSWDIR)\treectrl.obj \ $(MSWDIR)\utils.obj \ $(MSWDIR)\utilsexc.obj \ $(MSWDIR)\ole\uuid.obj \ diff --git a/src/msw/makefile.vc b/src/msw/makefile.vc index 5ebec70f68..107fe650f1 100644 --- a/src/msw/makefile.vc +++ b/src/msw/makefile.vc @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 10:46, 2000/04/27 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE VC.T! # File: makefile.vc @@ -27,6 +27,9 @@ LIBTARGET=$(WXLIB) DUMMYOBJ=$D\dummy.obj !endif +# Please set these according to the settings in setup.h, so we can include +# the appropriate libraries in wx.lib + # This one overrides the others, to be consistent with the settings in setup.h MINIMAL_WXWINDOWS_SETUP=0 @@ -34,9 +37,6 @@ PERIPH_LIBS= PERIPH_TARGET= PERIPH_CLEAN_TARGET= -# Set to 0 if not using GLCanvas (only affects DLL build) -USE_GLCANVAS=1 - # 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 @@ -101,6 +101,7 @@ GENERICOBJS= ..\generic\$D\busyinfo.obj \ ..\generic\$D\proplist.obj \ ..\generic\$D\sashwin.obj \ ..\generic\$D\scrolwin.obj \ + ..\generic\$D\splash.obj \ ..\generic\$D\splitter.obj \ ..\generic\$D\statusbr.obj \ ..\generic\$D\tabg.obj \ @@ -129,7 +130,7 @@ NONESSENTIALOBJS= ..\generic\$D\caret.obj \ ..\generic\$D\printps.obj \ ..\generic\$D\prntdlgg.obj \ ..\generic\$D\statline.obj \ - ..\generic\$D\treectrl.obj + ..\generic\$D\treectlg.obj COMMONOBJS = \ ..\common\$D\y_tab.obj \ @@ -153,6 +154,7 @@ COMMONOBJS = \ ..\common\$D\docview.obj \ ..\common\$D\dynarray.obj \ ..\common\$D\dynlib.obj \ + ..\common\$D\effects.obj \ ..\common\$D\encconv.obj \ ..\common\$D\event.obj \ ..\common\$D\extended.obj \ @@ -202,6 +204,7 @@ COMMONOBJS = \ ..\common\$D\prntbase.obj \ ..\common\$D\process.obj \ ..\common\$D\protocol.obj \ + ..\common\$D\quantize.obj \ ..\common\$D\resource.obj \ ..\common\$D\sckaddr.obj \ ..\common\$D\sckfile.obj \ @@ -218,6 +221,7 @@ COMMONOBJS = \ ..\common\$D\textfile.obj \ ..\common\$D\timercmn.obj \ ..\common\$D\tokenzr.obj \ + ..\common\$D\treebase.obj \ ..\common\$D\txtstrm.obj \ ..\common\$D\unzip.obj \ ..\common\$D\url.obj \ diff --git a/src/msw/makefile.wat b/src/msw/makefile.wat index 2a31747017..10b8d512e7 100644 --- a/src/msw/makefile.wat +++ b/src/msw/makefile.wat @@ -1,6 +1,6 @@ #!/binb/wmake.exe -# This file was automatically generated by tmake at 11:50, 2000/06/26 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE WAT.T! # @@ -44,6 +44,7 @@ DOCDIR = $(WXDIR)\docs GENERICOBJS= busyinfo.obj & calctrl.obj & choicdgg.obj & + dirctrlg.obj & dragimgg.obj & grid.obj & gridsel.obj & @@ -58,6 +59,7 @@ GENERICOBJS= busyinfo.obj & proplist.obj & sashwin.obj & scrolwin.obj & + splash.obj & splitter.obj & statusbr.obj & tabg.obj & @@ -86,7 +88,7 @@ NONESSENTIALOBJS= caret.obj & printps.obj & prntdlgg.obj & statline.obj & - treectrl.obj + treectlg.obj COMMONOBJS = & y_tab.obj & @@ -110,6 +112,7 @@ COMMONOBJS = & docview.obj & dynarray.obj & dynlib.obj & + effects.obj & encconv.obj & event.obj & extended.obj & @@ -159,6 +162,7 @@ COMMONOBJS = & prntbase.obj & process.obj & protocol.obj & + quantize.obj & resource.obj & sckaddr.obj & sckfile.obj & @@ -175,6 +179,7 @@ COMMONOBJS = & textfile.obj & timercmn.obj & tokenzr.obj & + treebase.obj & txtstrm.obj & unzip.obj & url.obj & @@ -701,6 +706,9 @@ dynarray.obj: $(COMMDIR)\dynarray.cpp dynlib.obj: $(COMMDIR)\dynlib.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +effects.obj: $(COMMDIR)\effects.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + encconv.obj: $(COMMDIR)\encconv.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< @@ -848,6 +856,9 @@ process.obj: $(COMMDIR)\process.cpp protocol.obj: $(COMMDIR)\protocol.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +quantize.obj: $(COMMDIR)\quantize.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + resource.obj: $(COMMDIR)\resource.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< @@ -896,6 +907,9 @@ timercmn.obj: $(COMMDIR)\timercmn.cpp tokenzr.obj: $(COMMDIR)\tokenzr.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +treebase.obj: $(COMMDIR)\treebase.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + txtstrm.obj: $(COMMDIR)\txtstrm.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< @@ -964,6 +978,9 @@ calctrl.obj: $(GENDIR)\calctrl.cpp choicdgg.obj: $(GENDIR)\choicdgg.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +dirctrlg.obj: $(GENDIR)\dirctrlg.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + dragimgg.obj: $(GENDIR)\dragimgg.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< @@ -1006,6 +1023,9 @@ sashwin.obj: $(GENDIR)\sashwin.cpp scrolwin.obj: $(GENDIR)\scrolwin.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< +splash.obj: $(GENDIR)\splash.cpp + *$(CCC) $(CPPFLAGS) $(IFLAGS) $< + splitter.obj: $(GENDIR)\splitter.cpp *$(CCC) $(CPPFLAGS) $(IFLAGS) $< diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 0d54480eb5..24ead62f4f 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -46,9 +46,8 @@ #include "wx/log.h" #include "wx/dynarray.h" #include "wx/imaglist.h" -#include "wx/treectrl.h" #include "wx/settings.h" - +#include "wx/msw/treectrl.h" #include "wx/msw/dragimag.h" #ifdef __GNUWIN32_OLD__ @@ -2257,6 +2256,11 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) delete data; // can't be NULL here m_itemsWithIndirectData.Remove(item); +#if 0 + int iIndex = m_itemsWithIndirectData.Index(item); + wxASSERT( iIndex != wxNOT_FOUND) ; + m_itemsWithIndirectData.wxBaseArray::RemoveAt((size_t)iIndex); +#endif } else { @@ -2326,18 +2330,5 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) return processed; } -// ---------------------------------------------------------------------------- -// Tree event -// ---------------------------------------------------------------------------- - -IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent) - -wxTreeEvent::wxTreeEvent(wxEventType commandType, int id) - : wxNotifyEvent(commandType, id) -{ - m_code = 0; - m_itemOld = 0; -} - #endif // __WIN95__ diff --git a/src/os2/files.lst b/src/os2/files.lst index 348b16a697..a0017bd78b 100644 --- a/src/os2/files.lst +++ b/src/os2/files.lst @@ -1,4 +1,4 @@ -# This file was automatically generated by tmake at 01:34, 2000/03/05 +# This file was automatically generated by tmake at 15:57, 2000/08/04 # DO NOT CHANGE THIS FILE, YOUR CHANGES WILL BE LOST! CHANGE OS2.T! ALL_SOURCES = \ generic/busyinfo.cpp \ @@ -7,6 +7,7 @@ ALL_SOURCES = \ generic/choicdgg.cpp \ generic/colrdlgg.cpp \ generic/dcpsg.cpp \ + generic/dirctrlg.cpp \ generic/grid.cpp \ generic/gridsel.cpp \ generic/helpext.cpp \ @@ -29,12 +30,13 @@ ALL_SOURCES = \ generic/proplist.cpp \ generic/sashwin.cpp \ generic/scrolwin.cpp \ + generic/splash.cpp \ generic/splitter.cpp \ generic/statusbr.cpp \ generic/tbarsmpl.cpp \ generic/textdlgg.cpp \ generic/tipdlg.cpp \ - generic/treectrl.cpp \ + generic/treectlg.cpp \ generic/treelay.cpp \ generic/wizard.cpp \ common/appcmn.cpp \ @@ -57,6 +59,7 @@ ALL_SOURCES = \ common/docview.cpp \ common/dynarray.cpp \ common/dynlib.cpp \ + common/effects.cpp \ common/encconv.cpp \ common/event.cpp \ common/extended.c \ @@ -105,6 +108,7 @@ ALL_SOURCES = \ common/prntbase.cpp \ common/process.cpp \ common/protocol.cpp \ + common/quantize.cpp \ common/resource.cpp \ common/sckaddr.cpp \ common/sckfile.cpp \ @@ -121,6 +125,7 @@ ALL_SOURCES = \ common/textfile.cpp \ common/timercmn.cpp \ common/tokenzr.cpp \ + common/treebase.cpp \ common/txtstrm.cpp \ common/unzip.c \ common/url.cpp \ @@ -297,6 +302,7 @@ ALL_HEADERS = \ filesys.h \ font.h \ fontdlg.h \ + fontenc.h \ fontenum.h \ fontmap.h \ fontutil.h \ @@ -315,6 +321,7 @@ ALL_HEADERS = \ hash.h \ help.h \ helpbase.h \ + helpchm.h \ helphtml.h \ helpwin.h \ helpxlp.h \ @@ -414,6 +421,7 @@ ALL_HEADERS = \ tokenzr.h \ toolbar.h \ tooltip.h \ + treebase.h \ treectrl.h \ txtstrm.h \ types.h \ @@ -516,6 +524,7 @@ ALL_HEADERS = \ generic/choicdgg.h \ generic/colrdlgg.h \ generic/dcpsg.h \ + generic/dirctrlg.h \ generic/dirdlgg.h \ generic/dragimgg.h \ generic/filedlgg.h \ @@ -542,7 +551,7 @@ ALL_HEADERS = \ generic/statusbr.h \ generic/tabg.h \ generic/textdlgg.h \ - generic/treectrl.h \ + generic/treectlg.h \ generic/wizard.h \ html/forcelnk.h \ html/helpctrl.h \ @@ -584,6 +593,7 @@ COMMONOBJS = \ docview.o \ dynarray.o \ dynlib.o \ + effects.o \ encconv.o \ event.o \ extended.o \ @@ -632,6 +642,7 @@ COMMONOBJS = \ prntbase.o \ process.o \ protocol.o \ + quantize.o \ resource.o \ sckaddr.o \ sckfile.o \ @@ -648,6 +659,7 @@ COMMONOBJS = \ textfile.o \ timercmn.o \ tokenzr.o \ + treebase.o \ txtstrm.o \ unzip.o \ url.o \ @@ -685,6 +697,7 @@ COMMONDEPS = \ docview.d \ dynarray.d \ dynlib.d \ + effects.d \ encconv.d \ event.d \ extended.d \ @@ -733,6 +746,7 @@ COMMONDEPS = \ prntbase.d \ process.d \ protocol.d \ + quantize.d \ resource.d \ sckaddr.d \ sckfile.d \ @@ -749,6 +763,7 @@ COMMONDEPS = \ textfile.d \ timercmn.d \ tokenzr.d \ + treebase.d \ txtstrm.d \ unzip.d \ url.d \ @@ -771,6 +786,7 @@ GENERICOBJS = \ choicdgg.o \ colrdlgg.o \ dcpsg.o \ + dirctrlg.o \ grid.o \ gridsel.o \ helpext.o \ @@ -793,12 +809,13 @@ GENERICOBJS = \ proplist.o \ sashwin.o \ scrolwin.o \ + splash.o \ splitter.o \ statusbr.o \ tbarsmpl.o \ textdlgg.o \ tipdlg.o \ - treectrl.o \ + treectlg.o \ treelay.o \ wizard.o @@ -809,6 +826,7 @@ GENERICDEPS = \ choicdgg.d \ colrdlgg.d \ dcpsg.d \ + dirctrlg.d \ grid.d \ gridsel.d \ helpext.d \ @@ -831,12 +849,13 @@ GENERICDEPS = \ proplist.d \ sashwin.d \ scrolwin.d \ + splash.d \ splitter.d \ statusbr.d \ tbarsmpl.d \ textdlgg.d \ tipdlg.d \ - treectrl.d \ + treectlg.d \ treelay.d \ wizard.d diff --git a/src/wxvc.dsp b/src/wxvc.dsp index 899b1902c7..b35b9110cd 100644 --- a/src/wxvc.dsp +++ b/src/wxvc.dsp @@ -440,6 +440,10 @@ SOURCE=.\common\tokenzr.cpp # End Source File # Begin Source File +SOURCE=.\common\treebase.cpp +# End Source File +# Begin Source File + SOURCE=.\common\txtstrm.cpp # End Source File # Begin Source File @@ -624,6 +628,10 @@ SOURCE=.\generic\tipdlg.cpp # End Source File # Begin Source File +SOURCE=.\generic\treectlg.cpp +# End Source File +# Begin Source File + SOURCE=.\generic\treelay.cpp # End Source File # Begin Source File diff --git a/src/wxvc_dll.dsp b/src/wxvc_dll.dsp index 3038c83f71..eab6437c6e 100644 --- a/src/wxvc_dll.dsp +++ b/src/wxvc_dll.dsp @@ -451,6 +451,10 @@ SOURCE=.\common\tokenzr.cpp # End Source File # Begin Source File +SOURCE=.\common\treebase.cpp +# End Source File +# Begin Source File + SOURCE=.\common\txtstrm.cpp # End Source File # Begin Source File @@ -622,6 +626,10 @@ SOURCE=.\generic\tipdlg.cpp # End Source File # Begin Source File +SOURCE=.\generic\treectlg.cpp +# End Source File +# Begin Source File + SOURCE=.\generic\treelay.cpp # End Source File # Begin Source File