home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / inventor / noodle / PullDowns.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  4.9 KB  |  158 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #ifndef  _PULL_DOWNS_
  18. #define  _PULL_DOWNS_
  19.  
  20. #include <X11/StringDefs.h>
  21. #include <X11/Intrinsic.h>
  22. #include <X11/Xatom.h>
  23.  
  24. #include <Xm/Xm.h>
  25. #include <Xm/RowColumn.h>
  26. #include <Xm/BulletinB.h>
  27. #include <Xm/CascadeB.h>
  28. #include <Xm/CascadeBG.h>
  29. #include <Xm/FileSB.h>
  30. #include <Xm/Form.h>
  31. #include <Xm/Label.h>
  32. #include <Xm/FileSB.h>
  33. #include <Xm/PushB.h>
  34. #include <Xm/PushBG.h>
  35. #include <Xm/SeparatoG.h>
  36. #include <Xm/Text.h>
  37. #include <Xm/ToggleB.h>
  38. #include <Xm/ToggleBG.h>
  39.  
  40. #define MENUS_IN_POPUP
  41.  
  42. #include "Interface.h"
  43.  
  44. enum MenuEntries {
  45.     MM_FILE = 0,
  46.     MM_FILE_NEW,
  47.     MM_FILE_OPEN,
  48.     MM_FILE_SAVE,
  49.     MM_FILE_SAVE_AS,
  50.     MM_FILE_SAVE_VANILLA,
  51.     MM_FILE_QUIT,
  52.  
  53.     MM_EDIT,
  54.     MM_EDIT_NEW,
  55.     MM_EDIT_SEP,
  56.     MM_EDIT_DELETE,
  57.     MM_EDIT_UNDELETE,
  58.     MM_EDIT_SEP2,
  59.     MM_EDIT_COPY,
  60.     MM_EDIT_COPY_ALL,
  61.  
  62.     MM_PARTS,
  63.     MM_PARTS_SIDES,
  64.     MM_PARTS_TOP_CAP,
  65.     MM_PARTS_BOT_CAP,
  66.  
  67.     MM_SHAPE,
  68.     MM_SHAPE_FACE_SET,
  69.     MM_SHAPE_TRI_STRIP,
  70.     MM_SHAPE_QUAD_MESH,
  71.     MM_SHAPE_CUBIC_SPLINE,
  72.     MM_SHAPE_CUBIC_TO_EDGE,
  73.     MM_SHAPE_BEZIER,
  74.  
  75.     MM_MANIPS,
  76.     MM_MANIPS_HBOX,
  77.     MM_MANIPS_TRACKBALL,
  78.     MM_MANIPS_NONE,
  79.  
  80.     MM_GIZMOS,
  81.     MM_GIZMOS_TEXTURE,
  82.     MM_GIZMOS_SURFACE,
  83.  
  84.     MM_ABOUT,
  85.     MM_ABOUT_ABOUT,
  86.  
  87.     MM_MENU_NUM        // this must be the last entry
  88. };
  89.  
  90. enum ButtonTypes {
  91.     MM_SEPARATOR,
  92.     MM_PUSH_BUTTON,
  93.     MM_TOGGLE_BUTTON,
  94.     MM_RADIO_BUTTON,
  95. };
  96.  
  97. static NoodleButtonInfo fileData[] = {
  98.    {"New...",     MM_FILE_NEW,     MM_PUSH_BUTTON, 0, "Alt Shift <Key> n", "Alt+N" },
  99.    {"Open...",    MM_FILE_OPEN,    MM_PUSH_BUTTON, 0, "Alt <Key> o", "Alt+o" },
  100.    {"Save",       MM_FILE_SAVE,    MM_PUSH_BUTTON, 0, "Alt <Key> s", "Alt+s" },
  101.    {"Save As...", MM_FILE_SAVE_AS, MM_PUSH_BUTTON, 0, "Alt Shift <Key> s", "Alt+S" },
  102.    {"Save Standard Inventor...", MM_FILE_SAVE_VANILLA, MM_PUSH_BUTTON, 0, "Alt <Key> v", "Alt+v" },
  103.    {"Quit",       MM_FILE_QUIT,    MM_PUSH_BUTTON, 0, "Alt <Key> q", "Alt+q" },
  104. };
  105.  
  106. static NoodleButtonInfo editData[] = {
  107.    {"New",        MM_EDIT_NEW,      MM_PUSH_BUTTON, 0, "Alt <Key> n", "Alt+n" },
  108.    {"",           MM_EDIT_SEP,         MM_SEPARATOR,   0, 0, 0 },
  109.    {"Delete",     MM_EDIT_DELETE,   MM_PUSH_BUTTON, 0, "Alt <Key> d", "Alt+d" },
  110.    {"Undelete",   MM_EDIT_UNDELETE, MM_PUSH_BUTTON, 0, "Alt <Key> u", "Alt+u" },
  111.    {"",           MM_EDIT_SEP2,        MM_SEPARATOR,   0, 0, 0 },
  112.    {"Copy",       MM_EDIT_COPY,     MM_PUSH_BUTTON, 0, "Alt <Key> c", "Alt+c" },
  113.    {"CopyAll",    MM_EDIT_COPY_ALL, MM_PUSH_BUTTON, 0, "Alt Shift <Key> c", "Alt+C" },
  114. };
  115.  
  116. static NoodleButtonInfo partsData[] = {
  117.    {"Sides", MM_PARTS_SIDES, MM_TOGGLE_BUTTON, 1, 0, 0 },
  118.    {"Top Cap", MM_PARTS_TOP_CAP, MM_TOGGLE_BUTTON, 1, 0, 0 },
  119.    {"Bottom Cap", MM_PARTS_BOT_CAP, MM_TOGGLE_BUTTON, 1, 0, 0 },
  120. };
  121.  
  122. static NoodleButtonInfo shapeData[] = {
  123.    {"Face Set", MM_SHAPE_FACE_SET, MM_RADIO_BUTTON, 1, 0, 0 },
  124.    {"Triangle Strip Set", MM_SHAPE_TRI_STRIP, MM_RADIO_BUTTON, 0, 0, 0 },
  125.    {"Quad Mesh", MM_SHAPE_QUAD_MESH, MM_RADIO_BUTTON, 0, 0, 0 },
  126.    {"Cubic Spline", MM_SHAPE_CUBIC_SPLINE, MM_RADIO_BUTTON, 0, 0, 0 },
  127.    {"Cubic Spline To Edge", MM_SHAPE_CUBIC_TO_EDGE, MM_RADIO_BUTTON, 0, 0, 0 },
  128.    {"Bezier", MM_SHAPE_BEZIER, MM_RADIO_BUTTON, 0, 0, 0 },
  129. };
  130.  
  131. static NoodleButtonInfo manipsData[] = {
  132.    {"HandleBox", MM_MANIPS_HBOX,       MM_RADIO_BUTTON, 1, 0, 0 },
  133.    {"Trackball", MM_MANIPS_TRACKBALL,  MM_RADIO_BUTTON, 0, 0, 0 },
  134.    {"None",      MM_MANIPS_NONE,       MM_RADIO_BUTTON, 0, 0, 0 },
  135. };
  136.  
  137. static NoodleButtonInfo gizmosData[] = {
  138.    {"Texture Gizmo", MM_GIZMOS_TEXTURE, MM_PUSH_BUTTON, 0, 0, 0 },
  139.    {"Surface Gizmo", MM_GIZMOS_SURFACE, MM_PUSH_BUTTON, 0, 0, 0 },
  140. };
  141.  
  142. static NoodleButtonInfo aboutData[] = {
  143.    {"About Noodle...",   MM_ABOUT_ABOUT,   MM_PUSH_BUTTON, 0, "Alt <Key> h", "Alt+h" },
  144. };
  145.  
  146. static NoodleMenu pulldownData[] = {
  147. // {name, id, subMenu, subItemCount}
  148.    {"File",  MM_FILE, fileData, XtNumber(fileData) },
  149.    {"Edit",  MM_EDIT, editData, XtNumber(editData) },
  150.    {"Parts",  MM_PARTS, partsData, XtNumber(partsData) },
  151.    {"ShapeStyle",  MM_SHAPE, shapeData, XtNumber(shapeData) },
  152.    {"Manips",  MM_MANIPS, manipsData, XtNumber(manipsData) },
  153.    {"Gizmos",  MM_GIZMOS, gizmosData, XtNumber(gizmosData) },
  154.    {"About",  MM_ABOUT, aboutData, XtNumber(aboutData) },
  155. };
  156.  
  157. #endif /* _PULL_DOWNS_ */
  158.