Benjamin Popp
146c1ffa16
Added a "childviewport", a view that knows about its parent.
...
This was needed so that a CompositeViewPort could follow links to the main view that created it.
Implemented CompositeViewPort
Implemented Find for the EditorViewModel
Implemented Find for the ViewPort
All tabs can now request that focus move from them to another tab, but they have to know that tab by reference.
All ViewPorts can now "follow link" at a chosen (x,y).
Added tests to show how the editor should behave for tab change requests.
2018-11-17 14:04:26 -06:00
Benjamin Popp
77c9d926cd
make the tests compile
...
HACK adding StubViewPort to revision control (bug in AutoImplement keeps it from generating cleanly)
2018-11-16 21:30:33 -06:00
Benjamin Popp
ed402fbdb9
adding first pass unit tests for find feature
2018-11-16 20:12:21 -06:00
haven1433
129bc99f0e
Merge pull request #8 from haven1433/dev
...
adding cut/copy/paste/delete
2018-11-15 20:00:59 -06:00
Benjamin Popp
7331ebd0c5
cleanup code: use Enumerable.Range and string.Join instead of a for loop
2018-11-15 20:00:06 -06:00
Benjamin Popp
b65f3eadfb
adding cut/copy/paste/delete
...
adding 'help' to menu, with links to GitHub and credit to Solarized.
2018-11-11 15:57:30 -06:00
haven1433
a007ea0fa2
Merge pull request #6 from haven1433/dev
...
Add support for "Goto"
2018-11-10 22:06:13 -06:00
Benjamin Popp
67154009df
fix visual styles to correctly toggle between dark/light.
...
cleanup on Button style
2018-11-10 21:51:13 -06:00
Benjamin Popp
042a589a97
fix typo, remove duplicate code.
2018-11-08 20:51:02 -06:00
Benjamin Popp
c57953c5cf
fixing broken test (the test was wrong). Changing the implementation of Selection so that ScrollRegion.DataIndex doesn't need a public set.
2018-11-08 20:38:41 -06:00
Benjamin Popp
2f3d144e70
move goto/forward/back logic from ScrollRegion to Selection, since goto/forward/back needs to move the selection as well.
...
add style for button
add error display in the main window, with commands for hiding it
add OnError to ITabContent so tabs can bubble errors up to the main viewmodel.
fix a UI bug where hiding the goto when there are no tabs caused a crash (see MainWindow.xaml.cs)
add tests showing that selection moves during a goto
add tests showing that tab errors are shown/cleared by the EditorViewModel.
2018-11-07 21:03:31 -06:00
Benjamin Popp
ae4c73efc6
+ change out app.xaml to use dynamicresource instead of directly using solarized:Theme.
...
-> allows us to change styles at will
+ Add style for TextBlock / TextBox
+ Add handler in App.xaml.cs to update styles when the theme changes
+ Change HexContent's constants from ints to doubles so we can use them in Xaml.
+ MainWindow: add shortcuts/menuitems for Goto, Back, and Forward.
+ MainWindow: add control for Goto
+ MainWindow: add control/logic for toggling the Theme
+ MainWindow: add control to show addresses
+ EditorViewModel: add commands for back, forward, goto, and showGoto
-> UI shortcut for Goto can't just immediately do a Goto: more info is needed.
so instead, the first UI command just shows the box (and moves the focus)
and a second command performs the action.
+ ScrollRegion: implement Goto/Back/Forward
+ ScrollRegion: own the logic for updating the address headers
This is the initial push for the goto feature. There are bugs / needs more tests.
2018-11-06 21:43:01 -06:00
haven1433
ce2352aaef
Merge pull request #5 from haven1433/dev
...
* Support for save / save as
* Support for multiple tabs (open, close, save all, close all, re-ordering)
* A tab will have a '*' in the title if it is different from when it was last saved.
* Menus to allow easy access to commands like New, Open, Save, Close, Undo, and Redo. Also included keyboard shortcuts.
2018-11-04 14:26:47 -06:00
Benjamin Popp
19967071cf
updates from self-review. Minor code cleanup.
2018-11-04 07:29:32 -06:00
Benjamin Popp
59c08cd309
updates from self review. Refactoring code to make it a bit cleaner. Fixing a bug in Solarized that was preventing it from ever using night theme. Styling the TextBox foreground color. Improving comments. Added some missing tests and fixing the bugs.
2018-10-30 22:49:05 -05:00
Benjamin Popp
4acbd969f5
middle-click to close a tab. Drag tabs to re-order.
2018-10-30 20:57:23 -05:00
Benjamin Popp
8d8621a2e1
added styling for Separator. Added icon.
2018-10-29 23:07:52 -05:00
Benjamin Popp
b134d78d02
importing icons from another project. Added improvements for styles for MenuItem and TabControl.
2018-10-29 20:30:37 -05:00
Benjamin Popp
3bf17d41f8
styling menu and tabs. Still need to style the menu items.
2018-10-28 19:58:22 -05:00
Benjamin Popp
99935f5ba5
made the tab display a file name without path and extension. Made the tab have a * if the file is edited. Fixed some bugs with selection. Implemented drag-drop file support for opening files.
2018-10-28 12:54:11 -05:00
Benjamin Popp
1f1fcfb171
first pass at implementing the UI. Not sure that everything actually works yet, still needs more testing.
2018-10-27 23:05:25 -05:00
Benjamin Popp
211ff8399d
moving ChangeHistory from the model to the viewmodel, since it now provides change notification.
2018-10-27 20:42:09 -05:00
Benjamin Popp
6a821d3741
finished the model, all tests now pass. Next I get to work on changes to expose these features in the UI.
2018-10-27 20:38:44 -05:00
Benjamin Popp
a2a0d9550b
IFileSystem also needs to be able to handle opening files from the user. Added tests to show that the EditorViewModel works correctly with that. Also added a 'New' command, for creating a new file.
2018-10-27 19:43:42 -05:00
Benjamin Popp
361a9840d1
writing viewmodel for the editor. Basically, one view model to handle multiple tabs.
2018-10-27 14:06:15 -05:00
Benjamin Popp
1a7bd44228
get the code building to match what is needed for the tests.
2018-10-27 13:25:44 -05:00
Benjamin Popp
618beeaf2c
added a new test for showing the functionality of the save all command
2018-10-27 10:33:50 -05:00
Benjamin Popp
8efe5bd490
adding tests for editor viewmodel and viewport saving
2018-10-26 23:28:24 -05:00
haven1433
b64354ec2b
Merge pull request #4 from haven1433/dev
...
Minimal editing support
2018-10-26 20:33:22 -05:00
Benjamin Popp
cf2eaf0b78
updates from self review
...
+ ChangeHistory needs to do a better job of knowing if it's in the process of reverting a change.
- Include StubDisposable in HavenSoft
+ provide an extension method IDataFormat.Edit to singlesource the logic for transforming to the UnderEdit format.
2018-10-26 20:29:11 -05:00
Benjamin Popp
b012edcef8
remove newline
2018-10-19 21:51:43 -05:00
Benjamin Popp
b6813f1c44
add .editorconfig and auto-format all files
2018-10-19 21:40:22 -05:00
Benjamin Popp
a2cf3a3b85
reorder fields
2018-10-19 21:38:20 -05:00
Benjamin Popp
f83c05a4ac
refactor Edit method, which was too long. Also make it impossible to select before the data, and make it possible to select only one byte after the data. Adding data past the end expands the backing memory.
2018-10-19 21:38:00 -05:00
Benjamin Popp
0fa4c4fbc1
moving common viewmodel code into a base class. Could've used a helper class instead of a base class, but this way there is slightly less glue code. Will revisit this decision if the base class is needed for something else.
2018-10-18 21:00:15 -05:00
Benjamin Popp
31db2107df
refactor: move logic from ViewPort into a Selection helper class.
2018-10-18 20:53:15 -05:00
Benjamin Popp
5afd78a2ed
refactoring scrolling code into a helper class.
2018-10-18 19:39:50 -05:00
Benjamin Popp
a0e1b3013c
Selected points need to update based on view width changes
2018-10-18 15:13:38 -05:00
Benjamin Popp
729a1d3a5d
implement UI for editing. Found 2 bugs in the model from hand-testing, so I added two tests to capture those errors and then fixed the model.
2018-10-18 14:10:49 -05:00
Benjamin Popp
2730665636
all the tests pass. Added some more tests related to NotifyCollectionChanged to make sure I don't spam that. ViewPort needs to be refactored. I'll probably finish the view first and then try to clean up ViewPort.
2018-10-18 13:38:24 -05:00
Benjamin Popp
b95e43a9e1
wrote basics of the edit algorithm. It's long and needs to be refactored. It tracks what changes could be undone, but undo isn't implemented yet. CanEditData now passes, as does CanEditMultipleBytesInARow.
2018-10-17 22:45:04 -05:00
Benjamin Popp
5894ed1ca8
code now compiles. Added more tests for how undo should interact with scrolling / selection. Added extension method for ICommand so I can say 'Execute()' instead of 'Execute(null)' for commands that don't care about the parameter. Added a new data format to deal with data that is mid-edit.
2018-10-17 20:10:56 -05:00
Benjamin Popp
44b717ef9a
adding undo/redo manager object, named ChangeHistory. Added tests showing how it should work.
2018-10-16 22:26:58 -05:00
Benjamin Popp
682bd02b8b
split the tests into 3 files since the current test file was getting a little long. Added tests for redo.
2018-10-15 22:13:07 -05:00
Benjamin Popp
3e93377fd7
adding some tests for how I want text entry / undo to work.
2018-10-15 19:33:28 -05:00
haven1433
cb14de4185
Merge pull request #3 from haven1433/dev
...
Adding Selection Support
2018-10-15 19:22:14 -05:00
Benjamin Popp
61383372d6
sanitizing empty file scrolling. MaximumScroll should never be below zero. Empty files should be unable to scroll.
2018-10-14 15:08:50 -05:00
Benjamin Popp
ad6b24fcbf
fixing an edge case bug: if the user asks to scroll but scrolling is not possible, then the selection should stay the same as well.
2018-10-14 10:59:44 -05:00
Benjamin Popp
e2c9307778
rename _variant to variant to match the rest of the source naming conventions.
2018-10-14 09:56:39 -05:00
Benjamin Popp
ceedbfba43
removing unused using
2018-10-10 22:04:48 -05:00