Commit Graph

298 Commits

Author SHA1 Message Date
Dimitrie O. Paun 8f38417376 Unify set_{owner,main}_item functions.
Fix {old,new}state and lParam reporting in LVN_ITEMCHANG{ING,ED}.
Fix sanity check conditions for LVS_OWNERDATA.
2002-10-17 21:54:57 +00:00
Dimitrie O. Paun 96dca36cc8 More, better tracing to help nail down some crashes.
Fix typo in GetItemT (found, and fixed by Huw Davies).
Exit right away from GetItemT if nothing is asked (mask == 0).
Assorted code cleanups.
2002-10-17 21:53:56 +00:00
Dimitrie O. Paun 305fb4c3dd Deal with sparsely populated listviews.
Crash on internal corruption.
2002-10-17 21:38:21 +00:00
Dimitrie O. Paun ef4a6fc7e5 Add ability to create an iterator over a range list.
Fix memory leak when destroying ranges.
Add function that will to a 'deep' clone of a range list.
Add function that will subtract a range list from another.
Do not crash on NULL ranges (similar in spirit to HDPAs).
Fancy deselection routines uses the above infrastructure to deselect
the minimum possible.
Modify SetGroupSelection to take advantage of all this new
infrastructure, to avoid flicker on selection extension.
2002-10-17 21:37:24 +00:00
Dimitrie O. Paun fa81ec674b Change the definition of ranges to exclude the upper bound. 2002-10-17 21:36:29 +00:00
Dimitrie O. Paun bac35001fe Handle range tracing in a consistent fashion. 2002-10-17 21:35:47 +00:00
Dimitrie O. Paun 58b2ad925b Remove dated comments. 2002-10-17 21:35:08 +00:00
Dimitrie O. Paun 66dd824dbc Better encapsulation of the ranges concept. 2002-10-17 21:34:15 +00:00
Dimitrie O. Paun be8189bd9c Notification code cleanup, more traces, etc. 2002-10-17 01:20:18 +00:00
Dimitrie O. Paun 89eb8fdba3 We need to provide focus info always in ICON mode (spotted by Huw
Davies).
2002-10-16 19:57:31 +00:00
Mike McCormack bcfffe7b08 Duplicate selected items list in LISTVIEW_RemoveAllSelections to
prevent infinite loops.
2002-10-16 19:56:06 +00:00
Dimitrie O. Paun 3dd4dabffb Remember the global colors in custom draw mode. 2002-10-16 19:05:43 +00:00
Dimitrie O. Paun ef9adbb6f5 Compute only the old state that we're gonna look at. 2002-10-16 19:05:02 +00:00
Dimitrie O. Paun 8d2f7224f1 Instrument SetItemT to avoid repainting if nothing changed.
Teach RemoveAllSelections to skip an item, so we can eliminate the
flicker when we click on a selected item.
2002-10-16 19:04:07 +00:00
Dimitrie O. Paun 3c9591b413 Fix bug in edit label when sending the text to the app.
Cleanup the handling of nEditLabelItem.
2002-10-16 19:03:25 +00:00
Dimitrie O. Paun 07a6a3975a Edit label cleanup. 2002-10-16 19:02:32 +00:00
Dimitrie O. Paun 6b4a11af0a Fix bug in ranges_shift which was corrupting selections.
Fix click notification (found and fixed by Alexandre Julliard).
Fix bug in setting item's state (some selection changes were lost).
Simplify selection code substantially.
Add a lot of debug tracing.
2002-10-16 19:01:38 +00:00
Dimitrie O. Paun db14dbf12b Fix iterator creation for LVS_LIST mode.
Do not update the infoPtr->nItemWidth in set_main_item.
Better handling of text bk colour in custom draw.
Rename GetItemListOrigin to GetItemOrigin.
A bunch of code cleanups, simplifications, etc.
2002-10-15 21:08:09 +00:00
Dimitrie O. Paun 17dce17a58 No longer compute the ill-defined bounds in GetItemMetrics.
Fix a bunch of bug in subitem metrics computation.
Properly implement GetSubItemRect in terms of GetItemMetrics.
Documentation updates, and code cleanups.
2002-10-15 21:07:01 +00:00
Dimitrie O. Paun 3a5105c957 Teach GetItemMetrics to deal with subitems in report mode as well.
Unify Draw{,Sub}Item, simplify RefreshReport.
2002-10-15 21:06:14 +00:00
Dimitrie O. Paun f378bbd5a5 Fix iterator creation for LVS_LIST mode.
Use assert() instead of hand-made hack.
2002-10-15 21:05:29 +00:00
Dimitrie O. Paun 3baa344a43 Fix iterators to properly deal with LVS_{,SMALL}ICON modes.
Unify the Refresh{List,Icon} functions.
Simplify HitTest to make full use of the iterators.
Fix selection bounds in HitTest.
Avoid empty default to silence warning in gcc 3.2.
2002-10-15 21:03:10 +00:00
Dimitrie O. Paun 50b4688c7e Iterator updates:
Add the notion of a special item which sits at the start of the
   list.
   Add the ability to iterate in both directions through the list.
   Document the iterator interface.
   Remove iterator_visibleitems.
   Rename iterator_clippeditems to iterator_visibleitems for
   consistency.
