1. Mouse troubles

Hi friends:

Please I need  help.
I am using Windows xp and last 
Euphoria issue.

That's is the trouble:

The programm shows a word inside a Box.
When mouse click over a character in 
this word, the Euphoria code replace by 
onother word.
No problem until that step. But when 
move the mouse, the old character appears 
over the new word.
Below, I am sendind a Euphoria code 
with this problem.
Please, run in your PC to understand
bether.

Best regards

Sergio Gelli - Brasil 


include mouse.e
include graphics.e
object event,ink,kni,sound1,inser1,row1,col1,s,mcol1,mrow1
sound1=1
inser1=1
----------------------------------------------------------------------------------
global function getbit()
---------------------- 
 object event,kni
 ink=-1
 while ink=-1 do
  event=get_mouse()
  if sequence(event) and event[1]>1 then  -- test variavel is sequence
   ink=event[1]                     --- mouse press
   mcol1=(floor(event[2]/8))+1      --- col mouse
   mrow1=(floor(event[3]/8))+1      --- lin mouse 
  else
   ink=get_key()                    -- if no mouse
  end if 
 end while
 return ink
end function
------------
----------------------------------------------------------------------------------
position(25,01)
puts(1,"\\usre\\gettext.e\\read()       ")   ---- nome do pgm ativo 
s = get_position()
row1=s[1]
col1=s[2]
position(23,01)
bk_color(1)
text_color(14)
puts(1,"Clic over any letter in colored boxs, that letter appears when move the
mouse\n")
puts(1,{179}&"To End: Click here or press the Esc key "&{179})
bk_color(4)      --------  cor diretorio + ->
text_color(15)
ink=0
while ink!=27 and ink != 13 and ink!= 23  do  ----- ESC deve ser tratado -------
 machine_proc(6, NO_CURSOR)           -- cursor(NO_CURSOR)
 position( 24,65 )                    --  Sound position
 if sound1 then
  bk_color(14)   
  text_color(0)                       -- cor Sound 
  puts(1, 179&"Sound"&{32,179})
 else
  bk_color(1)   
  text_color(14)                      -- cor SILENT 
  puts(1,179&"SILENT"&{179})
 end if
 position( 24,55 )                    -- Insert position
 if inser1 then
  bk_color(14)   
  text_color(0)                        -- cor insert 
  puts(1,179& "Insert"&{32,179})
 else
  bk_color(1)   
  text_color(14)                       -- cor REPLACE 
  puts(1,179&"REPLACE"&{179})
 end if
 bk_color(14)
 text_color(0)
 -------------------------------------------------------------------------
 ink=getbit()                           -- date input
 --------------------------------------------------------------------------
 ------ actions click mouse -------------------------------------
 if ink=4  then                             -- ink=4 = button mouse up
  if mrow1=24 and mcol1>0 and mcol1<45 then -- place's simulation Esc key
   ink=27           ------ simula tecla Esc
  elsif mrow1=24 and mcol1>65 and mcol1<71  then -- Sound/Silent Box
   if  sound1 then sound1=0            
   else sound1=1   end if
  elsif mrow1=24 and mcol1>54 and mcol1<62  then  -- Insert/Replace Box
   if inser1 then inser1=0          
   else inser1=1 end if
  end if
 end if
end while

new topic     » topic index » view message » categorize

2. Re: Mouse troubles

Sergio Gelli wrote:

> 
> Hi friends:
> 
> Please I need  help.
> I am using Windows xp and last 
> Euphoria issue.
> 
> That's is the trouble:
> 
> The programm shows a word inside a Box.
> When mouse click over a character in 
> this word, the Euphoria code replace by 
> onother word.
> No problem until that step. But when 
> move the mouse, the old character appears 
> over the new word.
> Below, I am sendind a Euphoria code 
> with this problem.
> Please, run in your PC to understand
> bether.
> 
> Best regards
> 
> Sergio Gelli - Brasil 
 
Hi Sergio,

Try please the changed code below,
it works for me properly.

See please added the mouse_pointer() commands.

include mouse.e
include graphics.e
object event,ink,kni,sound1,inser1,row1,col1,s,mcol1,mrow1
sound1=1
inser1=1
----------------------------------------------------------------------------------
global function getbit()
---------------------- 
 object event,kni
 ink=-1
 while ink=-1 do
  event=get_mouse()
  if sequence(event) and event[1]>1 then  -- test variavel is sequence
   ink=event[1]                     --- mouse press
   mcol1=(floor(event[2]/8))+1      --- col mouse
   mrow1=(floor(event[3]/8))+1      --- lin mouse 
  else
   ink=get_key()                    -- if no mouse
  end if 
 end while
 return ink
end function
------------
----------------------------------------------------------------------------------
position(25,01)
puts(1,"\\usre\\gettext.e\\read()       ")   ---- nome do pgm ativo 
s = get_position()
row1=s[1]
col1=s[2]
position(23,01)
bk_color(1)
text_color(14)
puts(1,"Clic over any letter in colored boxs, that letter appears when move the
mouse\n")
puts(1,{179}&"To End: Click here or press the Esc key "&{179})
bk_color(4)      --------  cor diretorio + ->
text_color(15)
ink=0
while ink!=27 and ink != 13 and ink!= 23  do  ----- ESC deve ser tratado -------
 machine_proc(6, NO_CURSOR)           -- cursor(NO_CURSOR)
 position( 24,65 )                    --  Sound position
 if sound1 then
  bk_color(14)   
  text_color(0)                       -- cor Sound 
  mouse_pointer(0)
	 puts(1, 179&"Sound"&{32,179})
  mouse_pointer(1)
 else
  bk_color(1)   
  text_color(14)                      -- cor SILENT 
  mouse_pointer(0)
	 puts(1,179&"SILENT"&{179})
  mouse_pointer(1)
 end if
 position( 24,55 )                    -- Insert position
 if inser1 then
  bk_color(14)   
  text_color(0)                        -- cor insert 
  mouse_pointer(0)
	puts(1,179& "Insert"&{32,179})
  mouse_pointer(1)
 else
  bk_color(1)   
  text_color(14)                       -- cor REPLACE 
  mouse_pointer(0)
       puts(1,179&"REPLACE"&{179})
  mouse_pointer(1)
 end if
 bk_color(14)
 text_color(0)
 -------------------------------------------------------------------------
 ink=getbit()                           -- date input
 --------------------------------------------------------------------------
 ------ actions click mouse -------------------------------------
 if ink=4  then                             -- ink=4 = button mouse up
  if mrow1=24 and mcol1>0 and mcol1<45 then -- place's simulation Esc key
   ink=27           ------ simula tecla Esc
  elsif mrow1=24 and mcol1>65 and mcol1<71  then -- Sound/Silent Box
   if  sound1 then sound1=0            
   else sound1=1   end if
  elsif mrow1=24 and mcol1>54 and mcol1<62  then  -- Insert/Replace Box
   if inser1 then inser1=0          
   else inser1=1 end if
  end if
 end if
end while


Regards,
Igor Kachan
kinz at peterlink.ru

new topic     » goto parent     » topic index » view message » categorize

3. Re: Mouse troubles

Greats suvazheniem Igor

Thanks. Now the code works fine. I do a simple 
modification in your sample, only to avoid repeat
mouse_pointer[0] and [1] more than one time.

Udachi to you.
(As you see, I don't forgot Russian words.

Sérgio Gelli -Brasil


Igor Kachan wrote:
> 
> Sergio Gelli wrote:
> 
> > 
> > Hi friends:
> > 
> > Please I need  help.
> > I am using Windows xp and last 
> > Euphoria issue.
> > 
> > That's is the trouble:
> > 
> > The programm shows a word inside a Box.
> > When mouse click over a character in 
> > this word, the Euphoria code replace by 
> > onother word.
> > No problem until that step. But when 
> > move the mouse, the old character appears 
> > over the new word.
> > Below, I am sendind a Euphoria code 
> > with this problem.
> > Please, run in your PC to understand
> > bether.
> > 
> > Best regards
> > 
> > Sergio Gelli - Brasil 
>  
> Hi Sergio,
> 
> Try please the changed code below,
> it works for me properly.
> 
> See please added the mouse_pointer() commands.
> 
> }}}
<eucode>
> include mouse.e
> include graphics.e
> object event,ink,kni,sound1,inser1,row1,col1,s,mcol1,mrow1
> sound1=1
> inser1=1
>
> ----------------------------------------------------------------------------------
> global function getbit()
> ---------------------- 
>  object event,kni
>  ink=-1
>  while ink=-1 do
>   event=get_mouse()
>   if sequence(event) and event[1]>1 then  -- test variavel is sequence
>    ink=event[1]                     --- mouse press
>    mcol1=(floor(event[2]/8))+1      --- col mouse
>    mrow1=(floor(event[3]/8))+1      --- lin mouse 
>   else
>    ink=get_key()                    -- if no mouse
>   end if 
>  end while
>  return ink
> end function
> ------------
>
> ----------------------------------------------------------------------------------
> position(25,01)
> puts(1,"\\usre\\gettext.e\\read()       ")   ---- nome do pgm ativo 
> s = get_position()
> row1=s[1]
> col1=s[2]
> position(23,01)
> bk_color(1)
> text_color(14)
> puts(1,"Clic over any letter in colored boxs, that letter appears when move
> the mouse\n")
> puts(1,{179}&"To End: Click here or press the Esc key "&{179})
> bk_color(4)      --------  cor diretorio + ->
> text_color(15)
> ink=0
> while ink!=27 and ink != 13 and ink!= 23  do  ----- ESC deve ser tratado
> -------
>  machine_proc(6, NO_CURSOR)           -- cursor(NO_CURSOR)
>  position( 24,65 )                    --  Sound position
>  if sound1 then
>   bk_color(14)   
>   text_color(0)                       -- cor Sound 
>   mouse_pointer(0)
> 	 puts(1, 179&"Sound"&{32,179})
>   mouse_pointer(1)
>  else
>   bk_color(1)   
>   text_color(14)                      -- cor SILENT 
>   mouse_pointer(0)
> 	 puts(1,179&"SILENT"&{179})
>   mouse_pointer(1)
>  end if
>  position( 24,55 )                    -- Insert position
>  if inser1 then
>   bk_color(14)   
>   text_color(0)                        -- cor insert 
>   mouse_pointer(0)
> 	puts(1,179& "Insert"&{32,179})
>   mouse_pointer(1)
>  else
>   bk_color(1)   
>   text_color(14)                       -- cor REPLACE 
>   mouse_pointer(0)
>        puts(1,179&"REPLACE"&{179})
>   mouse_pointer(1)
>  end if
>  bk_color(14)
>  text_color(0)
>  -------------------------------------------------------------------------
>  ink=getbit()                           -- date input
>  --------------------------------------------------------------------------
>  ------ actions click mouse -------------------------------------
>  if ink=4  then                             -- ink=4 = button mouse up
>   if mrow1=24 and mcol1>0 and mcol1<45 then -- place's simulation Esc key
>    ink=27           ------ simula tecla Esc
>   elsif mrow1=24 and mcol1>65 and mcol1<71  then -- Sound/Silent Box
>    if  sound1 then sound1=0            
>    else sound1=1   end if
>   elsif mrow1=24 and mcol1>54 and mcol1<62  then  -- Insert/Replace Box
>    if inser1 then inser1=0          
>    else inser1=1 end if
>   end if
>  end if
<snip>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu