PageRenderTime 48ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/cde/programs/dtmail/include/MotifApp/MenuBar.h

https://bitbucket.org/tifan/cde
C Header | 134 lines | 32 code | 27 blank | 75 comment | 0 complexity | 9b89d81a18310835e8574901aeffd76b MD5 | raw file
Possible License(s): LGPL-2.1, IPL-1.0, 0BSD
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these librararies and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: MenuBar.h /main/4 1996/04/21 19:46:27 drk $
  24. *
  25. * (c) Copyright 1996 Digital Equipment Corporation.
  26. * (c) Copyright 1996 Hewlett-Packard Company.
  27. * (c) Copyright 1996 International Business Machines Corp.
  28. * (c) Copyright 1996 Sun Microsystems, Inc.
  29. * (c) Copyright 1996 Novell, Inc.
  30. * (c) Copyright 1996 FUJITSU LIMITED.
  31. * (c) Copyright 1996 Hitachi.
  32. */
  33. /*
  34. *+SNOTICE
  35. *
  36. * RESTRICTED CONFIDENTIAL INFORMATION:
  37. *
  38. * The information in this document is subject to special
  39. * restrictions in a confidential disclosure agreement between
  40. * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
  41. * document outside HP, IBM, Sun, USL, SCO, or Univel without
  42. * Sun's specific written approval. This document and all copies
  43. * and derivative works thereof must be returned or destroyed at
  44. * Sun's request.
  45. *
  46. * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
  47. *
  48. *+ENOTICE
  49. */
  50. ///////////////////////////////////////////////////////////////////////////////
  51. //////////////////////////////////////////////////////////////////////////////
  52. // This example code is from the book:
  53. //
  54. // Object-Oriented Programming with C++ and OSF/Motif
  55. // by
  56. // Douglas Young
  57. // Prentice Hall, 1992
  58. // ISBN 0-13-630252-1
  59. //
  60. // Copyright 1991 by Prentice Hall
  61. // All Rights Reserved
  62. //
  63. // Permission to use, copy, modify, and distribute this software for
  64. // any purpose except publication and without fee is hereby granted, provided
  65. // that the above copyright notice appear in all copies of the software.
  66. ///////////////////////////////////////////////////////////////////////////////
  67. //////////////////////////////////////////////////////////////////////////////
  68. //////////////////////////////////////////////////////////
  69. // MenuBar.h: A menu bar, whose panes support items
  70. // that execute Cmds
  71. //////////////////////////////////////////////////////////
  72. ////////////////////////////////////////////////////////////
  73. // MODIFIED TO SUPPORT SUBMENUS - not described in Book
  74. ///////////////////////////////////////////////////////////
  75. #ifndef MENUBAR_H
  76. #define MENUBAR_H
  77. #include "UIComponent.h"
  78. #include <Xm/RowColumn.h>
  79. class Cmd;
  80. class CmdList;
  81. class MenuBar : public UIComponent {
  82. protected:
  83. #ifdef DEAD_WOOD
  84. virtual Boolean isValidMenuPane(Widget);
  85. #endif /* DEAD_WOOD */
  86. virtual Widget createPulldown ( Widget, CmdList *,
  87. Boolean, unsigned char);
  88. virtual Widget createPulldown ( Widget, CmdList *,
  89. Widget *, Boolean, unsigned char);
  90. public:
  91. MenuBar ( Widget, char *, unsigned char = XmMENU_BAR );
  92. // Create a named menu pane from a list of Cmd objects
  93. virtual Widget addCommands ( Widget *, CmdList *, Boolean = FALSE,
  94. unsigned char = XmMENU_BAR);
  95. virtual Widget addCommands ( CmdList *, Boolean = FALSE,
  96. unsigned char = XmMENU_BAR);
  97. virtual Widget addCommands ( Widget, CmdList *);
  98. virtual void addCommand ( Widget, Cmd *);
  99. virtual void removeCommands( Widget, CmdList *);
  100. virtual void removeCommand( Widget, int at);
  101. virtual void removeOnlyCommands( Widget, CmdList *);
  102. virtual void changeLabel ( Widget, int, char *);
  103. virtual void changeLabel(Widget, const char * wid_name, const char * label);
  104. virtual void rotateLabels ( Widget, int, int );
  105. virtual const char *const className() { return "MenuBar"; }
  106. };
  107. #endif