Use the new bidirectionality to paint the items in decreasing order.
2002-10-15 21:01:57 +00:00
Dimitrie O. Paun 00ea0868ba Rename GetItemHeight to CalculateMaxHeight, for consistency
Fix usage of nItemWidth vs. iconSpacing.cx
Misc cleanups.
2002-10-11 23:34:32 +00:00
Dimitrie O. Paun a1ca0122b9 Use the item box rather than the bounds when invalidating.
Implement 'bPartial' in EnsureVisible.
2002-10-11 23:33:25 +00:00
Dimitrie O. Paun ed29ffdea4 Unify DrawLargeItem with DrawItem. 2002-10-11 18:47:03 +00:00
Dimitrie O. Paun 0b93d5c4c5 Use GetItemMetrics instead of GetItemMeasures.
Remove GetItemMeasures.
Add GetItemBox which only returns the boundary of the item.
2002-10-11 18:46:21 +00:00
Dimitrie O. Paun ac756afcc2 Be real tough on internal programming errors. 2002-10-11 18:00:28 +00:00
Dimitrie O. Paun dda1e31ce7 Remove support for owner drawn listviews in non-REPORT mode. We need
to do this since Windows supports owner draw *only* in report mode,
and hence apps are not prepared to handle drawing in other modes.
2002-10-11 17:59:39 +00:00
Dimitrie O. Paun 4150f31f58 Use GetItemMetrics instead of GetItemMeasures when drawing. 2002-10-11 17:58:56 +00:00
Dimitrie O. Paun 01b5226508 Make use of the new GetItemMetrics in HitTest, to avoid code
duplication.
2002-10-11 17:58:11 +00:00
Dimitrie O. Paun f1f447931e Separate item metrics computation from positioning
Add support for computing state icon metrics.
2002-10-11 17:57:27 +00:00
Alexandre Julliard 5feaff534b LVS_OWNERDRAWFIXED should only take effect in REPORT mode. 2002-10-11 04:19:20 +00:00
Dimitrie O. Paun 1c6c29e313 Fix drawing bug introduced with the custom notification
reorganization.
2002-10-10 22:57:45 +00:00
Dimitrie O. Paun 01dbe3999e Simplify the report mode, and item drawing considerably.
Fix full row select in report mode.
2002-10-10 22:55:21 +00:00
Dimitrie O. Paun ffd4bd37d0 Handle custom draw notifications properly.
Various cleanups, and simplifications.
2002-10-10 22:54:06 +00:00
Dimitrie O. Paun d2d4baf96b Remove superfluous abstractions which make the code harder to
understand.
2002-10-10 22:52:56 +00:00
Dimitrie O. Paun 6d6be0e1d4 Move the custom draw notifications into the Draw.*Item functions. 2002-10-10 22:52:12 +00:00
Dimitrie O. Paun a994fb8135 Move the custom draw item notifications down into DrawLargeItem. 2002-10-10 22:51:27 +00:00
Dimitrie O. Paun 7ac890984d Fix silly redraw bug introduced in previous patch.
Tidy up, and simplify large item drawing.
2002-10-10 22:50:49 +00:00
Dimitrie O. Paun 50ed9b9962 Implement WM_SETREDRAW properly. 2002-10-10 22:50:09 +00:00
Dimitrie O. Paun 12dca97b9d Rework the mouse click notifications
Assorted cleanups, and simplifications.
2002-10-10 22:49:29 +00:00
Dimitrie O. Paun 1094c63c0e Use (semi)standard HitTest, rather then our own little invention.
Get rid of GetItemAtPt.
Fix HitTest but in REPORT mode.
2002-10-10 22:48:36 +00:00
Michael Stefaniuc bc54d78532 - change the internal functions in windows/cursoricon.c to use 32bit
handles
- move the implementation of ExtractAssociatedIcon16 to
  ExtractAssociatedIconA
