File: buttonmatrix.h

package info (click to toggle)
vis5d 4.3-5
  • links: PTS
  • area: main
  • in suites: slink
  • size: 16,856 kB
  • ctags: 6,127
  • sloc: ansic: 66,158; fortran: 4,470; makefile: 1,683; tcl: 414; sh: 69
file content (82 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/* buttonmatrix.h */



#ifndef BUTTONMATRIX_H
#define BUTTONMATRIX_H



#define MAX_BM_ROWS 50
#define MAX_BM_COLS 10


typedef struct lui_button_matrix {
   Window mainwindow;
   int x, y;
   int width, height;
   int rows, columns;           /* how many rows and columns of buttons */
   int viewrows;                /* how many rows are visible */

   int bwidth, bheight;         /* size of each button in pixels */
   int maxchars;                /* max chars per button */
   int toprow;
   char *labels[MAX_BM_ROWS][MAX_BM_COLS];
   float color[MAX_BM_ROWS][MAX_BM_COLS][3];
   unsigned long pixel[MAX_BM_ROWS][MAX_BM_COLS];
   char state[MAX_BM_ROWS][MAX_BM_COLS];

   LUI_SCROLLBAR *scrollbar;

   int (*callback)( struct lui_button_matrix *, int row, int col, int button );
   int context_index;                   /* for example, Vis5D context */
} LUI_BUTTON_MATRIX;




extern LUI_BUTTON_MATRIX *LUI_ButtonMatrixCreate( Window parent,
       int x, int y, int width, int height, int columns );



extern void LUI_ButtonMatrixAddRow( LUI_BUTTON_MATRIX *bm,
       char *labels[], float *reds, float *greens, float *blues );


extern void LUI_ButtonMatrixChangeLabel( LUI_BUTTON_MATRIX *bm,
                                         int row, int column, char *label );


extern void LUI_ButtonMatrixCallback( LUI_BUTTON_MATRIX *bm,
                                      int (*callback)() );



extern void LUI_ButtonMatrixSetState( LUI_BUTTON_MATRIX *bm,
                                      int row, int col, int state );


extern int LUI_ButtonMatrixGetState( LUI_BUTTON_MATRIX *bm,
                                     int row, int col );


extern void LUI_ButtonMatrixSetColor( LUI_BUTTON_MATRIX *bm,
                                      int row, int col,
                                      double red, double green, double blue );


extern void LUI_ButtonMatrixShowBottom( LUI_BUTTON_MATRIX *bm );


extern void LUI_ButtonMatrixResize( LUI_BUTTON_MATRIX *bm,
                                    int width, int height );


extern void LUI_ButtonMatrixEmpty( LUI_BUTTON_MATRIX *bm );


extern void LUI_ButtonMatrixDestroy( LUI_BUTTON_MATRIX *bm );


#endif