home *** CD-ROM | disk | FTP | other *** search
/ Encyclopedia of Graphics File Formats Companion / GFF_CD.ISO / software / unix / saoimage / sao1_07.tar / panel / makemenu.c < prev    next >
C/C++ Source or Header  |  1991-01-02  |  3KB  |  88 lines

  1.  
  2. #include <stdio.h>
  3. #include <X11/Xlib.h>
  4. #include "../btnlib/buttons.h"
  5.  
  6. #include "menumain.h"
  7. #include "menuclr.h"
  8. #include "menucsr.h"
  9. #include "menuscl.h"
  10. #include "menupan.h"
  11. #include "menuetc.h"
  12. #include "menurgn.h"
  13. #include "menucmap.h"
  14. #include "menumono.h"
  15.  
  16. ButtonBox MainPanel[1];
  17. ButtonBox ColorPanel[1];
  18. ButtonBox CursorPanel[2];
  19. ButtonBox ScalePanel[1];
  20. ButtonBox PanPanel[1];
  21. ButtonBox EtcPanel[1];
  22. ButtonBox RegionPanel[1];
  23. ButtonBox CmapPanel[1];
  24. ButtonBox MonoPanel[1];
  25.  
  26. ButtonBox CreateMenu ( parent, gc, visual, background )
  27.      BoxParent *parent;        /* i: array of parent window specs */
  28.      GC gc;            /* i: optional, else 0 */
  29.      Visual *visual;        /* i: optional, else 0 */
  30.      unsigned long background;    /* i: optional, else 0 */
  31. {
  32.   void MakeMainPanel();
  33.   void MakeColorPanel();
  34.   void MakeCursorPanel();
  35.   void MakeScalePanel();
  36.   void MakePanPanel();
  37.   void MakeEtcPanel();
  38.   void MakeRegionPanel();
  39.   void MakeCmapPanel();
  40.   void MakeMonoPanel();
  41.  
  42.   MakeMainPanel(MainPanel, parent, gc, visual, background);
  43.   MakeColorPanel(ColorPanel, parent, gc, visual, background);
  44.   MakeCursorPanel(CursorPanel, parent, gc, visual, background);
  45.   MakeScalePanel(ScalePanel, parent, gc, visual, background);
  46.   MakePanPanel(PanPanel, parent, gc, visual, background);
  47.   MakeEtcPanel(EtcPanel, parent, gc, visual, background);
  48.   MakeRegionPanel(RegionPanel, parent, gc, visual, background);
  49.   MakeCmapPanel(CmapPanel, parent, gc, visual, background);
  50.   MakeMonoPanel(MonoPanel, parent, gc, visual, background);
  51.   AttachSubmenu(ColorPanel[0], MainPanel[0], 1, 0x4, 0x0);
  52.   AttachSubmenu(CursorPanel[0], MainPanel[0], 2, 0x4, 0x0);
  53.   AttachSubmenu(CursorPanel[1], MainPanel[0], 2, 0x4, 0x0);
  54.   AttachSubmenu(ScalePanel[0], MainPanel[0], 0, 0x4, 0x0);
  55.   AttachSubmenu(PanPanel[0], MainPanel[0], 3, 0x4, 0x0);
  56.   AttachSubmenu(EtcPanel[0], MainPanel[0], 4, 0x4, 0x0);
  57.   AttachSubmenu(RegionPanel[0], CursorPanel[1], 0, 0x4, 0x0);
  58.   AttachSubmenu(CmapPanel[0], ColorPanel[0], 6, 0x4, 0x0);
  59.   JoinMenus(CmapPanel[0], ColorPanel[0]);
  60.   AttachSubmenu(MonoPanel[0], ColorPanel[0], 0, 0x4, 0x0);
  61.   return( MainPanel[0] );
  62. }
  63.  
  64. void ResizeMenu( parent, flags )
  65.      BoxParent *parent;        /* i: array of parent window specs */
  66.      int *flags;        /* i: array of window-changed flags */
  67. {
  68.  
  69.   if( flags[0] ) {
  70.     ResizeBox(MainPanel[0], &parent[0]);
  71.   }
  72.   if( flags[1] ) {
  73.     ResizeBox(ColorPanel[0], &parent[1]);
  74.     ResizeBox(CursorPanel[0], &parent[1]);
  75.     ResizeBox(CursorPanel[1], &parent[1]);
  76.     ResizeBox(ScalePanel[0], &parent[1]);
  77.     ResizeBox(PanPanel[0], &parent[1]);
  78.     ResizeBox(EtcPanel[0], &parent[1]);
  79.     ResizeBox(CmapPanel[0], &parent[1]);
  80.   }
  81.   if( flags[6] ) {
  82.     ResizeBox(RegionPanel[0], &parent[2]);
  83.   }
  84.   if( flags[8] ) {
  85.     ResizeBox(MonoPanel[0], &parent[3]);
  86.   }
  87. }
  88.