summaryrefslogtreecommitdiffstats
path: root/lib/libforms/examples
diff options
context:
space:
mode:
authorpaul <paul@FreeBSD.org>1995-02-01 04:06:37 +0000
committerpaul <paul@FreeBSD.org>1995-02-01 04:06:37 +0000
commit0305d2ddc1bf66ecafae556f714242e7c8a04664 (patch)
tree576ca2890714ba0aff9ce46fa51c6d9c6eaaeba4 /lib/libforms/examples
parent0f25422ca89f5fe648e16dedf4c0e6cb062c6c61 (diff)
downloadFreeBSD-src-0305d2ddc1bf66ecafae556f714242e7c8a04664.zip
FreeBSD-src-0305d2ddc1bf66ecafae556f714242e7c8a04664.tar.gz
Implemented height field for text fields so they can now be more than
one line long. Fixed a bug in the input field with cursor positioning at the end of the field. Make the print_status function available to apps so they can print status messages. Updated the example for the new fib parser.
Diffstat (limited to 'lib/libforms/examples')
-rw-r--r--lib/libforms/examples/Makefile2
-rw-r--r--lib/libforms/examples/example.c1
-rw-r--r--lib/libforms/examples/example.frm94
3 files changed, 25 insertions, 72 deletions
diff --git a/lib/libforms/examples/Makefile b/lib/libforms/examples/Makefile
index 3e721fc..e098b68 100644
--- a/lib/libforms/examples/Makefile
+++ b/lib/libforms/examples/Makefile
@@ -3,7 +3,7 @@ NOMAN = yet
SRCS = example.c frm.tab.h
-CFLAGS =
+CFLAGS = -g -static
.if exists(${.CURDIR}/../obj)
FORMDIR=${.CURDIR}/../obj
diff --git a/lib/libforms/examples/example.c b/lib/libforms/examples/example.c
index 120dc20..120fdb1 100644
--- a/lib/libforms/examples/example.c
+++ b/lib/libforms/examples/example.c
@@ -49,6 +49,7 @@ main()
}
keypad(example.window, TRUE);
+ print_status("This is the status line");
while (!(res = update_form(&example)));
wclear(example.window);
diff --git a/lib/libforms/examples/example.frm b/lib/libforms/examples/example.frm
index 942bbbf..e2ebd80 100644
--- a/lib/libforms/examples/example.frm
+++ b/lib/libforms/examples/example.frm
@@ -1,103 +1,55 @@
-Colors example {
+Colours example {
pair = red, yellow
pair = blue, white
}
-Field Title {
- attributes = COLOR_PAIR(2)
- text = "A Simple Demo"
-}
-
-Field field1 {
- attributes = A_BLINK|A_BOLD
- text = "This text is bold and flashy"
-}
+field1 { attributes = A_BLINK|A_BOLD text = "This text is bold and flashy" }
-Field field2 {
+field2 {
+ height = 2
+ width = 22
text = "This is an input field with a default"
}
-Field field3 {
+field3 {
width = 10
default = "This is a default entry"
limit = 30
}
-Field field4 {
- text = "This is a labelled input field"
-}
+field4 { text = "This is a labelled input field" }
-Field field5 {
- label = "A temp. label"
-}
+field5 { label = "A temp. label" }
-Field field6 {
- text = "Some options to choose from: "
-}
+field6 { text = "Some options to choose from: " }
-Field field7 {
- selected = 0
- options = "Choose", "another", "of", "these"
-}
+field7 { selected = 0 options = "Choose", "another", "of", "these" }
-Field field8 {
- width = 6
- action = "EXIT"
- function = exit_form
-}
+field8 { width = 6 action = "EXIT" function = exit_form }
-Field field9 {
+field9 {
attributes = COLOR_PAIR(1)
highlight = COLOR_PAIR(1)|A_BOLD
action = "CANCEL"
function = cancel_form
}
-Link input1 as field3 {
- next = input2
- down = input2
-}
-
-Link input2 as field5 {
- next = menu1
- up = input1
- down = menu1
-}
-
-Link menu1 as field7 {
- next = quit
- up = input2
- down = quit
-}
-
-Link quit as field8 {
- up = menu1
- right = cancel
-}
-
-Link cancel as field9 {
- up = input1
- down = input1
- left = quit
- right = input1
-}
-
Form example at 0,0 {
- height = 24
+ height = 25
width = 80
colortable = example
attributes = COLOR_PAIR(1)
- Field Title at 0,30
+ Title {attributes = COLOR_PAIR(2) text = "A Simple Demo"} at 0,30
- Field field1 at 3,23
- Field field2 at 7, 2
- Field field4 at 11, 2
- Field field6 at 15, 2
+ field1 at 3,23
+ field2 at 7, 2
+ field4 at 11, 2
+ field6 at 15, 2
- Field input1 at 7,45
- Field input2 at 11,45
- Field menu1 at 15,45
- Field quit at 20,20
- Field cancel at 20,43
+ input1 {field3} at 7,45, next=input2, up=input2, down=input2
+ input2 {field5} at 11,45, next=menu1, up=input1, down=menu1
+ menu1 {field7} at 15,45, next=quit, up=input2, down=quit
+ quit {field8} at 20,20, up=menu1, right=cancel
+ cancel {field9} at 20,43, up=input1, down=input1, left=quit, right=input1
}
OpenPOWER on IntegriCloud