Commit Graph

48 Commits

Author SHA1 Message Date
Summate 65a9097980
Allowing a paste into a number field to be trimmed automatically (#2414)
The specific issue I experienced is that Excel/LibreOffice Calc add a newline when you copy the contents of a single cell. This is bad behavior and they should provide a copy option that does not do that, but alas, it's much harder to get that into those applications. This behavior made it impossible to paste an otherwise-valid hex address into the Project64 fields without first putting it into Notepad, deleting the newline, recopying, and then doing the paste from there. If the field was simply text, you can go into the field edit and shift + home to select all and then do a copy, but that does not work for a formula. When you edit the file, it shows the formula instead. Therefore, you have absolutely no way of working around this except pasting it somewhere else and removing the newline manually.

In principle, there's no reason why you wouldn't trim the ends at least. Whitespace on either end is useless to you. However, content being after the newline should be rejected as it was before.

There were two secondary issues in the pasting code that are fixed here: One is that it only sort of collapsed single spaces. So if you had more than one space, spaces still would have ended up in the result. Actually I think the semantics were slightly more insidious, <space><number> would have turned into <number><same number> effectively. The only thing it did was remove the space by duplicating the number. If you had two spaces, then it would have ended up with e.g. <space><number><same number>. The only case where this wouldn't have happened is a space at the end which would have been preserved in the paste.

Secondly, it mutated the clipboard data directly. This would have lead to confusing results where multiple pastes would have had clipboard data in the clipboard itself move from, for example, two spaces to a single space to no spaces at all. The better solution is to preprocess to figure out how big we ultimately want our space-less result to be and stamp out the copy ourselves skipping anything we don't want. Leave the clipboard alone.

If it's desired to preserve single spaces only in the middle, the code will need to be modified a bit.

Co-authored-by: Summate <summate.ssbm@gmail.com>
2024-06-06 14:22:26 +09:30
zilmar ea70218d1c Clean up warnings 2023-02-28 10:09:08 +10:30
zilmar 761a1ee52a Code clean up 2022-10-10 10:52:17 +10:30
zilmar 179282043f Project64: Code cleanup 2022-09-26 12:01:54 +09:30
zilmar a65086579f Project64: Code clean up 2022-09-21 14:46:07 +09:30
shyguyhex ac94f2505e
[Debugger] Rewrite script API (#2110)
* [Debugger] Rewrite script API

* Update js api paths in installer script
2021-09-03 14:41:04 +09:30
zilmar ee864797ab vgturtle127's Beautification 14 - Source\Project64-video directory and final cleanup 2021-05-18 21:21:36 +09:30
zilmar cdb7cdcfd5 Replace getwindow text with GetCWindowText 2021-04-20 12:26:16 +09:30
zilmar 662637460e Remove Disable copy constructor comments 2021-04-13 09:37:11 +09:30
zilmar cf58754414 Change NULL to nullptr 2021-04-12 21:05:39 +09:30
Derek "Turtle" Roe 9ec34d4c39 Update HexEditCtrl.cpp
Fix title case, adjust spacing, fix comments
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 3a18ee46de Update ListCtrl.h
Fix lines, fix title case, fix typos, fix abbreviations
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 8251abf36d Update ListCombo.h
Remove a line, fix title case
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 53d936ec05 Update DragDrop.h
Remove a line, fix title case
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 82059adc6f Update ListDate.h
Remove a line, fix title case, adjust spacing
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 2d427d3a3b Update ListEdit.h
Fix title case and punctuation, remove one line at the top
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 4052011e09 Update TitleTip.h
Fix title case, adjust spacing, remove some punctuation
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe c8faa1d46d Update wtl-BitmapPicture.h
Add newline
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe eba0bc30a2 Update TooltipDialog.h
Remove a line, remove some spacing
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe be699d3986 Update PartialGroupBox.cpp
Remove punctuation, fix title case
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe c417a1e439 Update ModifiedEditBox.h
Remove a line
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 77f1bde845 Update ModifiedEditBox.cpp
Add newline
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 215859c96e Update ModifiedComboBox.h
Remove a line
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe eb03ed4b7e Update GetCWindowText.h
Remove a line
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 7e922500b6 Update GetCWindowText.cpp
Add newline
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 8859fab473 Update EditNumber32.cpp
Fix title case and adjust some spacing, add newline
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 1049ffe489 Update ListTypes.h
Remove a line
2021-03-17 20:47:05 -05:00
Derek "Turtle" Roe 3f9431d609 Update DataArray.h
Fix title case and add a line
2021-03-17 20:47:05 -05:00
zilmar 5c60ea213f Update copyright date 2021-03-02 12:43:17 +10:30
Vincent Cunningham dcb360cf41
Replace \ with / in include directives 2021-02-28 17:38:56 -05:00
oddMLan 914ad3b74a Remove hardcoded Unicode API calls
Since #define UNICODE is defined in the project it will call the wrapper function which will return the W version
2021-01-01 20:37:00 -07:00
zilmar 883632b4a4 Project64: Add choosing game dir on welcome screen 2020-08-04 22:28:40 +09:30
shygoo e1b2fee7af [Debugger] Use better charset for memory viewer's text 2020-06-18 22:46:17 -05:00
shygoo f82ee04173 Fix pasting for EditNumber32 textboxes 2020-06-14 03:04:41 -05:00
zilmar 0462f637c4 Add UNICODE to Project64 project 2020-05-12 21:49:05 +09:30
Summate af0b0e18ea Adding label IDs to correspond to debugger register edit IDs
Abstracting pairing edit IDs with label IDs
Extracting definition of register tab data to a separate file
Adding a facility to get the text of a CWindow, there didn't seem to be a straightforward mechanism to do this Adding functionality to clipboard the current tab's registers or registers from all tabs
Fixing FCSR to have the same styling as all of the other register edit fields
2020-04-09 01:17:19 -05:00
Summate fef045baed Cleaning up unclear booleans with a clearer enum class 2020-04-08 07:00:17 -05:00
shygoo 277f1c4a31 [Debugger] Clean up compiler warnings 2020-01-22 00:34:27 -06:00
shygoo 5c2aa06f7c [Debugger] Rewrite memory viewer
replace the list control with a custom hex editor control
add ability to select/copy/paste/delete multiple bytes
add byte group size option
make window resizable
fix DPI-related issues
speed up auto-refresh
remove option to disable auto-refresh (new control's cpu usage is insignificant)
move the dump and search buttons into the context menu
change colors of breakpoints to match the command window's
highlight CPU read and write targets while stepping
move address info into a status bar
allow window to open before MMU is initialized
add shortcut keys for various actions
add "follow pointer" feature
add "safe mode" feature
add copy gameshark code feature
add copy with row/group addresses feature
add tabs feature
add jump menu for hardware regions
fix cartridge ROM addresses not being viewable
allow writes to cartridge ROM
use thread-safe functions for reading/writing memory
2019-11-30 11:48:46 -06:00
oddMLan 3b9cafc058 [Debugger UI] Try to handle spaces in Mem Viewer address editbox
FormatClipboard() doesn't seem to be doing anything for some reason.
2019-05-13 01:32:00 -07:00
zilmar 188d6ae6d1 [User Interface] Rename CEditNumber to CEditNumber32 2017-11-22 07:37:45 +11:00
zilmar 6fa3be42cd [User Interface] Move code for EditNumber32 code to in to cpp file 2017-11-21 18:09:50 +11:00
zilmar 9267d1311d [User Interface] Rename numberctrl.h to EditNumber32.h 2017-11-21 17:53:34 +11:00
zilmar 0730582085 [Project64] Clean up some warnings in List Control 2017-11-10 16:52:10 +11:00
zilmar 06653d326a [Project64] Fix up warning ListCtrl.h 2017-09-13 20:13:09 +10:00
shygoo 47fd0632ff Add debug features 2017-08-18 00:08:22 -05:00
zilmar a228a9d1f9 line ends ? 2016-01-27 20:11:59 +11:00
zilmar e3b32c572d [Project64] Remove spaces from filename 2015-12-04 17:49:31 +11:00