home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / lyx-0.13.2.tar.gz / lyx-0.13.2.tar / lyx-0.13.2 / src / math_panel.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  2KB  |  105 lines

  1. // -*- C++ -*-
  2. /*
  3.  *  File:        math_panel.h
  4.  *  Purpose:     Mathed GUI for lyx
  5.  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
  6.  *  Created:     March 28, 1996
  7.  * 
  8.  *  Dependencies: Xlib, Xpm, XForms, Lyx
  9.  *
  10.  *  Copyright: (c) 1996, Alejandro Aguilar Sierra 
  11.  *
  12.  *   You are free to use and modify it under the terms of
  13.  *   the GNU General Public Licence version 2 or later.
  14.  */
  15.  
  16. #ifndef FD_math_panel_h_
  17. #define FD_math_panel_h_
  18.  
  19. #ifdef __GNUG__
  20. #pragma interface
  21. #endif
  22.  
  23. #include "bmtable.h"                 
  24.  
  25. ///
  26. enum  {
  27.    MM_GREEK, MM_ARROW, MM_BOP, MM_BRELATS, MM_VARSIZE, MM_MISC,
  28.    MM_FRAC, MM_SQRT, MM_DELIM, MM_MATRIX, MM_EQU,
  29.    MM_DECO, MM_SPACE, MM_DOTS, MM_FUNC,
  30.    MM_MAX,
  31.    MM_CLOSE = 1024,
  32.    MM_APPLY, MM_OK
  33. };
  34.  
  35. ///
  36. typedef FL_OBJECT* FL_OBJECTP;
  37.  
  38. /// Class to manage bitmap menu bars
  39. class BitmapMenu {
  40.   ///
  41.    static BitmapMenu *active;
  42.    ///
  43.    friend int peek_event(FL_FORM *, void *);
  44.  protected:
  45.    ///
  46.    BitmapMenu *next, *prev;
  47.    ///
  48.    int nb;             // Number of bitmaps
  49.                 ///
  50.    int i;              // Current bitmap
  51.                 ///
  52.    int ww;             // Border width
  53.                 ///
  54.    int x, y, w, h;
  55.    ///
  56.    FL_FORM *form;
  57.    ///
  58.    FL_OBJECTP *bitmap;
  59.    ///
  60.    FL_OBJECT *button;
  61.  public:
  62.    ///
  63.    BitmapMenu(int n, FL_OBJECT* bt, BitmapMenu* prevx=NULL);
  64.    ///
  65.    ~BitmapMenu();
  66.    ///
  67.    FL_OBJECT* AddBitmap(int id,
  68.             int nx, int ny, int bw, int bh,
  69.             unsigned char* data, Bool vert=True); // Why Bool?
  70. #warning Why bool? (Lgb)
  71.    ///
  72.    void Create();
  73.    ///
  74.    void Hide();
  75.    ///
  76.    void Show();
  77.    ///
  78.    void Prev();
  79.    ///
  80.    void Next();
  81.    ///
  82.    int  GetIndex(FL_OBJECT* ob);
  83. };
  84.  
  85.  
  86. inline
  87. void BitmapMenu::Prev()  {
  88.    Hide();
  89.    if (prev)
  90.      prev->Show();
  91. }
  92.  
  93. inline
  94. void BitmapMenu::Next()  {
  95.    Hide();
  96.    if (next)
  97.      next->Show();
  98. }
  99.  
  100. #include "math_forms.h"
  101.  
  102. extern FD_panel * create_math_panel(void);
  103.  
  104. #endif /* FD_math_panel_h_ */
  105.