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 / bmtable.h < prev    next >
C/C++ Source or Header  |  1998-04-23  |  3KB  |  83 lines

  1. /*
  2.  *  File:        bmtable.h
  3.  *  Purpose:     Declaration of the XForms object bmtable. 
  4.  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
  5.  *  Created:     November 1995
  6.  *  Description: A bitmap table uses a single bitmap to simulate a 2d array 
  7.  *               of bitmap buttons. It can be used to build bitmap menus.
  8.  *               
  9.  *  Copyright (C) 1995,1996 Alejandro Aguilar Sierra 
  10.  *
  11.  *  You are free to use and modify this code under the terms of
  12.  *  the GNU General Public Licence version 2 or later. 
  13.  * 
  14.  */ 
  15.  
  16. #ifndef __BMTABLE_H__
  17. #define __BMTABLE_H__ 
  18.  
  19. #include FORMS_H_LOCATION
  20.  
  21. #define FL_BMTABLE 1500
  22. #define FL_BMTABLE_FLAT 0        /*  A flat bitmap table */
  23. #define FL_BMTABLE_GRID 1         /* A grided bitmap table */
  24.  
  25.  
  26. /*  Same as fl_bitmapbutton */
  27.  
  28.  
  29. /*
  30.  *  normal bmtable default
  31.  */
  32. #define FL_BMTABLE_BOXTYPE    FL_UP_BOX
  33.  
  34. FL_OBJECT *fl_create_bmtable(int, FL_Coord, FL_Coord, 
  35.                  FL_Coord, FL_Coord, char const *);
  36.  
  37. FL_OBJECT *fl_add_bmtable(int, FL_Coord, FL_Coord, 
  38.               FL_Coord, FL_Coord, char const *);
  39.  
  40. /* Same as fl_get_button_numb() */
  41. int fl_get_bmtable_numb(FL_OBJECT *ob);
  42.  
  43. void fl_set_bmtable(FL_OBJECT *, int pushed, int pos);
  44.  
  45. /* Number of columns and rows, and the background bitmap */
  46. void fl_set_bmtable_data(FL_OBJECT *, int, int, int, int , unsigned char *);
  47. void fl_set_bmtable_pixmap_data(FL_OBJECT *, int, int, char **);
  48.  
  49. void fl_set_bmtable_file(FL_OBJECT *, int, int, char const *);
  50. void fl_set_bmtable_pixmap_file(FL_OBJECT *, int, int, char const *);
  51.  
  52. /* Adjust bitmap origin (ox, oy) and cell dimensions (dx, dy) incrementally */
  53. void fl_set_bmtable_adjust(FL_OBJECT *, int ox, int oy, int dx, int dy);
  54.  
  55. /* The number of items is by default nc x nr, but you can change it */
  56. void fl_set_bmtable_maxitems(FL_OBJECT *, int);
  57.  
  58. int fl_get_bmtable_maxitems(FL_OBJECT *); 
  59.  
  60. /* Returns the index of the selected item or -1 if none was selected */
  61. int fl_get_bmtable(FL_OBJECT *);
  62.  
  63. /* Replace an item's sub_bitmap at id position */
  64. void fl_replace_bmtable_item(FL_OBJECT *ob, int id, int  cw, int ch, char *data); 
  65.  
  66. /* Get the sub_bitmap from id position. You must alloc memory for the data. */ 
  67. void fl_get_bmtable_item(FL_OBJECT *ob, int id, int *cw, int *ch, char *data);
  68.  
  69. /* Returns a pixmap from the table, if available. */
  70. Pixmap fl_get_bmtable_pixmap(FL_OBJECT *);
  71.  
  72. /* Draws a single item on a drawable */ 
  73. void fl_draw_bmtable_item(FL_OBJECT *ob, int i, Drawable d, int xx, int yy);
  74.  
  75. /* Free the current bitmap in preparation for installing a new one */
  76. void fl_free_bmtable_bitmap(FL_OBJECT *ob);
  77.  
  78. /* Free the current pixmap in preparation for installing a new one */
  79. void fl_free_bmtable_pixmap(FL_OBJECT *ob);
  80.  
  81. #endif  /* __BMTABLE_H__ */
  82.  
  83.