home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume15 / touchup / part06 / interface.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-14  |  19.8 KB  |  674 lines

  1.  
  2. /**************************************************************************
  3.    Touchup a bitmap graphics editor for the Sun Workstation running SunView
  4.    Copyright (c) 1988 by Raymond Kreisel
  5.    1/22/88 @ Suny Stony Brook
  6.  
  7.    This program may be redistributed without fee as long as this copyright
  8.    notice is intact.
  9.  
  10. ==> PLEASE send comments and bug reports to one of the following addresses:
  11.  
  12.        Ray Kreisel
  13.        CS Dept., SUNY at Stony Brook, Stony Brook NY 11794
  14.  
  15.        UUCP: {allegra, philabs, pyramid, research}!sbcs!rayk   
  16.        ARPA-Internet: rayk@sbcs.sunysb.edu            
  17.        CSnet: rayk@suny-sb
  18.        (If nobody is home at any of the above addresses try:
  19.         S72QKRE@TOWSONVX.BITNET                    )
  20.  
  21.  "If I get home before daylight, I just might get some sleep tonight...."
  22.  
  23. **************************************************************************/
  24. /**************************************************************************
  25.     file: interface.c
  26.     purpose: this file contains all of the window defs for touchup
  27.  
  28.     modifications:
  29.         date:    Tue Mar 22 22:04:58 EST 1988
  30.         author:    rayk
  31.         changes:add comments
  32. **************************************************************************/
  33.  
  34. #include"header.h"
  35.  
  36.  
  37. Cursor fat_cursor;
  38.  
  39.  
  40. static short icon_data[] = {
  41. #include "touchup.icon"
  42. };
  43. static mpr_static(touchup_pr, 64, 64, 1, icon_data);
  44.  
  45. static short cursor_data[] = {
  46. #include "fat_cursor"
  47. };
  48. static mpr_static(my_fat_cursor, 16, 16, 1, cursor_data);
  49.  
  50.  
  51.  
  52.     Frame base_frame,fat_frame,color_frame,command_frame;
  53.     Canvas canvas,fat_canvas,color_canvas;
  54.     Pixwin *pw,*fat_pw,*color_pw;
  55. static Scrollbar    vertical_sb, horizontal_sb;
  56.     Panel       panel,fat_panel,color_panel,pattern_panel,
  57.         brush_panel,region_panel,command_panel;
  58.     Panel_item magnify_cycle,grid_cycle,view_cycle;
  59.     Panel_item  file_panel,brush_choice,mono_cycle,save_cycle,border_cycle,
  60.         msg_string,color_button,text_panel,current_pattern,
  61.         load_cycle,pattern_choice,command_choice,region_choice,
  62.         compress_cycle,text_size_item,undo_button;
  63.  
  64.    struct pixrect *pattern[PATTERN_NO];
  65.    struct pixrect *brushes[BRUSH_NO];
  66.   
  67.  
  68. /*
  69.  * Build all of the window that we need for touchup
  70.  */
  71. init_windows(argc,argv) int argc; char *argv[];
  72. {
  73.  
  74.     base_frame = window_create(NULL,FRAME,
  75.         FRAME_ARGS,    argc,argv,
  76.         FRAME_LABEL,    "TouchUp version 2.2",
  77.         FRAME_ICON,        icon_create(ICON_IMAGE, &touchup_pr, 0),
  78.         FRAME_INHERIT_COLORS,  TRUE,
  79.         WIN_FONT,    main_font,
  80.         WIN_WIDTH,    1030,
  81.         WIN_HEIGHT,    675+ATTR_ROW(10),
  82.         WIN_X,        10,
  83.         WIN_Y,        10,
  84.         0);
  85.     panel = window_create(base_frame, PANEL,
  86.          PANEL_LABEL_BOLD,         TRUE,
  87.          WIN_FONT,              main_font,
  88.          WIN_X,             0,
  89.          WIN_Y,             3,
  90.          WIN_HEIGHT,         ATTR_ROW(5),
  91.         0);
  92.  
  93.  
  94.  
  95.     vertical_sb = scrollbar_create((char*)0);
  96.     horizontal_sb = scrollbar_create((char*)0);
  97.  
  98.     canvas = 
  99.         window_create(base_frame, CANVAS, 
  100.         WIN_VERTICAL_SCROLLBAR,    vertical_sb,
  101.         WIN_HORIZONTAL_SCROLLBAR,    horizontal_sb,
  102.         WIN_CONSUME_PICK_EVENTS,    WIN_NO_EVENTS,WIN_MOUSE_BUTTONS,
  103.                     LOC_DRAG,
  104.                     LOC_MOVE, 
  105.                     0,
  106.         WIN_EVENT_PROC,         handle_event,
  107.         WIN_WIDTH,            780,
  108. /*        WIN_HEIGHT,             650, */
  109.         WIN_X,            PATTERN_SIZE*2+70,
  110.         WIN_Y,            ATTR_ROW(7)+12,
  111.         CANVAS_AUTO_SHRINK,        FALSE,
  112.         CANVAS_AUTO_EXPAND,        FALSE,
  113.         CANVAS_FIXED_IMAGE,        FALSE,
  114.         CANVAS_RETAINED,        TRUE,
  115.         CANVAS_WIDTH,        image_wid,
  116.         CANVAS_HEIGHT,        image_hgt,
  117.         WIN_BELOW,            panel,
  118.         0),
  119.  
  120.  
  121.     pw = canvas_pixwin(canvas);
  122.  
  123.  
  124.     command_panel = window_create(base_frame, PANEL,
  125.          WIN_FONT,            main_font,
  126. /*         WIN_X,             1000-(COMMAND_SIZE*2+32), */
  127.          WIN_Y,             ATTR_ROW(6)+12,
  128.          WIN_WIDTH,             COMMAND_SIZE*2+5,
  129.          WIN_HEIGHT,         COMMAND_SIZE*COMMAND_NO/2+9,
  130.          WIN_RIGHT_OF,         canvas,
  131.          WIN_BELOW,             panel,
  132.         0);
  133.  
  134.    command_choice = panel_create_item(command_panel, PANEL_CHOICE, 
  135.          PANEL_LABEL_BOLD,         TRUE,
  136.          PANEL_SHOW_MENU,         FALSE,
  137.          PANEL_LAYOUT,        PANEL_VERTICAL,
  138.          PANEL_VALUE,         6,
  139.          PANEL_LABEL_X,        10,
  140.          PANEL_LABEL_Y,        4,
  141.          PANEL_DISPLAY_LEVEL,    PANEL_ALL,
  142.          PANEL_FEEDBACK,        PANEL_INVERTED,
  143.          PANEL_CHOICE_IMAGES,    &command12_pr,&command5_pr,
  144.                     &command13_pr,&command14_pr,
  145.                     &command1_pr,&command6_pr,
  146.                     &command15_pr,&command3_pr,
  147.                     &command4_pr,&command16_pr,
  148.                     &command11_pr,&command10_pr,
  149.                     &command2_pr,&command7_pr,
  150.                     &command9_pr,&command8_pr,
  151.                     0,
  152.          PANEL_CHOICE_XS,        1,51,1,51,1,51,
  153.                     1,51,1,51,1,51,
  154.                     1,51,1,51,
  155.                     0,
  156.          
  157.          PANEL_CHOICE_YS,        1,1,
  158.                     50,50,
  159.                     99,99,
  160.                     148,148,
  161.                     197,197,
  162.                     246,246,
  163.                     295,295,
  164.                     344,344,
  165.                     0,
  166.          PANEL_NOTIFY_PROC,     command_handle,
  167.          0);
  168.  
  169.  
  170.     brush_panel = window_create(base_frame, PANEL,
  171.          WIN_FONT,            main_font,
  172.          WIN_SHOW,            TRUE,
  173.          WIN_X,             1000-(COMMAND_SIZE*2+32),
  174.          WIN_Y,             COMMAND_SIZE*COMMAND_NO/2+9+ATTR_ROW(6)+14,
  175.          WIN_WIDTH,             COMMAND_SIZE*2+5,
  176. /*         WIN_HEIGHT,         COMMAND_SIZE*4+15, */
  177.          WIN_BELOW,             command_panel,
  178.          WIN_RIGHT_OF,         canvas,
  179.         0);
  180.  
  181.    brush_choice = panel_create_item(brush_panel, PANEL_CHOICE, 
  182.          PANEL_LABEL_BOLD,         TRUE,
  183.          PANEL_SHOW_MENU,         FALSE,
  184.          PANEL_LAYOUT,        PANEL_VERTICAL,
  185.          PANEL_VALUE,         3,
  186.          PANEL_LABEL_X,        10,
  187.          PANEL_LABEL_Y,        4,
  188.          PANEL_DISPLAY_LEVEL,    PANEL_ALL,
  189.          PANEL_FEEDBACK,        PANEL_MARKED,
  190.          PANEL_CHOICE_IMAGES,    &brush1_pr,&brush2_pr,
  191.                     &brush3_pr,&brush4_pr,
  192.                     &brush5_pr,&brush6_pr,
  193.                     0,
  194.          PANEL_CHOICE_XS,        51,51,51,51,51,51,
  195.                     0,
  196.          
  197.          PANEL_CHOICE_YS,        1,
  198.                     35,69,
  199.                     103,137,
  200.                     171,
  201.                     0,
  202.          PANEL_MARK_XS,        3,
  203.                     0,
  204.          
  205.          PANEL_MARK_YS,        1,
  206.                     35,69,
  207.                     103,137,
  208.                     171,
  209.                     0,
  210.          0);
  211.  
  212.   brushes[0] = &brush1_pr;
  213.   brushes[1] = &brush2_pr;
  214.   brushes[2] = &brush3_pr;
  215.   brushes[3] = &brush4_pr;
  216.   brushes[4] = &brush5_pr;
  217.   brushes[5] = &brush6_pr;
  218.  
  219.  
  220.  
  221.  
  222.     region_panel = window_create(base_frame, PANEL,
  223.          WIN_FONT,            main_font,
  224.          WIN_SHOW,            FALSE,
  225.          WIN_X,             1000-(COMMAND_SIZE*2+32),
  226.          WIN_Y,             COMMAND_SIZE*COMMAND_NO/2+9+ATTR_ROW(6)+14,
  227.          WIN_WIDTH,             COMMAND_SIZE*2+5,
  228. /*         WIN_HEIGHT,         COMMAND_SIZE*4+4, */
  229.          WIN_BELOW,             command_panel,
  230.          WIN_RIGHT_OF,         canvas,
  231.         0);
  232.  
  233.    region_choice = panel_create_item(region_panel, PANEL_CHOICE, 
  234.          PANEL_LABEL_BOLD,         TRUE,
  235.          PANEL_SHOW_MENU,         FALSE,
  236.          PANEL_LAYOUT,        PANEL_VERTICAL,
  237.          PANEL_VALUE,         5,
  238.          PANEL_LABEL_X,        10,
  239.          PANEL_LABEL_Y,        4,
  240.          PANEL_DISPLAY_LEVEL,    PANEL_ALL,
  241.          PANEL_FEEDBACK,        PANEL_INVERTED,
  242.          PANEL_CHOICE_IMAGES,    ®_command2_pr,®_command3_pr,
  243.                     ®_command4_pr,®_command7_pr,
  244.                     ®_command5_pr,®_command6_pr,
  245.                     ®_command8_pr,®_command1_pr,
  246.                     0,
  247.          PANEL_CHOICE_XS,        1,51,1,51,1,51,1,51,
  248.                     0,
  249.          
  250.          PANEL_CHOICE_YS,        1,1,
  251.                     50,50,
  252.                     99,99,
  253.                     148,148,
  254.                     0,
  255.          PANEL_NOTIFY_PROC,     region_handle,
  256.          0);
  257.  
  258.  
  259.     pattern_panel = window_create(base_frame, PANEL,
  260.          WIN_FONT,            main_font,
  261.          WIN_X,             0,
  262.          WIN_Y,            ATTR_ROW(6)+12,
  263.           WIN_BELOW,            panel,
  264.          WIN_WIDTH,             PATTERN_SIZE*2+65,
  265. /*         WIN_HEIGHT,         PATTERN_SIZE*PATTERN_NO/2+22, */
  266.         0);
  267.  
  268.    (void)panel_create_item(pattern_panel, PANEL_BUTTON, 
  269.      PANEL_ITEM_X, ATTR_COL(0),
  270.      PANEL_ITEM_Y, PATTERN_SIZE*PATTERN_NO/2+40,
  271.      PANEL_LABEL_IMAGE, panel_button_image(panel, "define pattern", 14, (Pixfont *)0),
  272.      PANEL_NOTIFY_PROC, pattern_define,
  273.      0);
  274.  
  275.    pattern_choice = panel_create_item(pattern_panel, PANEL_CHOICE, 
  276.          PANEL_LABEL_BOLD,         TRUE,
  277.          PANEL_SHOW_MENU,         FALSE,
  278.          PANEL_LAYOUT,        PANEL_VERTICAL,
  279.          PANEL_LABEL_X,        10,
  280.          PANEL_LABEL_Y,        4,
  281.          PANEL_VALUE,         0,
  282.          PANEL_DISPLAY_LEVEL,    PANEL_ALL,
  283.          PANEL_FEEDBACK,        PANEL_MARKED,
  284.          PANEL_NOTIFY_PROC,     select_pattern,
  285.          PANEL_CHOICE_IMAGES,    &pattern1_pr,&pattern2_pr,&pattern3_pr,
  286.                     &pattern4_pr,&pattern5_pr,
  287.                     &pattern6_pr,&pattern7_pr,
  288.                     &pattern8_pr,&pattern9_pr,
  289.                     &pattern10_pr,
  290.                          &pattern11_pr,&pattern12_pr,&pattern13_pr,
  291.                     &pattern14_pr,&pattern15_pr,
  292.                     &pattern16_pr,&pattern17_pr,
  293.                     &pattern18_pr,&pattern19_pr,
  294.                     &pattern20_pr,
  295.                          &pattern21_pr,&pattern22_pr,&pattern23_pr,
  296.                     &pattern24_pr,&pattern25_pr,
  297.                     &pattern26_pr,&pattern27_pr,
  298.                     &pattern28_pr,&pattern29_pr,
  299.                     &pattern30_pr,
  300.                          &pattern31_pr,&pattern32_pr,&pattern33_pr,
  301.                     &pattern34_pr,&pattern35_pr,
  302.                     &pattern36_pr,&pattern37_pr,
  303.                     &pattern38_pr,&pattern39_pr,
  304.                     &pattern40_pr,0,
  305.          PANEL_CHOICE_XS,        25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,25,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,0,
  306.          
  307.          PANEL_CHOICE_YS,        1+35,33+35,65+35,97+35,129+35,161+35,193+35,225+35,257+35,289+35,
  308.                     321+35,353+35,385+35,417+35,449+35,481+35,513+35,545+35,577+35,609+35,
  309.                          1+35,33+35,65+35,97+35,129+35,161+35,193+35,225+35,257+35,289+35,
  310.                     321+35,353+35,385+35,417+35,449+35,481+35,513+35,545+35,577+35,609+35,0,
  311.          PANEL_MARK_XS,        3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,0,
  312.          PANEL_MARK_YS,        8+35,40+35,72+35,104+35,136+35,168+35,200+35,232+35,266+35,296+35,
  313.                     328+35,360+35,392+35,426+35,456+35,488+35,520+35,552+35,584+35,616+35,
  314.                          8+35,40+35,72+35,104+35,136+35,168+35,200+35,232+35,266+35,296+35,
  315.                     328+35,360+35,392+35,426+35,456+35,488+35,520+35,552+35,584+35,616+35,0,
  316.  
  317.      0);
  318.  
  319.   pattern[0] = &pattern1_pr;
  320.   pattern[1] = &pattern2_pr;
  321.   pattern[2] = &pattern3_pr;
  322.   pattern[3] = &pattern4_pr;
  323.   pattern[4] = &pattern5_pr;
  324.   pattern[5] = &pattern6_pr;
  325.   pattern[6] = &pattern7_pr;
  326.   pattern[7] = &pattern8_pr;
  327.   pattern[8] = &pattern9_pr;
  328.   pattern[9] = &pattern10_pr;
  329.   pattern[10] = &pattern11_pr;
  330.   pattern[11] = &pattern12_pr;
  331.   pattern[12] = &pattern13_pr;
  332.   pattern[13] = &pattern14_pr;
  333.   pattern[14] = &pattern15_pr;
  334.   pattern[15] = &pattern16_pr;
  335.   pattern[16] = &pattern17_pr;
  336.   pattern[17] = &pattern18_pr;
  337.   pattern[18] = &pattern19_pr;
  338.   pattern[19] = &pattern20_pr;
  339.   pattern[20] = &pattern21_pr;
  340.   pattern[21] = &pattern22_pr;
  341.   pattern[22] = &pattern23_pr;
  342.   pattern[23] = &pattern24_pr;
  343.   pattern[24] = &pattern25_pr;
  344.   pattern[25] = &pattern26_pr;
  345.   pattern[26] = &pattern27_pr;
  346.   pattern[27] = &pattern28_pr;
  347.   pattern[28] = &pattern29_pr;
  348.   pattern[29] = &pattern30_pr;
  349.   pattern[30] = &pattern31_pr;
  350.   pattern[31] = &pattern32_pr;
  351.   pattern[32] = &pattern33_pr;
  352.   pattern[33] = &pattern34_pr;
  353.   pattern[34] = &pattern35_pr;
  354.   pattern[35] = &pattern36_pr;
  355.   pattern[36] = &pattern37_pr;
  356.   pattern[37] = &pattern38_pr;
  357.   pattern[38] = &pattern39_pr;
  358.   pattern[39] = &pattern40_pr;
  359.  
  360.    current_pattern = panel_create_item(pattern_panel, PANEL_MESSAGE, 
  361.      PANEL_ITEM_X, ATTR_COL(6),
  362.      PANEL_ITEM_Y, 3,
  363.      PANEL_LABEL_IMAGE, &pattern1_pr,
  364.      0);
  365.  
  366.     color_frame = window_create(base_frame,FRAME,
  367.         FRAME_LABEL,    "Color Pallet",
  368.             FRAME_SHOW_LABEL, TRUE,
  369.         WIN_FONT,    main_font,
  370.         WIN_WIDTH,    PALET_BLOCK*16+9,
  371.         WIN_HEIGHT,    PALET_BLOCK*(16+3)+20+ATTR_ROW(2),
  372.         WIN_X,        650,
  373.         WIN_Y,        10,
  374.         0);
  375.  
  376.     color_canvas = 
  377.         window_create(color_frame, CANVAS, 
  378.         WIN_CONSUME_PICK_EVENTS,    WIN_NO_EVENTS, WIN_MOUSE_BUTTONS,
  379.                     LOC_DRAG,
  380.                     LOC_MOVE, 
  381.                     0,
  382.         WIN_EVENT_PROC,         color_handle_event,
  383.         WIN_X,        0,
  384.         WIN_Y,        ATTR_ROW(2)+5,
  385.         CANVAS_WIDTH,        PALET_BLOCK*16,
  386.         CANVAS_HEIGHT,        PALET_BLOCK*(16+3),
  387.         CANVAS_AUTO_SHRINK,        FALSE,
  388.         CANVAS_FIXED_IMAGE,        FALSE,
  389.         CANVAS_AUTO_EXPAND,        TRUE,
  390.         CANVAS_REPAINT_PROC,    draw_colormap,
  391.         CANVAS_RESIZE_PROC,        draw_colormap,
  392.         0),
  393.  
  394.     color_pw = canvas_pixwin(color_canvas);
  395.  
  396.     color_panel = window_create(color_frame, PANEL,
  397.          PANEL_LABEL_BOLD,         TRUE,
  398.         WIN_FONT,    main_font,
  399.          WIN_X,             0,
  400.          WIN_Y,             3,
  401.          WIN_WIDTH,             PALET_BLOCK*16+1,
  402.          WIN_HEIGHT,         ATTR_ROW(1)+4,
  403.         0);
  404.  
  405.  
  406.    (void)panel_create_item(color_panel, PANEL_BUTTON, 
  407.      PANEL_ITEM_X, ATTR_COL(0),
  408.      PANEL_ITEM_Y, ATTR_ROW(0),
  409.      PANEL_LABEL_IMAGE, panel_button_image(color_panel, "done", 5, (Pixfont *)0),
  410.      PANEL_NOTIFY_PROC, color_done,
  411.      0);
  412.  
  413.  
  414.  
  415.    
  416.     fat_frame = window_create(base_frame,FRAME,
  417.         FRAME_LABEL,    "Big bits",
  418.             FRAME_SHOW_LABEL, TRUE,
  419.         WIN_CURSOR,    cursor_create(CURSOR_IMAGE, &my_fat_cursor,0),
  420.         WIN_FONT,    main_font,
  421.         WIN_WIDTH,    ATTR_COL(31),
  422.         WIN_HEIGHT,    ATTR_ROW(24),
  423.          WIN_X,             0,
  424.          WIN_Y,            ATTR_ROW(8)+12,
  425.         0);
  426.  
  427.     fat_canvas = 
  428.         window_create(fat_frame, CANVAS, 
  429.         WIN_CONSUME_PICK_EVENTS,    WIN_NO_EVENTS,WIN_MOUSE_BUTTONS,
  430.                     LOC_DRAG,
  431.                     LOC_MOVE, 
  432.                     0,
  433.         WIN_CURSOR,            cursor_create(CURSOR_IMAGE, &my_fat_cursor,0),
  434.         WIN_EVENT_PROC,         fat_handle_event,
  435.         WIN_X,        0,
  436.         WIN_Y,        ATTR_ROW(2)+5,
  437.         CANVAS_WIDTH,        ATTR_COL(30),
  438.         CANVAS_HEIGHT,        ATTR_ROW(14),
  439.         CANVAS_AUTO_SHRINK,        TRUE,
  440.         CANVAS_FIXED_IMAGE,        FALSE,
  441.         CANVAS_AUTO_EXPAND,        TRUE,
  442.         CANVAS_RETAINED,        TRUE,
  443.         0),
  444.  
  445.     fat_pw = canvas_pixwin(fat_canvas);
  446.  
  447.     fat_panel = window_create(fat_frame, PANEL,
  448.          PANEL_LABEL_BOLD,         TRUE,
  449.         WIN_FONT,    main_font,
  450.          WIN_X,             0,
  451.          WIN_Y,             3,
  452.          WIN_WIDTH,             ATTR_COL(30),
  453.          WIN_HEIGHT,         ATTR_ROW(1)+4,
  454.         0);
  455.    
  456.     magnify_cycle = 
  457.     panel_create_item(fat_panel, PANEL_CYCLE,
  458.         PANEL_ITEM_X, ATTR_COL(8),
  459.         PANEL_ITEM_Y, ATTR_ROW(0),
  460.         PANEL_LABEL_STRING, "Magnification:",
  461.         PANEL_CHOICE_STRINGS, "1x", "2x","3x","4x",
  462.                   "5x","6x","7x","8x","9x",
  463.                   "10x","11x","12x","13x","14x",
  464.                   "15x","16x","17x","18x","19x",
  465.                   "20x", 0,
  466.         PANEL_VALUE, 8,
  467.         PANEL_NOTIFY_PROC, fat_parms,
  468.         0);
  469.  
  470.    (void)panel_create_item(fat_panel, PANEL_BUTTON, 
  471.      PANEL_ITEM_X, ATTR_COL(0),
  472.      PANEL_ITEM_Y, ATTR_ROW(0),
  473.      PANEL_LABEL_IMAGE, panel_button_image(fat_panel, "done", 5, (Pixfont *)0),
  474.      PANEL_NOTIFY_PROC, fat_done,
  475.      0);
  476.  
  477.  
  478.    (void)panel_create_item(panel, PANEL_BUTTON, 
  479.      PANEL_ITEM_X, ATTR_COL(8),
  480.      PANEL_ITEM_Y, ATTR_ROW(1),
  481.      PANEL_LABEL_IMAGE, panel_button_image(panel, "view", 5, (Pixfont *)0),
  482.      PANEL_NOTIFY_PROC, viewer,
  483.      0);
  484.  
  485.     view_cycle =
  486.     panel_create_item(panel, PANEL_CYCLE,
  487.         PANEL_ITEM_X, ATTR_COL(16),
  488.         PANEL_ITEM_Y, ATTR_ROW(1),
  489.         PANEL_LABEL_STRING, "View:",
  490.         PANEL_CHOICE_STRINGS, "Touchup info", "man page (help)", "Cut/Paste buffer", 0,
  491.         PANEL_VALUE, 1,
  492.         0);
  493.  
  494.    (void)panel_create_item(panel, PANEL_BUTTON, 
  495.      PANEL_ITEM_X, ATTR_COL(8),
  496.      PANEL_ITEM_Y, ATTR_ROW(0),
  497.      PANEL_LABEL_IMAGE, panel_button_image(panel, "load", 5, (Pixfont *)0),
  498.      PANEL_NOTIFY_PROC, load_file,
  499.      0);
  500.     load_cycle =
  501.     panel_create_item(panel, PANEL_CYCLE,
  502.         PANEL_ITEM_X, ATTR_COL(16),
  503.         PANEL_ITEM_Y, ATTR_ROW(0),
  504.         PANEL_LABEL_STRING, "Load:",
  505.         PANEL_CHOICE_STRINGS, "entire image", "Cut/Paste buffer", 0,
  506.         PANEL_VALUE, LOAD_ALL,
  507.         0);
  508.  
  509.    (void)panel_create_item(panel, PANEL_BUTTON, 
  510.      PANEL_ITEM_X, ATTR_COL(45),
  511.      PANEL_ITEM_Y, ATTR_ROW(0),
  512.      PANEL_LABEL_IMAGE, panel_button_image(panel, "save", 5, (Pixfont *)0),
  513.      PANEL_NOTIFY_PROC, save_file,
  514.      0);
  515.  
  516.     save_cycle =
  517.     panel_create_item(panel, PANEL_CYCLE,
  518.         PANEL_ITEM_X, ATTR_COL(53),
  519.         PANEL_ITEM_Y, ATTR_ROW(0),
  520.         PANEL_LABEL_STRING, "Save:",
  521.         PANEL_CHOICE_STRINGS, "entire image", "Cut/Paste buffer", 0,
  522.         PANEL_VALUE, SAVE_ALL,
  523.         0);
  524.  
  525.     compress_cycle =
  526.     panel_create_item(panel, PANEL_CYCLE,
  527.         PANEL_ITEM_X, ATTR_COL(53),
  528.         PANEL_ITEM_Y, ATTR_ROW(1),
  529.         PANEL_LABEL_STRING, "Save:",
  530.         PANEL_CHOICE_STRINGS, "Standard format","Compressed",0,
  531.         PANEL_VALUE, 0,
  532.         0);
  533.  
  534.    (void)panel_create_item(panel, PANEL_BUTTON, 
  535.      PANEL_ITEM_X, ATTR_COL(0),
  536.      PANEL_ITEM_Y, ATTR_ROW(0),
  537.      PANEL_LABEL_IMAGE, panel_button_image(panel, "quit", 5, (Pixfont *)0),
  538.      PANEL_NOTIFY_PROC, quit,
  539.      0);
  540.  
  541.    undo_button = panel_create_item(panel, PANEL_BUTTON, 
  542.      PANEL_ITEM_X, ATTR_COL(0),
  543.      PANEL_ITEM_Y, ATTR_ROW(2),
  544.      PANEL_LABEL_IMAGE, panel_button_image(panel, "undo", 5, (Pixfont *)0),
  545.      PANEL_NOTIFY_PROC, undo_screen,
  546.      0);
  547.  
  548.     grid_cycle =
  549.     panel_create_item(panel, PANEL_CYCLE,
  550.         PANEL_ITEM_X, ATTR_COL(8),
  551.         PANEL_ITEM_Y, ATTR_ROW(2),
  552.         PANEL_LABEL_STRING, "Grid size:",
  553.         PANEL_CHOICE_STRINGS, "none","5","10","15","20","25","30",0,
  554.         PANEL_VALUE, grid_size,
  555.         PANEL_NOTIFY_PROC, change_parms,
  556.         0);
  557.  
  558.     border_cycle =
  559.     panel_create_item(panel, PANEL_CYCLE,
  560.         PANEL_ITEM_X, ATTR_COL(30),
  561.         PANEL_ITEM_Y, ATTR_ROW(2),
  562.         PANEL_LABEL_STRING, "Borders:",
  563.         PANEL_CHOICE_STRINGS, "No","Yes",0,
  564.         PANEL_VALUE, 1,
  565.         0);
  566.  
  567.    file_panel=panel_create_item(panel, PANEL_TEXT, 
  568.      PANEL_ITEM_X, ATTR_COL(80),
  569.      PANEL_ITEM_Y, ATTR_ROW(0),
  570.      PANEL_VALUE, file_name,
  571.      PANEL_VALUE_DISPLAY_LENGTH, 35,
  572.      PANEL_LABEL_STRING, "Filename:",
  573.      PANEL_NOTIFY_PROC, make_new_name,
  574.      PANEL_NOTIFY_STRING, "\033",
  575.      PANEL_VALUE_STORED_LENGTH, MAX_FILE_NAME,
  576.      PANEL_SHOW_MENU, FALSE,
  577.      0);
  578.  
  579.    text_panel=panel_create_item(panel, PANEL_TEXT, 
  580.      PANEL_ITEM_X, ATTR_COL(80),
  581.      PANEL_ITEM_Y, ATTR_ROW(1),
  582.      PANEL_VALUE, "",
  583.      PANEL_VALUE_DISPLAY_LENGTH, 32,
  584.      PANEL_LABEL_STRING, "Text string:",
  585.      PANEL_VALUE_STORED_LENGTH, MAX_FILE_NAME,
  586.      PANEL_SHOW_MENU, FALSE,
  587.      0);
  588.  
  589.  
  590.         text_size_item = panel_create_item(panel,PANEL_CYCLE,
  591.                                           PANEL_ITEM_X, ATTR_COL(80),
  592.                                           PANEL_ITEM_Y, ATTR_ROW(2),
  593.                       PANEL_LABEL_STRING, "Fonts:",
  594.                                           PANEL_CHOICE_STRINGS, "ABC abc 123",
  595.                                 "ABC abc 123",
  596.                                 "ABC abc 123",
  597.                                 "ABC abc 123",
  598.                                 "ABC abc 123",
  599.                                 "ABC abc 123",
  600.                                 "ABC abc 123",
  601.                                 "ABC abc 123",
  602.                                 "ABC abc 123",
  603.                                 "ABC abc 123",
  604.                                 "ABC abc 123",
  605.                                 "ABC abc 123",
  606.                                 "ABC abc 123",
  607.                                 "ABC abc 123",
  608.                                 "ABC abc 123",
  609.                                 "ABC abc 123",
  610.                                 "ABC abc 123",
  611.                                 "ABC abc 123",
  612.                                 "ABC abc 123",
  613.                                                                 0,
  614.                                           PANEL_CHOICE_FONTS, 
  615.                                                        cour_r_10,
  616.                                                               cour_r_12,
  617.                                                               cour_r_16,
  618.                                                               cour_r_24,
  619.                                   cour_b_10,
  620.                                                               cour_b_12,
  621.                                                               cour_b_16,
  622.                                                               cour_b_24,
  623.                                                               serif_r_10,
  624.                                                               serif_r_11,
  625.                                                               serif_r_16,
  626.                                   screen_r_7,
  627.                                   screen_r_11,
  628.                                   screen_r_12,
  629.                                   screen_r_14,
  630.                                   screen_b_12,
  631.                                   screen_b_14,
  632.                                   pcfont_b_14,
  633.                                   pcfont_r_14,
  634.                                                               0,
  635.                                           0);
  636.  
  637.  
  638.     mono_cycle =
  639.     panel_create_item(panel, PANEL_CYCLE,
  640.         PANEL_ITEM_X, ATTR_COL(48),
  641.         PANEL_ITEM_Y, ATTR_ROW(2),
  642.         PANEL_LABEL_STRING, "Draw color",
  643.         PANEL_CHOICE_STRINGS, "WHITE", "BLACK",
  644.                    0,
  645.         PANEL_VALUE, 1,
  646.         PANEL_NOTIFY_PROC, change_parms,
  647.         0);
  648.  
  649.    color_button = panel_create_item(panel, PANEL_BUTTON, 
  650.      PANEL_ITEM_X, ATTR_COL(52),
  651.      PANEL_ITEM_Y, ATTR_ROW(2),
  652.      PANEL_SHOW_ITEM, FALSE,
  653.      PANEL_LABEL_IMAGE, panel_button_image(panel, "color", 5, (Pixfont *)0),
  654.      PANEL_NOTIFY_PROC, color_mode,
  655.      0);
  656.  
  657.    msg_string = panel_create_item(panel, PANEL_MESSAGE, 
  658.      PANEL_ITEM_X, ATTR_COL(0),
  659.      PANEL_ITEM_Y, ATTR_ROW(4),
  660.      PANEL_LABEL_BOLD,    TRUE,
  661.      PANEL_LABEL_STRING, "",
  662.      0);
  663.  
  664.   fat_cursor = window_get(canvas,WIN_CURSOR);
  665.   cursor_set(fat_cursor,CURSOR_OP,PIX_SRC^PIX_DST,0);
  666.   window_set(canvas,WIN_CURSOR,fat_cursor,0);
  667.  
  668.   fat_cursor = window_get(fat_canvas,WIN_CURSOR);
  669.   cursor_set(fat_cursor,CURSOR_OP,PIX_SRC^PIX_DST,0);
  670.   window_set(fat_canvas,WIN_CURSOR,fat_cursor,0);
  671.  
  672. }
  673.  
  674.