Commit Graph

93 Commits

Author SHA1 Message Date
Robin Dunn
dd360466a5 Applied a modification of Patch #704995 which changes how the lines
are drawn such that only the visible portions are drawn.  This is
because (I think) if the length of the line is > 32k then on at least
Win9x and GTK 1.2 the line will wrap around to the other end of the
tree ctrl...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-03-19 01:01:14 +00:00
Julian Smart
6aa89a22b8 Fixed copyrights and licence spelling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19596 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-03-17 11:55:54 +00:00
Stefan Csomor
e549bec483 m_y of generic tree item was only a short, which unnecessarily limits the number of items that can be displayed and handled
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-02-25 09:48:30 +00:00
Ron Lee
12a3f2275c Deprecated wxSizer::Remove( wxWindow* ), s/Remove/Detach/ in most places.
Made wxSizer child list typesafe.  I've not added the wxList implicit
conversion kludge yet, let's see who complains first perhaps..

Deprecated wxSizer::{G,S}etOption in favour of {G,S}etProportion in line
with the parameter name change in the docs.

Added {G,S}etSpacer consistent with the accessors for windows/sizers.

Made all wxSizer index parameters size_t -- we support no sensible
interpretation for negative indexes in them.  Hopefully this will
cause no real problems, but code doing (eg. Remove( 0 )) will need
to change to use 0u to resolve the ambiguity with overloaded members.
This is probably a Good Thing though, ymmv.

s/FALSE/false/g ; s/TRUE/true/g ; s/wxASSERT/wxASSERT_MSG/g in sizer.{cpp,h}

Fixed (I hope) the brokenness in wxSizer::Show -- I have no code to test
this yet, so it's a blind change, but spacers should now be hidden correctly
instead of ignored, and it should be properly reversable over multiple
calls now too.

removed pointless private scoping around DECLARE_CLASS macros.

Replace 0's I added previously with NULL -- not like that will end the
email thread either..

Added Add( wxSizerItem * ) & co.  There are probably a couple of other
places we can usefully do something like this too.  Stopped short of
refactoring everything to raise some issues about sizer method recursion
on -dev.

Updated wxSizer docs some more, they are still incomplete but getting
better.

wrapped KeyCode in wxDEPRECATED, converted all (gtk build) instances
to GetKeyCode.  There may be a few left for other ports.

Fixed a couple of other random compile warnings along the way.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-07 10:22:07 +00:00
Vadim Zeitlin
22f3361e1c use DECLARE_NO_COPY_CLASS() where applicable (patch 633384)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-01-02 23:38:11 +00:00
Ron Lee
99006e446e Added wxTreeCtrl::GetItemParent to deprecate GetParent.
Moved GetParent into WX_COMPAT_2_2 and exposed base GetParent in
that case too.

Replaced all lib/sample uses of wxTC::GetParent with GetItemParent.

Updated docs to suit.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18448 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-29 07:48:21 +00:00
Julian Smart
fbb1226068 Applied patch [ 651287 ] adds missing wxTreeCtrl::GetEditControl
This patch implements a missing member in the generic
version of the wxTreeCtrl. The GetEditControl member is
currently not implemented in the generic tree control
used by wxGTK. This patch implements the feature by

1. adding a pointer to the wxTextTreeControl as a
member (m_textCtrl) of the wxGenericTreeCtrl class
2. making sure pointer was initialized to 0
3. using the member variable instead of the stack
variable in the wxGenericTreeCtrl::Edit member
4. making sure the new wxGenericTreeCtrl class
member is set to 0 when the control is set up for
deletion in Finish by calling a new protected member
(ResetTextControl) of the wxGenericTreeCtrl class.

These modification were discussed on the wx-dev list
under the "wxGTK - wxTreeCtrl::GetEditControl status?"
subject.

I have tested, but I certainly welcome comments and
further testing.

Pete Stieber


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18192 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-11 09:08:46 +00:00
Vadim Zeitlin
2b5f62a0b2 merged 2.4 branch into the trunk
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-12-04 14:11:26 +00:00
Julian Smart
dd23c25cde Applied patch [ 605189 ] add edit cancel notify to wxTreeEvent
Benjamin I. Williams

