Topic: Scrollable text in DI1() for big dialogs (1 of 9), Read 42 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, August 21, 2003 02:13 PM


I wrote a little macro to make it possible to show text with *many* lines in Dialog_Input_1().

The macro gets it's input via Text-Registers and lets the user page forward and backward through the text.

Since the macro uses DI1() it requires VEDIT for Windows.

The macro is attached (as complete example.)
Simply execute it to see what I tried to describe ;-)

Christian

 
DI1-SCROLL.VDM (2KB)

 


Topic: Re: Scrollable text in DI1() for big dialogs (2 of 9), Read 38 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Thursday, August 21, 2003 03:47 PM

> I wrote a little macro to make it possible to show text with *many*
> lines in Dialog_Input_1().

Christian

this is very impressive an interesting, and I think I will use it to
develop some step by step instructions for me and my colleages ("how
to produce Greek text with TeX?", and the like).

However, there are two points for which i'd ask your permission for
some modification:

(1) You put the entire text into @104 and then read 4-line segments
of it into the Dialog box. However, for help info's it is more
natural to display entire paragraphs. So, if i unterstand your code
correctly, i would have to replace

Reg_Copy(105,#104)

#105=Cur_Line
Line(#104, NOERR)

by something like

RCB(105,BOP_Pos,EOP_Pos)
Goto_Pos(EOP_Pos)

and can dispense with #104=4. Is this correct, or have i overlooked
something important?

(2) I'd suggest you to order the buttons like this:

[Previous] [Next] [Cancel]

This would me more iconic, since in our western tradition "back" is,
by way of metaphor, strongly associated with "left", and "forward"
with "right" (of course, if you go to make Vedit popular in semitic
cultures, you will have more success with your original
arrangement :))

Thank you for this fine lesson on macro programing.

As always, your "humble student".

Fritz

 


Topic: Re: Scrollable text in DI1() for big dialogs (3 of 9), Read 40 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, August 21, 2003 04:26 PM

Fritz:

On Thu, 21 Aug 2003 15:51:19 , you wrote:

>this is very impressive an interesting, and I think I will use it to
>develop some step by step instructions for me and my colleages ("how
>to produce Greek text with TeX?", and the like).
>
>However, there are two points for which i'd ask your permission for
>some modification:

Permission??
You are free to use that code with or without modifications in your
own macros of course!

>(1) You put the entire text into @104 and then read 4-line segments
>of it into the Dialog box. However, for help info's it is more
>natural to display entire paragraphs.

I'm using the fixed number of lines because otherwise the dialog
window would have a different height on every new paragraph (assuming
that they are of different length). And that looks strange IMHO.

With some more lines of code it should be possible to page through
paragraphs with a fixed dialog size:

1) determine the longest paragraph in lines (and set #103 to it)

2) make all paragraphs the same length by inserting the appropriate
number of empty lines between them.
(BTW: What about not using standard paragraphs but something like :
Line 1 of paragraph 1
Line 2 of paragraph 1
[empty line for optical structure]
Line 3 of paragraph 1
Line 4 of paragraph 1
.# [some special character(s) to mark a new paragraph]
Line 1 of paragraph 2
Line 2 of paragraph 2
)

3) Now you can page through them with my original code.



>(2) I'd suggest you to order the buttons like this:
>
>[Previous] [Next] [Cancel]
>
>This would me more iconic,

Yes, you are correct.


>Thank you for this fine lesson on macro programing.
>
>As always, your "humble student".

;-) Happy coding!


Christian

 


Topic: Re: Scrollable text in DI1() for big dialogs (4 of 9), Read 42 times, 1 File Attachment
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Thursday, August 21, 2003 05:10 PM


Some minutes ago I wrote:
> [modifications]
> Happy coding!

Since I'm interested in those modifications too I've done them on the fly. The result is attached.

Fritz:
Don't look into the new macro.
IIRC you want to learn macro programming by doing it by yourself. ;-)

Christian

 
DI1-SCROLL2.VDM (3KB)

 


Topic: Re: Scrollable text in DI1() for big dialogs (5 of 9), Read 41 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Friday, August 22, 2003 07:51 AM

On 8/21/2003 5:10:29 PM, Christian Ziemski wrote:
>Fritz:
>Don't look into the new macro.
>IIRC you want to learn macro
>programming by doing it by
>yourself. ;-)

Christian:

it took me some time to understand the new macro. And now i'm so exhausted that i feel i have deserved a 2 week holidays :)

Thanks for the new code, i will start using it as soon as i will have returned to work.

Fritz

 


Topic: Scrollable text in DI1() for big dialogs (6 of 9), Read 37 times
Conf: VEDIT Macro Library
From: Christian Ziemski
Date: Friday, August 22, 2003 10:17 AM

Ooops, there is a "little" bug in the last 2 versions:

The last two lines are

Reg_Push(103,106) // restore used registers
Num_Push(103,106)

but should be:

Reg_Pop(103,106) // restore used registers
Num_Pop(103,106)

 


Topic: Re: Scrollable text in DI1() for big dialogs (7 of 9), Read 35 times
Conf: VEDIT Macro Library
From: Fritz Heberlein
Date: Friday, August 22, 2003 11:27 AM



vedit-macros Listmanager am 22 Aug 2003, 10:16:

Christian:

i couldn't reesist to experiment a bit with your new macro, and
i see that i still need some enlightenment:

> Line(1, NOERR+ERRBREAK)

Until now, i thought that these two were conflicting options. What's
the goal of this combination?

Thanks and regards,

Fritz

--
Dr. Friedrich Heberlein, Akad. Direktor
Seminar für Klassische Philologie, KU Eichstaett-Ingolstadt
Universitaetsallee 1
D-85071 Eichstaett / Bayern

 


Topic: Re: Scrollable text in DI1() for big dialogs (8 of 9), Read 37 times
Conf: VEDIT Macro Library
From: Deleted User
Date: Friday, August 22, 2003 01:35 PM

Fritz:

You wrote:

>i couldn't reesist to experiment a bit with your new macro, and
>i see that i still need some enlightenment:
>
>> Line(1, NOERR+ERRBREAK)
>
> Until now, i thought that these two were conflicting options. What's
>the goal of this combination?


Without NOERR the Line(1) would stop the macro with an error if at
EoF: There is no further line to go to...
With NOERR the above error is silently ignored.

ERRBREAK defines an action if the above error occurs: "break out of
the current loop". So it's easy to leave a loop if At EndOfFile.

Hopefully those short infos help a bit.

Christian

 


Topic: Re: Scrollable text in DI1() for big dialogs (9 of 9), Read 36 times
Conf: VEDIT Macro Library
From: Ted Green
Date: Monday, August 25, 2003 11:22 AM

At 10:14 AM 8/21/2003, you wrote:
>From: "Christian Ziemski"
>
>
>I wrote a little macro to make it possible to show text with *many* lines in Dialog_Input_1().

Christian:

That is a very impressive macro. Thank you for the contribution.

I would like to include it as a subroutine within another standard VEDIT macro. Any suggestions on which existing VEDIT macro/function could use this would be appreciated.

Ted.