- convert HICON to a void*
- fixed some handle conversions that happened to be in the way while
  doing the above
2002-10-10 21:22:09 +00:00
Paul Rupe 8b3da5e3ba Scroll the listview when doing multiple selections. 2002-10-10 18:56:50 +00:00
Dimitrie O. Paun 05b4a09357 Narrow down the items we iterate over in LIST, and REPORT mode.
Fix a Client --> List coordinate transformations in FindItem.
Fix bug in HitItem (in LIST and REPORT mode).
Avoid the last bit of drawing in REPORT mode.
2002-10-10 03:13:14 +00:00
Dimitrie O. Paun 9d678ff740 Draw _only_ the items that are invalidated.
Fix serious bug when deleting from a range.
Pass in a range to the ranges_{add,del} functions.
Tidy up the RefreshIcon function.
Assorted cleanups.
2002-10-10 03:12:05 +00:00
Dimitrie O. Paun 0295e4fceb Reimplement FindItem (cleaner, faster, more compliant with MSDN). 2002-10-10 03:10:20 +00:00
Dimitrie O. Paun 1313431b1b Rewrite HitTest to make it pretty, and very fast. 2002-10-10 03:08:45 +00:00
Dimitrie O. Paun a80ced02e9 Introduce the notion of item iterators, and use them to clean up code. 2002-10-10 03:07:04 +00:00
Dimitrie O. Paun 00e3435f54 Separate range manipulation functions from selection ranges. 2002-10-10 03:05:28 +00:00
Dimitrie O. Paun 764607d931 Fix large item label calculation when not focused.
Fancy focus rectangle handling.
2002-10-10 03:04:34 +00:00
Dimitrie O. Paun b2056c22b5 Fix focus handling when deleting items, or changing modes.
Better label rect calculation in ICON mode.
2002-10-10 03:03:39 +00:00
Dimitrie O. Paun c95b2a0202 Fix large item handling focus in ICON mode. 2002-10-10 03:02:30 +00:00
Dimitrie O. Paun bbf878ded6 No need to go through the heavy duty rect computation when in OWNERDRAW. 2002-10-10 03:01:10 +00:00
Dimitrie O. Paun a625dd394d Factor out owner draw code, so that it works for all modes.
Documentation updates.
2002-10-10 02:59:34 +00:00
Dimitrie O. Paun b8d5715bc1 Factor out the computation of item position, so it can be used
independently of the rectangles.
2002-10-10 02:58:47 +00:00
Dimitrie O. Paun f29d0ce05b Unify LISTVIEW_UpdateLargeItemLabelRect, and GetItemMeasures.
Optimize GetItemMeasures to the max.
Centralize the DrawText's DT_* flags.
2002-10-10 02:57:50 +00:00
Dimitrie O. Paun 1fc91d2d65 Get rid of 'goto's in GetItemMeasures.
Move LISTVIEW_UpdateLargeItemLabelRect close to where it's used.
2002-10-10 02:56:57 +00:00
Dimitrie O. Paun cf4670cba2 Fix braino in calculation of LVS_LIST origin.
Invalidate the entire window when we are invalidating the list.
2002-10-10 02:56:13 +00:00
Dimitrie O. Paun 74e43dd023 Fixed bug that caused item texts to be empty. 2002-10-08 01:55:32 +00:00
Dimitrie O. Paun 783bab61de Fix nasty bug generated by UINT vs. INT (resulted in bogus
comparisons).
Fix LVIR_SELECTBOUNDS computation, for REPORT mode.
Fix dependency generation in GetItemMeasures.
Fix rectangle computation for REPORT mode (corner case problems).
Better debug messages.
Assorted cleanups.
2002-10-07 22:43:42 +00:00
Dimitrie O. Paun 97ffbfad72 Cleaned up the rectangle handling, and fixed numerous bugs in
rectangle calculations.
2002-10-07 22:42:44 +00:00
Paul Rupe 1446a06ce9 Fix inaccurate listview scrolling with PgUp/Down and Home/End keys. 2002-10-07 21:44:01 +00:00
Dimitrie O. Paun 3ac601d52b Fix silly bug in SetItemPosition (we should set it, not create a new
one).
2002-10-07 18:51:52 +00:00
Dimitrie O. Paun b9cacc438a Maintain the item position in {,SMALL}ICON mode separataly from the
item, so that we have it even in LVS_OWNERDATA.
2002-10-07 18:50:21 +00:00
Dimitrie O. Paun 6cfd83b985 Cleanup the SetItemPosition interface. 2002-10-07 18:48:47 +00:00
Dimitrie O. Paun 7f77992091 Remove the COUNT_OF macro.
Indentation fixes, and minor cleanups to notify_dispinfoT.
2002-10-07 18:44:55 +00:00
Dimitrie O. Paun 6a6310d099 Fixes bug which rendered virtual listboxes always empty.
Smarter focus rectangle drawing.
Fix focus handling when we add/delete a column.
Fix silly bug in GetSubItemRect.
Elimiante flicker in Report mode.
2002-10-07 18:43:49 +00:00
Dimitrie O. Paun 95f2799537 Cleanup, and clarify the handling of the various rectangles.
Fix handling of large items in ICON mode.
Fix calculation of LVIR_SELECTBOUNDS.
Various cleanups, and simplifications.
2002-10-07 18:42:52 +00:00
Dimitrie O. Paun 914aac36b5 Cleanup of the way we maintain/lookup the item count.
Rename GetItemWidth to CalculateMaxWidth.
Misc trivial changes.
2002-10-07 18:41:00 +00:00
Dimitrie O. Paun 1c7bf6229f Fix focus handling for owner draw listviews. 2002-10-07 18:38:17 +00:00
Dimitrie O. Paun d308a8d4fe Fix potential bug in RemoveAllItems.
Fix report-mode ONWERDRAW bug (with help from Alexandre Julliard).
Fix multiple selection bug (in report and list mode).
Remove code duplication for removing selections.
2002-10-07 18:36:34 +00:00
Dimitrie O. Paun 769f6a8c0f Reimplement GetSubItemRect, subitem setting optimizations. 2002-10-05 18:05:27 +00:00
Dimitrie O. Paun 76f397e3a1 Fix bug in OWNERDATA selection handling.
Fix critical performance bug in GetSelectedCount.
Fix critical performance bug in SetGroupSelection.
Fix problems for OWNERDRAW report.
Fix hidden/latent bugs in state handling.
Better debug messages.
2002-10-05 18:04:30 +00:00
Dimitrie O. Paun f645727afe Fix onwer-draw REPORT for broken apps. 2002-10-05 18:02:54 +00:00
Dimitrie O. Paun d2b526ed33 Streamline the GetItem usage.
Fix fatal bug for ICON mode in LVS_ONWERDATA.
Documentation updates, marking places which need work.
2002-10-05 17:46:30 +00:00
Dimitrie O. Paun 86e92428fb Fix condition so we actually store the state in virtual listviews.
Assorted code cleanups.
2002-10-05 17:44:51 +00:00
Dimitrie O. Paun 3547087c70 - Effective optimization in GetNextItem (speeds up Xnews).
- Misc cleanups.
2002-10-05 17:43:26 +00:00
Dimitrie O. Paun a656944875 Rewrite the begin/end label edit procedures.
Better support of OWNERDRAW.
Cleaner, simpler code.
2002-10-05 17:42:14 +00:00
Dimitrie O. Paun 530793ff4d Fixed large item focus handling for virtual listviews. Since at most
_one_ item can have the focus at any time, we can maintain one such
rectangle per list, rather than per item. This is both more efficient,
and works for LVS_OWNERDATA listviews as well.
2002-10-04 17:54:22 +00:00
Dimitrie O. Paun c1b1a296ff Do not blindly trust GetItem to succeed -- check the return value, and
fail gracefully.
2002-10-04 17:51:42 +00:00
Dimitrie O. Paun 45387e3a6c Do not send uninitialized data in notification to application. 2002-10-04 17:49:29 +00:00
Dimitrie O. Paun dd0c4c16ae - Fix nasty bug in REPORT mode, when calculating the label rect.
- Lots of cleanups, and simplifications.
2002-10-04 00:25:55 +00:00
Dimitrie O. Paun df6bcfbe57 - Reorganize DrawItem.
- Unify text attribute selection between Draw{Sub,}Item.
- Usual cleanups, and simplifications.
2002-10-02 23:53:04 +00:00
Dimitrie O. Paun 91d41c7fe3 Fancy/optimized EnsureVisible method that eliminates flicker.
Minor cleanups.
2002-10-02 23:45:50 +00:00
Dimitrie O. Paun fc01fcd25a - Fix the subitem drawing code.
- A lot faster drawing in report mode.
- A great deal of cleanup, and simplifications.
2002-10-02 19:59:55 +00:00
Dimitrie O. Paun feae6c3ea4 - Fix the state icon handling.
- Fix handling of new image lists.
- Small cleanups.
2002-10-02 18:38:11 +00:00
Dimitrie O. Paun 25bf08267a - Rework the {Insert,Delete}Column functions.
- Drawing optimizations when adding/removing columns.
- More cleanups, and simplifications.
2002-10-02 18:32:08 +00:00
Dimitrie O. Paun e7c82c2711 - Fix LIST mode, broken by previous changes.
- Implement GetItemRect in terms of GetItemMeasurements.
- Improvements in debug traces.
- Many bug fixes, compelete implementation for GetItemMeasurements.
- Lots of code cleanups, simplifications.
- Documentation updates.
2002-10-01 18:06:15 +00:00
Paul Rupe 4ee2e9e989 Prevent crash when listview trace logging is on. 2002-09-30 18:52:33 +00:00
Guy Albertelli 7e1e62de1c - Eliminate extra background fills.
- Eliminate bogus error messages.
2002-09-29 18:34:51 +00:00
Dimitrie O. Paun a4f580b74b - Cache GWL_STYLE, to avoid fetching in virtually every function.
- Separate GetOrigin from GetAllMeasures as it is item independent,
  and rename function to reflect the change.