Currently there is no way of receiving notification
that a user cancelled an edit operation on a wxTreeCtrl
tree node label.

This patch adds a method "IsEditCancelled" to the
wxTreeEvent class. During an EVT_TREE_END_LABEL_EDIT
event, the programmer can now determine whether or not
the edit operation was cancelled by the user (by
pressing <ESC>).

This patch provides this implementation for both
wxMSW's wxTreeCtrl and the wxGenericTreeCtrl. Both
situations have been tested and work well.

The patch is not very invasive, and is much smaller
than I had expected.

Please see the relevent discussion on the wx-dev list
for more details.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-09-05 19:50:41 +00:00
Vadim Zeitlin
6151e1445b generate key events for Space/Enter in addition to the activate events, as wxMSW does
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-09-02 12:51:33 +00:00
Vadim Zeitlin
7475e8a313 fixed crash when calling Delete(root) and also when calling Delete(descendant_of_selected_item)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-23 18:05:58 +00:00
Julian Smart
1fc32b12ee Misc mods for feedback from Marcin Wojdyr <wojdyr@if.pw.edu.pl>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-23 11:57:10 +00:00
Vadim Zeitlin
02fe25c214 really remove the selection when Unselect() is called
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16084 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-07-08 16:43:28 +00:00
Vadim Zeitlin
edb8f2985f fix crash when the user code refuses to validate the new text when editing the item and a generic label editing code cleanup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-07-08 16:38:46 +00:00
Václav Slavík
374a8e5c7f fixed hidden root expansion in extreme usage case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-30 22:15:10 +00:00
Robert Roebling
1ec3a9848a Moved wxCharhookEvent so that it sends the same
keycode as wxCharEvent.
  Removed wxDestroyWindowEvent as it crashes all
   the time.
  Corrcted wxTreeCtrl's interception of wxCharEvents
   as it misinterpreted "F5" for "Z" e.g.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15798 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-09 23:02:58 +00:00
Vadim Zeitlin
526b8142e1 make the incremental kbd search wrap to the beginning if necessary
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15767 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-06 19:37:52 +00:00
Robin Dunn
b3887715e4 Fix for compilation error in Unicode mode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15763 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-06 18:50:36 +00:00
Robin Dunn
7a944d2fd2 Fixed a strange MSVC compile error (C2253) It thought a pure virtual
function was being defined...


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-04 20:17:44 +00:00
Vadim Zeitlin
cb59313ce5 added incremental keyboard search to wxTreeCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-06-04 15:00:57 +00:00
Julian Smart
f4bd67593e Don't call a function that might do drawing when setting a null image list
(might be deleting the tree control)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-05-15 19:59:10 +00:00
Julian Smart
4855a4773e textctrl.cpp: Removed assert from CanRedo/CanUndo since the best behaviour is
to return FALSE (Redo/Undo functions are unimplemented)
treectrlg.cpp: in InsertItem, allow previous item to be null in order
to insert at first position of possibly-empty child list
dcclient.cpp: allow setting of null font (common espec. on Windows)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15540 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-05-13 16:54:32 +00:00
Robert Roebling
5941c5de92 Fixed tree control redraw bug, which had nothing
ro do with scrolling. Someone just removed my use


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-05-06 22:35:55 +00:00
Václav Slavík
999723f31a don't allow expanding/collapsing hidden root node
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-04-09 22:43:14 +00:00
Václav Slavík
d027179b48 use Calc(Un)ScrolledPosition instead of wxClientDC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-03-17 14:13:35 +00:00
Václav Slavík
cb9965c3cc fixes to refreshing code in wxTreeCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-03-12 23:20:55 +00:00
Vadim Zeitlin
40e7f56c71 applied patch for calculating the tree items size with non default font (patch 520965)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14338 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-02-21 15:09:13 +00:00
Vadim Zeitlin
6f0dd6b274 fixed SetForegroundColour() for the generic tree ctrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-02-20 17:42:05 +00:00
Kendall Bennett
574c939ef1 Merges from Scitech Branch (George Davison):
Added wxDisplayChangedEvent and triggering in MSW, when display mode changes
this event gets triggered. I don't know what should happen with other OS's
since I am not familiar with how they handle mode changes.

