Alaska Software Inc. - Hybrid screen within VIO application or new window
Username: Password:
AuthorTopic: Hybrid screen within VIO application or new window
Juan GonzalezHybrid screen within VIO application or new window
on Fri, 25 Oct 2024 16:09:44 +0200
Hello,
I have a big and old (but perfectly working) software, all compiled in VIO 
Mode (character mode).

There are some screens that MEMO fields are edited, using memoedit().
The problem with memoedit() in VIO Mode is that it is not possible to cut and 
paste text both within that window or from another windows app.
So the operator has to type everything.

My questions are:
A) Is it possible to have a Hybrid Screen within my (mostly) VIO Mode 
application? So in the screens that there is MEMO fields editing, I would open 
the screen in Hybrid Mode. I think this is very unlikely and also does not 
sounds good.
B) Another solution (more feasible I think) is that if a Memo field has to be 
edited, my VIO application opens a different window in Hybrid or Graphics 
mode, opening the Memo field for edit, and then returning the value to the 
calling VIO app.

Since I think that the right solution is B)... how could this be done? Is it 
neccesary to create a different EXE with passing parameters, or this could be 
done within my existing app?

Thank you very much for any help!
JJ
Jorge BorlandoRe: Hybrid screen within VIO application or new window
on Fri, 08 Nov 2024 10:55:56 -0300
Hi Juan,
Hello Juan, to be able to make insertions, you must search outside of the 
memoedit, with the MlCToPos() function you obtain the position and then use 
Stuff(), I leave you an example to start

Best regards

t1 := memoread( 'test.txt' )
pp := 1
p1 := p2 := p3 := p4 := 1
While pp != 0
   Memoedit( t1, 10, 10, 20, 90, .T., 'ppp1', 100,, p1, p2, p3, p4 )

   CLEAR TYPEAHEAD
   k := MlCtoPos( t1, 100, p1, p2 )
   t1 := Stuff( t1, k, 4, 'hola' )
EndDO


Function ppp1( nMode, nRow, nCol )
      LOCAL nKey, nReturn
      nKey        := LastKey()
      nReturn     := ME_DEFAULT
      DO CASE
      CASE nMode == ME_UNKEY .OR. nMode == ME_UNKEYX

         DO CASE
         CASE nKey == K_F5                        F5 make an insert
            M->p1 := nRow
            M->p2 := nCol + 1

            M->p3 := Row()
            M->p4 := Col()
            nReturn := K_C_W    save
         CASE nKey == K_C_RET           save with Ctrl-Return
            nReturn:= K_C_W
         ENDCASE

      OTHERWISE                            on initialization
         nReturn := IIf( Set(_SET_INSERT), 0, K_INS )
                                           switch to the insertion
         SetCursor( SC_SPECIAL1 )          mode by default

      ENDCASE

   RETURN nReturn




"Juan Gonzalez" escribió en el mensaje de 
noticias:8dd1d97$315b2c1e$66bc8@news.alaska-software.com...

Hello,
I have a big and old (but perfectly working) software, all compiled in VIO
Mode (character mode).

There are some screens that MEMO fields are edited, using memoedit().
The problem with memoedit() in VIO Mode is that it is not possible to cut 
and
paste text both within that window or from another windows app.
So the operator has to type everything.

My questions are:
A) Is it possible to have a Hybrid Screen within my (mostly) VIO Mode
application? So in the screens that there is MEMO fields editing, I would 
open
the screen in Hybrid Mode. I think this is very unlikely and also does not
sounds good.
B) Another solution (more feasible I think) is that if a Memo field has to 
be
edited, my VIO application opens a different window in Hybrid or Graphics
mode, opening the Memo field for edit, and then returning the value to the
calling VIO app.

Since I think that the right solution is B)... how could this be done? Is it
neccesary to create a different EXE with passing parameters, or this could 
be
done within my existing app?

Thank you very much for any help!
JJ
Jorge BorlandoRe: Hybrid screen within VIO application or new window
on Fri, 08 Nov 2024 11:01:53 -0300
Juan,

Juan, I correct the previous routine by adding what is necessary to 
differentiate F5 from CTRL_ENTER


t1 := memoread( 'test.txt' )
pp := 1
p1 := p2 := p3 := p4 := 1
While pp != 0
   Memoedit( t1, 10, 10, 20, 90, .T., 'ppp1', 100,, p1, p2, p3, p4 )

   CLEAR TYPEAHEAD
   If pp = 2
      k := MlCtoPos( t1, 100, p1, p2 )
      t1 := Stuff( t1, k, 4, 'hola' )
      pp := 1
EndDO


Function ppp1( nMode, nRow, nCol )
      LOCAL nKey, nReturn
      nKey        := LastKey()
      nReturn     := ME_DEFAULT
      DO CASE
      CASE nMode == ME_UNKEY .OR. nMode == ME_UNKEYX

         DO CASE
         CASE nKey == K_F5                        F5 make an insert
            M->p1 := nRow
            M->p2 := nCol + 1

            M->p3 := Row()
            M->p4 := Col()
            M->pp := 2
            nReturn := K_C_W    save
         CASE nKey == K_C_RET           save with Ctrl-Return
            nReturn:= K_C_W
            M->pp := 0
         ENDCASE

      OTHERWISE                            on initialization
         nReturn := IIf( Set(_SET_INSERT), 0, K_INS )
                                           switch to the insertion
         SetCursor( SC_SPECIAL1 )          mode by default

      ENDCASE

   RETURN nReturn


