jovibor / HexCtrl

Fully-featured Hex Control written in C++/MFC.
Other
164 stars 61 forks source link

Support data operations on all data or only selection #39

Closed datasynergyuk closed 3 years ago

datasynergyuk commented 3 years ago

Support operations on all data or only selection Avoid unnecessary byte swap for bitwise NOT operation Added swap (reverse) bytes data operation Minor change to operations dialog layout to fit new controls

jovibor commented 3 years ago

As mentioned previously, an implicit options could be very harmful for the user. Choosing to operate on a whole data by default, when there is no selection provided, is very dangerous. User might just be unable to notice this selected tiny radio button and press Ok, which may lead to very undesirable/danger consequences, especially when the data size is very big. In the domains like this everything must be as explicit as possible.

I'm not sure option like this needed at all, a user can always just select a whole data region if he so wants Ctrl+A.

datasynergyuk commented 3 years ago

I think maybe we will need to disagree about this. From my perspective, this is a standard (almost universal) feature of every hex editor tool. There are many ways a user can damage their data. For instance, they could accidentally paste data from the clipboard. I think we should give the user the credit that they know what they are doing.

However, if this isn't enough, I can suggest two possible compromises:

  1. Do not auto-select "All" when there is no selection - In this way, the user will be forced to choose All before performing the operation
  2. Add a flag to the HEXCREATESTRUCT to allow the software developer to make this choice (for their users)
jovibor commented 3 years ago

There are many ways a user can damage their data

Yes, let's add another one.

For instance, they could accidentally paste data from the clipboard.

That can be easily Undone, which is not the case when a very big amount of data accidentally had modified.

Do not auto-select "All" when there is no selection - In this way, the user will be forced to choose All before performing the operation

I think some explicit confirmation must be added for that matter. Message box asking Yes/No to continue when entire data region is chosen. Then ok, i can agree with that.

datasynergyuk commented 3 years ago

I will have another go at this when you have finished your latest round of changes. It is too depressing to try to figure out which elements of my contribution are still useful when the code keeps changing.