Watcome Version 11 now compiles with wide character support.

Fixed watcom warnings in
	html/htmlwin.h
	imagbmp.h
	listctrl.h
	imagbmp.cpp
	quantize.cpp
	strconv.cpp
	variant.cpp
	dirctrlg.cpp
	treectlg.cpp
	m_style.cpp
	fontenum.cpp
	listctrl.cpp
	ole\dataobj.cpp
	textctrl.cpp
	window.cpp
	xml.cpp

msw/setup.h
	with watcom version 11 it now compiles with wide character support.

xrc/xml.cpp
	fixed memory leak and compile warnings


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-02-07 18:46:31 +00:00
Vadim Zeitlin
be93a00bb4 made XPMs const
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-12 15:00:25 +00:00
Václav Slavík
a756f21001 use the new wxSystemSettings API everywhere
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13471 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-08 23:53:01 +00:00
Václav Slavík
cf31a1d7b6 fix order of initializiton of rootless treectrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-05 23:27:42 +00:00
Vadim Zeitlin
0a33446c8e don't crash in UnselectAll() if the tree has no root
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-03 17:39:28 +00:00
Robert Roebling
d21d2e5adf Smooth Aqua buttons in wxTreeCtrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13054 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 01:20:25 +00:00
Václav Slavík
c6f4913a76 applied patch that adds wxTR_FULL_ROW_HIGHLIGHT to wxTreeCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-17 00:30:23 +00:00
Robert Roebling
17d5bdf9e9 Aqua gets Aqua tree buttons automatically now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-15 13:49:05 +00:00
Robert Roebling
f6eaeda1b0 Small optical fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12969 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-10 11:55:16 +00:00
Robert Roebling
2593f03384 Changed wxTreeCtrl to look Mac-like under Mac
automatically.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-10 11:21:28 +00:00
Robert Roebling
dd5a32cc2d Changed semantics of clicking beside the text control
when editing a label. This now accepts the input.
 My attempt to make the focus return to the owning
   tree and list control window failed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12964 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-09 21:15:56 +00:00
Vadim Zeitlin
607d9cfc56 oops, a typo in the last commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-09 14:38:23 +00:00
Vadim Zeitlin
59a2e6354d ItemHasChildren() should return TRUE for the items which have plus button as they could have children even if they currently don't
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-09 14:35:54 +00:00
Václav Slavík
e76520fdf8 fixed rendering of expanded nodes with exactly one child
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-07 22:44:02 +00:00
Václav Slavík
2b84e565c6 applied Greg's refinment of hist treectrl patch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-11-23 19:39:04 +00:00
Mattia Barbon
9e0a12c958 Changed char* to wxChar* in wxColour constructor.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12034 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-10-16 19:05:56 +00:00
Vadim Zeitlin
b09bda689c added wxTreeEvent::GetKeyEvent() to allow to retrieve the key event flags from EVT_TREE_KEY_DOWN event
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-09-24 16:39:49 +00:00
Vadim Zeitlin
0800a4ba40 typo fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-25 12:07:45 +00:00
Vadim Zeitlin
7009f411aa refresh the tree ctrl when its back/foreground colour changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-25 12:06:53 +00:00
Vadim Zeitlin
ebb987b77b double click handling is finally correct in the treectrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11434 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-21 15:17:48 +00:00
Robert Roebling
c9c4b3a009 Fixed focus event problems with control derived
from wxScrolledWindow.
  If wxTreeCtrl has no +/. button, toggle branch,
    otherwise send activate event upon double-click.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-21 11:12:42 +00:00
Vadim Zeitlin
68eb5f6337 allow user code to override key handling in wxTreeCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-20 19:25:00 +00:00