I have STR'd the changes to STR 2838 please Note

0) I could only attach 1 diff file (Fl_Text_Display.cxx.diff) but also have 
(Fl_Text_Display.H.diff) which the form only let me add 1.
  Instructions?

1) While it worked for the behavoiral tests I needed I can't say what will 
happen for more complete testing (resizing etc).
2) My coding style is different to existing. (eg i use lSomeVariableName as a 
local stack variable rather than some_variable_name).
3) Some code (particularly in draw_string) appears to be optimised for speed 
alone taking great space.
   (I could nitpick about details here). I have attempted to make it fairly 
fast (say 95%??)(considering the changes).
   There was no instruction about speed Vs size. If the FLTK community needs 
his to be ABSOLUTELY FASTEST EXECUTING CODE
   I can fix + resubmit.
4) I have made STYLE_TABLE_ATTR_UNDERSCORE and STYLE_TABLE_ATTR_STRIKETHRU bit 
fields (so if the user desires he can have both).
   Tell me if this is wrong.
5) There is an assumption in the code that Style_Table_Entry is constant.
   I could again nitpick but I will hold until I am told if it breaks the ABI.

6) Although I assert it makes no difference (assuming attr is currently unused)

  Note
  struct Style_Table_Entry {
    Fl_Color    color;
    Fl_Font     font;
    Fl_Fontsize size;
    unsigned    attr;
    Fl_Color    color_BG;
  };
  not
  struct Style_Table_Entry {
    Fl_Color    color;
    Fl_Font     font;
    Fl_Fontsize size;
    Fl_Color    color_BG;
    unsigned    attr;
  };
   as this would cause least change to doc.

7) New code should look like

//...
Fl_Text_Display::Style_Table_Entry sStyleTable[] = {
  // FONT COLOR  FONT FACE  FONT SIZE  ATTR  COLOR_BG
         // --------------- ----------- --------------
  { FL_BLUE, FL_SCREEN, 7, STYLE_TABLE_ATTR_UNDERSCORE, 0xff9f0000 }, // A
  { FL_CYAN, FL_COURIER, 16, STYLE_TABLE_ATTR_NONE, 0xffff0000 },     // B
  { FL_DARK_BLUE, FL_HELVETICA_BOLD_ITALIC, 24,STYLE_TABLE_ATTR_UNDERSCORE
         + STYLE_TABLE_ATTR_STRIKETHRU, 0x0fff0000 },                 // C
};

//...
  int lStylTableSize = sizeof(sStylTable)/sizeof(sStylTable[0]);
  fTextDisplay->highlight_data_BG(fStylBuff, sStylTable, lStylTableSize, 'A', 
0, 0);
       //   Note              _BG

I have yet other questions but will await a reply.

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to