New commands will be added:
SLIDER n$ SET VALUE k
sets value [k] for slider with name [n$]. Valid values for [k] are from 0 to 1.
FIELD n$ SET TEXT a$
sets text [a$] for text input field with name [n$].
SWITCH n$ SET STATE k
sets state [k] for switch with name [n$]. If [k] = 0 then switch is off, otherwise it is on.
2.6 version
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.6 version
New command will be added:
BUTTON n$ SET TITLE a$
sets title [a$] for button with name [n$].
BUTTON n$ SET TITLE a$
sets title [a$] for button with name [n$].
-
- Posts: 814
- Joined: Tue Apr 09, 2013 12:23 pm
- My devices: iPhone,iPad
Windows - Location: Groningen, Netherlands
- Flag:
Re: 2.6 version
For objects BUTTON and FIELD we have functions BUTTON-PRESSED() and FIELD-CHANGED(), or generic: OBJECT-TOUCHED()
IMO the new objects SWITCH and SLIDE should also have such functions.
Very nice to have the new UI objects! It is an enrichment of this Basic!
Maybe you could consider adding a scrollable LISTBOX ?
IMO the new objects SWITCH and SLIDE should also have such functions.
Very nice to have the new UI objects! It is an enrichment of this Basic!
Maybe you could consider adding a scrollable LISTBOX ?
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.6 version
Switch and slider has no generic "changed" state because they always return meaningful value: state for switch and value for slider.Henko wrote:For objects BUTTON and FIELD we have functions BUTTON-PRESSED() and FIELD-CHANGED(), or generic: OBJECT-TOUCHED()
IMO the new objects SWITCH and SLIDE should also have such functions.
Very nice to have the new UI objects! It is an enrichment of this Basic!
Maybe you could consider adding a scrollable LISTBOX ?
For button meaningful value is its "pressed" state, and for field we have "changed" value because it says that user finished typing text.
Yes, currently LIST object is under construction and it will be ready soon with several commands.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.6 version
New commands will be added:
SET LISTS CUSTOM
SET LISTS DEFAULT
set newly created lists to be of "CUSTOM" or "DEFAULT" type. Custom list type means that when list is created its text color and opacity are defined by draw color and alpha, also its background color and opacity are defined by fill color and alpha. Default list type means that lists have standard appearance.
New interface object "list" will be added with commands:
LIST n$ DELETE
deletes list with name [n$].
LIST n$ SET SELECTION k
selects row with number [k] in list with name [n$]. To clear selection, set row number to -1.
OPTION BASE command affects this command.
LIST n$ SET TEXT m
sets contents of list with name [n$] equal to contents of one-dimensional array [m].
LIST n$ TEXT m AT x,y SIZE w,h
creates list with name [n$], with contents of one-dimensional array [m], at point [x,y] and with size [w,h].
SET LISTS command affects appearance of newly created lists.
LIST_SELECTED (n$)
returns number of selected row in list with name [n$]. If nothing is selected then returns -1.
OPTION BASE command affects this function.
SET LISTS CUSTOM
SET LISTS DEFAULT
set newly created lists to be of "CUSTOM" or "DEFAULT" type. Custom list type means that when list is created its text color and opacity are defined by draw color and alpha, also its background color and opacity are defined by fill color and alpha. Default list type means that lists have standard appearance.
New interface object "list" will be added with commands:
LIST n$ DELETE
deletes list with name [n$].
LIST n$ SET SELECTION k
selects row with number [k] in list with name [n$]. To clear selection, set row number to -1.
OPTION BASE command affects this command.
LIST n$ SET TEXT m
sets contents of list with name [n$] equal to contents of one-dimensional array [m].
LIST n$ TEXT m AT x,y SIZE w,h
creates list with name [n$], with contents of one-dimensional array [m], at point [x,y] and with size [w,h].
SET LISTS command affects appearance of newly created lists.
LIST_SELECTED (n$)
returns number of selected row in list with name [n$]. If nothing is selected then returns -1.
OPTION BASE command affects this function.
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.6 version
New unique syntax of scope variables will be introduced:
Although all variables are local, smart BASIC allows you to use any variable from any function inside any other function. For this purpose you can use scope variable syntax as "scope.name", where "scope" is variable definition scope and "name" is variable name. For example, if in your program F function is defined:
DEF F(X)
X2 = X^2
X3 = X^3
F = X2 + X3
END DEF
then you can get access to its local variables X2 and X3 outside of this function like this:
X = F(2)
PRINT X; F.X2; F.X3
Scope variable syntax allows you directly set function parameters and get any number of function results.
So called "global" variables, when you get access to variables outside the function, in scope variables syntax looks similar but without any scope:
DEF F
F = .X^2
END DEF
X = 2
PRINT F
Although all variables are local, smart BASIC allows you to use any variable from any function inside any other function. For this purpose you can use scope variable syntax as "scope.name", where "scope" is variable definition scope and "name" is variable name. For example, if in your program F function is defined:
DEF F(X)
X2 = X^2
X3 = X^3
F = X2 + X3
END DEF
then you can get access to its local variables X2 and X3 outside of this function like this:
X = F(2)
PRINT X; F.X2; F.X3
Scope variable syntax allows you directly set function parameters and get any number of function results.
So called "global" variables, when you get access to variables outside the function, in scope variables syntax looks similar but without any scope:
DEF F
F = .X^2
END DEF
X = 2
PRINT F
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: 2.6 version
Yes, functions SWITCH_CHANGED() and SLIDER_CHANGED() will be available in version 2.7.Henko wrote:For objects BUTTON and FIELD we have functions BUTTON-PRESSED() and FIELD-CHANGED(), or generic: OBJECT-TOUCHED()
IMO the new objects SWITCH and SLIDE should also have such functions.