1. Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you will

Hello,

I have had the problem before with Winlib32Hover.. Hov..

I have made a launch programme.... below..

But, clicking on icon2 .. img2 .. gives me 3 executions.

You can see below I have tried all I know ..

And it is not much..

Can you help please ??..

1 execution required would suffice .

I do mean the programme..

In anticipation, ........

Selgor... Thank You..

 
without warning 
include win32lib.ew 
 
object setpath4bitmaps 
 
integer WeeWin,img1,img2,img3,img4,img5, 
        origstate, 
        b1,b2,b3,b4,b5 
 
        origstate = 0 
        b2=0 b3=0 b4=0 b5=0 
 
sequence bm,bsize 
 
WeeWin=create(Window,"",0,25,52,35,35,{WS_POPUP,WS_BORDER,WS_VISIBLE}) 
 
setWindowBackColor(WeeWin,#FFFFFF)--w,{255,254,27}) 
 
setpath4bitmaps = setSearchPaths("..\\demoresources\\") 
 
bm = {loadBitmapFromFile("happy.bmp"), 
      loadBitmapFromFile("Kal.bmp"), 
      loadBitmapFromFile("Picasa.bmp"), 
      loadBitmapFromFile("Target.bmp") , 
      loadBitmapFromFile("sh1.bmp") } 
 
bsize = {getSize(bm[1]), getSize(bm[2])} 
 
img1 = create(Bitmap, "", WeeWin,   4, 7, 30, 30, 0) 
img2 = create(Bitmap, "", WeeWin,  35, 7, 30, 30, 0) 
img3 = create(Bitmap, "", WeeWin,  65, 7, 30, 30, 0) 
img4 = create(Bitmap, "", WeeWin,  96, 7, 30, 30, 0) 
img5 = create(Bitmap, "", WeeWin, 126, 7, 30, 30, 0) 
b1=create(PictureButton,"",WeeWin,  1,3,30,30,0) 
 
setMousePointer( {WeeWin,img1,img2,img3,img4,img5,b1}, 
                  "c:\\euphoria\\im\\hnd1.cur" ) 
 
 
procedure w_Activate(integer self, integer event, sequence params) 
   origstate = 1 
   setBitmap(img1, bm[origstate]) 
end procedure 
 
procedure w_Mouse(integer self, integer event, sequence params) 
   integer x 
   integer newstate 
 
   x = params[2] 
 
   if x < 7 or x > bsize[origstate][3]+7  then 
      newstate = 1 
   else 
      newstate = 2 
   end if 
 
   if newstate = 2  then 
      b2=create(PictureButton,"",WeeWin,  32,3,30,30,0) 
      b3=create(PictureButton,"",WeeWin,  63,3,30,30,0) 
      b4=create(PictureButton,"",WeeWin,  94,3,30,30,0) 
      b5=create(PictureButton,"",WeeWin, 125,3,30,30,0) 
 
      setBitmap(img2, bm[2]) 
      setBitmap(img3, bm[3]) 
      setBitmap(img4, bm[4]) 
      setBitmap(img5, bm[5]) 
 
      setClientRect(WeeWin, 
                   (getSystemMetrics(SM_CXDLGFRAME)*52), 
                   (getSystemMetrics(SM_CYDLGFRAME)*12)) 
    end if 
end procedure 
 
procedure Click(integer self, integer event, sequence params) 
 --  if self = img2 --or self = WeeWin -- or self = PT2 then 
   --   then -- shellExecute( "open", "C:\\",SW_SHOWNORMAL)--EUPHORIA\\run_now\\SYSstuff.exw", SW_SHOWNORMAL ) 
      -- shellExecute( "open", "C:\\EUPHORIA\\run_now\\SYSstuff.exw", SW_NORMAL) 
     -- closeWindow(w) -- closeApp()--setVisible(w,0) 
  --  if  params[1] = WM_LBUTTONDOWN then 
     --       shellExecute( "open", "c:\\", SW_SHOWNORMAL ) 
       -- end if 
 
  --  shellExecute("open","C:\\EUPHORIA\\Win32LIB6006\\Demo\\EuLornch.exw",SW_SHOWNORMAL) 
--------------      setClientRect(WeeWin, 
--------------------                   (getSystemMetrics(SM_CXDLGFRAME)*12), 
-------------------                   (getSystemMetrics(SM_CYDLGFRAME)*12)) 
 
----************************  needs the ams thing 2 do it once    ????????? 
 
                                                     -- end if 
     if self = img2 --or self = w -- or self = PT2 then 
      then -- shellExecute( "open", "C:\\",SW_SHOWNORMAL)--EUPHORIA\\run_now\\SYSstuff.exw", SW_SHOWNORMAL ) 
 
        shellExecute("open","C:\\EUPHORIA\\Win32LIB6006\\Demo\\EuLornch.exw",SW_SHOWNORMAL) 
            --  shellExecute( "open", "c:\\autoruns\\autoruns.exe", SW_SHOWNORMAL ) 
 
    --  closeWindow(WeeWin) -- closeApp()--setVisible(w,0) 
--   end if 
 --------------- need to state what has 2 be executed individually !!!!!! 
   end if 
end procedure 
 
setHandler( WeeWin, w32HActivate,                                      routine_id("w_Activate")) 
setHandler( WeeWin, w32HMouse,                                         routine_id("w_Mouse")) 
setHandler({WeeWin,img1,img2,img3,img4,img5,b1}, w32HClick, routine_id("Click")) 
 
WinMain(WeeWin, Normal) 
new topic     » topic index » view message » categorize

2. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Selgor said...

Hello,

I have had the problem before with Winlib32Hover.. Hov..

I have made a launch programme.... below..

But, clicking on icon2 .. img2 .. gives me 3 executions.

You can see below I have tried all I know ..

And it is not much..

Can you help please ??..

1 execution required would suffice .

I do mean the programme..

In anticipation, ........

Selgor... Thank You..

 
without warning 
include win32lib.ew 
 
object setpath4bitmaps 
 
integer WeeWin,img1,img2,img3,img4,img5, 
        origstate, 
        b1,b2,b3,b4,b5 
 
        origstate = 0 
        b2=0 b3=0 b4=0 b5=0 
 
sequence bm,bsize 
 
WeeWin=create(Window,"",0,25,52,35,35,{WS_POPUP,WS_BORDER,WS_VISIBLE}) 
 
setWindowBackColor(WeeWin,#FFFFFF)--w,{255,254,27}) 
 
setpath4bitmaps = setSearchPaths("..\\demoresources\\") 
 
bm = {loadBitmapFromFile("happy.bmp"), 
      loadBitmapFromFile("Kal.bmp"), 
      loadBitmapFromFile("Picasa.bmp"), 
      loadBitmapFromFile("Target.bmp") , 
      loadBitmapFromFile("sh1.bmp") } 
 
bsize = {getSize(bm[1]), getSize(bm[2])} 
 
img1 = create(Bitmap, "", WeeWin,   4, 7, 30, 30, 0) 
img2 = create(Bitmap, "", WeeWin,  35, 7, 30, 30, 0) 
img3 = create(Bitmap, "", WeeWin,  65, 7, 30, 30, 0) 
img4 = create(Bitmap, "", WeeWin,  96, 7, 30, 30, 0) 
img5 = create(Bitmap, "", WeeWin, 126, 7, 30, 30, 0) 
b1=create(PictureButton,"",WeeWin,  1,3,30,30,0) 
 
setMousePointer( {WeeWin,img1,img2,img3,img4,img5,b1}, 
                  "c:\\euphoria\\im\\hnd1.cur" ) 
 
 
procedure w_Activate(integer self, integer event, sequence params) 
   origstate = 1 
   setBitmap(img1, bm[origstate]) 
end procedure 
 
procedure w_Mouse(integer self, integer event, sequence params) 
   integer x 
   integer newstate 
 
   x = params[2] 
 
   if x < 7 or x > bsize[origstate][3]+7  then 
      newstate = 1 
   else 
      newstate = 2 
   end if 
 
   if newstate = 2  then 
      b2=create(PictureButton,"",WeeWin,  32,3,30,30,0) 
      b3=create(PictureButton,"",WeeWin,  63,3,30,30,0) 
      b4=create(PictureButton,"",WeeWin,  94,3,30,30,0) 
      b5=create(PictureButton,"",WeeWin, 125,3,30,30,0) 
 
      setBitmap(img2, bm[2]) 
      setBitmap(img3, bm[3]) 
      setBitmap(img4, bm[4]) 
      setBitmap(img5, bm[5]) 
 
      setClientRect(WeeWin, 
                   (getSystemMetrics(SM_CXDLGFRAME)*52), 
                   (getSystemMetrics(SM_CYDLGFRAME)*12)) 
    end if 
end procedure 
 
procedure Click(integer self, integer event, sequence params) 
 --  if self = img2 --or self = WeeWin -- or self = PT2 then 
   --   then -- shellExecute( "open", "C:\\",SW_SHOWNORMAL)--EUPHORIA\\run_now\\SYSstuff.exw", SW_SHOWNORMAL ) 
      -- shellExecute( "open", "C:\\EUPHORIA\\run_now\\SYSstuff.exw", SW_NORMAL) 
     -- closeWindow(w) -- closeApp()--setVisible(w,0) 
  --  if  params[1] = WM_LBUTTONDOWN then 
     --       shellExecute( "open", "c:\\", SW_SHOWNORMAL ) 
       -- end if 
 
  --  shellExecute("open","C:\\EUPHORIA\\Win32LIB6006\\Demo\\EuLornch.exw",SW_SHOWNORMAL) 
--------------      setClientRect(WeeWin, 
--------------------                   (getSystemMetrics(SM_CXDLGFRAME)*12), 
-------------------                   (getSystemMetrics(SM_CYDLGFRAME)*12)) 
 
----************************  needs the ams thing 2 do it once    ????????? 
 
                                                     -- end if 
     if self = img2 --or self = w -- or self = PT2 then 
      then -- shellExecute( "open", "C:\\",SW_SHOWNORMAL)--EUPHORIA\\run_now\\SYSstuff.exw", SW_SHOWNORMAL ) 
 
        shellExecute("open","C:\\EUPHORIA\\Win32LIB6006\\Demo\\EuLornch.exw",SW_SHOWNORMAL) 
            --  shellExecute( "open", "c:\\autoruns\\autoruns.exe", SW_SHOWNORMAL ) 
 
    --  closeWindow(WeeWin) -- closeApp()--setVisible(w,0) 
--   end if 
 --------------- need to state what has 2 be executed individually !!!!!! 
   end if 
end procedure 
 
setHandler( WeeWin, w32HActivate,                                      routine_id("w_Activate")) 
setHandler( WeeWin, w32HMouse,                                         routine_id("w_Mouse")) 
setHandler({WeeWin,img1,img2,img3,img4,img5,b1}, w32HClick, routine_id("Click")) 
 
WinMain(WeeWin, Normal) 
 

Hi

Without looking too closely, or remembering all the event types, I think you actually need to check the event type in procedure Click - looks like it may be being triggered by a mousedown, mouseup, and a mouseclick event.

Do something like if event = mouseclick then run your stuff end

Note, I can't remember what all the events are, I would have to look it up, and I'm not at a windows machine with eu installed atm.

Chris

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

3. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Hello Chris,

Thank you..

Gives me a mouseclick not declared ???..

Cheers..

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

4. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Selgor said...

Hello,

I have had the problem before with Winlib32Hover.. Hov..

Looking at your code, I'm not really sure what you are trying to do.

I'm guessing here but I think you want to show 5 buttons (picture buttons) and when the user clicks any of them, the application associated with the button will launch.

But when do you want the buttons to show? Currently it looks like initially the buttons are not there and only when the mouse moves between certain limits are the buttons to appear. Is that right? Also, do you need the buttons to disappear when the mouse is outside that X range?

If this is the sort of thing you want the program to do, your code looks far to complicated. I'm sure we can simplify it greatly.

If I've understood what your application is trying to do, let me know and I'll show you a much simpler way to do that.

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

5. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Hello, Derek thank you for taking time to help. And thank you Chris.

Derek, to answer your question..

A button+image sits on desktop.Img1.

When mouse moves over img1 out comes the other 4 buttons with images on them..

When I click img2 I get an application launched 3 times.Once is enough.

Then the buttons "disappear" and only original button is left.

So, a button. Hover the button. Out moves a "strip" with the other 4 buttons.

When a button is clicked , application is launched. "Strip" moves back to single button on desktop.

I hope I have made it clear.

It is the 3 executions that come ... that is the trouble.

But if you have a simpler way to do it then O.K. .. Great.

Thank you Derek..

Cheers..

Selgor..

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

6. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Selgor said...

When I click img2...

The click event is w32HClick, not w32HMouse.

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

7. Re: Similar or Same problem -- Derek please help !-- Click icon and executes 3 times the program -- It is a real mess as you w

Hello CoJaBo.

I have w32HClick for the Click.

The w32HMouse is for the mouse hover event..

Well, I think so ??..

Thanks for the help.

Cheers..

Selgor..

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

Search



Quick Links

User menu

Not signed in.

Misc Menu