Menu

ezTable lines

emilt
2013-12-03
2013-12-03
  • emilt

    emilt - 2013-12-03

    Currently the lines in ezTable are controlled by an option 'showLines', which has a fixed number of hard to remember variants.
    I have implemented locally a replacement for this option, I called it 'gridlines', which acts as a bitmask controlling the different lines. I defined some constants,

    define('EZ_GRID_OUT', 8); // Table outline
    define('EZ_GRID_HD', 4); // Horizontal line between headings and table body when showHeadings
    define('EZ_GRID_H', 2); // horizontal lines between data rows
    define('EZ_GRID_V', 1); // vertical lines between data columns

    that can be added together to provide the required style. The current 'showLines' values can be 'translated' to these in order to preserve compatibility.

    If you like this approach, I can provide a patch for it. I'm not sure if further refinement would be useful, like e.g. separating horizontal and vertical outlines, or odd/even row lines or anything else. There are more bits available :)

    Please comment.
    Emil

     
  • Ole K

    Ole K - 2013-12-03

    that is a nice approach but I would name a bit more user friendly:

    For instance:
    EZ_GRIDLINE_TABLE
    EZ_GRIDLINE_HEADERONLY
    EZ_GRIDLINE_ROWS
    EZ_GRIDLINE_COLUMNS

    Would you agree to this?

     
  • emilt

    emilt - 2013-12-03

    No problem, I am a bit lazy typing :)

    The more I think, the more I tend to split table gridline into EZ_GRIDLINE_TABLE_H and EZ_GRIDLINE_TABLE_V parts, so I will do this, change the names and send the patch.

     
  • Ole K

    Ole K - 2013-12-03

    Well EZ_GRIDLINE_TABLE is double IMO (GRID vs. TABLE). let us use my definition please ;-)

    I am already thinking to provide some more definition in future.

    For instance:

    EZ_ALIGN_LEFT = 0
    EZ_ALIGN_CENTER = 1
    EZ_ALIGN_RIGHT = 2
    ...
    

    and for shading

    EZ_SHADING_DISABLE
    EZ_SHADING_ONEWAY
    EZ_SHADING_TWOWAY
    

    maybe some days shading will be also available for ezText, thats why I used EZ_SHADING and not EZ_GRID_SHADING

     
  • emilt

    emilt - 2013-12-03

    Patch #20 created. You can change the names of options and constants as you like.
    I am also not 100% sure in the compatibility translation of 'showLines' values.

     

Log in to post a comment.