home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / menu.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  76 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.    menu.h --- menu creating utilities
  20.    Created: Terry Weissman <terry@netscape.com>, 14-Jun-95.
  21.  */
  22.  
  23.  
  24. #ifndef __menu_h
  25. #define __menu_h
  26.  
  27. /*
  28.  * Structure describing a single button or menu title.
  29.  * fe_PopulateMenubar is passed an array of these.  The first entry in
  30.  * each menu is for the menu title.  If name is "", it means a separator
  31.  * line.  If name is NULL, it means the end of a menu.  If two entries in
  32.  * a row have a name of NULL, it marks the end of the array.
  33.  */
  34.  
  35. typedef struct fe_button 
  36. {
  37.   char *name;
  38.   XtCallbackProc callback;
  39.   int type;
  40.   void* var;
  41.   void* offset;
  42.   void* userdata;
  43. } fe_button;
  44.  
  45. typedef struct fe_button_closure
  46. {
  47.   MWContext *context;
  48.   void *userdata;
  49. } fe_button_closure;
  50.  
  51. #define UNSELECTABLE 0
  52. #define SELECTABLE   1
  53. #define TOGGLE       2
  54. #define RADIO         3        /* Just like TOGGLE, but with a radio button
  55.                    look.*/
  56. #define CASCADE      4
  57. #define INTL_CASCADE      5    /* This is temporary. Will go away. */
  58.  
  59. #define FE_MENU_SEPARATOR          { "",0,UNSELECTABLE,0}
  60. #define FE_MENU_BEGIN(l)           { (l), 0, SELECTABLE, 0 }
  61. #define FE_MENU_END                { 0 }
  62. #define FE_NOT_IMPLEMENTED         0
  63.  
  64. extern Widget fe_PopulateMenubar(Widget parent, struct fe_button* buttons,
  65.                  MWContext* context, void* closure, void* data,
  66.                  XtCallbackProc pulldown_cb);
  67.  
  68. /* Creates the buttons as child of menu until if finds a {0}
  69.  * button. Passes back the number of button elements it used.
  70.  * Can do push-buttons, toggle-buttons, radio-buttons & cascades too.
  71.  */
  72. extern int fe_CreateSubmenu(Widget menu, struct fe_button *buttons,
  73.             MWContext *context, XtPointer closure, XtPointer data);
  74.  
  75. #endif
  76.