Widgets an obsolete application just for playing and getting touch with
widgets. Written in plain Ano script, no C involved.
Widgets demonstrates how to use different type of widgets.
User interface
There is dummy widgets to play with.
Compilation
Easiest way to get Widgets running is to go to examples directory in
package root, and run:
$ ./build.sh gui_widgets
build.sh script compiles Ano script, menu and widget definitions to C, copies
source files in place and pops up instructions what to do next. Follow them.
Check also examples/README for more info.
;
; Copyright (c) 2016-2023, Jani Salonen <salojan at goto10 piste co>
; All rights reserved.
;
; @WIDGET_DEFAULT_COLOR rgb:#ffffff
; @WIDGET_DEFAULT_HUE 0
; @WIDGET_DEFAULT_LIGHT no
; @WIDGET_DEFAULT_STATE enable
; @WIDGET_DEFAULT_STICKY no
; @WIDGET_DEFAULT_TITLE_CHARSET UTF-8
; @WIDGET_DEFAULT_TITLE_COLOR rgb:#ffffff
; @WIDGET_DEFAULT_TITLE_DPI 0
; WIDGET_DEFAULT_TITLE_FONT path_to_the_font_file
; @WIDGET_DEFAULT_TITLE_JUSTIFICATION center
; @WIDGET_DEFAULT_TITLE_POSITION above
; @WIDGET_DEFAULT_TITLE_SIZE 11
; @WIDGET_DEFAULT_TRIGGER constant
; @WIDGET_DEFAULT_TYPE 0
; @WIDGET_DEFAULT_VALUE 0
;
; @WIDGET_USE_BOUNDING_BOXES no
;
window "1" {
set "0" {
widget "background" {
name "background"
image "examples/datafiles/background.tga"
}
; Turnswitch type 0
widget "turnswitch" {
name "widget_a"
position x = 80, y = 100
angle min = 45, max = 315
steps start = 0, total = 100
title "Large chicken head", \
x = 0, y = -50
action turn = cb_turn_a
}
; Turnswitch type 1
widget "turnswitch" {
name "widget_b"
type 1
position x = 280, y = 108
angle min = 45, max = 315
steps start = 0, total = 100
title "Small chicken head", \
x = 0, y = -20
action turn = cb_turn_b
}
; Turnswitch type 2
widget "turnswitch" {
name "widget_c"
type 2
position x = 88, y = 310
angle min = 1, max = 359
steps start = 0, total = 359
title "Large round", \
x = 0, y = -20
action turn = cb_turn_c
}
; Turnswitch type 3
widget "turnswitch" {
name "widget_d"
type 3
position x = 296, y = 318
angle min = 1, max = 359
steps start = 0, total = 359
title "Small round", \
x = 0, y = -20
action turn = cb_turn_d
}
; Turnswitch type 4
widget "turnswitch" {
name "widget_e"
type 4
position x = 96, y = 500
angle min = 5, max = 355
steps start = 0, total = 9
title "Large flat-top", \
x = 0, y = -20
action turn = cb_turn_e
}
; Turnswitch type 5
widget "turnswitch" {
name "widget_f"
type 5
position x = 304, y = 508
angle min = 5, max = 355
steps start = 0, total = 11
title "Lights, please!", \
x = 0, y = -20
action turn = cb_turn_f
}
; Lamp type 0
widget "lamp" {
name "lamp_a"
position x = 440, y = 80
title "Red lamp", \
x = 0, y = -10
}
; Lamp type 1
widget "lamp" {
name "lamp_b"
type 1
position x = 558, y = 80
title "Orange", \
x = 0, y = -10
}
; Lamp type 2
widget "lamp" {
name "lamp_c"
type 2
position x = 676, y = 80
title "White", \
x = 0, y = -10
}
; Lamp type 3
widget "lamp" {
name "lamp_d"
type 3
position x = 440, y = 240
title "Green", \
x = 0, y = -10
}
; Lamp type 4
widget "lamp" {
name "lamp_e"
type 4
position x = 558, y = 240
title "Blue", \
x = 0, y = -10
}
; Lamp type 5
widget "lamp" {
name "lamp_f"
type 5
position x = 676, y = 240
title "Purple", \
x = 0, y = -10
}
; Led type 1, subtype 0
widget "led_1" {
name "led_a_a"
position x = 460, y = 400
}
; Led type 1, subtype 1
widget "led_1" {
name "led_a_b"
type 1
position x = 460, y = 432
}
; Led type 1, subtype 2
widget "led_1" {
name "led_a_c"
type 2
position x = 460, y = 464
}
; Led type 1, subtype 3
widget "led_1" {
name "led_a_d"
type 3
position x = 460, y = 496
}
; Led type 1, subtype 4
widget "led_1" {
name "led_a_e"
type 4
position x = 460, y = 528
}
; Led type 1, subtype 5
widget "led_1" {
name "led_a_f"
type 5
position x = 460, y = 560
}
; Led type 2, subtype 0
widget "led_2" {
name "led_b_a"
position x = 584, y = 400
}
; Led type 2, subtype 1
widget "led_2" {
name "led_b_b"
type 1
position x = 584, y = 432
}
; Led type 2, subtype 2
widget "led_2" {
name "led_b_c"
type 2
position x = 584, y = 464
}
; Led type 2, subtype 3
widget "led_2" {
name "led_b_d"
type 3
position x = 584, y = 496
}
; Led type 2, subtype 4
widget "led_2" {
name "led_b_e"
type 4
position x = 584, y = 528
}
; Led type 2, subtype 5
widget "led_2" {
name "led_b_f"
type 5
position x = 584, y = 560
}
; Led type 3, subtype 0
widget "led_3" {
name "led_c_a"
position x = 716, y = 396
}
; Led type 3, subtype 1
widget "led_3" {
name "led_c_b"
type 1
position x = 716, y = 428
}
; Led type 3, subtype 2
widget "led_3" {
name "led_c_c"
type 2
position x = 716, y = 460
}
; Led type 3, subtype 3
widget "led_3" {
name "led_c_d"
type 3
position x = 716, y = 492
}
; Led type 3, subtype 4
widget "led_3" {
name "led_c_e"
type 4
position x = 716, y = 524
}
; Led type 3, subtype 5
widget "led_3" {
name "led_c_f"
type 5
position x = 716, y = 556
}
; Pushbutton type 1, subtype 0
widget "pushbutton_1" {
name "button_a"
position x = 514, y = 420
title "Red button", \
size = 10, x = 0, y = -10
action push = cb_push_a
}
; Pushbutton type 2, subtype 1
widget "pushbutton_2" {
name "button_b"
type 1
position x = 510, y = 480
title "Yellow", \
size = 10, x = 0, y = -10
action push = cb_push_b
}
; Pushbutton type 3, subtype 2
widget "pushbutton_3" {
name "button_c"
type 2
position x = 510, y = 548
title "Sticky", \
size = 10, x = 0, y = -10
sticky yes
action push = cb_push_c
}
; Led for sticky button
widget "led_1" {
name "led_button_c"
type 3
position x = 654, y = 548
title "Sticky?", \
size = 10, x = 0, y = -10
}
; Pushbutton type 1, subtype 3
widget "pushbutton_1" {
name "button_d"
type 3
position x = 646, y = 400
action push = cb_push_a
}
; Pushbutton type 1, subtype 4
widget "pushbutton_1" {
name "button_e"
type 4
position x = 646, y = 430
action push = cb_push_a
}
; Pushbutton type 1, subtype 5
widget "pushbutton_1" {
name "button_f"
type 5
position x = 646, y = 460
action push = cb_push_a
}
; Sliders
widget "slideswitch" {
name "slider_a"
type 1
position x = 70, y = 680
slide length = 100, start = 0, total = 100
title "Channel A", \
size = 10, x = 0, y = -10
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_b"
type 1
position x = 170, y = 680
slide length = 100, start = 0, total = 100
title "Channel B", \
size = 10, x = 0, y = -10
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_c"
type 3
position x = 280, y = 704
slide length = 100, start = 0, total = 100
title "Channel C", \
size = 10, x = 0, y = -34
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_d"
type 3
position x = 360, y = 704
slide length = 100, start = 0, total = 100
title "Channel D", \
size = 10, x = 0, y = -34
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_e"
type 5
position x = 470, y = 680
slide length = 100, start = 0, total = 100
title "Channel E", \
size = 10, x = 0, y = -10
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_f"
type 5
position x = 550, y = 680
slide length = 100, start = 0, total = 100
title "Channel F", \
size = 10, x = 0, y = -10
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_g"
type 0
position x = 650, y = 680
slide length = 50, start = 0, total = 100
title "More sliders", \
size = 10, x = 0, y = -10
trigger release
action slide = cb_turn_a
}
widget "slideswitch" {
name "slider_h"
type 0
position x = 650, y = 740
slide length = 50, start = 0, total = 100
trigger release
action slide = cb_turn_a
}
}
}