BBjWindow::addInputTSpinner

Description

In BBj 24.00 and higher, this method creates a BBjInputTSpinner on the BBjWindow.

Syntax

Return Value Method
BBjInputTSpinner

addInputTSpinner()

BBjInputTSpinner

addInputTSpinner(int ID)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, string mask$)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, string mask$, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, string mask$, string rules$)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, string mask$, string rules$, number restore, number value)

BBjInputTSpinner

addInputTSpinner(int ID, number x, number y, number w, number h, string flags$, string mask$, string rules$, number restore, number value, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, String mask$)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, String mask$, number min, number max)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, String mask$, string rules$)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, String mask$, string rules$, number restore, number value)

BBjInputTSpinner

addInputTSpinner(int ID, String flags$, String mask$, string rules$, number restore, number value, number min, number max)

BBjInputTSpinner

addInputTSpinner(number min, number max)

BBjInputTSpinner

addInputTSpinner(String flags$)

BBjInputTSpinner

addInputTSpinner(String flags$, number min, number max)

BBjInputTSpinner

addInputTSpinner(String flags$, String mask$)

BBjInputTSpinner

addInputTSpinner(String flags$, String mask$, number min, number max)

BBjInputTSpinner

addInputTSpinner(String flags$, String mask$, string rules$)

BBjInputTSpinner

addInputTSpinner(String flags$, String mask$, string rules$, number restore, number value)

BBjInputTSpinner

addInputTSpinner(String flags$, String mask$, string rules$, number restore, number value, number min, number max)

Parameters

Parameter Description

id

INPUTT control ID.

x

Horizontal position of the upper-left corner of the INPUTT control.

y

Vertical position of the upper-left corner of the INPUTT control.

w

Width of the INPUTT control.

h

Height of the INPUTT control. To create a standard size control, set the h parameter to 0.

flags Control flags, as follows:
FlagDescription
$0000$Left justifies text (default).
$0001$Sets the control to be initially disabled.
$0002$Passes the Enter key to the parent window.
$0004$Passes the Tab key to the parent window.
$0008$Prompts non-mouse events on the control to highlight the control text.
$0010$Sets the control to be initially invisible.
$0020$Designates the control to be part of a keyboard navigation group.
$0800$Draws a recessed client edge around the control.
$4000$Centers text.
$8000$Right justifies text.
mask Output mask. If omitted or specified as "", the current default time mask from STBL("!TIME") is used.
rules

Input rules. If specified as "", the value in STBL("!IRULES") is used.

Flag Bit Effect on Input if Bit is Set
$80$ Beep if the user types more characters than the maximum length.

restore

Restore value, specified as a number as defined by the BBx TIM variable, or -1 for blank.

val

Initial value, specified as a number as defined by the BBx TIM variable, or -1 for blank. 

Return Value

This method returns the created object.

Remarks

A BBjInputTSpinner adds spinner functionality to a standard BBjInputT control.

If the ID parameter is not specified, a control ID is assigned dynamically using getAvailableControlID().

If the x, y, width, and height parameters are not specified, they are all initialized to 0. This is typically for use with DWC windows that dynamically arrange their contents (window creation flag $00100000$).

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: BBjWindow::addInputTSpinner added.

See Also

BBjAPI

BBjSysGui

BBjControl

BBjWindow

BBjInputTSpinner

BBjInputT

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