skip to main content

Controls Reference : ENTRY-FIELD : Styles : { Auto-Spin | Spinner }

{ Auto-Spin | Spinner }
If this style is applied, the spinner arrows are displayed on the left of the entry-field to increment and decrement the entry-field content. The MSG-SPIN-UP event and the MSG-SPIN-DOWN event are fired when the user clicks the up or the down arrow. It is programmer's responsibility to activate procedures to increase or decrease the entry-field value.
 
Example - Define an entry-field with auto-spin style
screen section.
  03 screen-1-ef-3 Entry-Field
     line 35.8
     column 49.7
     size 11.6 cells 
     lines 3.5 cells 
     auto-spin
Example - Define an entry-field with the spinner style and program the events of spin up and down to add 5 and substract 5 to the current value respectively
working-storage section.
77 ws-num   pic 9(4).
screen section.
  03 screen-1-ef-5 Entry-Field
     line 50.1
     column 19.9
     size 10.7 cells 
     lines 3.0 cells 
     spinner
     event procedure screen-1-ef-5-evt-proc
     value 0
procedure division.
  evaluate event-control-id
  when 23
    evaluate event-type
    when msg-spin-up   perform screen-1-ef-5-evt-msg-spin-up
    when msg-spin-down perform screen-1-ef-5-evt-msg-spin-down
    when other
    end-evaluate
  end-evaluate.
  inquire screen-1-ef-5 value ws-num
  add 5 to ws-num
  modify screen-1-ef-5 value ws-num 
  inquire screen-1-ef-5 value ws-num
  if ws-num > 0
     add -5 to ws-num
     modify screen-1-ef-5 value ws-num
  end-if            

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left