Commit Graph

125 Commits

Author SHA1 Message Date
Benjamin Popp
13ad1aefe2 when doing a multi-cell edit, select multiple cells 2018-12-12 19:46:30 -06:00
Benjamin Popp
66c36bb469 only show right-click menu if the right-mouse-down
happened on the same cell
2018-12-12 19:41:54 -06:00
Benjamin Popp
2972bc9a29 underline pointers to make the start/end more apparent 2018-12-12 19:38:24 -06:00
Benjamin Popp
de6dce1382 null pointers should say 'null'
it should be possible to write a null pointer
2018-12-12 19:29:25 -06:00
Benjamin Popp
5289949734 replace 'null' after last run with a NullObject 2018-12-12 19:09:04 -06:00
Benjamin Popp
eff3f59aff refactor: don't need the 'anchor' type as part of the pointer runs.
Each run just needs a simple list of things that point to it.
refactor: PointerRuns don't need the model at construction time.
refactor: use a base class to remove duplicate code (IFormattedRun)
2018-12-10 21:44:40 -06:00
Benjamin Popp
7617af8391 improve search 2018-12-10 21:02:45 -06:00
Benjamin Popp
6f75d0a5c1 refactoring: move byte[]data to the model 2018-12-10 20:45:41 -06:00
Benjamin Popp
4d9d14eda5 support for copy/paste for pointers/anchors 2018-12-10 07:13:23 -06:00
Benjamin Popp
5f708b5eec delete dead comment 2018-12-09 20:15:56 -06:00
Benjamin Popp
f7cc560281 show the anchor name in the right-click menu 2018-12-09 20:15:24 -06:00
Benjamin Popp
4a60c02c62 make it possible to move named anchors. Doing so deletes anything associated with the old anchor, and moves any named pointers to point to the new spot. 2018-12-09 20:06:35 -06:00
Benjamin Popp
bc74eda3e5 make the listbox look not terrible 2018-12-09 19:54:41 -06:00
Benjamin Popp
f8aef7220c can double-click to follow pointers. Right-click on Anchors lets you follow those backwards.
Followed suggestions from Raina to change the way Anchors look a little.
2018-12-09 17:23:00 -06:00
Benjamin Popp
af64d4aad2 implement find/goto for pointers 2018-12-09 13:07:14 -06:00
Benjamin Popp
40d70817a9 bugfixes. See ModelTests.cs
-> note that I had to remove EditOnlyNotifiesCollectionChangeOnceWhenScrolling(),
   that test is no longer true. Changes to pointers and anchors can change data
   elsewhere on screen.
2018-12-09 11:14:42 -06:00
Benjamin Popp
f74d38c012 first pass at making the UI work. 2018-12-08 22:07:02 -06:00
Benjamin Popp
f7d04c5b67 add ability to remove names from anchors 2018-12-08 21:26:01 -06:00
Benjamin Popp
408a56c91b first pass at adding backspace to the model 2018-12-08 21:01:31 -06:00
Benjamin Popp
ad9e3386d0 support for writing pointers/anchors over other ones, and how replacement works. 2018-12-08 16:18:47 -06:00
Benjamin Popp
25be2aa0fb basic support for writing pointers and writing anchors 2018-12-06 22:08:36 -06:00
Benjamin Popp
32a5c5759f implementing the first part of the model 2018-12-04 20:19:00 -06:00
Benjamin Popp
d6cd4cc689 first pass at adding model interfaces. The model will be in charge of parsing the data and listing data formats. The ViewModel can then ask the Model for the 'next format' from a given location. Note that there could be multiple implementations: the only thing the ViewModel knows is the interface. 2018-12-03 22:43:58 -06:00
Benjamin Popp
ae6571dba2 simplify confusing code 2018-12-03 19:26:12 -06:00
Benjamin Popp
ffb3f5410b Refactor: Moving things to a more organized file structure. 2018-12-02 19:47:23 -06:00
Benjamin Popp
242e7199b9 get version string from attributes, so that I can update it in only one place. 2018-12-02 12:59:18 -06:00
haven1433
e5d8a6c006 Merge pull request #13 from haven1433/dev-haven1433-12
fixing #12
2018-12-02 12:47:37 -06:00
haven1433
d141012de2 Merge pull request #10 from haven1433/dev
Fixing #7 and #11
2018-12-02 12:47:12 -06:00
Benjamin Popp
355d56eeb4 removing duplicate logic - we already know that the changed button was pressed. 2018-12-02 12:46:47 -06:00
Benjamin Popp
a3e88511e0 removing dead code 2018-12-01 23:25:51 -06:00
Benjamin Popp
32b26068da provide a default value for recentFindResults to avoid null checks. 2018-12-01 23:23:56 -06:00
Benjamin Popp
d0a0a2bbf1 fixing #12
- FindPrevious/FindNext logic for CanExecute was wrong.
- also updated when CanExecuteChanged gets called.
2018-12-01 19:22:21 -06:00
Benjamin Popp
a510e924d5 - EditorViewModel should update FileSystem watches when a ViewPort's FileName changes.
... This additionally requires that the FileName shares its oldValue when it changes.
- All TabContents are ViewModels
- ViewPort should notify when its FileName changes
2018-12-01 16:59:05 -06:00
Benjamin Popp
ee65fdb4d3 - Side mouse buttons map to back/forward
- call CanExecuteChanged on back/forward correctly
2018-11-30 19:56:20 -06:00
Benjamin Popp
0dc5a903de - click+shift should move the selection end, not the selection start
(see HexContent)
- add keybinding for delete
- fix keybinding for cut
- clearing data via cut or delete needs to go on the undo stack
2018-11-30 18:42:52 -06:00
Benjamin Popp
152f0cb548 - Add a FileSystem resource to the MainWindow, so that it can use it as
an argument for closing tabs
- don't do threading work in collection change callbacks. Instead,
  do thread switching as early as possible, as soon as I realize that work
  needs to be done (in WindowsFileSystem).
