BBjInputTSpinner::getSpinField

Description

In BBj 24.00 and higher, this BBjInputTSpinner method returns the field signifying how much the spinner will spin on an up or down button.

Syntax

Return Value Method
int getSpinField()

Parameters

None.

Return Value

Returns one of BBjInputTSpinner::HOUR, BBjInputTSpinner::MINUTE, BBjInputTSpinner::SECOND, or BBjInputTSpinner::MILLISECOND.

Remarks

The default spin field is MINUTE.

Example

rem ' BBjInputTSpinner

sysgui = unt
open (sysgui)"X0"
print (sysgui)'scale'(2,2)
sysgui! = bbjapi().getSysGui()
window! = sysgui!.addWindow(25,25,230,250,"BBjInputTSpinner",$2009008f$)
window!.setCallback(sysgui!.ON_CLOSE,"eoj")

rem ' BBjInputTSpinner
window!.addGroupBox(101,10,10,200,210,"BBjInputTSpinner")
window!.addStaticText(102,15,30,60,25,"Spinner:",$8000$)
inputt! = window!.addInputTSpinner(103,80,30,115,25,9,16.5)
inputt!.setValue(time("123456"))
inputt!.setCallback(sysgui!.ON_SPIN, "spin")
inputt!.setCallback(sysgui!.ON_INPUT_KEYPRESS,"event")
inputt!.setCallback(sysgui!.ON_EDIT_MODIFY,"event")
inputt!.setCallback(sysgui!.ON_GAINED_FOCUS,"event")
inputt!.setCallback(sysgui!.ON_LOST_FOCUS,"event")
inputt!.setCallback(sysgui!.ON_MOUSE_ENTER,"event")
inputt!.setCallback(sysgui!.ON_MOUSE_EXIT,"event")
inputtSpinDown! = window!.addButton(104,80,60,40,21,"<",$$)
inputtSpinDown!.setCallback(sysgui!.ON_BUTTON_PUSH,"inputtSpinDown")
inputtSpinUp! = window!.addButton(105,125,60,40,21,">",$$)
inputtSpinUp!.setCallback(sysgui!.ON_BUTTON_PUSH,"inputtSpinUp")
window!.addStaticText(106,15,90,60,25,"Mask:",$8000$)
inputtMask! = window!.addEditBox(107,80,90,100,25,inputt!.getMask())
inputtMask!.setCallback(sysgui!.ON_LOST_FOCUS,"inputtMask")
window!.addStaticText(108,15,120,60,25,"Minimum:",$8000$)
inputtMinimum! = window!.addInputT(109,80,120,100,25)
inputtMinimum!.setValue(inputt!.getMinimumTime())
inputtMinimum!.setCallback(sysgui!.ON_LOST_FOCUS,"inputTMinimum")
window!.addStaticText(110,15,150,60,25,"Maximum:",$8000$)
inputtMaximum! = window!.addInputT(111,80,150,100,25)
inputtMaximum!.setValue(inputt!.getMaximumTime())
inputtMaximum!.setCallback(sysgui!.ON_LOST_FOCUS,"inputTMaximum")
inputtHour! = window!.addRadioButton(113,15,180,45,25,"h",$0020$)
inputtHour!.setCallback(sysgui!.ON_CHECK_ON,"inputtHours")
inputtHour!.setToolTipText("Spin hours")
inputtMinute! = window!.addRadioButton(114,60,180,45,25,"m",$0024$)
inputtMinute!.setCallback(sysgui!.ON_CHECK_ON,"inputtMinutes")
inputtMinute!.setToolTipText("Spin minutes")
inputtSecond! = window!.addRadioButton(115,105,180,45,25,"s",$0020$)
inputtSecond!.setCallback(sysgui!.ON_CHECK_ON,"inputtSeconds")
inputtSecond!.setToolTipText("Spin seconds")
inputtMillisecond! = window!.addRadioButton(116,150,180,45,25,"t",$0020$)
inputtMillisecond!.setCallback(sysgui!.ON_CHECK_ON,"inputtMilliseconds")
inputtMillisecond!.setToolTipText("Spin milliseconds")
vector! = bbjapi().makeVector()
vector!.add(inputtHour!)
vector!.add(inputtMinute!)
vector!.add(inputtSecond!)
vector!.add(inputtMillisecond!)
radioGroup! = window!.addRadioGroup(vector!)
statusbar! = window!.addStatusBar(99,$$)
statusbar!.setText("Spin events go here")
dim event$:tmpl(sysgui)
process_events

eoj:
release

event:
    event! = sysgui!.getLastEvent()
    control! = event!.getControl()
    print control!," ",event!
return

spin:
    gosub event
    statusbar!.setText("Spin on "+c$+": "+event!.getText())
return

inputtSpinUp:
    time = inputt!.getNextTime()
    print "getNextTime",time," ",date(0,time:inputt!.getMask(),err=*next)
    inputt!.spin(1)
return

inputtSpinDown:
    time = inputt!.getPreviousTime()
    print "getPreviousTime",time," ",date(0,time:inputt!.getMask(),err=*next)
    inputt!.spin(0)
return

inputtMask:
    inputt!.setMask(inputtMask!.getText())
    inputtMinimum!.setMask(inputtMask!.getText())
    inputtMaximum!.setMask(inputtMask!.getText())
return

inputtMinimum:
    inputt!.setMinimumTime(inputtMinimum!.getValue())
    print "getMinimumTime",inputt!.getMinimumTime()
return

inputtMaximum:
    inputt!.setMaximumTime(inputtMaximum!.getValue())
    print "getMaximumTime",inputt!.getMaximumTime()
return

inputtHours24:
    inputt!.setSpinField(inputt!.HOUR_OF_DAY)
    print "getSpinField",inputt!.getSpinField()
return

inputtHours:
    inputt!.setSpinField(inputt!.HOUR)
    print "getSpinField",inputt!.getSpinField()
return

inputtMinutes:
    inputt!.setSpinField(inputt!.MINUTE)
    print "getSpinField",inputt!.getSpinField()
return

inputtSeconds:
    inputt!.setSpinField(inputt!.SECOND)
    print "getSpinField",inputt!.getSpinField()
return

inputtMilliseconds:
    inputt!.setSpinField(inputt!.MILLISECOND)
    print "getSpinField",inputt!.getSpinField()
return

ClosedVersion History

  • BBj 24.00: BBjInputTSpinner::getSpinField added.

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.