home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 May / cica_0595_4.zip / cica_0595_4 / UTIL / MSWSRC35 / DLGWIND.CPP < prev    next >
C/C++ Source or Header  |  1993-10-14  |  56KB  |  2,195 lines

  1. #include "allwind.h"
  2.  
  3. #define TWindow_type 1
  4. #define TStatic_type 2
  5. #define TListBox_type 3
  6. #define TComboBox_type 4
  7. #define TButton_type 5
  8. #define TScrollBar_type 6
  9. #define TGroupBox_type 7
  10. #define TRadioButton_type 8
  11. #define TCheckBox_type 9
  12. #define TDialog_type 10
  13.  
  14. //NODE *xxx;
  15.  
  16. HICON hCursorSave = 0;           /* handle for saved cursor */
  17.  
  18. char *Windowname[]={"?","Window","Static","ListBox","ComboBox","Button","ScrollBar","GroupBox","RadioButton","CheckButton","Dialog"};
  19.  
  20. char mainwindow[]="ROOT";
  21.  
  22. /* class structure for storing information about users windows */
  23.  
  24. class slink
  25.    {
  26.    friend class slist;
  27.    
  28.    slink *next;
  29.    slink *prev;
  30.    char *key;
  31.    char *parent;
  32.    int type;
  33.    ent e;
  34.    
  35.    slink(ent a, slink* n, slink* p, char *k, char *par, int t)
  36.       {
  37.       e=a;
  38.       next=n;
  39.       prev=p;
  40.       key=k;
  41.       parent=par;
  42.       type=t;
  43.       }
  44.    };
  45.  
  46. class slist
  47.    {
  48.    slink* last;
  49.    public:
  50.    void insert(ent a, char* k, char* par, int t);
  51.    ent get(char* k);
  52.    ent get2(char* k, int t);
  53.    char *getparent(char* par);
  54.    void zap(char* k);
  55.    void list(char* k, int lev);
  56.    void clear();
  57.    
  58.    slist()
  59.       {
  60.       last = NULL;
  61.       }
  62.    
  63.    slist(ent a, char *k, char *par, int t)
  64.       {
  65.       last=new slink(a, NULL, NULL, k, par, t);
  66.       last->next=last;
  67.       last->prev=last;
  68.       }
  69.    
  70.    ~slist()
  71.       {
  72.       clear();
  73.       }
  74.    };
  75.  
  76. void slist::insert(ent a, char* k, char *par, int t)
  77.    {
  78.    if (last)
  79.       {
  80.       last->next = new slink(a, last->next, last, k, par, t);
  81.       last->next->next->prev = last->next;
  82.       }
  83.    else
  84.       {
  85.       last = new slink(a, NULL, NULL, k, par, t);
  86.       last->next = last;
  87.       last->prev = last;
  88.       }
  89.    }
  90.  
  91. ent slist::get2(char *k,int t)
  92.    {
  93.    slink* f;
  94.    
  95.    if (last==NULL) return NULL;
  96.    
  97.    f = last;
  98.    
  99.    do
  100.       {
  101.       if (strcmp(f->key,k)==0)
  102.          {
  103.          if (f->type == t) return(f->e); else return(NULL);
  104.          }
  105.       f = f->next;
  106.       } while (f != last);
  107.    
  108.    return NULL;
  109.    }
  110.  
  111. ent slist::get(char *k)
  112.    {
  113.    slink* f;
  114.    
  115.    if (last==NULL) return NULL;
  116.    
  117.    f = last;
  118.    
  119.    do
  120.       {
  121.       if (strcmp(f->key,k)==0)
  122.          {
  123.          return(f->e);
  124.          }
  125.       f = f->next;
  126.       } while (f != last);
  127.    
  128.    return NULL;
  129.    }
  130.  
  131. char *slist::getparent(char *k)
  132.    {
  133.    slink* f;
  134.    
  135.    if (last==NULL) return NULL;
  136.    
  137.    f = last;
  138.    
  139.    do
  140.       {
  141.       if (strcmp(f->parent,k)==0)
  142.          {
  143.          return(f->key);
  144.          }
  145.       f = f->next;
  146.       } while (f != last);
  147.    
  148.    return NULL;
  149.    }
  150.  
  151. void slist::zap(char* k)
  152.    {
  153.    slink* f;
  154.    slink* p;
  155.    char* t;
  156.    
  157.    if (last==NULL) return;
  158.    
  159.    f = last;
  160.    p = NULL;
  161.    
  162.    do
  163.       {
  164.       if (strcmp(f->key,k)==0)
  165.          {
  166.          p = f;
  167.          break;
  168.          }
  169.       f = f->next;
  170.       } while (f != last);
  171.    
  172.    // delete any children first
  173.    
  174.    while ((t=getparent(k)) != NULL) { zap(t); }
  175.    
  176.    if (p != NULL)
  177.       {
  178.       f = p->next;
  179.       
  180.       if (f == p)
  181.          {
  182.          last = NULL;
  183.          }
  184.       else
  185.          {
  186.          if (p == last) last = p->prev;
  187.          
  188.          p->prev->next = p->next;
  189.          f->prev = p->prev;
  190.          }
  191.       
  192.       delete p;
  193.       }
  194.    
  195.    }
  196.  
  197. void slist::list(char *k,int level)
  198.    {
  199.    slink* f;
  200.    slink* ff;
  201.    slink* p;
  202.    char temp[128];
  203.    char indent[128];
  204.    int i;
  205.    
  206.    if (last==NULL) return;
  207.    
  208.    f = last;
  209.    p = NULL;
  210.    
  211.    do
  212.       {
  213.       if (strcmp(f->key,k)==0)
  214.          {
  215.          p = f;
  216.          break;
  217.          }
  218.       f = f->next;
  219.       } while (f != last);
  220.    
  221.    if (p != NULL)
  222.       {
  223.       
  224.       indent[0] = '\0';
  225.       for (i=0;i<level;i++) strcat(indent," ");
  226.       
  227.       if (level == 0)
  228.          {
  229.          sprintf(temp,"%s %s",Windowname[p->type],p->key);
  230.          putcombobox(temp);
  231.          }
  232.       
  233.       ff = last;
  234.       
  235.       do
  236.          {
  237.          if (strcmp(ff->parent,k)==0)
  238.             {
  239.             sprintf(temp,"  %s%s %s",indent,Windowname[ff->type],ff->key);
  240.             putcombobox(temp);
  241.             list(ff->key,level+1);
  242.             }
  243.          ff = ff->next;
  244.          } while (ff != last);
  245.       
  246.       }
  247.    }
  248.  
  249. void slist::clear()
  250.    {
  251.    slink* l = last;
  252.    
  253.    if (l == NULL) return;
  254.    
  255.    do
  256.       {
  257.       slink* ll = l;
  258.       l = l->next;
  259.       delete ll;
  260.       }
  261.    while (l!=last);
  262.    
  263.    }
  264.  
  265. // class structures for the controls we support, for the most part they
  266. // are the same as the original with just a key and callback string added
  267.  
  268. class TMxWindow : public TWindow
  269.    {
  270.    public:
  271.    char key[MAX_BUFFER_SIZE];
  272.    TMxWindow(PTWindowsObject AParent, LPSTR AText, PTModule AModule = NULL) :
  273.    (AParent, AText, AModule) {};
  274.    };
  275.  
  276. class TMxDialog : public TDialog
  277.    {
  278.    public:
  279.    char key[MAX_BUFFER_SIZE];
  280.    char callback[MAX_BUFFER_SIZE];
  281.    char caption[MAX_BUFFER_SIZE];
  282.    int x,y,h,w;
  283.    TMxDialog(PTWindowsObject AParent, LPSTR AText, PTModule AModule = NULL) :
  284.    (AParent, AText, AModule) {};
  285.    virtual void SetupWindow();
  286.    };
  287.  
  288. void TMxDialog::SetupWindow()
  289.    {
  290.    SetWindowPos(HWindow, NULL, x, y, w, h, 0);
  291.    SetCaption(caption);
  292.    
  293.    do_execution(callback);
  294.    
  295.    TDialog::SetupWindow();
  296.    }
  297.  
  298. class TMyListBox : public TListBox
  299.    {
  300.    public:
  301.    char key[MAX_BUFFER_SIZE];
  302.    TMyListBox(PTWindowsObject AParent, int AnId, int X, int Y,
  303.    int W, int H, PTModule AModule = NULL) :
  304.    (AParent, AnId, X, Y, W, H, AModule) {};
  305.    };
  306.  
  307. class TMxComboBox : public TComboBox
  308.    {
  309.    public:
  310.    char key[MAX_BUFFER_SIZE];
  311.    TMxComboBox(PTWindowsObject AParent, int AnId, int X, int Y,
  312.    int W, int H, DWORD AStyle, WORD ATextLen, PTModule AModule = NULL) :
  313.    (AParent, AnId, X, Y, W, H, AStyle, ATextLen, AModule) {};
  314.    };
  315.  
  316. class TMyStatic : public TStatic
  317.    {
  318.    public:
  319.    char key[MAX_BUFFER_SIZE];
  320.    TMyStatic(PTWindowsObject AParent, int AnId, LPSTR AText, int X, int Y,
  321.    int W, int H, WORD ATextLen, PTModule AModule = NULL) :
  322.    (AParent, AnId, AText, X, Y, W, H, ATextLen, AModule) {};
  323.    };
  324.  
  325. class TMyButton : public TButton
  326.    {
  327.    public:
  328.    char key[MAX_BUFFER_SIZE];
  329.    char callback[MAX_BUFFER_SIZE];
  330.    //   NODE *callbackx;
  331.    int critical;
  332.    TMyButton(PTWindowsObject AParent, int AnId, LPSTR AText, int X, int Y,
  333.    int W, int H, BOOL IsDefault, PTModule AModule = NULL) :
  334.    (AParent, AnId, AText, X, Y, W, H, IsDefault, AModule) {};
  335.    virtual void DefWndProc(RTMessage Msg);
  336.    };
  337.  
  338. NODE *leventcheck(void)
  339.    {
  340.    MSG msg;
  341.    
  342.    //   checkqueue();
  343.    
  344.    while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
  345.       {
  346.       TranslateMessage(&msg);
  347.       DispatchMessage(&msg);
  348.       }
  349.    
  350.    return (UNBOUND);
  351.    }
  352.  
  353. /* function that processes our own queued events */
  354.  
  355. void checkqueue()
  356.    {
  357.    callthing *thing;
  358.    int save_yield_flag;
  359.    int sv_val_status;
  360.    
  361.    while (thing=calllists.get())
  362.       {
  363.       
  364.       sv_val_status = val_status;
  365.       
  366.       calllists.zap();
  367.       switch (thing->kind)
  368.          {
  369.          
  370.          // mouse event must not yield while processing
  371.          
  372.          case 1:
  373.             {
  374.             save_yield_flag = yield_flag;
  375.             yield_flag = 0;
  376.             mouse_posx = thing->arg1;
  377.             mouse_posy = thing->arg2;
  378.             do_execution(thing->func);
  379.             yield_flag = save_yield_flag;
  380.             break;
  381.             }
  382.          
  383.          // keyboard  event must not yield while processing
  384.          
  385.          case 2:
  386.             {
  387.             save_yield_flag = yield_flag;
  388.             yield_flag = 0;
  389.             keyboard_value = thing->arg1;
  390.             do_execution(thing->func);
  391.             yield_flag = save_yield_flag;
  392.             break;
  393.             }
  394.          
  395.          // Button, timer or other event ok to yield while processing
  396.          
  397.          case 3:
  398.             {
  399.             do_execution(thing->func);
  400.             break;
  401.             }
  402.          
  403.          // Scrollbar, timer or other event must not yield while processing
  404.          
  405.          case 4:
  406.             {
  407.             save_yield_flag = yield_flag;
  408.             yield_flag = 0;
  409.             do_execution(thing->func);
  410.             yield_flag = save_yield_flag;
  411.             break;
  412.             }
  413.          }
  414.       
  415.       delete thing;    
  416.       
  417.       val_status = sv_val_status;
  418.       }
  419.    }
  420.  
  421. /* function to dump the queue */
  422.  
  423. void emptyqueue()
  424.    {
  425.    callthing *thing;
  426.    
  427.    while (thing=calllists.get())
  428.       {
  429.       calllists.zap();
  430.       delete thing;
  431.       }
  432.    }
  433.  
  434. /* if the button gets clicked we end up here and queue the event */
  435.  
  436. void TMyButton::DefWndProc(RTMessage Msg)
  437.    {
  438.    callthing *callevent;
  439.    
  440.    TButton::DefWndProc( Msg );
  441.    
  442.    if (Msg.Message == WM_LBUTTONUP)
  443.       {
  444.       callevent = new callthing;
  445.       callevent->func = callback;
  446.       callevent->kind = 3;
  447.       calllists.insert(callevent,3);
  448.       checkqueue();
  449.       }
  450.    }
  451.  
  452. class TMyScrollBar : public TScrollBar
  453.    {
  454.    public:
  455.    char key[MAX_BUFFER_SIZE];
  456.    char callback[MAX_BUFFER_SIZE];
  457.    int critical;
  458.    TMyScrollBar(PTWindowsObject AParent, int AnId, int X, int Y,
  459.    int W, int H, BOOL IsHScrollBar, PTModule AModule = NULL) :
  460.    (AParent, AnId, X, Y, W, H, IsHScrollBar, AModule) {};
  461.  
  462.    virtual void SBLineDown(RTMessage Msg) = [NF_FIRST + SB_LINEDOWN];
  463.    virtual void SBLineUp(RTMessage Msg) = [NF_FIRST + SB_LINEUP];
  464.    virtual void SBPageDown(RTMessage Msg) = [NF_FIRST + SB_PAGEDOWN];
  465.    virtual void SBPageUp(RTMessage Msg) = [NF_FIRST + SB_PAGEUP];
  466.    virtual void SBThumbPosition(RTMessage Msg) = [NF_FIRST + SB_THUMBPOSITION];
  467.    virtual void SBThumbTrack(RTMessage Msg) = [NF_FIRST + SB_THUMBTRACK];
  468.    };
  469.  
  470. void TMyScrollBar::SBLineDown(RTMessage Msg)
  471.    {
  472.    callthing *callevent;
  473.    
  474.    TScrollBar::SBLineDown( Msg );
  475.    
  476.    callevent = new callthing;
  477.    callevent->func = callback;
  478.    callevent->kind = 4;
  479.    calllists.insert(callevent,4);
  480.    checkqueue();
  481.    }
  482.  
  483. void TMyScrollBar::SBLineUp(RTMessage Msg)
  484.    {
  485.    callthing *callevent;
  486.    
  487.    TScrollBar::SBLineUp( Msg );
  488.    
  489.    callevent = new callthing;
  490.    callevent->func = callback;
  491.    callevent->kind = 4;
  492.    calllists.insert(callevent,4);
  493.    checkqueue();
  494.    }
  495.  
  496. void TMyScrollBar::SBPageDown(RTMessage Msg)
  497.    {
  498.    callthing *callevent;
  499.    
  500.    TScrollBar::SBPageDown( Msg );
  501.    
  502.    callevent = new callthing;
  503.    callevent->func = callback;
  504.    callevent->kind = 4;
  505.    calllists.insert(callevent,4);
  506.    checkqueue();
  507.    }
  508.  
  509. void TMyScrollBar::SBPageUp(RTMessage Msg)
  510.    {
  511.    callthing *callevent;
  512.    
  513.    TScrollBar::SBPageUp( Msg );
  514.    
  515.    callevent = new callthing;
  516.    callevent->func = callback;
  517.    callevent->kind = 4;
  518.    calllists.insert(callevent,4);
  519.    checkqueue();
  520.    }
  521.  
  522. void TMyScrollBar::SBThumbPosition(RTMessage Msg)
  523.    {
  524.    callthing *callevent;
  525.    
  526.    TScrollBar::SBThumbPosition( Msg );
  527.    
  528.    callevent = new callthing;
  529.    callevent->func = callback;
  530.    callevent->kind = 4;
  531.    calllists.insert(callevent,4);
  532.    checkqueue();
  533.    }
  534.  
  535. void TMyScrollBar::SBThumbTrack(RTMessage Msg)
  536.    {
  537.    callthing *callevent;
  538.    
  539.    TScrollBar::SBThumbTrack( Msg );
  540.    
  541.    callevent = new callthing;
  542.    callevent->func = callback;
  543.    callevent->kind = 4;
  544.    calllists.insert(callevent,4);
  545.    checkqueue();
  546.    }
  547.  
  548. class TMyGroupBox : public TGroupBox
  549.    {
  550.    public:
  551.    char key[MAX_BUFFER_SIZE];
  552.    TMyGroupBox(PTWindowsObject AParent, int AnId, LPSTR AText, int X, int Y,
  553.    int W, int H, PTModule AModule = NULL) :
  554.    (AParent, AnId, AText, X, Y, W, H, AModule) {};
  555.    };
  556.  
  557. class TMyRadioButton : public TRadioButton
  558.    {
  559.    public:
  560.    char key[MAX_BUFFER_SIZE];
  561.    int critical;
  562.    char callback[MAX_BUFFER_SIZE];
  563.    TMyRadioButton(PTWindowsObject AParent, int AnId, LPSTR ATitle, int X, int Y,
  564.    int W, int H, PTGroupBox AGroup, PTModule AModule = NULL) :
  565.    (AParent, AnId, ATitle, X, Y, W, H, AGroup, AModule) {};
  566.    };
  567.  
  568. class TMyCheckBox : public TCheckBox
  569.    {
  570.    public:
  571.    char key[MAX_BUFFER_SIZE];
  572.    int critical;
  573.    char callback[MAX_BUFFER_SIZE];
  574.    TMyCheckBox(PTWindowsObject AParent, int AnId, LPSTR ATitle, int X, int Y,
  575.    int W, int H, PTGroupBox AGroup, PTModule AModule = NULL) :
  576.    (AParent, AnId, ATitle, X, Y, W, H, AGroup, AModule) {};
  577.    };
  578.  
  579. typedef struct dialogthing
  580.    {
  581.    union
  582.       {
  583.       TMxWindow *TWmybox;
  584.       TMyStatic *TSmybox;
  585.       TMyListBox *TLmybox;
  586.       TMxComboBox *TCmybox;
  587.       TMyButton *TBmybox;
  588.       TMyScrollBar *TSCmybox;
  589.       TMyGroupBox *TGmybox;
  590.       TMyRadioButton *TRmybox;
  591.       TMyCheckBox *TCBmybox;
  592.       TMxDialog *TDmybox;
  593.       };
  594.    };
  595.  
  596. struct dialoglist : slist
  597.    {
  598.    void insert(dialogthing* a, char* k, char* par, int t) { slist::insert(a, k, par, t); }
  599.    dialogthing* get(char* k)                       { return(dialogthing*)slist::get(k); }
  600.    dialogthing* get2(char* k, int t)               { return(dialogthing*)slist::get2(k,t); }
  601.    dialoglist()                                    {}
  602.    dialoglist(dialogthing* a, char* k, char* par, int t) : (a, k, par, t) {}
  603.    };
  604.  
  605. dialoglist dialogboxes;
  606.  
  607. /* User function to create a modeless window */
  608.  
  609. NODE *lwindowcreate(NODE *args)
  610.    {
  611.    dialogthing *child;
  612.    dialogthing *parent;
  613.    int x;
  614.    int y;
  615.    int w;
  616.    int h;
  617.    char parentname[MAX_BUFFER_SIZE];
  618.    char childname[MAX_BUFFER_SIZE];
  619.    char titlename[MAX_BUFFER_SIZE];
  620.    char *ptr;
  621.    
  622.    /* get all the args */
  623.    
  624.    cnv_strnode_string(parentname, args);
  625.    cnv_strnode_string(childname, args=cdr(args));
  626.    cnv_strnode_string(titlename, args=cdr(args));
  627.    x = getint(pos_int_arg(args=cdr(args)));
  628.    y = getint(pos_int_arg(args=cdr(args)));
  629.    w = getint(pos_int_arg(args=cdr(args)));
  630.    h = getint(pos_int_arg(     cdr(args)));
  631.    
  632.    // convert them to "DIALOG" units this is the key to making
  633.    // all Graphics Modes work correctly.
  634.    
  635.    x = (x*BaseUnitsx)/4;
  636.    y = (y*BaseUnitsy)/8;
  637.    w = (w*BaseUnitsx)/4;
  638.    h = (h*BaseUnitsy)/8;
  639.    
  640.    // if not akready exist continue
  641.    
  642.    if (dialogboxes.get(childname) == NULL)
  643.       {
  644.       
  645.       child = new dialogthing;
  646.       
  647.       // if parent exists use it else use main window
  648.       
  649.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  650.          {
  651.          child->TWmybox = new TMxWindow(parent->TWmybox,titlename);
  652.          ptr = parent->TWmybox->key;
  653.          }
  654.       else
  655.          {
  656.          child->TWmybox = new TMxWindow(MainWindowx,titlename);
  657.          ptr = mainwindow;
  658.          }
  659.       
  660.       // Set appropriate attributes
  661.       
  662.       child->TWmybox->Attr.Style |= WS_POPUPWINDOW | WS_CAPTION;
  663.       
  664.       // we don't want the user closing the window without going
  665.       // through the proper channels
  666.       
  667.       child->TWmybox->Attr.Style ^= WS_SYSMENU;
  668.       
  669.       child->TWmybox->Attr.X = x;
  670.       child->TWmybox->Attr.Y = y;
  671.       child->TWmybox->Attr.W = w;
  672.       child->TWmybox->Attr.H = h;
  673.       
  674.       ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TWmybox);
  675.       
  676.       // Make sure the window is up before we try to add controls?
  677.       
  678.       MyMessageScan();
  679.       
  680.       strcpy(child->TWmybox->key,childname);
  681.       dialogboxes.insert(child,child->TWmybox->key,ptr,TWindow_type);
  682.       }
  683.    else
  684.       {
  685.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  686.       err_logo(STOP_ERROR,NIL);
  687.       }
  688.    
  689.    return (UNBOUND);
  690.    }
  691.  
  692. NODE *lwindowdelete(NODE *arg1)
  693.    {
  694.    dialogthing *temp;
  695.    char childname[MAX_BUFFER_SIZE];
  696.    
  697.    // get args
  698.    
  699.    cnv_strnode_string(childname, arg1);
  700.    
  701.    // Check if exact name and type exists and if does kill it and all
  702.    // it's children too
  703.    
  704.    if ((temp = dialogboxes.get2(childname,TWindow_type)) != NULL)
  705.       {
  706.       
  707.       ((TWindow *)temp->TWmybox)->CloseWindow();
  708.       
  709.       dialogboxes.zap(childname);
  710.       }
  711.    else
  712.       {
  713.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  714.       err_logo(STOP_ERROR,NIL);
  715.       }
  716.    
  717.    return (UNBOUND);
  718.    }
  719.  
  720. NODE *ldialogcreate(NODE *args)
  721.    {
  722.    dialogthing *child;
  723.    dialogthing *parent;
  724.    int x;
  725.    int y;
  726.    int w;
  727.    int h;
  728.    char parentname[MAX_BUFFER_SIZE];
  729.    char childname[MAX_BUFFER_SIZE];
  730.    char titlename[MAX_BUFFER_SIZE];
  731.    char callback[MAX_BUFFER_SIZE];
  732.    char *ptr;
  733.    
  734.    // get args
  735.    
  736.    cnv_strnode_string(parentname, args);
  737.    cnv_strnode_string(childname, args=cdr(args));
  738.    cnv_strnode_string(titlename, args=cdr(args));
  739.    x = getint(pos_int_arg(args=cdr(args)));
  740.    y = getint(pos_int_arg(args=cdr(args)));
  741.    w = getint(pos_int_arg(args=cdr(args)));
  742.    h = getint(pos_int_arg(args=cdr(args)));
  743.    if (cdr(args) != NIL) cnv_strnode_string(callback, cdr(args));
  744.    else callback[0] = '\0';
  745.    
  746.    // convert to "DIALOG" units. This is the key to getting consistent
  747.    // results in all graphics MODEs.
  748.    
  749.    x = (x*BaseUnitsx)/4;
  750.    y = (y*BaseUnitsy)/8;
  751.    w = (w*BaseUnitsx)/4;
  752.    h = (h*BaseUnitsy)/8;
  753.    
  754.    // if it does not exist continue
  755.    
  756.    if (dialogboxes.get(childname) == NULL)
  757.       {
  758.       
  759.       // make one
  760.       
  761.       child = new dialogthing;
  762.       
  763.       // if parent of corect type exists use it
  764.       
  765.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  766.          {
  767.          child->TDmybox = new TMxDialog(parent->TWmybox,"DIALOGSTUB");
  768.          ptr = parent->TWmybox->key;
  769.          }
  770.       
  771.       // else use main window
  772.       
  773.       else
  774.          {
  775.          child->TDmybox = new TMxDialog(MainWindowx,"DIALOGSTUB");
  776.          ptr = mainwindow;
  777.          }
  778.       
  779.       // Modal windows have to have a callback to set them up
  780.       // since it will not return until closed
  781.       
  782.       strcpy(child->TDmybox->callback,callback);
  783.       strcpy(child->TDmybox->caption,titlename);
  784.       
  785.       // Most attributes are set in DIALOGSTUB
  786.       
  787.       child->TDmybox->x = x;
  788.       child->TDmybox->y = y;
  789.       child->TDmybox->w = w;
  790.       child->TDmybox->h = h;
  791.       
  792.       strcpy(child->TDmybox->key,childname);
  793.       dialogboxes.insert(child,child->TDmybox->key,ptr,TDialog_type);
  794.       
  795.       // Note will not return until the Window closes
  796.       // But the LOGO program still has some control through
  797.       // the callback which is done through OWLs "SetupWindow".
  798.       
  799.       ((TWindow *)MainWindowx)->GetApplication()->ExecDialog(child->TDmybox);
  800.       }
  801.    else
  802.       {
  803.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  804.       err_logo(STOP_ERROR,NIL);
  805.       }
  806.    
  807.    return (UNBOUND);
  808.    }
  809.  
  810. NODE *ldialogdelete(NODE *arg1)
  811.    {
  812.    dialogthing *temp;
  813.    char childname[MAX_BUFFER_SIZE];
  814.    
  815.    // get args
  816.    
  817.    cnv_strnode_string(childname, arg1);
  818.    
  819.    // if it exists then kill it and all its children
  820.    
  821.    if ((temp = dialogboxes.get2(childname,TDialog_type)) != NULL)
  822.       {
  823.       
  824.       ((TWindow *)temp->TWmybox)->CloseWindow();
  825.       
  826.       dialogboxes.zap(childname);
  827.       }
  828.    else
  829.       {
  830.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  831.       err_logo(STOP_ERROR,NIL);
  832.       }
  833.    
  834.    return (UNBOUND);
  835.    }
  836.  
  837. NODE *llistboxcreate(NODE *args)
  838.    {
  839.    dialogthing *child;
  840.    dialogthing *parent;
  841.    int x;
  842.    int y;
  843.    int w;
  844.    int h;
  845.    char parentname[MAX_BUFFER_SIZE];
  846.    char childname[MAX_BUFFER_SIZE];
  847.    
  848.    // get args
  849.    
  850.    cnv_strnode_string(parentname, args);
  851.    cnv_strnode_string(childname, args=cdr(args));
  852.    x = getint(pos_int_arg(args=cdr(args)));
  853.    y = getint(pos_int_arg(args=cdr(args)));
  854.    w = getint(pos_int_arg(args=cdr(args)));
  855.    h = getint(pos_int_arg(     cdr(args)));
  856.    
  857.    // convert to "DIALOG" units.
  858.    
  859.    x = (x*BaseUnitsx)/4;
  860.    y = (y*BaseUnitsy)/8;
  861.    w = (w*BaseUnitsx)/4;
  862.    h = (h*BaseUnitsy)/8;
  863.    
  864.    // if unique continue
  865.    
  866.    if (dialogboxes.get(childname) == NULL)
  867.       {
  868.       
  869.       // If modeless parent then continue
  870.       
  871.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  872.          {
  873.          child = new dialogthing;
  874.          
  875.          child->TLmybox = new TMyListBox(parent->TWmybox,MYLISTBOX_ID,x,y,w,h);
  876.          
  877.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TLmybox);
  878.          
  879.          MyMessageScan();
  880.          
  881.          strcpy(child->TLmybox->key,childname);
  882.          dialogboxes.insert(child,child->TLmybox->key,parent->TWmybox->key,TListBox_type);
  883.          }
  884.       
  885.       // else if modal window continue
  886.       
  887.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  888.          {
  889.          child = new dialogthing;
  890.          
  891.          child->TLmybox = new TMyListBox(parent->TDmybox,MYLISTBOX_ID,x,y,w,h);
  892.          
  893.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TLmybox);
  894.          
  895.          MyMessageScan();
  896.          
  897.          strcpy(child->TLmybox->key,childname);
  898.          dialogboxes.insert(child,child->TLmybox->key,parent->TDmybox->key,TListBox_type);
  899.          }
  900.       else
  901.          {
  902.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  903.          err_logo(STOP_ERROR,NIL);
  904.          }
  905.       }
  906.    else
  907.       {
  908.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  909.       err_logo(STOP_ERROR,NIL);
  910.       }
  911.    
  912.    return (UNBOUND);
  913.    }
  914.  
  915. NODE *llistboxdelete(NODE *arg1)
  916.    {
  917.    dialogthing *temp;
  918.    char childname[MAX_BUFFER_SIZE];
  919.    
  920.    // get args
  921.    
  922.    cnv_strnode_string(childname, arg1);
  923.    
  924.    // if it exists kill it
  925.    
  926.    if ((temp = dialogboxes.get2(childname,TListBox_type)) != NULL)
  927.       {
  928.       
  929.       ((TListBox *)temp->TLmybox)->CloseWindow();
  930.       
  931.       dialogboxes.zap(childname);
  932.       }
  933.    else
  934.       {
  935.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  936.       err_logo(STOP_ERROR,NIL);
  937.       }
  938.    
  939.    return (UNBOUND);
  940.    }
  941.  
  942. NODE *llistboxgetselect(NODE *args)
  943.    {
  944.    dialogthing *parent;
  945.    char parentname[MAX_BUFFER_SIZE];
  946.    char stringname[MAX_BUFFER_SIZE];
  947.    NODE *val = UNBOUND;
  948.    
  949.    // get args
  950.    
  951.    cnv_strnode_string(parentname, args);
  952.    
  953.    // If it exists continue
  954.    
  955.    if ((parent = dialogboxes.get2(parentname,TListBox_type)) != NULL)
  956.       {
  957.       
  958.       // if success on fetching string return it
  959.       
  960.       if (((TListBox *)parent->TLmybox)->GetSelString(stringname,MAX_BUFFER_SIZE) >= 0)
  961.          {
  962.          
  963.          // parsing it basically turns it into a list for us
  964.          
  965.          val = parser(make_strnode(stringname, NULL, strlen(stringname), STRING, strnzcpy),FALSE);
  966.          return(val);
  967.          }
  968.       }
  969.    else
  970.       {
  971.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  972.       err_logo(STOP_ERROR,NIL);
  973.       }
  974.    
  975.    return (UNBOUND);
  976.    }
  977.  
  978. NODE *llistboxaddstring(NODE *args)
  979.    {
  980.    dialogthing *parent;
  981.    char parentname[MAX_BUFFER_SIZE];
  982.    char stringname[MAX_BUFFER_SIZE];
  983.    
  984.    // get args
  985.    
  986.    cnv_strnode_string(parentname, args);
  987.    cnv_strnode_string(stringname, cdr(args));
  988.    
  989.    // if exists continue
  990.    
  991.    if ((parent = dialogboxes.get2(parentname,TListBox_type)) != NULL)
  992.       {
  993.       
  994.       // add entry and reset Index for consistency
  995.       
  996.       ((TListBox *)parent->TLmybox)->AddString(stringname);
  997.       ((TListBox *)parent->TLmybox)->SetSelIndex(0);
  998.       }
  999.    else
  1000.       {
  1001.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1002.       err_logo(STOP_ERROR,NIL);
  1003.       }
  1004.    
  1005.    return (UNBOUND);
  1006.    }
  1007.  
  1008. NODE *llistboxdeletestring(NODE *args)
  1009.    {
  1010.    dialogthing *parent;
  1011.    int index;
  1012.    char parentname[MAX_BUFFER_SIZE];
  1013.    
  1014.    // get args
  1015.    
  1016.    cnv_strnode_string(parentname, args);
  1017.    index = getint(pos_int_arg(cdr(args)));
  1018.    
  1019.    // if exists continue
  1020.    
  1021.    if ((parent = dialogboxes.get2(parentname,TListBox_type)) != NULL)
  1022.       {
  1023.       
  1024.       // kill entry based on index
  1025.       
  1026.       ((TListBox *)parent->TLmybox)->DeleteString(index);
  1027.       ((TListBox *)parent->TLmybox)->SetSelIndex(0);
  1028.       }
  1029.    else
  1030.       {
  1031.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1032.       err_logo(STOP_ERROR,NIL);
  1033.       }
  1034.    
  1035.    return (UNBOUND);
  1036.    }
  1037.  
  1038. NODE *lcomboboxcreate(NODE *args)
  1039.    {
  1040.    dialogthing *child;
  1041.    dialogthing *parent;
  1042.    int x;
  1043.    int y;
  1044.    int w;
  1045.    int h;
  1046.    char parentname[MAX_BUFFER_SIZE];
  1047.    char childname[MAX_BUFFER_SIZE];
  1048.    
  1049.    // get args
  1050.    
  1051.    cnv_strnode_string(parentname, args);
  1052.    cnv_strnode_string(childname, args=cdr(args));
  1053.    x = getint(pos_int_arg(args=cdr(args)));
  1054.    y = getint(pos_int_arg(args=cdr(args)));
  1055.    w = getint(pos_int_arg(args=cdr(args)));
  1056.    h = getint(pos_int_arg(     cdr(args)));
  1057.    
  1058.    // convert to "DIALOG" units
  1059.    
  1060.    x = (x*BaseUnitsx)/4;
  1061.    y = (y*BaseUnitsy)/8;
  1062.    w = (w*BaseUnitsx)/4;
  1063.    h = (h*BaseUnitsy)/8;
  1064.    
  1065.    // if unique continue
  1066.    
  1067.    if (dialogboxes.get(childname) == NULL)
  1068.       {
  1069.       
  1070.       // if modeless window enter here
  1071.       
  1072.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1073.          {
  1074.          // create thingy
  1075.          
  1076.          child = new dialogthing;
  1077.          
  1078.          child->TCmybox = new TMxComboBox(parent->TWmybox,MYCOMBOBOX_ID,x,y,w,h,CBS_SIMPLE,0);
  1079.          
  1080.          // set attributes
  1081.          
  1082.          child->TCmybox->Attr.Style |= CBS_DISABLENOSCROLL;
  1083.          
  1084.          // Display the control
  1085.          
  1086.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TCmybox);
  1087.          
  1088.          MyMessageScan();
  1089.          
  1090.          strcpy(child->TCmybox->key,childname);
  1091.          dialogboxes.insert(child,child->TCmybox->key,parent->TWmybox->key,TComboBox_type);
  1092.          }
  1093.       
  1094.       // if modal window enter here (same as above except names change)
  1095.       
  1096.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1097.          {
  1098.          child = new dialogthing;
  1099.          
  1100.          child->TCmybox = new TMxComboBox(parent->TDmybox,MYCOMBOBOX_ID,x,y,w,h,CBS_SIMPLE,0);
  1101.          
  1102.          child->TCmybox->Attr.Style |= CBS_DISABLENOSCROLL;
  1103.          
  1104.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TCmybox);
  1105.          
  1106.          MyMessageScan();
  1107.          
  1108.          strcpy(child->TCmybox->key,childname);
  1109.          dialogboxes.insert(child,child->TCmybox->key,parent->TDmybox->key,TComboBox_type);
  1110.          }
  1111.       else
  1112.          {
  1113.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1114.          err_logo(STOP_ERROR,NIL);
  1115.          }
  1116.       }
  1117.    else
  1118.       {
  1119.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1120.       err_logo(STOP_ERROR,NIL);
  1121.       }
  1122.    
  1123.    return (UNBOUND);
  1124.    }
  1125.  
  1126. NODE *lcomboboxdelete(NODE *arg1)
  1127.    {
  1128.    dialogthing *temp;
  1129.    char childname[MAX_BUFFER_SIZE];
  1130.    
  1131.    // get args
  1132.    
  1133.    cnv_strnode_string(childname, arg1);
  1134.    
  1135.    // if it exists kill it
  1136.    
  1137.    if ((temp = dialogboxes.get2(childname,TComboBox_type)) != NULL)
  1138.       {
  1139.       
  1140.       ((TComboBox *)temp->TCmybox)->CloseWindow();
  1141.       
  1142.       dialogboxes.zap(childname);
  1143.       }
  1144.    else
  1145.       {
  1146.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1147.       err_logo(STOP_ERROR,NIL);
  1148.       }
  1149.    
  1150.    return (UNBOUND);
  1151.    }
  1152.  
  1153. NODE *lcomboboxgettext(NODE *args)
  1154.    {
  1155.    dialogthing *parent;
  1156.    char parentname[MAX_BUFFER_SIZE];
  1157.    char stringname[MAX_BUFFER_SIZE];
  1158.    NODE *val;
  1159.    
  1160.    // get args
  1161.    
  1162.    cnv_strnode_string(parentname, args);
  1163.    
  1164.    // if exists continue
  1165.    
  1166.    if ((parent = dialogboxes.get2(parentname,TComboBox_type)) != NULL)
  1167.       {
  1168.       
  1169.       // if successful getting string return it
  1170.       
  1171.       if (((TComboBox *)parent->TCmybox)->GetText(stringname,MAX_BUFFER_SIZE) >= 0)
  1172.          {
  1173.          
  1174.          // parsing it turns it into a list
  1175.          
  1176.          val = parser(make_strnode(stringname, NULL, strlen(stringname), STRING, strnzcpy),FALSE);
  1177.          return(val);
  1178.          }
  1179.       }
  1180.    else
  1181.       {
  1182.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1183.       err_logo(STOP_ERROR,NIL);
  1184.       }
  1185.    
  1186.    return (UNBOUND);
  1187.    }
  1188.  
  1189. NODE *lcomboboxsettext(NODE *args)
  1190.    {
  1191.    dialogthing *parent;
  1192.    char parentname[MAX_BUFFER_SIZE];
  1193.    char stringname[MAX_BUFFER_SIZE];
  1194.    
  1195.    // get args
  1196.    
  1197.    cnv_strnode_string(parentname, args);
  1198.    cnv_strnode_string(stringname, cdr(args));
  1199.    
  1200.    // if exists continue
  1201.    
  1202.    if ((parent = dialogboxes.get2(parentname,TComboBox_type)) != NULL)
  1203.       {
  1204.       
  1205.       // set the editcontrol portion to the user specified text
  1206.       
  1207.       ((TComboBox *)parent->TCmybox)->SetText(stringname);
  1208.       }
  1209.    else
  1210.       {
  1211.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1212.       err_logo(STOP_ERROR,NIL);
  1213.       }
  1214.    
  1215.    return (UNBOUND);
  1216.    }
  1217.  
  1218. NODE *lcomboboxaddstring(NODE *args)
  1219.    {
  1220.    dialogthing *parent;
  1221.    char parentname[MAX_BUFFER_SIZE];
  1222.    char stringname[MAX_BUFFER_SIZE];
  1223.    
  1224.    // get args
  1225.    
  1226.    cnv_strnode_string(parentname, args);
  1227.    cnv_strnode_string(stringname, cdr(args));
  1228.    
  1229.    // if exists continue
  1230.    
  1231.    if ((parent = dialogboxes.get2(parentname,TComboBox_type)) != NULL)
  1232.       {
  1233.       
  1234.       // add string and reset selection
  1235.       
  1236.       ((TComboBox *)parent->TCmybox)->AddString(stringname);
  1237.       ((TComboBox *)parent->TCmybox)->SetSelIndex(0);
  1238.       }
  1239.    else
  1240.       {
  1241.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1242.       err_logo(STOP_ERROR,NIL);
  1243.       }
  1244.    
  1245.    return (UNBOUND);
  1246.    }
  1247.  
  1248. NODE *lcomboboxdeletestring(NODE *args)
  1249.    {
  1250.    dialogthing *parent;
  1251.    int index;
  1252.    char parentname[MAX_BUFFER_SIZE];
  1253.    
  1254.    // get args
  1255.    
  1256.    cnv_strnode_string(parentname, args);
  1257.    index = getint(pos_int_arg(cdr(args)));
  1258.    
  1259.    // if exists continue
  1260.    
  1261.    if ((parent = dialogboxes.get2(parentname,TComboBox_type)) != NULL)
  1262.       {
  1263.       
  1264.       // kill entrt and reset Index
  1265.       
  1266.       ((TComboBox *)parent->TCmybox)->DeleteString(index);
  1267.       ((TComboBox *)parent->TCmybox)->SetSelIndex(0);
  1268.       }
  1269.    else
  1270.       {
  1271.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1272.       err_logo(STOP_ERROR,NIL);
  1273.       }
  1274.    
  1275.    return (UNBOUND);
  1276.    }
  1277.  
  1278. //xxxxxxxxxxxxxxxxxxxx
  1279.  
  1280. NODE *lscrollbarcreate(NODE *args)
  1281.    {
  1282.    dialogthing *child;
  1283.    dialogthing *parent;
  1284.    int x;
  1285.    int y;
  1286.    int w;
  1287.    int h;
  1288.    char parentname[MAX_BUFFER_SIZE];
  1289.    char childname[MAX_BUFFER_SIZE];
  1290.    char callback[MAX_BUFFER_SIZE];
  1291.    
  1292.    cnv_strnode_string(parentname, args);
  1293.    cnv_strnode_string(childname, args=cdr(args));
  1294.    x = getint(pos_int_arg(args=cdr(args)));
  1295.    y = getint(pos_int_arg(args=cdr(args)));
  1296.    w = getint(pos_int_arg(args=cdr(args)));
  1297.    h = getint(pos_int_arg(args=cdr(args)));
  1298.    cnv_strnode_string(callback, cdr(args));
  1299.    //   if (cdr(args) != NIL) 
  1300.    //   else callback[0] = '\0';
  1301.    
  1302.    x = (x*BaseUnitsx)/4;
  1303.    y = (y*BaseUnitsy)/8;
  1304.    w = (w*BaseUnitsx)/4;
  1305.    h = (h*BaseUnitsy)/8;
  1306.    
  1307.    if (dialogboxes.get(childname) == NULL)
  1308.       {
  1309.       
  1310.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1311.          {
  1312.          child = new dialogthing;
  1313.          
  1314.          if (w>h)
  1315.             {
  1316.             child->TSCmybox = new TMyScrollBar(parent->TWmybox,MYSCROLLBAR_ID,x,y,w,0,TRUE);
  1317.             }
  1318.          else
  1319.             {
  1320.             child->TSCmybox = new TMyScrollBar(parent->TWmybox,MYSCROLLBAR_ID,x,y,0,h,FALSE);
  1321.             }
  1322.          
  1323.          strcpy(child->TSCmybox->callback,callback);
  1324.          child->TSCmybox->critical = 0;
  1325.          
  1326.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TSCmybox);
  1327.          
  1328.          MyMessageScan();
  1329.          
  1330.          strcpy(child->TSCmybox->key,childname);
  1331.          dialogboxes.insert(child,child->TSCmybox->key,parent->TWmybox->key,TScrollBar_type);
  1332.          }
  1333.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1334.          {
  1335.          child = new dialogthing;
  1336.          
  1337.          if (w>h)
  1338.             {
  1339.             child->TSCmybox = new TMyScrollBar(parent->TDmybox,MYSCROLLBAR_ID,x,y,w,0,TRUE);
  1340.             }
  1341.          else
  1342.             {
  1343.             child->TSCmybox = new TMyScrollBar(parent->TDmybox,MYSCROLLBAR_ID,x,y,0,h,FALSE);
  1344.             }
  1345.          
  1346.          strcpy(child->TSCmybox->callback,callback);
  1347.          child->TSCmybox->critical = 0;
  1348.          
  1349.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TSCmybox);
  1350.          
  1351.          MyMessageScan();
  1352.          
  1353.          strcpy(child->TSCmybox->key,childname);
  1354.          dialogboxes.insert(child,child->TSCmybox->key,parent->TDmybox->key,TScrollBar_type);
  1355.          }
  1356.       else
  1357.          {
  1358.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1359.          err_logo(STOP_ERROR,NIL);
  1360.          }
  1361.       }
  1362.    else
  1363.       {
  1364.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1365.       err_logo(STOP_ERROR,NIL);
  1366.       }
  1367.    
  1368.    return (UNBOUND);
  1369.    }
  1370.  
  1371. NODE *lscrollbarset(NODE *args)
  1372.    {
  1373.    dialogthing *parent;
  1374.    char parentname[MAX_BUFFER_SIZE];
  1375.    int lo;
  1376.    int hi;
  1377.    int pos;
  1378.    
  1379.    cnv_strnode_string(parentname, args);
  1380.    lo = getint(pos_int_arg(args=cdr(args)));
  1381.    hi = getint(pos_int_arg(args=cdr(args)));
  1382.    pos = getint(pos_int_arg(cdr(args)));
  1383.    
  1384.    if ((parent = dialogboxes.get2(parentname,TScrollBar_type)) != NULL)
  1385.       {
  1386.       ((TScrollBar *)parent->TSCmybox)->SetRange(lo,hi);
  1387.       ((TScrollBar *)parent->TSCmybox)->SetPosition(pos);
  1388.       }
  1389.    else
  1390.       {
  1391.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1392.       err_logo(STOP_ERROR,NIL);
  1393.       }
  1394.    
  1395.    return (UNBOUND);
  1396.    }
  1397.  
  1398. NODE *lscrollbarget(NODE *args)
  1399.    {
  1400.    dialogthing *parent;
  1401.    char parentname[MAX_BUFFER_SIZE];
  1402.    int pos;
  1403.    
  1404.    cnv_strnode_string(parentname, args);
  1405.    
  1406.    if ((parent = dialogboxes.get2(parentname,TScrollBar_type)) != NULL)
  1407.       {
  1408.       pos = ((TScrollBar *)parent->TSCmybox)->GetPosition();
  1409.       return(make_intnode(pos));
  1410.       }
  1411.    else
  1412.       {
  1413.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1414.       err_logo(STOP_ERROR,NIL);
  1415.       }
  1416.    
  1417.    return (UNBOUND);
  1418.    }
  1419.  
  1420. NODE *lscrollbardelete(NODE *arg1)
  1421.    {
  1422.    dialogthing *temp;
  1423.    char childname[MAX_BUFFER_SIZE];
  1424.    
  1425.    cnv_strnode_string(childname, arg1);
  1426.    
  1427.    if ((temp = dialogboxes.get2(childname,TScrollBar_type)) != NULL)
  1428.       {
  1429.       
  1430.       ((TScrollBar *)temp->TSCmybox)->CloseWindow();
  1431.       
  1432.       dialogboxes.zap(childname);
  1433.       }
  1434.    else
  1435.       {
  1436.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1437.       err_logo(STOP_ERROR,NIL);
  1438.       }
  1439.    
  1440.    return (UNBOUND);
  1441.    }
  1442.  
  1443. NODE *lstaticcreate(NODE *args)
  1444.    {
  1445.    dialogthing *child;
  1446.    dialogthing *parent;
  1447.    int x;
  1448.    int y;
  1449.    int w;
  1450.    int h;
  1451.    char parentname[MAX_BUFFER_SIZE];
  1452.    char childname[MAX_BUFFER_SIZE];
  1453.    char titlename[MAX_BUFFER_SIZE];
  1454.    
  1455.    cnv_strnode_string(parentname, args);
  1456.    cnv_strnode_string(childname, args=cdr(args));
  1457.    cnv_strnode_string(titlename, args=cdr(args));
  1458.    x = getint(pos_int_arg(args=cdr(args)));
  1459.    y = getint(pos_int_arg(args=cdr(args)));
  1460.    w = getint(pos_int_arg(args=cdr(args)));
  1461.    h = getint(pos_int_arg(     cdr(args)));
  1462.    
  1463.    x = (x*BaseUnitsx)/4;
  1464.    y = (y*BaseUnitsy)/8;
  1465.    w = (w*BaseUnitsx)/4;
  1466.    h = (h*BaseUnitsy)/8;
  1467.    
  1468.    if (dialogboxes.get(childname) == NULL)
  1469.       {
  1470.       
  1471.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1472.          {
  1473.          child = new dialogthing;
  1474.          
  1475.          child->TSmybox = new TMyStatic(parent->TWmybox,MYSTATIC_ID,titlename,x,y,w,h,0);
  1476.          
  1477.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TSmybox);
  1478.          
  1479.          MyMessageScan();
  1480.          
  1481.          strcpy(child->TSmybox->key,childname);
  1482.          dialogboxes.insert(child,child->TSmybox->key,parent->TWmybox->key,TStatic_type);
  1483.          }
  1484.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1485.          {
  1486.          child = new dialogthing;
  1487.          
  1488.          child->TSmybox = new TMyStatic(parent->TDmybox,MYSTATIC_ID,titlename,x,y,w,h,0);
  1489.          
  1490.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TSmybox);
  1491.          
  1492.          MyMessageScan();
  1493.          
  1494.          strcpy(child->TSmybox->key,childname);
  1495.          dialogboxes.insert(child,child->TSmybox->key,parent->TDmybox->key,TStatic_type);
  1496.          }
  1497.       else
  1498.          {
  1499.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1500.          err_logo(STOP_ERROR,NIL);
  1501.          }
  1502.       }
  1503.    else
  1504.       {
  1505.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1506.       err_logo(STOP_ERROR,NIL);
  1507.       }
  1508.    
  1509.    return (UNBOUND);
  1510.    }
  1511.  
  1512. NODE *lstaticupdate(NODE *args)
  1513.    {
  1514.    dialogthing *temp;
  1515.    char childname[MAX_BUFFER_SIZE];
  1516.    char titlename[MAX_BUFFER_SIZE];
  1517.    
  1518.    cnv_strnode_string(childname, args);
  1519.    cnv_strnode_string(titlename, cdr(args));
  1520.    
  1521.    if ((temp = dialogboxes.get2(childname,TStatic_type)) != NULL)
  1522.       {
  1523.       
  1524.       ((TStatic *)temp->TSmybox)->SetText(titlename);
  1525.       
  1526.       }
  1527.    else
  1528.       {
  1529.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1530.       err_logo(STOP_ERROR,NIL);
  1531.       }
  1532.    
  1533.    return (UNBOUND);
  1534.    }
  1535.  
  1536. NODE *lstaticdelete(NODE *arg1)
  1537.    {
  1538.    dialogthing *temp;
  1539.    char childname[MAX_BUFFER_SIZE];
  1540.    
  1541.    cnv_strnode_string(childname, arg1);
  1542.    
  1543.    if ((temp = dialogboxes.get2(childname,TStatic_type)) != NULL)
  1544.       {
  1545.       
  1546.       ((TStatic *)temp->TSmybox)->CloseWindow();
  1547.       
  1548.       dialogboxes.zap(childname);
  1549.       }
  1550.    else
  1551.       {
  1552.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1553.       err_logo(STOP_ERROR,NIL);
  1554.       }
  1555.    
  1556.    return (UNBOUND);
  1557.    }
  1558.  
  1559. NODE *lbuttoncreate(NODE *args)
  1560.    {
  1561.    dialogthing *child;
  1562.    dialogthing *parent;
  1563.    int x;
  1564.    int y;
  1565.    int w;
  1566.    int h;
  1567.    char parentname[MAX_BUFFER_SIZE];
  1568.    char childname[MAX_BUFFER_SIZE];
  1569.    char titlename[MAX_BUFFER_SIZE];
  1570.    char callback[MAX_BUFFER_SIZE];
  1571.    //   NODE *callbackx;   
  1572.    
  1573.    cnv_strnode_string(parentname, args);
  1574.    cnv_strnode_string(childname, args=cdr(args));
  1575.    cnv_strnode_string(titlename, args=cdr(args));
  1576.    x = getint(pos_int_arg(args=cdr(args)));
  1577.    y = getint(pos_int_arg(args=cdr(args)));
  1578.    w = getint(pos_int_arg(args=cdr(args)));
  1579.    h = getint(pos_int_arg(args=cdr(args)));
  1580.    //   callbackx = cdr(args);
  1581.    //   lprint(callbackx);
  1582.    //   xxx = reref(xxx, cdr(args));
  1583.    //   lprint(xxx);
  1584.    if (cdr(args) != NIL) cnv_strnode_string(callback, cdr(args));
  1585.    else callback[0] = '\0';
  1586.    
  1587.    x = (x*BaseUnitsx)/4;
  1588.    y = (y*BaseUnitsy)/8;
  1589.    w = (w*BaseUnitsx)/4;
  1590.    h = (h*BaseUnitsy)/8;
  1591.    
  1592.    if (dialogboxes.get(childname) == NULL)
  1593.       {
  1594.       
  1595.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1596.          {
  1597.          child = new dialogthing;
  1598.          
  1599.          child->TBmybox = new TMyButton(parent->TWmybox,MYBUTTON_ID,titlename,x,y,w,h,0);
  1600.          
  1601.          strcpy(child->TBmybox->callback,callback);
  1602.          child->TBmybox->critical = 0;
  1603.          
  1604.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TBmybox);
  1605.          
  1606.          MyMessageScan();
  1607.          
  1608.          strcpy(child->TBmybox->key,childname);
  1609.          dialogboxes.insert(child,child->TBmybox->key,parent->TWmybox->key,TButton_type);
  1610.          } 
  1611.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1612.          {
  1613.          child = new dialogthing;
  1614.          
  1615.          child->TBmybox = new TMyButton(parent->TDmybox,MYBUTTON_ID,titlename,x,y,w,h,0);
  1616.          
  1617.          strcpy(child->TBmybox->callback,callback);
  1618.          child->TBmybox->critical = 0;
  1619.          
  1620.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TBmybox);
  1621.          
  1622.          MyMessageScan();
  1623.          
  1624.          strcpy(child->TBmybox->key,childname);
  1625.          dialogboxes.insert(child,child->TBmybox->key,parent->TDmybox->key,TButton_type);
  1626.          } 
  1627.       else
  1628.          {
  1629.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1630.          err_logo(STOP_ERROR,NIL);
  1631.          }
  1632.       }
  1633.    else
  1634.       {
  1635.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1636.       err_logo(STOP_ERROR,NIL);
  1637.       }
  1638.    
  1639.    return (UNBOUND);
  1640.    }
  1641.  
  1642. NODE *lbuttondelete(NODE *arg1)
  1643.    {
  1644.    dialogthing *temp;
  1645.    char childname[MAX_BUFFER_SIZE];
  1646.    
  1647.    cnv_strnode_string(childname, arg1);
  1648.    
  1649.    if ((temp = dialogboxes.get2(childname,TButton_type)) != NULL)
  1650.       {
  1651.       
  1652.       ((TButton *)temp->TBmybox)->CloseWindow();
  1653.       
  1654.       dialogboxes.zap(childname);
  1655.       }
  1656.    else
  1657.       {
  1658.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1659.       err_logo(STOP_ERROR,NIL);
  1660.       }
  1661.    
  1662.    return (UNBOUND);
  1663.    }
  1664.  
  1665. NODE *lgroupboxcreate(NODE *args)
  1666.    {
  1667.    dialogthing *child;
  1668.    dialogthing *parent;
  1669.    int x;
  1670.    int y;
  1671.    int w;
  1672.    int h;
  1673.    char parentname[MAX_BUFFER_SIZE];
  1674.    char childname[MAX_BUFFER_SIZE];
  1675.    
  1676.    cnv_strnode_string(parentname, args);
  1677.    cnv_strnode_string(childname, args=cdr(args));
  1678.    x = getint(pos_int_arg(args=cdr(args)));
  1679.    y = getint(pos_int_arg(args=cdr(args)));
  1680.    w = getint(pos_int_arg(args=cdr(args)));
  1681.    h = getint(pos_int_arg(     cdr(args)));
  1682.    
  1683.    x = (x*BaseUnitsx)/4;
  1684.    y = (y*BaseUnitsy)/8;
  1685.    w = (w*BaseUnitsx)/4;
  1686.    h = (h*BaseUnitsy)/8;
  1687.    
  1688.    if (dialogboxes.get(childname) == NULL)
  1689.       {
  1690.       
  1691.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1692.          {
  1693.          child = new dialogthing;
  1694.          
  1695.          child->TGmybox = new TMyGroupBox(parent->TWmybox,MYGROUPBOX_ID,NULL,x,y,w,h);
  1696.          
  1697.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TGmybox);
  1698.          
  1699.          MyMessageScan();
  1700.          
  1701.          strcpy(child->TGmybox->key,childname);
  1702.          dialogboxes.insert(child,child->TGmybox->key,parent->TWmybox->key,TGroupBox_type);
  1703.          }
  1704.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1705.          {
  1706.          child = new dialogthing;
  1707.          
  1708.          child->TGmybox = new TMyGroupBox(parent->TDmybox,MYGROUPBOX_ID,NULL,x,y,w,h);
  1709.          
  1710.          ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TGmybox);
  1711.          
  1712.          MyMessageScan();
  1713.          
  1714.          strcpy(child->TGmybox->key,childname);
  1715.          dialogboxes.insert(child,child->TGmybox->key,parent->TDmybox->key,TGroupBox_type);
  1716.          }
  1717.       else
  1718.          {
  1719.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1720.          err_logo(STOP_ERROR,NIL);
  1721.          }
  1722.       }
  1723.    else
  1724.       {
  1725.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1726.       err_logo(STOP_ERROR,NIL);
  1727.       }
  1728.    
  1729.    return (UNBOUND);
  1730.    }
  1731.  
  1732. NODE *lgroupboxdelete(NODE *arg1)
  1733.    {
  1734.    dialogthing *temp;
  1735.    char childname[MAX_BUFFER_SIZE];
  1736.    
  1737.    cnv_strnode_string(childname, arg1);
  1738.    
  1739.    if ((temp = dialogboxes.get2(childname,TGroupBox_type)) != NULL)
  1740.       {
  1741.       
  1742.       ((TGroupBox *)temp->TGmybox)->CloseWindow();
  1743.       
  1744.       dialogboxes.zap(childname);
  1745.       }
  1746.    else
  1747.       {
  1748.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1749.       err_logo(STOP_ERROR,NIL);
  1750.       }
  1751.    
  1752.    return (UNBOUND);
  1753.    }
  1754.  
  1755. NODE *lradiobuttoncreate(NODE *args)
  1756.    {
  1757.    dialogthing *child;
  1758.    dialogthing *parent;
  1759.    dialogthing *group;
  1760.    int x;
  1761.    int y;
  1762.    int w;
  1763.    int h;
  1764.    char parentname[MAX_BUFFER_SIZE];
  1765.    char childname[MAX_BUFFER_SIZE];
  1766.    char titlename[MAX_BUFFER_SIZE];
  1767.    char groupname[MAX_BUFFER_SIZE];
  1768.    
  1769.    cnv_strnode_string(parentname, args);
  1770.    cnv_strnode_string(groupname, args=cdr(args));
  1771.    cnv_strnode_string(childname, args=cdr(args));
  1772.    cnv_strnode_string(titlename, args=cdr(args));
  1773.    x = getint(pos_int_arg(args=cdr(args)));
  1774.    y = getint(pos_int_arg(args=cdr(args)));
  1775.    w = getint(pos_int_arg(args=cdr(args)));
  1776.    h = getint(pos_int_arg(args=cdr(args)));
  1777.    //   if (cdr(args) != NIL) cnv_strnode_string(callback, cdr(args));
  1778.    //   else callback[0] = '\0';
  1779.    
  1780.    x = (x*BaseUnitsx)/4;
  1781.    y = (y*BaseUnitsy)/8;
  1782.    w = (w*BaseUnitsx)/4;
  1783.    h = (h*BaseUnitsy)/8;
  1784.    
  1785.    if (dialogboxes.get(childname) == NULL)
  1786.       {
  1787.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1788.          {
  1789.          if ((group = dialogboxes.get2(groupname,TGroupBox_type)) != NULL)
  1790.             {
  1791.             child = new dialogthing;
  1792.             
  1793.             child->TRmybox = new TMyRadioButton(parent->TWmybox,MYRADIOBUTTON_ID,titlename,x,y,w,h,group->TGmybox);
  1794.             
  1795.             //         strcpy(child->TRmybox->callback,callback);
  1796.             //         child->TRmybox->critical = 0;
  1797.             
  1798.             ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TRmybox);
  1799.             
  1800.             MyMessageScan();
  1801.             
  1802.             strcpy(child->TRmybox->key,childname);
  1803.             dialogboxes.insert(child,child->TRmybox->key,parent->TWmybox->key,TRadioButton_type);
  1804.             } 
  1805.          else
  1806.             {
  1807.             MessageBox(CmdHWindow, groupname, "Does not exist", MB_OK);
  1808.             err_logo(STOP_ERROR,NIL);
  1809.             }
  1810.          } 
  1811.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1812.          {
  1813.          if ((group = dialogboxes.get2(groupname,TGroupBox_type)) != NULL)
  1814.             {
  1815.             child = new dialogthing;
  1816.             
  1817.             child->TRmybox = new TMyRadioButton(parent->TDmybox,MYRADIOBUTTON_ID,titlename,x,y,w,h,group->TGmybox);
  1818.             
  1819.             //         strcpy(child->TRmybox->callback,callback);
  1820.             //         child->TRmybox->critical = 0;
  1821.             
  1822.             ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TRmybox);
  1823.             
  1824.             MyMessageScan();
  1825.             
  1826.             strcpy(child->TRmybox->key,childname);
  1827.             dialogboxes.insert(child,child->TRmybox->key,parent->TDmybox->key,TRadioButton_type);
  1828.             } 
  1829.          else
  1830.             {
  1831.             MessageBox(CmdHWindow, groupname, "Does not exist", MB_OK);
  1832.             err_logo(STOP_ERROR,NIL);
  1833.             }
  1834.          } 
  1835.       else
  1836.          {
  1837.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1838.          err_logo(STOP_ERROR,NIL);
  1839.          }
  1840.       }
  1841.    else
  1842.       {
  1843.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  1844.       err_logo(STOP_ERROR,NIL);
  1845.       }
  1846.    
  1847.    return (UNBOUND);
  1848.    }
  1849.  
  1850. NODE *lradiobuttondelete(NODE *arg1)
  1851.    {
  1852.    dialogthing *temp;
  1853.    char childname[MAX_BUFFER_SIZE];
  1854.    
  1855.    cnv_strnode_string(childname, arg1);
  1856.    
  1857.    if ((temp = dialogboxes.get2(childname,TRadioButton_type)) != NULL)
  1858.       {
  1859.       
  1860.       ((TRadioButton *)temp->TRmybox)->CloseWindow();
  1861.       
  1862.       dialogboxes.zap(childname);
  1863.       }
  1864.    else
  1865.       {
  1866.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  1867.       err_logo(STOP_ERROR,NIL);
  1868.       }
  1869.    
  1870.    return (UNBOUND);
  1871.    }
  1872.  
  1873. NODE *lradiobuttonget(NODE *args)
  1874.    {
  1875.    dialogthing *parent;
  1876.    char parentname[MAX_BUFFER_SIZE];
  1877.    
  1878.    cnv_strnode_string(parentname, args);
  1879.    
  1880.    if ((parent = dialogboxes.get2(parentname,TRadioButton_type)) != NULL)
  1881.       {
  1882.       if (BF_CHECKED == ((TCheckBox *)parent->TRmybox)->GetCheck())
  1883.       return(Truex);
  1884.       else
  1885.       return(Falsex);
  1886.       }
  1887.    else
  1888.       {
  1889.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1890.       err_logo(STOP_ERROR,NIL);
  1891.       }
  1892.    
  1893.    return (UNBOUND);
  1894.    }
  1895.  
  1896. NODE *lradiobuttonset(NODE *args)
  1897.    {
  1898.    dialogthing *parent;
  1899.    char parentname[MAX_BUFFER_SIZE];
  1900.    int pos;
  1901.    
  1902.    cnv_strnode_string(parentname, args);
  1903.    pos = getint(pos_int_arg(args=cdr(args)));
  1904.    
  1905.    if ((parent = dialogboxes.get2(parentname,TRadioButton_type)) != NULL)
  1906.       {
  1907.       if (pos == 1) 
  1908.       ((TCheckBox *)parent->TRmybox)->Check();
  1909.       else
  1910.       ((TCheckBox *)parent->TRmybox)->Uncheck();
  1911.       }
  1912.    else
  1913.       {
  1914.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  1915.       err_logo(STOP_ERROR,NIL);
  1916.       }
  1917.    
  1918.    return (UNBOUND);
  1919.    }
  1920.  
  1921. NODE *lcheckboxcreate(NODE *args)
  1922.    {
  1923.    dialogthing *child;
  1924.    dialogthing *parent;
  1925.    dialogthing *group;
  1926.    int x;
  1927.    int y;
  1928.    int w;
  1929.    int h;
  1930.    char parentname[MAX_BUFFER_SIZE];
  1931.    char childname[MAX_BUFFER_SIZE];
  1932.    char titlename[MAX_BUFFER_SIZE];
  1933.    char groupname[MAX_BUFFER_SIZE];
  1934.    
  1935.    cnv_strnode_string(parentname, args);
  1936.    cnv_strnode_string(groupname, args=cdr(args));
  1937.    cnv_strnode_string(childname, args=cdr(args));
  1938.    cnv_strnode_string(titlename, args=cdr(args));
  1939.    x = getint(pos_int_arg(args=cdr(args)));
  1940.    y = getint(pos_int_arg(args=cdr(args)));
  1941.    w = getint(pos_int_arg(args=cdr(args)));
  1942.    h = getint(pos_int_arg(args=cdr(args)));
  1943.    //   if (cdr(args) != NIL) cnv_strnode_string(callback, cdr(args));
  1944.    //   else callback[0] = '\0';
  1945.    
  1946.    x = (x*BaseUnitsx)/4;
  1947.    y = (y*BaseUnitsy)/8;
  1948.    w = (w*BaseUnitsx)/4;
  1949.    h = (h*BaseUnitsy)/8;
  1950.    
  1951.    if (dialogboxes.get(childname) == NULL)
  1952.       {
  1953.       if ((parent = dialogboxes.get2(parentname,TWindow_type)) != NULL)
  1954.          {
  1955.          if ((group = dialogboxes.get2(groupname,TGroupBox_type)) != NULL)
  1956.             {
  1957.             child = new dialogthing;
  1958.             
  1959.             child->TCBmybox = new TMyCheckBox(parent->TWmybox,MYCHECKBOX_ID,titlename,x,y,w,h,group->TGmybox);
  1960.             
  1961.             //         strcpy(child->TCBmybox->callback,callback);
  1962.             //         child->TCBmybox->critical = 0;
  1963.             
  1964.             ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TCBmybox);
  1965.             
  1966.             MyMessageScan();
  1967.             
  1968.             strcpy(child->TCBmybox->key,childname);
  1969.             dialogboxes.insert(child,child->TCBmybox->key,parent->TWmybox->key,TCheckBox_type);
  1970.             } 
  1971.          else
  1972.             {
  1973.             MessageBox(CmdHWindow, groupname, "Does not exist", MB_OK);
  1974.             err_logo(STOP_ERROR,NIL);
  1975.             }
  1976.          } 
  1977.       else if ((parent = dialogboxes.get2(parentname,TDialog_type)) != NULL)
  1978.          {
  1979.          if ((group = dialogboxes.get2(groupname,TGroupBox_type)) != NULL)
  1980.             {
  1981.             child = new dialogthing;
  1982.             
  1983.         child->TCBmybox = new TMyCheckBox(parent->TDmybox,MYCHECKBOX_ID,titlename,x,y,w,h,group->TGmybox);
  1984.             
  1985.             //         strcpy(child->TCBmybox->callback,callback);
  1986.             //         child->TCBmybox->critical = 0;
  1987.             
  1988.             ((TWindow *)MainWindowx)->GetApplication()->MakeWindow(child->TCBmybox);
  1989.             
  1990.             MyMessageScan();
  1991.             
  1992.             strcpy(child->TCBmybox->key,childname);
  1993.             dialogboxes.insert(child,child->TCBmybox->key,parent->TDmybox->key,TCheckBox_type);
  1994.             } 
  1995.          else
  1996.             {
  1997.             MessageBox(CmdHWindow, groupname, "Does not exist", MB_OK);
  1998.             err_logo(STOP_ERROR,NIL);
  1999.             }
  2000.          } 
  2001.       else
  2002.          {
  2003.          MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  2004.          err_logo(STOP_ERROR,NIL);
  2005.          }
  2006.       }
  2007.    else
  2008.       {
  2009.       MessageBox(CmdHWindow, childname, "Already exists", MB_OK);
  2010.       err_logo(STOP_ERROR,NIL);
  2011.       }
  2012.    
  2013.    return (UNBOUND);
  2014.    }
  2015.  
  2016. NODE *lcheckboxdelete(NODE *arg1)
  2017.    {
  2018.    dialogthing *temp;
  2019.    char childname[MAX_BUFFER_SIZE];
  2020.    
  2021.    cnv_strnode_string(childname, arg1);
  2022.    
  2023.    if ((temp = dialogboxes.get2(childname,TCheckBox_type)) != NULL)
  2024.       {
  2025.       
  2026.       ((TCheckBox *)temp->TCBmybox)->CloseWindow();
  2027.       
  2028.       dialogboxes.zap(childname);
  2029.       }
  2030.    else
  2031.       {
  2032.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  2033.       err_logo(STOP_ERROR,NIL);
  2034.       }
  2035.    
  2036.    return (UNBOUND);
  2037.    }
  2038.  
  2039. NODE *lcheckboxget(NODE *args)
  2040.    {
  2041.    dialogthing *parent;
  2042.    char parentname[MAX_BUFFER_SIZE];
  2043.    
  2044.    cnv_strnode_string(parentname, args);
  2045.    
  2046.    if ((parent = dialogboxes.get2(parentname,TCheckBox_type)) != NULL)
  2047.       {
  2048.       if (BF_CHECKED == parent->TCBmybox->GetCheck())
  2049.       return(Truex);
  2050.       else
  2051.       return(Falsex);
  2052.       }
  2053.    else
  2054.       {
  2055.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  2056.       err_logo(STOP_ERROR,NIL);
  2057.       }
  2058.    
  2059.    return (UNBOUND);
  2060.    }
  2061.  
  2062. NODE *lcheckboxset(NODE *args)
  2063.    {
  2064.    dialogthing *parent;
  2065.    char parentname[MAX_BUFFER_SIZE];
  2066.    int pos;
  2067.    
  2068.    cnv_strnode_string(parentname, args);
  2069.    pos = getint(pos_int_arg(args=cdr(args)));
  2070.    
  2071.    if ((parent = dialogboxes.get2(parentname,TCheckBox_type)) != NULL)
  2072.       {
  2073.       if (pos == 1) 
  2074.       parent->TCBmybox->Check();
  2075.       else
  2076.       parent->TCBmybox->Uncheck();
  2077.       }
  2078.    else
  2079.       {
  2080.       MessageBox(CmdHWindow, parentname, "Does not exist", MB_OK);
  2081.       err_logo(STOP_ERROR,NIL);
  2082.       }
  2083.    
  2084.    return (UNBOUND);
  2085.    }
  2086.  
  2087. NODE *ldebugwindows(NODE *arg1)
  2088.    {
  2089.    char childname[MAX_BUFFER_SIZE];
  2090.    
  2091.    cnv_strnode_string(childname, arg1);
  2092.    
  2093.    if (dialogboxes.get(childname) != NULL)
  2094.       {
  2095.       dialogboxes.list(childname,0);
  2096.       }
  2097.    else
  2098.       {
  2099.       MessageBox(CmdHWindow, childname, "Does not exist", MB_OK);
  2100.       err_logo(STOP_ERROR,NIL);
  2101.       }
  2102.    
  2103.    return (UNBOUND);
  2104.    }
  2105.  
  2106. NODE *lmessagebox(NODE *args)
  2107.    {
  2108.    char banner[MAX_BUFFER_SIZE];
  2109.    char body[MAX_BUFFER_SIZE];
  2110.    
  2111.    cnv_strnode_string(banner, args);
  2112.    cnv_strnode_string(body, args=cdr(args));
  2113.    
  2114.    MessageBox(CmdHWindow, body, banner, MB_OK);
  2115.    
  2116.    return (UNBOUND);
  2117.    }
  2118.  
  2119. NODE *lsetcursorwait()
  2120.    {
  2121.    hCursorSave = SetCursor(hCursorWait);
  2122.    
  2123.    return (UNBOUND);
  2124.    }
  2125.  
  2126. NODE *lsetcursorarrow()
  2127.    {
  2128.    
  2129.    if (hCursorSave)
  2130.       {
  2131.       SetCursor(hCursorSave);
  2132.       hCursorSave = 0;
  2133.       }
  2134.    
  2135.    return (UNBOUND);
  2136.    }
  2137.  
  2138. NODE *ldialogfileopen(NODE *args)
  2139.    {
  2140.    NODE *arg, *val = UNBOUND;
  2141.    char filename[MAX_BUFFER_SIZE];
  2142.    
  2143.    cnv_strnode_string(filename, args);
  2144.    
  2145.    if ( ((TWindow *)MainWindowx)->GetApplication()->ExecDialog(new TFileDialog(MainWindowx, SD_FILEOPEN, filename)) == IDOK )
  2146.       {
  2147.       arg = make_strnode(filename, NULL, strlen(filename), STRING, strnzcpy);
  2148.       val = parser(arg, FALSE);
  2149.       return(val);
  2150.       }
  2151.    else
  2152.       {
  2153.       return (NIL);
  2154.       }
  2155.    
  2156.    }
  2157.  
  2158. NODE *ldialogfilesave(NODE *args)
  2159.    {
  2160.    NODE *arg, *val = UNBOUND;
  2161.    char filename[MAX_BUFFER_SIZE];
  2162.    
  2163.    cnv_strnode_string(filename, args);
  2164.    
  2165.    if ( ((TWindow *)MainWindowx)->GetApplication()->ExecDialog(new TFileDialog(MainWindowx, SD_FILESAVE, filename)) == IDOK )
  2166.       {
  2167.       arg = make_strnode(filename, NULL, strlen(filename), STRING, strnzcpy);
  2168.       val = parser(arg, FALSE);
  2169.       return(val);
  2170.       }
  2171.    else
  2172.       {
  2173.       return (NIL);
  2174.       }
  2175.    
  2176.    }
  2177.  
  2178. NODE *lwindowfileedit(NODE *args)
  2179.    {
  2180.    char filename[MAX_BUFFER_SIZE];
  2181.    char editexit[MAX_BUFFER_SIZE];
  2182.    
  2183.    cnv_strnode_string(filename, args);
  2184.    cnv_strnode_string(editexit, args=cdr(args));
  2185.    
  2186.    strcpy(edit_editexit,editexit);
  2187.    
  2188.    if (TMyWindow_MyPopupEdit(filename, (NODE *)NULL))
  2189.       {
  2190.       return (UNBOUND);
  2191.       }
  2192.    
  2193.    return (UNBOUND);
  2194.    }
  2195.