Object.OnTop not working for gadgets?

All right, so I've done everything I can think of including setting the object's z-order (in the relation tab) to always on top, and coding it to move ontop, and coding it to set focus.

It works fine in builder mode, but when it's gadgetized, bupkus.

Here's a simpler version of what I'm doing. Stick it in an object, gadgetize it and tell me if it works for you.

Code: vbscript
  1. 'Called when the script is executed
  2. Sub Object_OnScriptEnter
  3.  Object.SetTimer 1, 2000
  4. End Sub
  5. Sub Object_OnTimer1
  6.  Object.OnTop
  7. End Sub

 

It's supposed to be a small pop-up alert in the bottom corner of the screen. It wouldn't be much use if it didn't, you know, pop-up over the other windows. I'm wondering if it's just me or if it's a legitimate bug.

8,699 views 10 replies
Reply #2 Top

The .OnTop function will only put the designated object on top of the other objects. I do not believe this is at the scope of other applications, putting that object on top of other windows.

From the DX docs:
"The object pushes an object to the top of the z-order which obviously makes it more visible. The below example makes an object appear above other objects when you move the mouse over it."

Setting "always on top" in the object properties dialog should definitely have the effect you're looking for, however.
http://sd.stardock.com/mike/apps/testobject.zip


Mike

Reply #3 Top

Here's what I'm working on:

Setting the main gadget itself to always on top isn't feasable. I only need one object, the popup alert, not the main gadget, to appear on top. I've tried setting the pop up object to always on top in the relations tab but that didn't work once I exported the whole thing.

I thought for sure object.ontop used to work for windows, too. Thanks for your reply.

Reply #4 Top

What specifically happened when you tried exporting after setting the z-orders of the two layers?

I've thrown together a sample dxpack if you wanted to give it a test run:
https://www.wincustomize.com/skins.aspx?skinid=4484&libid=3

Here is the same thing exported as a gadget:
http://sd.stardock.com/mike/apps/NotificationWindow.zip

I've tested this on xp/vista/win7: there is one "overlapped window" (normal z-order), then there is an "always on top" window (on-top z-order) and both layers behave as expected.


Mike

Reply #5 Top

Milksama rocks!

Reply #6 Top

Hey, Mike. Using L-click to show the pop up object works; it shows up above other windows. I'm guessing that's because you are actually setting z-order when you click on it. However, when it's set to show up on timer, it doesn't show up over other windows.

Here's a sample gadget: LINK

Here's the object version: LINK

My popup is triggered by an event, no clicking involved. But the sample objects above are the same principle; they popup on timer.

I selected all and exported as a gadget (simple deployment). I run it, open a window to full screen and it doesn't show up on top unless I click on the gadget's icon or otherwise manually bring it to front.

I'm not sure what I'm doing wrong.

Reply #7 Top

Thanks ZubaZ :)

sViz: I see what you're talking about now and think the problem may lie in the method of deployment. It seems with custom deployment, it works as expected, but with simple deployment, it appears unable to use "always on top" z-ordering.

If it weren't for the fact that it weren't as portable, I'd just suggest to use the custom deployment. That is really the most viable workaround at the moment.

I will let the DesktopX developers know about this bug.


Mike

+1 Loading…
Reply #8 Top

Okay; that clears things up. Thanks for your time. And I do prefer simple deployment because of the portability.

Thanks again. :)

Reply #9 Top

Hey no problem, always glad to help. I'm a fan of DX, too, after all :thumbsup:

Reply #10 Top

Just thought I'd update: Widget.OnTop seems to work fine.

It brings the whole gadget to fore, instead of just my popup alert, but it's better than nothing!|-)