Commit Graph

3392 Commits

Author SHA1 Message Date
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
haven1433
9cc5d3b228 Create README.md
adding first draft readme with details about the plan / intent for the project.
2018-10-10 21:58:39 -05:00
Benjamin Popp
fd9d8afd6d add UI interactions for selection. Draw the selection. Fixed a bug where scrolling caused the selection to change in the wrong direction. Added capability for the model to answer if a given cell is selected. 2018-10-10 21:21:27 -05:00
Benjamin Popp
337a29311f adding visual style for scrollbar 2018-10-09 22:46:07 -05:00
Benjamin Popp
44feccba8c get all the tests passing. Ideally this means that selection works correctly now, but when we finish implementing the view we'll see what other tests we need. 2018-10-07 22:00:33 -05:00
Benjamin Popp
0565bfc055 make it compile: adding the minimal required so that I can compile the new tests. This includes fixing syntax errors in the tests and adding the required new members. 2018-10-07 19:47:11 -05:00
Benjamin Popp
4611c14216 Merge branch 'master' into dev1
Merging from master to dev1
2018-10-07 19:31:15 -05:00
haven1433
85fd631ae7 Merge pull request #1 from haven1433/dev
First Commit
2018-10-07 19:20:11 -05:00
Benjamin Popp
90601a1dd4 self review improvements
Fixed a bug in update scroll range where the maximum scroll value could be wrong if the data was offset by part of a line.
empty ViewPorts get an empty name instead of a null name
minimum scroll is always zero, so just make it so
Rename Update -> TryUpdate to match C# conventions
'resetArgs' is a constant, so make it static and capital
remove unused usings
test cleanup:
replace changeList with changedProperties to make it easier to read ViewPortNotifiesOnSizeChange
use the new HexElement.Undefined in ViewPortStartsEmpty
rename ViewPortWillNotScrollAboveAllData to ViewPortCannotScrollLowerThanMinimumScroll, since that's what it's actually testing and the old test name refered to a behavior that is no longer wanted
2018-10-07 13:26:13 -05:00
Benjamin Popp
5de41e7e29 removing hard link to AutoImplement - using the NuGet instead. Updating from review comments. 2018-10-06 20:51:40 -05:00
Benjamin Popp
6bedf8269b adding some tests for the features I'm going to work on next: cursor, selection, shifting left/right 2018-10-06 20:12:37 -05:00
Benjamin Popp
1d9a2e90b5 updating from review comments. DataFormats.None doesn't use IsUnused, so IsUnused should be removed a speculative code. Update ViewPort to not allow any more than one line-completions worth of empty bytes at the start. 2018-09-16 10:46:04 -05:00
Benjamin Popp
826dbdbdb9 updating from review comments. DataFormats.None doesn't use IsUnused, so IsUnused should be removed a speculative code. Update ViewPort to not allow any more than one line-completions worth of empty bytes at the start. 2018-09-16 10:38:56 -05:00
Benjamin Popp
90f70f3779 first pass at adding theming 2018-09-15 20:00:50 -05:00
haven1433
f6e0b3a05d Merge pull request #2 from haven1433/add-license-1
Create LICENSE
2018-09-15 15:28:48 -05:00
haven1433
bab16b424d Create LICENSE 2018-09-15 15:28:22 -05:00
Benjamin Popp
cd86ef1f2e don't allow data to scroll totally out of view. 2018-09-15 15:23:56 -05:00
Benjamin Popp
641453c718 added some more tests, removed unused usings, made DataFormats Equatable. Removed dead code from MainWindow.xaml, since the viewmodel doesn't need to be assigned twice. 2018-09-14 20:55:11 -05:00
Benjamin Popp
36d9fe36a1 Make the tests pass. Added a test to verify that I'm updating the scroll-index correctly from the data-index when the size of the viewport changes. Moved the FormatDrawer to its own file. Might need to find a better name for it at some point. Removed some dead using statements from SharedAssemblyInfo.cs. 2018-09-14 07:15:02 -05:00
Benjamin Popp
5e8461f523 Scrolling view/viewmodel written. You can actually load and display a file now. You can scroll through the file with the scroll wheel or a scroll bar. Also added the outline of how the renderer (via a Visitor pattern). 2018-09-13 22:51:52 -05:00
Benjamin Popp
5abc812b19 added notification for ViewPort's Min/Max Scroll properties. Turned CommonFormats into a sort of enum that collects together different data formats. Until I know more, I have to assume that each dataformat won't really have stuff in common with other data formats, which means that it's just a collection of separate unrelated classes. Changed ViewPort's use of LoadedFile to make it so you have to pass a loaded file in at construction time. 2018-09-13 07:20:39 -05:00
Benjamin Popp
f7f713bc33 make the current failing test pass: ViewPort now notifies on size changes. Add two new failing tests for what I should work on next: loading files and scrolling. Also added the boilerplate so that I can start using StubCommand from AutoImplement. 2018-09-12 22:27:11 -05:00
Benjamin Popp
e9380a5b79 creating HexContent and its ViewModel, ViewPort. I expect that HexContent will represent an area of the screen filled with hex data. There will probably be a wrapper panel that adds the scrollbar to the right and addresses to the left. ViewPort can act as the ViewModel for that entire panel. Added a failing test so I remember to go back and make the ViewModel notify when it's Width/Height gets changed. 2018-09-11 22:20:37 -05:00
Benjamin Popp
c541158043 initial commit. Project is just a skeleton. 2018-09-06 22:48:12 -05:00