Last and this month, controls challenges are going in the Challenge of the Month. So today, I'd like to write about Controls.
Controls in Small Basic
There are three controls in Small Basic - button, text input box and multi-line text input box. Following sample screen shots are from a program Dictionary 1.2b (ZRS542-0).
Button
Image may be NSFW.
Clik here to view.
Text Input Box
Image may be NSFW.
Clik here to view.
Multi-Line Text Input Box
If this control has a long text, scroll bars appear like following screen shot. Scroll bar is another control.
Image may be NSFW.
Clik here to view.
Controls Challenges
Other controls in Small Basic? We can write code for them. Here are many samples in Challenge of the Month.
Password
This password control (LXM256) is published by Alexwarrington.
Image may be NSFW.
Clik here to view.
This is another password control (CND797) by WhTurner33.
Image may be NSFW.
Clik here to view.
Fancy Button and Read Only Text Box
This is a fancy button sample (GGL988) by litdev. And this program is also a sample for switching between read only and read/write text input box. Great!
Image may be NSFW.
Clik here to view.
Rotary Control
This control (HZV539-0) is originally written by Pappa Lapub. I modified not to rotate image but to move red dot. Anyway, it's cool. You need the rotary knob image for this program.
Image may be NSFW.
Clik here to view.
Read Only Text Box
This is very simple version of read only text box by NaochanON.
Msg
=
"This is read only"
box
=
Controls
.
AddTextBox
(
20
,
20
)
Controls
.
SetTextBoxText
(
box
,
msg
)
Msg2
=
"This is editable"
box2
=
Controls
.
AddTextBox
(
20
,
50
)
Controls
.
SetTextBoxText
(
box2
,
msg2
)
GraphicsWindow
.
Keyup
=
Onkeyup
Sub
onkeyup
txt
=
Controls
.
GetTextBoxText
(
box
)
If
txt
<
>
Msg
Then
GraphicsWindow
.
ShowMessage
(
"Sorry, This is Read Only"
,
"error"
)
Controls
.
SetTextBoxText
(
box
,
msg
)
EndIf
EndSub
Image may be NSFW.
Clik here to view.
This another control (WZH765-0) is written by Jibba Jabba.
Image may be NSFW.
Clik here to view.
Combo Box
This program (KMG391-0) is written by Nonki Takahashi (me!).
Image may be NSFW.
Clik here to view.
Slider
This control (DST499) is published by OzJerry.
Image may be NSFW.
Clik here to view.
Scroll Bar
This program (XZB099) is written by Nonki Takahashi (again).
Image may be NSFW.
Clik here to view.
Selector
This selector (QMD177) is written by Jibba Jabba again.
Image may be NSFW.
Clik here to view.
Multi Feature Dialog Box
This program (SXD381-0) is written by Jibba Jabba also.
Image may be NSFW.
Clik here to view.
Drop Down Menu
This program (BGF911-1) is also written by Jibba Jabba. Wow! Lot of works!
Image may be NSFW.
Clik here to view.
Expander
This control (WMK208-0) is written by Pappa Lapub also.
Image may be NSFW.
Clik here to view.
Other Controls
I wrote about the other controls in a TechNet Wiki article Small Basic: Controls.
- Check Box (GZL896 Image may be NSFW.
Clik here to view.) - Check box control is an on/off switch. Details are described in an article Small Basic: How to Make a Check Box.
- Radio Button (SZW634 Image may be NSFW.
Clik here to view.) - Radio buttons are controls to select one from a group.
- Color Slider (HWD964 Image may be NSFW.
Clik here to view.) - Slider control is to get a value from a range.
- Progress Bar (MBB966-0 Image may be NSFW.
Clik here to view.) - Progress bar shows percentage.
See Also
- Small Basic - Controls are Shapes (blog)
- Small Basic: Controls (wiki)
- Challenge of the Month - October/November 2015 (forum)
Image may be NSFW.
Clik here to view.