Celestia icon indicating copy to clipboard operation
Celestia copied to clipboard

[win] Can't paste floating point numbers into the "Julian Date" field

Open SevenSpheres opened this issue 4 years ago • 8 comments

Describe the bug Apparently 1.6.2 still has bugs. In both 1.6.1 and 1.6.2, I can't type a decimal point in the "Julian Date" field of the "Set Simulation Time" window. In 1.6.1 I'm still able to paste in a number with a decimal point, but when I try to do that in 1.6.2 I get the message "Unacceptable Character. You can only type a number here."

This bug does not exist in 1.7.0, either the Qt or Windows native version. @LukeCEL is unable to reproduce this on Mac.

To Reproduce Steps to reproduce the behavior:

  1. Go to "Time" menu
  2. Click on "Set Time"
  3. Copy and paste a floating point number (e.g. 2451330.5069) into the "Julian Date" field
  4. See error message

Expected behavior The number is pasted into the "Julian Date" field.

Desktop (please complete the following information):

  • OS: Windows 10
  • Version: 1.6.2

SevenSpheres avatar Mar 22 '20 01:03 SevenSpheres

Just to be sure: this occurs with both Qt and Win or with Win only?

pirogronian avatar Apr 02 '20 06:04 pirogronian

"1.6.2" tells me that win only :)

375gnu avatar Apr 02 '20 07:04 375gnu

It's really curious, git diff showed no defference in wintime.cpp between 1.6.x and master. But I only briefly looked at it. Also I dont have Windows.

pirogronian avatar Apr 02 '20 09:04 pirogronian

@SevenSpheres what is your locale? I cannot enter a point, but I can paste without any errors.

375gnu avatar Apr 05 '20 15:04 375gnu

okay. maybe the different behavior because you use windoze, while i checked using wine.

https://docs.microsoft.com/en-us/windows/win32/controls/edit-control-styles says:

ES_NUMBER | Allows only digits to be entered into the edit control. Note that, even with this set, it is still possible to paste non-digits into the edit control. To change this style after the control has been created, use SetWindowLong. To translate text that was entered into the edit control to an integer value, use the GetDlgItemInt function. To set the text of the edit control to the string representation of a specified integer, use the SetDlgItemInt function.

To fix this we need to use custom controls. But as we don't have any windoze dev, we doubt this will be ever fixed.

375gnu avatar Apr 05 '20 15:04 375gnu

But as we don't have any windoze dev, we doubt this will be ever fixed.

Okay, it can probably be closed then, since it's not that big an issue and only affects 1.6.2.

SevenSpheres avatar Apr 05 '20 17:04 SevenSpheres

Okay, it can probably be closed then, since it's not that big an issue and only affects 1.6.2.

Closing because of this, since there's now a final release of 1.6.2 (except for data updates, which can hopefully be added later as a 1.6.2.1 update)

SevenSpheres avatar Nov 10 '20 19:11 SevenSpheres

This issue seems to be present in 1.7.0 with the native Windows frontend, although according to my original post it wasn't in 2020.

SevenSpheres avatar Sep 07 '22 22:09 SevenSpheres