Commit Graph

17 Commits

Author SHA1 Message Date
Paul Licameli f64bc5a829 Pass non-const AudacityProject to HitTest::Preview...
... because that will be needed for elimination of some GetActiveProject()
calls.  Because some overrides need to find the focused track, but that may
mutate the project by setting the focused track when it wasn't yet defined.
2020-01-04 09:40:33 -05:00
Paul Licameli 548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli 56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d170.
2019-05-16 14:33:55 -04:00
Paul Licameli b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli 005abb06d6 Replace uses of TrackPanel::Cells() with CellularPanel::VisitCells() 2018-11-01 18:25:02 -04:00
Paul Licameli ecc869bdbe Remove GetLink(ed) in TrackPanel resizing code 2018-10-01 13:42:32 -04:00
Paul Licameli b3d62e2ab6 Simplify by removing class HitTestResult...
... Because all hit tests returned all fields blank, or else, returned a
UIHandle object whose Preview method gives the rest of the information; so
the other fields were redundant.
2017-07-09 07:57:34 -04:00
Paul Licameli 2c1a16f593 Changed lifetime management of UIHandle objects, no singletons...
... Rather, construct them during hit tests (also capturing more state sooner
rather than at Click time, and adding some accessors for later use)

This also fixes bug 1677 by other means and avoids similar problems.

A cell may be implemented to re-use a previously hit handle object, not yet
clicked, in a later hit test, by remembering a weak pointer, but TrackPanel
holds the strong pointers that determine when the object is destroyed.

And the objects will surely be destroyed after drag-release, or ESC key.

For now they are also destroyed whenever not dragging, and hit-testing is
re-invoked; that will be changed later, so that the re-use mentioned above
becomes effective, but still they will be destroyed when the pointer moves
from one cell to another.
2017-07-09 07:23:28 -04:00
Paul Licameli 3a8280c562 Distinguish TrackPanelMouseState from TrackPanelMouseEvent...
... Let cell hit tests, and handle preview, know states only, not transitions.

Cell hit tests are passed a mouse state that does not always match the current,
but anticipates the button click to come; usually left, but if the Control
[sic] key on Mac is down, then right.

Thus, pressing and releasing Mac Control in multi-tool switches in and out of
the magnifier cursor.
2017-07-09 06:38:55 -04:00
Paul Licameli c1f667f170 Move some handle and cell classes into their own files 2017-07-09 06:38:54 -04:00
Paul Licameli 708d84ac22 CommonTrackPanelCell::FindTrack returns shared_ptr 2017-06-27 23:09:35 -04:00
Paul Licameli 28b40e02fb Manage TrackPanelResizerCell by shared_ptr, no singleton 2017-06-26 16:39:07 -04:00
Paul Licameli fa5a742e22 weak_ptr not events to avoid dangling track pointers in UIHandles 2017-06-25 13:35:15 -04:00
Paul Licameli 91c86fd937 TrackPanelCellIterator visits all cells, and FindCell simply uses it 2017-06-17 03:01:40 -04:00
Paul Licameli a6c583e596 fix #include path 2017-06-17 02:12:06 -04:00
Paul Licameli a94eb75b4e Further regularize the odd case of hit-test on the resizer region 2017-06-16 18:05:09 -04:00
Paul Licameli bbfa574790 Move track resizing code out of TrackPanel.cpp, though it still...
... cooperates more closely with TrackPanel than the other UIHandle subclasses
do.
2017-06-15 08:54:58 -04:00