Opened 4 years ago

Closed 23 months ago

#12342 closed defect (fixed)

wxSpinCtrlDbl SetIncrement() and SetDigits() interaction

Reported by: steve_lamerton Owned by:
Priority: low Milestone:
Component: GUI-all Version: stable-latest
Keywords: wxSpinCtrlDbl increment Cc:
Blocked By: Blocking:
Patch: no

Description

Under GTK GetIncrement and SetIncrement have a few bugs:

  1. SetIncrement clears the current page size if one has been set.
  2. GetIncrement actually returns the page size and not the increment size.
  3. Calling SetIncrement makes no difference as by default the spin control is created with a precision of 1 and so (for example) calling SetIncrement(0.1) and then SetValue(1.1) with just display 1. This can be worked around by the user calling SetDigits before but should probably be automated.

Attached is a patch for issues 1 & 2.

Attachments (1)

spinctrlinc.patch download (840 bytes) - added by steve_lamerton 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by steve_lamerton

comment:1 Changed 4 years ago by vadz

  • Component changed from wxGTK to GUI-all
  • Milestone 2.9.2 deleted
  • Patch unset
  • Priority changed from normal to low
  • Summary changed from wxSpinCtrlDbl Get/SetIncrement issues to wxSpinCtrlDbl SetIncrement() and SetDigits() interaction

I'll apply your patches for the first two points, thanks!

Concerning the remaining one, I'm not sure how does this work in the generic version. If it doesn't do anything fancy (and I don't think it does), we should probably just document that you may want to call SetDigits() in SetIncrement() documentation. Of course, ideally we'd implement the smart behaviour for both versions but I'm not sure if it's worth the trouble.

comment:2 Changed 4 years ago by VZ

(In [65671]) Fix wrong return value of wxGTK wxSpinCtrlDouble::GetIncrement().

Due to confusion in gtk_spin_button_get_increments() parameters order the page
size was returned instead of the increment.

See #12342.

comment:3 Changed 4 years ago by VZ

(In [65672]) Preserve page size when changing increment in wxGTK wxSpinCtrlDouble.

The page size was wrongly reset when changing the increment before.

See #12342.

comment:4 Changed 23 months ago by SJL

  • Resolution set to fixed
  • Status changed from new to closed

(In [72514]) Update the wxSpinCtrlDouble documentation so SetIncrement refers to SetDigits

Closes #12342

Note: See TracTickets for help on using tickets.