Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <admucina.h>
- #include <admucinf.h>
- #include <stdlib.h>
- #include <unistd.h>
- /* field type constants */
- #define F_PROTECTED 2
- #define F_UNPROT 0
- /* field highlight constants */
- #define F_HLT_NONE 0
- #define F_HLT_BLINK 1
- #define F_HLT_REVERSE 2
- #define F_HLT_UNDERSCORE 4
- /* colours */
- #define F_COL_DFT 0
- #define F_COL_BLUE 1
- #define F_COL_RED 2
- #define F_COL_PINK 3
- #define F_COL_GREEN 4
- #define F_COL_CYAN 5
- #define F_COL_YELLOW 6
- #define F_COL_WHITE 7
- int main() {
- int attype,attval,attcount;
- char entered_name??(15??);
- /* init text display */
- fsinit();
- /* define fields */
- /* fnum y x h w type */
- asdfld( 1, 24, 70, 1, 9, F_PROTECTED); /* bottom label */
- asdfld( 2, 3, 3, 1, 20, F_PROTECTED); /* enter name label */
- asdfld( 3, 3, 25, 1, 15, F_UNPROT); /* name input */
- asdfld( 4, 10, 10, 1, 6, F_PROTECTED);
- asdfld( 5, 10, 20, 1, 15, F_PROTECTED);
- /* set colours */
- /* fnum colour */
- asfcol( 1, F_COL_BLUE);
- asfcol( 2, F_COL_GREEN);
- asfcol( 3, F_COL_WHITE);
- asfcol( 4, F_COL_GREEN);
- asfcol( 5, F_COL_YELLOW);
- /* fill static fields */
- /* fnum len data */
- ascput( 1, 9, "GDDMDEMO");
- ascput( 2, 20, "Enter your name ===>");
- /* put cursor in name input field at (1,1) */
- /* fnum y x */
- asfcur( 3, 1, 1);
- /* output screen */
- asread(&attype, &attval, &attcount);
- /* read name from screen */
- /* fnum len destination */
- ascget( 3, 15, entered_name);
- /* protect input name field since entered */
- /* fnum field type */
- asftyp( 3, F_PROTECTED);
- /* change input field colour to green */
- /* fnum colour */
- asfcol( 3, F_COL_GREEN);
- /* output name and hello message */
- /* fnum len data */
- ascput( 4, 6, "Hello,");
- ascput( 5, 15, entered_name);
- /* blinky mcblinkface */
- /* fnum highlight type */
- asfhlt( 5, F_HLT_BLINK);
- /* output/read cycle */
- asread(&attype, &attval, &attcount);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement