Topic: Dialog_input_1 (1 of 5), Read 63 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Monday, March 12, 2001 03:54 AM

I wonder if somebody could give me a tip with the
dialog_input_1 macro:

I have studied the - somewhat different - descriptions given
in the manual and in the help file, which enabled me to put
together a DP1 that is accessible with the mouse. So far,
the fragment appended below works fine for me.

What i haven't understood yet, is how to implement keyboard
control. According to the manual, a hotkey can be defined by
placing a "&" into the button descriptions. But - what's the
related macro code? E.g., what have i to add to the
fragment to activate the hot keys, so that
pressing "E" or "Alt-E" will insert "\begin{enumerate}
etc."?

Background:
i have introduced Vedit in our department some years ago.
Now, some Tex Guru in the computing dept. (which is charged
with providing software for all other depts.) has begun to
advocate an editor, which has many `prêt a porter' solutions
for Latex, but is in every other respect, as far as i can
judge it, a rather poor thing. To kick it aside, i want to
demonstrate that with V+ i can do anything that can be done
with that fashionable mousy clicky something, whereas the
opposite doesn't hold. If get some idea how to manage keyboard control with DP1, i will have some clever student write a complete set of the most popular Tex macros and than go to make a little contest (Hi Christian, i you won't mind, i will use your pan-z.vdm of 1998, that certainly will finish him off).

Thanks,

Fritz


#1=Dialog_Input_1(5,"`Tex-Listen`,
`Enumerate: Aufzählungen \t \t Asparaenumerate: dto., als Paragraph
Itemize: Strichlisten \t \t Asparaitem: dto., als Paragraph
Description: Listen mit Schlagwort \t Asparadescription: dto., als Paragraph`,
`[&Enumerate]`,`[&Itemize]`,`[&Description]`,
`[Asparae&num]`, `[Asparai&tem]`, `[Asparad&esc]`",
APP+CENTER,0,0)
if(#1 == 1){instext("\begin{enumerate}")
insnewline(2)
instext("\end{enumerate}")
line(-1)
breakout(extra)}
// ... (more code)

 


Topic: Dialog_input_1 (2 of 5), Read 64 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Monday, March 12, 2001 06:07 AM

Hello Fritz!

Your code fragment is o.k. so far.
The only problem is that you defined the hotkey "e" twice (Enumerate and asparadEsc). So Vedit can't decide what to do here.

Additionally some suggestions (How I would do it) (see macro code below).

Since there are only six buttons available it's possible to build a menu system with DI_1.
Then in the second or third level there are your editing functions. You know what I mean?

HTH
Christian



// use a text register to make DI_1 a little bit easier to read
//
Reg_Set(98,`(E)numerate: Aufzählungen \t \t Asparae(n)umerate: dto., als Paragraph
(I)temize: Strichlisten \t \t \t Asparai(t)em: dto., als Paragraph
(D)escription: Listen mit Schlagwort \t Asparadescri(p)tion: dto., als Paragraph
`)

#1=Dialog_Input_1(5,"`Tex-Listen`,
'|@(98)',
`[&Enumerate]`,`[&Itemize]`,`[&Description]`,
`[Asparae&num]`, `[Asparai&tem]`, `[As¶desc]`",
APP+CENTER,0,0)

Reg_Set(99,"BUTTON-") // build the label dynamically
Num_Str(#1,99, LEFT+NOCR+APPEND) // with the button number
Call(@(99)) // and call it

// more code ...

return

// --------------- subroutines for DI_1 ------------------------------------

:BUTTON-0:
return

:BUTTON-1:
instext("\begin{enumerate}")
insnewline(2)
instext("\end{enumerate}")
line(-1)
return

:BUTTON-2:
instext("\begin{something}")
insnewline(2)
instext("\end{something}")
line(-1)
return

:BUTTON-3:
// ...
return

:BUTTON-4:
// ...
return

:BUTTON-5:
// ...
return

:BUTTON-6:
// ...
return

// --------------------------------------------------------------------------

 


Topic: Re: Dialog_input_1 (3 of 5), Read 72 times, 1 File Attachment
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, March 13, 2001 02:47 AM

Fritz,

to make it easier to understand (hopefully) I made another demo of that menu example.

//
// Menu system with Dialog_Input_1()
//
// (as example)
//
// this way you can implement nested menus easily
//
//


// ---------------- Main program with the main menu ---------

// ....

#1=Dialog_Input_1(5,"`Main-Menu`,
'please choose ...
(ESC cancels this menu)',
`[&List]`,`[&Paragraph]`,`[&etc]`",
APP+CENTER,0,0)

Reg_Set(99, "MENU-0") // build the label dynamically
Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number
Call(@(99)) // and call it

// more code ...

return


// ================ Subroutines ================================

// --------------- Sub menus ------------------------------------

:MENU-00: // ESC key
return

// ---------

:MENU-01:

#1=Dialog_Input_1(5,"`Submenu 1: List`,
'(E)numerate: Aufzählungen
(I)temize: Strichlisten
(D)escription: Listen mit Schlagwort

(ESC cancels this menu)',
`[&Enumerate]`,`[&Itemize]`,`[&Description]`",
APP+CENTER,0,0)

Reg_Set(99, "MENU01-B") // build the label dynamically
Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number
Call(@(99)) // and call it
return

// ---------

:MENU-02:

#1=Dialog_Input_1(5,"`Submenu 2: List as paragraph`,
'Asparae(n)umerate: Aufzählungen
Asparai(t)em: Strichlisten
Asparadescri(p)tion: Listen mit Schlagwort

(ESC cancels this menu)',
`[Asparae&num]`, `[Asparai&tem]`, `[As¶desc]`",
APP+CENTER,0,0)

Reg_Set(99, "MENU02-B") // build the label dynamically
Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number
Call(@(99)) // and call it
return

// ---------

:MENU-03:

#1=Dialog_Input_1(5,"`Submenu 3: etc`,
'more functions or sub menus
(ESC cancels this menu)',
`[Button1]`, `[Button2]`",
APP+CENTER,0,0)

Reg_Set(99, "MENU03-B") // build the label dynamically
Num_Str(#1, 99, LEFT+NOCR+APPEND) // with the button number
Call(@(99)) // and call it
return


// ------------------ Buttons for the menus ----------------------------------------

:MENU01-B0: // ESC key
return

:MENU01-B1:
instext("[Menu1-Button1]")
return

:MENU01-B2:
instext("[Menu1-Button2]")
return

:MENU01-B3:
instext("[Menu1-Button3]")
return

// ------

:MENU02-B0: // ESC key
return

:MENU02-B1:
instext("[Menu2-Button1]")
return

:MENU02-B2:
instext("[Menu2-Button2]")
return

:MENU02-B3:
instext("[Menu2-Button3]")
return

// ------

:MENU03-B0: // ESC key
return

:MENU03-B1:
instext("[Menu3-Button1]")
return

:MENU03-B2:
instext("[Menu3-Button2]")
return

// --------------------------------------------------------------------------



Christian

 
MENUEXAMPLE.VDM (3KB)

 


Topic: DI_1: Buttons (4 of 5), Read 48 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Thursday, October 25, 2001 11:57 AM

Is there a maximum length of the text string in radio buttons? In the following fragment a >10char string in the 3d button ("subsubsection") seems to cause overlapping of button 1 and 2. If it is shortened to "subsubsect" everything is ok.

#1=Dialog_Input_1(5,"
`Sectioning and Fonts (ESC = exit)`,
`.l[§ion]`,`[s&ubsection]`,`[su&bsubsection]`
",
APP+CENTER,0,0)
//

Fritz

 


Topic: Re: DI_1: Buttons (5 of 5), Read 47 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Thursday, October 25, 2001 03:22 PM

At 12:46 PM 10/25/2001, you wrote:
>Is there a maximum lenght of the text string in radio buttons? In the following fragment a >10char string in the 3d button ("subsubsection") seems to cause overlapping of button 1 and 2. If it is shortened to "subsubsect" everything is ok.

Yes, the buttons are all a fixed size. Depending upon your system font, 8 - 10 is the max number of characters.

Ted.