"Jorge Borlando"  escribió en el mensaje de 
noticias:467b552d$6fa0a23$102f13@news.alaska-software.com...

Hi Juan,
Hello Juan, to be able to make insertions, you must search outside of the
memoedit, with the MlCToPos() function you obtain the position and then use
Stuff(), I leave you an example to start

Best regards

t1 := memoread( 'test.txt' )
pp := 1
p1 := p2 := p3 := p4 := 1
While pp != 0
   Memoedit( t1, 10, 10, 20, 90, .T., 'ppp1', 100,, p1, p2, p3, p4 )

   CLEAR TYPEAHEAD
   k := MlCtoPos( t1, 100, p1, p2 )
   t1 := Stuff( t1, k, 4, 'hola' )
EndDO


Function ppp1( nMode, nRow, nCol )
      LOCAL nKey, nReturn
      nKey        := LastKey()
      nReturn     := ME_DEFAULT
      DO CASE
      CASE nMode == ME_UNKEY .OR. nMode == ME_UNKEYX

         DO CASE
         CASE nKey == K_F5                        F5 make an insert
            M->p1 := nRow
            M->p2 := nCol + 1

            M->p3 := Row()
            M->p4 := Col()
            nReturn := K_C_W    save
         CASE nKey == K_C_RET           save with Ctrl-Return
            nReturn:= K_C_W
         ENDCASE

      OTHERWISE                            on initialization
         nReturn := IIf( Set(_SET_INSERT), 0, K_INS )
                                           switch to the insertion
         SetCursor( SC_SPECIAL1 )          mode by default

      ENDCASE

   RETURN nReturn




"Juan Gonzalez" escribió en el mensaje de
noticias:8dd1d97$315b2c1e$66bc8@news.alaska-software.com...

Hello,
I have a big and old (but perfectly working) software, all compiled in VIO
Mode (character mode).

There are some screens that MEMO fields are edited, using memoedit().
The problem with memoedit() in VIO Mode is that it is not possible to cut
and
paste text both within that window or from another windows app.
So the operator has to type everything.

My questions are:
A) Is it possible to have a Hybrid Screen within my (mostly) VIO Mode
application? So in the screens that there is MEMO fields editing, I would
open
the screen in Hybrid Mode. I think this is very unlikely and also does not
sounds good.
B) Another solution (more feasible I think) is that if a Memo field has to
be
edited, my VIO application opens a different window in Hybrid or Graphics
mode, opening the Memo field for edit, and then returning the value to the
calling VIO app.

Since I think that the right solution is B)... how could this be done? Is it
neccesary to create a different EXE with passing parameters, or this could
be
done within my existing app?

Thank you very much for any help!
JJ
Jorge BorlandoRe: Hybrid screen within VIO application or new window
on Fri, 08 Nov 2024 11:02:32 -0300
Juan sorry, I correct the previous routine by adding what is necessary to 
differentiate F5 from CTRL_ENTER


t1 := memoread( 'test.txt' )
pp := 1
p1 := p2 := p3 := p4 := 1
While pp != 0
   Memoedit( t1, 10, 10, 20, 90, .T., 'ppp1', 100,, p1, p2, p3, p4 )

   CLEAR TYPEAHEAD
   If pp = 2
      k := MlCtoPos( t1, 100, p1, p2 )
      t1 := Stuff( t1, k, 4, 'hola' )
      pp := 1
EndDO


Function ppp1( nMode, nRow, nCol )
      LOCAL nKey, nReturn
      nKey        := LastKey()
      nReturn     := ME_DEFAULT
      DO CASE
      CASE nMode == ME_UNKEY .OR. nMode == ME_UNKEYX

         DO CASE
         CASE nKey == K_F5                        F5 make an insert
            M->p1 := nRow
            M->p2 := nCol + 1

            M->p3 := Row()
            M->p4 := Col()
            M->pp := 2
            nReturn := K_C_W    save
         CASE nKey == K_C_RET           save with Ctrl-Return
            nReturn:= K_C_W
            M->pp := 0
         ENDCASE

      OTHERWISE                            on initialization
         nReturn := IIf( Set(_SET_INSERT), 0, K_INS )
                                           switch to the insertion
         SetCursor( SC_SPECIAL1 )          mode by default

      ENDCASE

   RETURN nReturn


"Juan Gonzalez" escribió en el mensaje de 
noticias:8dd1d97$315b2c1e$66bc8@news.alaska-software.com...

Hello,
I have a big and old (but perfectly working) software, all compiled in VIO
Mode (character mode).

There are some screens that MEMO fields are edited, using memoedit().
The problem with memoedit() in VIO Mode is that it is not possible to cut 
and
paste text both within that window or from another windows app.
So the operator has to type everything.

My questions are:
A) Is it possible to have a Hybrid Screen within my (mostly) VIO Mode
application? So in the screens that there is MEMO fields editing, I would 
open
the screen in Hybrid Mode. I think this is very unlikely and also does not
sounds good.
B) Another solution (more feasible I think) is that if a Memo field has to 
be
edited, my VIO application opens a different window in Hybrid or Graphics
mode, opening the Memo field for edit, and then returning the value to the
calling VIO app.

Since I think that the right solution is B)... how could this be done? Is it
neccesary to create a different EXE with passing parameters, or this could 
be
done within my existing app?

Thank you very much for any help!
JJ