Sorry, transparency and Windows again an issue?

I am not surprised they removed mobile. It was such a dismal failure, they probably want to put that behind.

Microsoft has had an ARM version of Windows 10 since 2015.

https://docs.microsoft.com/en-us/windows/arm/

But the not so good success of ARM Surface tablets, and the fact that Windows for ARM is only available for OEM to preinstall on their hardware, does not seem to indicate Microsoft is going the same route as Apple.

I’ve not done anything with transparency (other than set the canvas on the Mac IDE to be transparent). I suggested you try the canvas MouseDrag and DropObject events. Have you looked at these? You’ll need code like this in the MouseDrag event:

Var d As DragItem, pict as Picture

if  (app.buttonbarMoving=True)  Then
  
  pict = new Picture (Me.Width, Me.Height)
  paintButton (pict.Graphics, &cFFFFFF)
  
  d = New DragItem (Self, X, Y, Me.Width, Me.Height)
  d.DragPicture = pict
  d.RawData("iLr0") = me.position.ToString
  d.Drag ()

end if

to start the drag. What happens is that when the drag starts, you create an image of the object being dragged using the same code you used to paint the actual button. That gives you the ghost button as you see in the screenshot I posted; you are not dragging the actual button, but an image of it.

Edit: it’s in the DropObject event where I do the rearrange of the buttons. The RawData property of the DragItem is what is used to pass informationabout which button is being moved, and I’m using (in this example) a global property (buttonbarMoving) to decide whether or not the drag is allowed.

Wow, thank you Tim!

I created that evil thing and it works ! ! ! - here comes the sample project:

https://capp.systems/download/DraggableTransparentControl.xojo_binary_project.zip

Even though I do not really understand WHY this is working now. I did not take in account / did not know about that “DragItem”.

And the problem is: At least in the sample it does NOT WORK on my Mac. It simply does not do anything. I used this code to draw the button on the first screen:

Var pict as Picture
pict = new Picture (Me.Width, Me.Height)
pict.Graphics.DrawingColor = &cFF00FF00
pict.Graphics.FillRoundRectangle(0, 0, 100, 100,30,30)

Then in the MouseDrag of the canvas I used:

Var d As DragItem, pict as Picture
pict = new Picture (Me.Width, Me.Height)
pict.Graphics.DrawingColor = &cFF00FFE0
pict.Graphics.FillRoundRectangle(0, 0, Pict.Width, Pict.Height, 30, 30)
d = New DragItem (Self, X, Y, Me.Width, Me.Height)
d.DragPicture = pict
d.Drag ()

Works with Windows but not with Mac:

WorkingWindowsTransparency

Any idea?

What do you mean by “doesn’t work”? It worked for me - I dragged your bubble and it moved. What else did you expect to happen?

Ooops, this sounds VERY STRANGE now. On the Mac? I am using Catalina 10.15.7 and Xojo 2020 R2.1 … and it simply does not “grab” and drag the canvas. It does nothing in fact.

May be something else will give us the explanation for all my problems :flushed:

Yes I’m on Mojave with 2020r2.1. It drags and when I let go, slides back to where it was. Just tried in in my Win7 VM, works there too but when I let go the mouse, rather than sliding back to where it started, the ghost just vanishes.

Hmmm. The behaviour may be inconsistent - because I did not take care about. It is just a proof of concept for getting something transparent.

I will reduce the functionality to a minimum and send this prepared sample to Xojo then. I presume it may be a bug. I will test on my Big Sur Mac before. Thanks again for your very valuable help, without you I would really in doubt if I would ever get it right. Now I see that someting in the background is the problem - which can be cleaned up. Hopefully.

Thanks again!
Michael

Are you expecting something to happen when you drop the object?

No

Just to keep everybody up to date. Xojo:

This issue has been reproduced based on the information provided.

Windows - Transparency is not rounded (the corners are square)
Linux - Transparent control cannot be dragged outside the parent window (on Windows it can)
macOS - does not work at all (at least the transparency is not visible; either Light or Dark mode)

I hope they will fix that before I have to deliver my product ! :crazy_face:

Reproduced does not mean it’s a bug. It means that the tester was able to reproduce the thing you are reporting using the files or explanation you provided. It is still possible that an engineer will look at it and say that it’s not a bug.

Agreed. Good that someone at least had a look at this issue.

Finally this is a kind of showstopper for any designed UI/UX. Not to mention that any beginner will tick the “transparency” flag in the IDE and will never get a consistent result.

My hope dies last.

1 Like

If you want to drop one object on another, the target object has to signal it will accept the drop by calling one of the AcceptDrop methods

https://documentation.xojo.com/topics/user_interface/desktop/supporting_drag_and_drop.html

(I use AcceptRawDataDrop). The target object also has to process the drop: I use the DropObject event for this.

The item being dragged must use the Mouse Drag event to create the dragPicture and all that as you saw before, so that the system knows which item is being dragged and will animate it.

HTH.

so you dont know what windows mobile. It was a big success used by many of the largest tech companies to implement what it was the “internet of things” 20 years ago along with many, many custom handheld solutions.

The hardware architecture was the one that got old and windows Windows Mobile was discontinued mainly for that reason, but if you could get the devices, Microsoft supported and sold the las version for some years. :thinking:

I don’t discuss technological features, but market share.

The market decides what will go away, and what will replace it. Windows Mobile may have had some success in some circles, it never reached the vast majority of users. Now Windows Mobile is just an appendix in computing history, just the same as Blackberry.

Reality is, today, the market is in iOS and Android. It is no mistake Windows 11 runs android apps.

1 Like

That makes the point, you dont know what Windows Mobile is and just talking about other product: Windows Phone. It is like it’s like saying that VB6 is the same as VB NET

As for the solution to this without redoing all in a single canvas :

Is what Xojo can do. Lets accept that Xojo CAN’T do transparency on windows and move on to the workarounds:

  1. Move your border to the edge of the container to remove the wasted space on the top, bottom and sides

  2. The space beetween buttons should be made by actual space of the controls.

  3. Add conditional code to draw rectangle buttons in windows so you dont use transparency:

#If TargetWindows 
  Me.Transparent = False
  TheButtonObject.CornerHeight = 0
  TheButtonObject.CornerWidth  = 0
#Else
  Me.DoubleBuffer = False
  TheButtonObject.CornerHeight = App.s_CornerRadius
  TheButtonObject.CornerWidth  = App.s_CornerRadius
#EndIf

While I maintain that Windows phone was a dismal failure, I was indeed confusing mobile phone and windows mobile. Please enlighten the poor ignorant, then. A link would be great.