Wx::SpinCtrl

From WxPerl wiki

Jump to: navigation, search

my $pinSs = new Wx::SpinCtrl(
		  $parent,
		  -1,		# id
		  0,		 # default value
		  [-1,-1], # pos
		  [-1,-1], # size
## style
# wxSP_HORIZONTAL  # Specifies a horizontal spin button
#(note that this style is not supported in wxGTK).  

		  wxSP_VERTICAL		# specifies vertical spin button
		  | wxSP_WRAP		  # the value wraps at minimum and max
		  | wxSP_ARROW_KEYS  # The user can use arrow keys
		, 0, # min
		  90,# max
		  0, # initial
	 );

Now a little explanation of wxSP_WRAP. If you had a wxSpinCtrl like above, and you pressed the down arrow and held it, the value would go from 0 to 90, to 89 .... until it became 0 again ... that's what they mean by wrapping.

  1. initial doesn't matter (at least on win32),

as default is used instead.

    • If you know how this behaves on a different platform, or if this is a bug, please report.
Google AdSense