Browse Source

fix a typo and indenting.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9326 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/49/head
Albrecht Schlosser 13 years ago
parent
commit
8ed93f0065
  1. 5
      FL/Fl_Widget.H
  2. 10
      src/Fl_File_Chooser2.cxx
  3. 2
      src/Fl_Input_.cxx
  4. 2
      src/fl_draw.cxx
  5. 10
      src/fl_plastic.cxx
  6. 20
      src/fl_set_fonts_win32.cxx

5
FL/Fl_Widget.H

@ -152,7 +152,7 @@ protected:
See activate(), output(), visible(), changed(), set_visible_focus() See activate(), output(), visible(), changed(), set_visible_focus()
*/ */
enum { enum {
INACTIVE = 1<<0, ///< the widget can't receive focus, and is disabled but potentially visible INACTIVE = 1<<0, ///< the widget can't receive focus, and is disabled but potentially visible
INVISIBLE = 1<<1, ///< the widget is not drawn, but can receive a few special events INVISIBLE = 1<<1, ///< the widget is not drawn, but can receive a few special events
OUTPUT = 1<<2, ///< for output only OUTPUT = 1<<2, ///< for output only
NOBORDER = 1<<3, ///< don't draw a decoration (Fl_Window) NOBORDER = 1<<3, ///< don't draw a decoration (Fl_Window)
@ -693,12 +693,11 @@ public:
unsigned int is_fullscreen() const {return (flags_ & FULLSCREEN);} unsigned int is_fullscreen() const {return (flags_ & FULLSCREEN);}
/** Returns whether the widget is active. /** Returns whether the widget is active.
\retval 0 if the widget is inacti \retval 0 if the widget is inactive
\see active_r(), activate(), deactivate() \see active_r(), activate(), deactivate()
*/ */
unsigned int active() const {return !(flags_&INACTIVE);} unsigned int active() const {return !(flags_&INACTIVE);}
/** Returns whether the widget and all of its parents are active. /** Returns whether the widget and all of its parents are active.
\retval 0 if this or any of the parent widgets are inactive \retval 0 if this or any of the parent widgets are inactive
\see active(), activate(), deactivate() \see active(), activate(), deactivate()

10
src/Fl_File_Chooser2.cxx

@ -951,16 +951,16 @@ Fl_File_Chooser::fileNameCB()
} else if (max_match > min_match && first_line) { } else if (max_match > min_match && first_line) {
// Add the matching portion... // Add the matching portion...
fileName->replace( fileName->replace(
(int) (filename - pathname), (int) (filename - pathname),
(int) (filename - pathname + min_match), (int) (filename - pathname + min_match),
matchname); matchname);
// Highlight it with the cursor at the end of the selection so // Highlight it with the cursor at the end of the selection so
// s/he can press the right arrow to accept the selection // s/he can press the right arrow to accept the selection
// (Tab and End also do this for both cases.) // (Tab and End also do this for both cases.)
fileName->position( fileName->position(
(int) (filename - pathname + max_match), (int) (filename - pathname + max_match),
(int) (filename - pathname + min_match)); (int) (filename - pathname + min_match));
} else if (max_match == 0) { } else if (max_match == 0) {
fileList->deselect(0); fileList->deselect(0);
fileList->redraw(); fileList->redraw();

2
src/Fl_Input_.cxx

@ -461,7 +461,7 @@ int Fl_Input_::line_end(int i) const {
for (const char* p=value()+j; ;) { for (const char* p=value()+j; ;) {
char buf[MAXBUF]; char buf[MAXBUF];
p = expand(p, buf); p = expand(p, buf);
int k = (int) (p-value()); int k = (int) (p-value());
if (k >= i) return k; if (k >= i) return k;
p++; p++;
} }

2
src/fl_draw.cxx

@ -303,7 +303,7 @@ void fl_draw(
callthis(buf,buflen,xpos,ypos-desc); callthis(buf,buflen,xpos,ypos-desc);
if (underline_at && underline_at >= buf && underline_at < (buf + buflen)) if (underline_at && underline_at >= buf && underline_at < (buf + buflen))
callthis("_",1,xpos+int(fl_width(buf,(int) (underline_at-buf))),ypos-desc); callthis("_",1,xpos+int(fl_width(buf,(int) (underline_at-buf))),ypos-desc);
if (!*e || (*e == '@' && e[1] != '@')) break; if (!*e || (*e == '@' && e[1] != '@')) break;
p = e; p = e;

10
src/fl_plastic.cxx

@ -145,11 +145,11 @@ static void frame_round(int x, int y, int w, int h, const char *c, Fl_Color bc)
static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) { static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
uchar *g = fl_gray_ramp(); uchar *g = fl_gray_ramp();
int i, j; int i, j;
int clen = (int) strlen(c) - 1; int clen = (int) strlen(c) - 1;
int chalf = clen / 2; int chalf = clen / 2;
int cstep = 1; int cstep = 1;
if (h < (w * 2)) { if (h < (w * 2)) {
// Horizontal shading... // Horizontal shading...
@ -217,8 +217,8 @@ static void shade_rect(int x, int y, int w, int h, const char *c, Fl_Color bc) {
} }
static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc) { static void shade_round(int x, int y, int w, int h, const char *c, Fl_Color bc) {
uchar *g = fl_gray_ramp(); uchar *g = fl_gray_ramp();
int i; int i;
int clen = (int) (strlen(c) - 1); int clen = (int) (strlen(c) - 1);
int chalf = clen / 2; int chalf = clen / 2;

20
src/fl_set_fonts_win32.cxx

@ -69,7 +69,7 @@ enumcbw(CONST LOGFONTW *lpelf,
dstlen = fl_utf8fromwc(n, dstlen, (xchar*)lpelf->lfFaceName, (unsigned) l); // convert the string dstlen = fl_utf8fromwc(n, dstlen, (xchar*)lpelf->lfFaceName, (unsigned) l); // convert the string
n[dstlen] = 0; n[dstlen] = 0;
for (int i=0; i<FL_FREE_FONT; i++) // skip if one of our built-in fonts for (int i=0; i<FL_FREE_FONT; i++) // skip if one of our built-in fonts
if (!strcmp(Fl::get_font_name((Fl_Font)i),n)) {free(n);return 1;} if (!strcmp(Fl::get_font_name((Fl_Font)i),n)) {free(n);return 1;}
char buffer[LF_FACESIZE + 1]; char buffer[LF_FACESIZE + 1];
strcpy(buffer+1, n); strcpy(buffer+1, n);
buffer[0] = ' '; Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer)); buffer[0] = ' '; Fl::set_font((Fl_Font)(fl_free_font++), strdup(buffer));
@ -86,7 +86,7 @@ Fl_Font Fl::set_fonts(const char* xstarname) {
if (fl_free_font == FL_FREE_FONT) {// if not already been called if (fl_free_font == FL_FREE_FONT) {// if not already been called
if (!fl_gc) fl_GetDC(0); if (!fl_gc) fl_GetDC(0);
EnumFontFamiliesW(fl_gc, NULL, (FONTENUMPROCW)enumcbw, xstarname != 0); EnumFontFamiliesW(fl_gc, NULL, (FONTENUMPROCW)enumcbw, xstarname != 0);
} }
return (Fl_Font)fl_free_font; return (Fl_Font)fl_free_font;
@ -145,14 +145,14 @@ Fl::get_font_sizes(Fl_Font fnum, int*& sizep) {
// int l = fl_utf_nb_char((unsigned char*)s->name+1, strlen(s->name+1)); // int l = fl_utf_nb_char((unsigned char*)s->name+1, strlen(s->name+1));
// unsigned short *b = (unsigned short*) malloc((l + 1) * sizeof(short)); // unsigned short *b = (unsigned short*) malloc((l + 1) * sizeof(short));
// fl_utf2unicode((unsigned char*)s->name+1, l, (xchar*)b); // fl_utf2unicode((unsigned char*)s->name+1, l, (xchar*)b);
const char *nm = (const char*)s->name+1; const char *nm = (const char*)s->name+1;
size_t len = strlen(s->name+1); size_t len = strlen(s->name+1);
unsigned l = fl_utf8toUtf16(nm, (unsigned) len, NULL, 0); // Pass NULL to query length required unsigned l = fl_utf8toUtf16(nm, (unsigned) len, NULL, 0); // Pass NULL to query length required
unsigned short *b = (unsigned short*) malloc((l + 1) * sizeof(short)); unsigned short *b = (unsigned short*) malloc((l + 1) * sizeof(short));
l = fl_utf8toUtf16(nm, (unsigned) len, b, (l+1)); // Now do the conversion l = fl_utf8toUtf16(nm, (unsigned) len, b, (l+1)); // Now do the conversion
b[l] = 0; b[l] = 0;
EnumFontFamiliesW(fl_gc, (WCHAR*)b, (FONTENUMPROCW)EnumSizeCbW, 0); EnumFontFamiliesW(fl_gc, (WCHAR*)b, (FONTENUMPROCW)EnumSizeCbW, 0);
free(b); free(b);
sizep = sizes; sizep = sizes;
return nbSize; return nbSize;

Loading…
Cancel
Save