Const the gray ramps
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10253 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
b42e32f70d
commit
3b1e7f31b9
@ -32,14 +32,14 @@
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
static uchar active_ramp[24] = {
|
||||
static const uchar active_ramp[24] = {
|
||||
FL_GRAY_RAMP+0, FL_GRAY_RAMP+1, FL_GRAY_RAMP+2, FL_GRAY_RAMP+3,
|
||||
FL_GRAY_RAMP+4, FL_GRAY_RAMP+5, FL_GRAY_RAMP+6, FL_GRAY_RAMP+7,
|
||||
FL_GRAY_RAMP+8, FL_GRAY_RAMP+9, FL_GRAY_RAMP+10,FL_GRAY_RAMP+11,
|
||||
FL_GRAY_RAMP+12,FL_GRAY_RAMP+13,FL_GRAY_RAMP+14,FL_GRAY_RAMP+15,
|
||||
FL_GRAY_RAMP+16,FL_GRAY_RAMP+17,FL_GRAY_RAMP+18,FL_GRAY_RAMP+19,
|
||||
FL_GRAY_RAMP+20,FL_GRAY_RAMP+21,FL_GRAY_RAMP+22,FL_GRAY_RAMP+23};
|
||||
static uchar inactive_ramp[24] = {
|
||||
static const uchar inactive_ramp[24] = {
|
||||
43, 43, 44, 44,
|
||||
44, 45, 45, 46,
|
||||
46, 46, 47, 47,
|
||||
@ -54,7 +54,7 @@ static int draw_it_active = 1;
|
||||
*/
|
||||
int Fl::draw_box_active() { return draw_it_active; }
|
||||
|
||||
uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
|
||||
const uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
|
||||
|
||||
/**
|
||||
Draws a series of line segments around the given box.
|
||||
@ -69,7 +69,7 @@ uchar *fl_gray_ramp() {return (draw_it_active?active_ramp:inactive_ramp)-'A';}
|
||||
\param[in] x, y, w, h position and size
|
||||
*/
|
||||
void fl_frame(const char* s, int x, int y, int w, int h) {
|
||||
uchar *g = fl_gray_ramp();
|
||||
const uchar *g = fl_gray_ramp();
|
||||
if (h > 0 && w > 0) for (;*s;) {
|
||||
// draw top line:
|
||||
fl_color(g[(int)*s++]);
|
||||
@ -103,7 +103,7 @@ void fl_frame(const char* s, int x, int y, int w, int h) {
|
||||
\param[in] x, y, w, h position and size
|
||||
*/
|
||||
void fl_frame2(const char* s, int x, int y, int w, int h) {
|
||||
uchar *g = fl_gray_ramp();
|
||||
const uchar *g = fl_gray_ramp();
|
||||
if (h > 0 && w > 0) for (;*s;) {
|
||||
// draw bottom line:
|
||||
fl_color(g[(int)*s++]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user