- if ConsiderReload is called because of a file change and the file is now
  missing, then do nothing.
- if ConsiderReload is called because the file got shorter, update the
  Selection.
2018-11-30 07:29:33 -06:00
Benjamin Popp
b88429873d improve comments after re-reading through the code changes. 2018-11-29 22:11:29 -06:00
Benjamin Popp
c77506d241 - make filesystem able to clear individual listeners per file, instead of all at once.
... because you can have the same file open in two tabs.
- Allow HexContent's ContentChanged to come from a background thread
  ... important for when the notification comes from a file change
- Allow MainWindow to track deferred work
- Allow Tabs to request delayed work
- Allow EditorViewModel to request delayed work
  ... because sometimes windows notifies about a file change before the
      other application lets go of the file handle.
- IViewPort should actually expose its FileName
  ... EditorViewModel needs to know a ViewPort's file to setup / tear down
      the file watch in IFileSystem
- Implement the reload in ViewPort
  ... note that the reload can fail if the file is still being edited.
      if this happens, then ask the app to retry next time the user clicks.
- 2 more unit tests to capture the desired behavior of requesting delayed work.
2018-11-29 21:54:13 -06:00
Benjamin Popp
0b60953ecc adding ability for IFileSystem to tell me when something changes on disk.
first pass at implementing the windows version of the new interface methods
IViewPort now has a public method to call whenever you want to notify it that its underlying file has been changed.
Added 3 tests showing how the Editor and ViewPort should behave with this new functionality.
- Editor should hook up ViewPorts whenever a new tab is opened
- Editor should clear out ViewPorts whenever a tab is closed
- ViewPort should reload when the file is changed and it is not.

Note that the model isn't implemented yet. This is just some failing tests.
2018-11-28 22:16:43 -06:00
haven1433
607ce508bc Merge pull request #9 from haven1433/dev
Find
2018-11-28 21:19:19 -06:00
Benjamin Popp
c8542fb32c fix bug when finding a result in a non-selected tab. Refactor Start/Stop pair into single disposable inside EditorViewModel to remove some code duplication. Use nameof for InlineData. 2018-11-28 21:18:12 -06:00
Benjamin Popp
2d3dc307cc Refactor EditorViewModel constructor.
Pull out command implementations into helper.
  Single-source the list of commands that need to be refreshed on tab change.
Refactor ViewPort constructor.
  Pull out command implemenatations into helper.
  Use CanAlwaysExecute instead of arg => true
Move CanAlwaysExecute to command extensions.
Change 'EditorNotifiesCanExecuteChangedOnTabChange' to a theory,
  so I can more easily add new commands to test for in the future.
Bug fix: EditorViewModel should notify copy/delete commands when tab changes.
2018-11-27 21:32:19 -06:00
Benjamin Popp
379d2059cc addressing review feedback. 2018-11-27 20:32:36 -06:00
Benjamin Popp
64d04feb8b future-proofing Find algorithm 2018-11-22 23:38:40 -06:00
Benjamin Popp
1852a86108 adding IChildViewPort interface so that IViewPort interface doesn't have a direct dependence on ViewPort concrete class. Also updated pre-build step to expect AutoImplement 1.1.0 2018-11-22 23:26:22 -06:00
Benjamin Popp
a49408cdb4 auto format 2018-11-22 23:13:15 -06:00
Benjamin Popp
4d2a6c0bba now that the autoimplement bug has been fixed, we don't have to check in a modified StubViewPort file anymore. 2018-11-22 22:58:52 -06:00
Benjamin Popp
fed4513c0e update to latest nugets 2018-11-22 22:55:44 -06:00
Benjamin Popp
ff2a36aafd make the search start from the cursor instead of the start of the file. 2018-11-17 20:50:44 -06:00
Benjamin Popp
c602660900 modified tests to pass given that CompositeViewPort actually cares about info from its children.
CompositeViewPort has correct headers
Find closes after run
CompositeViewPort can scroll now (max scroll is right, notifies work correctly)
Goto and Find Control Visibiilty notify change _after_ updating other control visibilities.
   so the control you care about (the one you actively chose to show/hide) gets notified last.
   this makes focus work as expected.
Double-clicking in a HexContent follows data links
   currently used to open full data when find-tab is double-clicked
added lots of keyboard / menuitem stuff to MainWindow.xaml
2018-11-17 20:33:40 -06:00