/* * Tearoff menu system * Internal header file * * © 1994-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Steel library. * * Steel is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Steel is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Steel. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __xtearoff_h #define __xtearoff_h #include "tearoff.h" #define tearoff__HEIGHT 24 /* Height of tearoff bar */ typedef struct tearoff__str { char *menuTitle; /* Title of menu */ int numberOfItems; /* Number of items in menu */ int width; /* Width of menu */ int keyWidth; /* Max width of shortcut */ int dotted; /* Height of dotted lines */ int selected; /* Currently selected item */ int maxHeight; /* Maximum height before scrollbar */ int fromItem; /* I came from this item */ tearoff_selectProc selectProc; /* Called with related event */ void *userHandle; /* User supplied handle */ wimp_w w; /* The `menu's window handle */ struct tearoff__str *sub; /* The submenu pointer thingy */ struct tearoff__str *prev; /* The previous menu */ struct tearoff__str *nextTornoff; /* The next tornoff menu in list */ char *indirected; /* Pointer to indirected space */ int indbytes; /* Length of indirected area */ BOOL open; /* Is menu open? */ BOOL tearoff :8; /* Can menu be torn off? */ BOOL tornoff :8; /* Has it been? */ BOOL warned :8; /* Hs usr bn wrnd about submenu? */ BOOL folded :8; /* Is menu folded */ BOOL redraw; /* Does it need redrawing? */ BOOL scrollBar; /* Menu has scroll bar */ /* Now followed by lots of items */ } tearoff__str; typedef struct tearoff__item { char *text; /* Item text */ char *keys; /* Short cut text */ tearoff sub; /* Sub menu to open */ int y; /* y coord of item */ BOOL shaded :1; /* Item is shaded */ BOOL subShaded :1; /* Arrow is shaded */ BOOL selType :2; /* Item is ticked */ BOOL dotted :1; /* Dotted line next */ BOOL blank :1; /* Word Align */ BOOL subMenu :1; /* Item has submenu */ BOOL subMenuWarning :1; /* Report a submenu warning */ } tearoff__item; typedef struct tearoff__alarm { tearoff t; /* The tearoff alarm was set on */ int item; /* The item is was set for */ } tearoff__alarm; void tearoff__doRedraw(tearoff t, wimp_redrawstr *r); void tearoff_calculateMenuWidth(tearoff t); void tearoff_rebuildMenu(tearoff t); void tearoff_highlightItem(int s, tearoff t, BOOL select); #ifdef notdef os_error *tearoff_opened(wimp_t task); os_error *tearoff_closed(void); os_error *tearoff_closeMenus(void); #endif #endif