- Small cleanups.
2002-09-29 18:02:21 +00:00
Dimitrie O. Paun 81beb955c8 Remove item from the list, if we fail to initialize it at insert
time.
2002-09-27 22:47:00 +00:00
Dimitrie O. Paun e65eb61419 - Fix crashes in debug mode.
- Fix some focus rectangle problems.
- Better debugging output.
- More cleanups.
2002-09-27 22:02:16 +00:00
Paul Rupe 7f32a8d176 - Initialize memory to prevent crashes when -debugmsg +listview is on.
- Fix various array bounds related errors.
2002-09-25 03:20:01 +00:00
Guy L. Albertelli e2e5097648 - Localize origin, location, and rectangle computation.
- Support state icons in LVS_ICON style.
- Draw only items that are in the clip box.
- Draw non-selected items first then the selected ones because large
  icons may overlap each other.
- Correct invalidation rectangles for items.
- Correct drawing of large icons.
- Eliminate divide by zero cases in scrolling.
- Invalidate selected items prior to setting window losing focus.
2002-09-24 18:27:21 +00:00
Dimitrie O. Paun 70c6cecef9 Remove some more superfluous ZeroMemory calls, small cleanups. 2002-09-23 20:59:42 +00:00
Dimitrie O. Paun e3e404296e - Fix outputting of a text pointer in debug mode (by Rein Klazes).
- Remove a large bunch of superfluous ZeroMemory calls.
- Fix a couple of bugs.
2002-09-23 20:55:22 +00:00
Dimitrie O. Paun df28ddf309 - Better implementation for GetTopindex/GetOrigin/SetIconSpacing.
- Drawing optimizations, better scrolling.
- A few more bugs squashed without mercy.
- Many cleanups, simplifications, doc updates.
2002-09-18 18:29:28 +00:00