diff options
Diffstat (limited to 'lib/libforms/examples')
-rw-r--r-- | lib/libforms/examples/Makefile | 17 | ||||
-rw-r--r-- | lib/libforms/examples/example.c | 60 | ||||
-rw-r--r-- | lib/libforms/examples/example.frm | 162 |
3 files changed, 0 insertions, 239 deletions
diff --git a/lib/libforms/examples/Makefile b/lib/libforms/examples/Makefile deleted file mode 100644 index b14392f..0000000 --- a/lib/libforms/examples/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -PROG = example -NOMAN = yet - -SRCS = example.c - -CFLAGS = -static #-g - -.if exists(${.CURDIR}/../obj) -FORMDIR=${.CURDIR}/../obj -.else -FORMDIR=${.CURDIR}/.. -.endif - -LDADD = -L${FORMDIR} -lforms -lncurses -lmytinfo -ll -DPADD = ${LIBFORMS} ${LIBNCURSES} - -.include <bsd.prog.mk> diff --git a/lib/libforms/examples/example.c b/lib/libforms/examples/example.c deleted file mode 100644 index 131ee04..0000000 --- a/lib/libforms/examples/example.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 1995 - * Paul Richards. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * verbatim and that no modifications are made prior to this - * point in the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Paul Richards. - * 4. The name Paul Richards may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY PAUL RICHARDS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL PAUL RICHARDS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ -#include <stdio.h> -#include <strhash.h> -#include <ncurses.h> -#include "../forms.h" - -void UserRoutine(OBJECT *); - -main() -{ - struct Tuple *tuple; - struct Form *form1, *form2; - int res; - - if (load_objects("example.frm") == ST_ERROR) - exit(0); - - bind_tuple(root_table, "User_Routine", TT_FUNC, &UserRoutine); - - start_object("adduser"); -} - -void -UserRoutine(OBJECT *obj) -{ - /* Just draw a box and return */ - exit (1); -} diff --git a/lib/libforms/examples/example.frm b/lib/libforms/examples/example.frm deleted file mode 100644 index eca43ab..0000000 --- a/lib/libforms/examples/example.frm +++ /dev/null @@ -1,162 +0,0 @@ -# An example form file for an adduser command -!Forms Version name - -Display screen1 { - Height 1000 - Width 1000 - Type Ncurses { - # libdialog compatible color pairs - ColorPairs { - 01 Cyan Blue - 02 Black Black - 03 Black White - 04 Yellow White - 05 White White - 06 White Blue - 07 Black White - 08 White Blue - 09 Red White - 10 Yellow Blue - 11 Black White - 12 Black White - 13 Black White - 14 Black White - 15 Yellow White - 16 White White - 17 Yellow White - 18 Black White - 19 White White - 20 Black White - 21 White Blue - 22 Yellow White - 23 Yellow Blue - 24 Red White - 25 Red Blue - 26 Black White - 27 White White - 28 Green White - 29 Green White - } - } - # - # The AttrTable assosciates attribute strings with numeric id's. - # It's up to the device dependant code to decide how to interprate an - # attribute id. For ncurses the id is treated as a color pair number. - # For other devices they'd likely be an index to some device specific - # structure declared above. - # - AttrTable { - screen 01 - shadow 02 - dialog 03 - title 04 - border 05 - button_active 06 - button_inactive 07 - button_key_active 08 - button_key_inactive 09 - button_label_active 10 - button_label_inactive 11 - inputbox 12 - inputbox_border 13 - searchbox 14 - searchbox_title 15 - searchbox_border 16 - position_indicator 17 - menubox 18 - menubox_border 19 - item 20 - item_selected 21 - tag 22 - tag_selected 23 - tag_key 24 - tag_key_selected 25 - check 26 - check_selected 27 - uarrow 28 - darrow 29 - } -} - -template { - Width 15 - Text "This is defined as a template and duplicated here" -} - -Window adduser on screen1 at 0,0 { - Attributes "\screen" - - window at 1,1 { - Height 22 - Width 75 - Attributes "\dialog" - Active username - - box { - Attributes "\dialog" - Highlight "\border" - CallFunc draw_box - shadow { - Attributes "\shadow" - CallFunc draw_shadow - } - } - - Title at 0,9 { Text " This is a title " } - - username at 5,20 { - Height 1 - Width 30 - Attributes "\screen" - Highlight "\tag_selected" - - Next shells - - Input "nobody" - - exp at 3,3 { - Attributes "\dialog" - Text "The is an input object:" - } - prompt at 5,3 { - Text "Username: " - } - } - - shells at 9,20 { - Attributes "\dialog" - Highlight "\tag_selected" - Next button - Options { - "sh" - "csh" - "tcsh" - "bash" - } - - exp at 7,3 { - Attributes "\dialog" - Text "This is a horizontal menu:" - } - prompt at 9,3 { Text "Select a shell: "} - } - - button at 14,9 { - Height 3 - Width 7 - Attributes "\tag_key_selected" - Highlight "\tag_selected" - Active button - - button_box at 14,9 { - CallFunc draw_box - } - - button at 15, 10 { - Up username Down username - Action User_Routine - Label "QUIT" - } - } - } -} |