SlickEdit Community

Archived Beta Discussions => SlickEdit 201x Beta Discussions => SlickEdit 2015 v20 Beta Discussion => Topic started by: Mike M on October 23, 2015, 11:09:23 PM

Title: Problems with the "draw" macro.
Post by: Mike M on October 23, 2015, 11:09:23 PM
Use the draw macro as follows:
command = draw a

Try to draw this box in a clockwise direction:

   *---------*
   |         |
   |         |
   |         |
   *---------*

When you retrace it a second time you get this:

   *---------*
   |         +
   |         +
   |         +
   *---------*

Do the same thing in a counter clockwise direction
And you end up with this:

   *---------*
   +         |
   +         |
   +         |
   *---------*

Try to make two intersecting boxes.
It should look like this:

      *---------------*
      |               |
      |               |
      |     *---------*-----*
      |     |         |     |
      |     |         |     |
      *-----*---------*     |
            |               |
            |               |
            *---------------*

But instead looks like this:

      *---------------*
      |               |
      |     *---------------*
      |     |         |     |
      |     |         |     |
      |     |         |     |
      *-----|---------*     |
            |               |
            |               |
            *---------------*
 
The box you draw last overwrites the box on you draw first.
The intersections do not work.
 
Plus I really like to use a "+" character for corners and intersections instead of an asterisk. I think it looks a lot better. But it is easy enough to update the draw.e macro myself and either change the asterisks or add another case.

I know that nobody is going to retrace a box, and this might seem like a corner case, but you have to retrace parts of the box when making simple tables similar to the following. 

+----------+----------------------+--------------------------------------------+
| Date     | Name                 | Comment                                    |
+----------+----------------------+--------------------------------------------+
|          |                      |                                            |
|          |                      |                                            |
|          |                      |                                            |
+----------+----------------------+--------------------------------------------+

And it is currently not possible to do this without drawing it first and then manually going back and fixing the intersections.

If you retrace a box, it should not change the box. You should get the exact same box regardless of what characters you are overwriting.

Title: Re: Problems with the "draw" macro.
Post by: rgloden on October 25, 2015, 06:56:55 PM
Another hidden gem.

Title: Re: Problems with the "draw" macro.
Post by: davehohl on October 26, 2015, 05:02:08 PM
Here is an example of what rgloden is talking about. I used "draw 1" command to create this box.
Title: Re: Problems with the "draw" macro.
Post by: Mike M on October 26, 2015, 05:37:10 PM
The draw macro takes one argument which specifies which characters you want to use for horizontal and vertical lines as well as intersections and corners. You can also use gui-draw to specify the argument from a radio button.

On the GUI, you can select single lines, double lines, horizontal double line, vertical double line, ASCII characters, or blank spaces.

The help text for the draw function says:
1   Single line top/bottom sides and left/right sides.
2   Double line top/bottom sides and left/right sides.
3   Single line sides and double line top/bottom sides.
4   Double line sides and single line top/bottom sides.
B   Draw with blank character.  Used to erase drawing.
Any character  Any character may be used as the draw character.

The A parameter is not mentioned.

For modes 1 to 4, you have to be using the OEM Fixed Font or another font that supports DOS character graphics, otherwise other characters will be displayed that don't make sense.

I also found that if I'm using the OEM Fixed Font with single lines, it seems to works perfect. It doesn't write intersection symbols on the sides of a simple box when retracing and the intersections work.

However, if I keep pressing Cursor Down on the last line of the document, the line alternates between the vertical line-draw character and a question mark, like follows:

|
?
|
?
|
Title: Re: Problems with the "draw" macro.
Post by: Mike M on October 26, 2015, 05:43:42 PM
Another quick note: Hitting the Help button on the GUI draw dialog box doesn't do anything. And the title of the GUI draw dialog box is "vs" instead of something more descriptive like other GUI dialog box's.
Title: Re: Problems with the "draw" macro.
Post by: davehohl on October 26, 2015, 06:00:52 PM
I tried the OEM fixed font and that did work, although I also experienced the issues with the '?' showing up in some circumstances. Never when drawing in the up direction, but sometimes when drawing in the down direction.