Author Topic: Is it possible to draw TABLE Border with lisp?  (Read 11536 times)

0 Members and 1 Guest are viewing this topic.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #15 on: September 20, 2011, 06:58:55 AM »
Here is my attempt at this. I think it could benefit from some more error handling, but I think this should give the basics of what you are trying to accomplish.

Please note that you can select a single cell, as long as it has content within it. You can also select multiple cells by clicking on any blank area of a cell in the corner.

I think this should give a good start to what you are asking for, I know it will help me with another routine.

Please let me know what you think.
thanks cmwade77. i need to study your code and try to incorporate this into my program
kruuger

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is it possible to draw TABLE Border with lisp?
« Reply #16 on: September 20, 2011, 11:43:10 AM »
I made a small tweak to make it work more reliably when clicking a single cell.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #17 on: September 23, 2011, 09:48:51 AM »
Kruuger,

Take a look at the attached code, it should hopefully perform as required.



The code isn't pretty and could probably be optimised somewhat, but it provides a working solution for the time being. There is a current restriction in that it doesn't like selection of a title row, but this could be avoided in a future version by detecting the presence of the title row in the table and testing whether the user's selection includes such title row.

I have found a bug with the SetCellGridColor method: after the cell grid color has been changed, undo'ing this change, although visually seems to reset the cell grid colour, it doesn't seem to properly undo the operation since the cell grid colour will revert back to the modified colour when the table is copied, or if the grid colour of other cells in the table is changed.

kruuger

  • Swamp Rat
  • Posts: 637
Re: Is it possible to draw TABLE Border with lisp?
« Reply #18 on: September 23, 2011, 10:33:45 AM »
Kruuger,

Take a look at the attached code, it should hopefully perform as required.



The code isn't pretty and could probably be optimised somewhat, but it provides a working solution for the time being. There is a current restriction in that it doesn't like selection of a title row, but this could be avoided in a future version by detecting the presence of the title row in the table and testing whether the user's selection includes such title row.

I have found a bug with the SetCellGridColor method: after the cell grid color has been changed, undo'ing this change, although visually seems to reset the cell grid colour, it doesn't seem to properly undo the operation since the cell grid colour will revert back to the modified colour when the table is copied, or if the grid colour of other cells in the table is changed.
Damn Lee, this is awesome  :lol: Your not pretty code is x100 times better then mine.
i need to go thru all these lines.

have a great weekend
take care
kruuger

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Is it possible to draw TABLE Border with lisp?
« Reply #19 on: September 23, 2011, 11:06:05 AM »
Kruuger,

Take a look at the attached code, it should hopefully perform as required.



The code isn't pretty and could probably be optimised somewhat, but it provides a working solution for the time being. There is a current restriction in that it doesn't like selection of a title row, but this could be avoided in a future version by detecting the presence of the title row in the table and testing whether the user's selection includes such title row.

I have found a bug with the SetCellGridColor method: after the cell grid color has been changed, undo'ing this change, although visually seems to reset the cell grid colour, it doesn't seem to properly undo the operation since the cell grid colour will revert back to the modified colour when the table is copied, or if the grid colour of other cells in the table is changed.
Damn Lee, this is awesome  :lol: Your not pretty code is x100 times better then mine.
i need to go thru all these lines.

have a great weekend
take care
kruuger
I tend to agree, I wish I had 1/2 of Lee's skill when it comes to programming.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Is it possible to draw TABLE Border with lisp?
« Reply #20 on: September 23, 2011, 11:45:07 AM »
Damn Lee, this is awesome  :lol: Your not pretty code is x100 times better then mine.
i need to go thru all these lines.

have a great weekend
take care
kruuger
I tend to agree, I wish I had 1/2 of Lee's skill when it comes to programming.

Cheers guys  8-)

If you have any questions or improvements for the code, let me know.

Have a good weekend the both of you!