Popovers (my solution)

Ah, I see what you mean about the border, and it would indeed be nice to add that (and the shadow) to the Windows version. I’ll take a look. Although the newest version of the code should be making the popover darker than the main window (based on FillColor) so I’m not sure why it’s showing up as the same color. Time to drag out an old XP machine and take a look.

I’m not sure what “The region cut for Windows doesn’t match with the picture.” Does that mean when you took the screenshot it thought it was only taking a picture of the window, and grabbed all the space around it as well because a “normal” window would have stuff there?

Also, thank you for your help!

I’m using the standard background, that’s why you see it differently, it’s not XP.

Here it’s a closeup of the corner on Windows.
I believe here there are 2 problems:

  • The FigureShape seems to ignore the border property for the AddQuad method. Indeed this method is a convenience method which draws a CurveShape, and, stating the Language Reference, the CurveShape default for border is 100.
    Here it’s what happen setting fs.Border = 100 in setWindowShape. You see the border is drawn ad 50% opacity and the corner is still at 100%.

  • Second problem, I suspect the CreateRoundRectRgn declare, makes a round rectangle with different shape, so the border doesn’t match with the clipped region. But it could be the clip is not well positioned. See the following closeup.

Also, the clip region may be too small, since the border is not visible on right-bottom part. See below:

Awesome explanation - thank you again!

When you double-click on the window then the window disappears and only the popover is visible …

Weird, I have to double click “just right” (it doesn’t always happen), but you’re right. I’ll have to look and see how to fix that. The window actually doesn’t completely disappear, it just gets moved to the back, but the effect is the same for the user.

Hi Bill, any progress?

here a Version for Linux

1 Like

Looks good.
If you scale the figureshape up to 4x and then back to the original size you nice rounded corners/smooth egdges.
That way I render my popover shapes:

[code]
const kScale = 6 // or 4
dim arcSize as integer = kArcSizekScale
dim polySize as integer = kPolySize
kScale

dim p as new Picture(self.WidthkScale,self.HeightkScale)
dim g as Graphics = p.Graphics

f = new FigureShape
// left top
f.AddQuad(0,arcSize,arcSize,0,0,0)
// right top
f.AddQuad(g.Width-arcSize,0,g.Width,arcSize,g.Width,0)
// right bottom
f.AddQuad(g.Width,g.Height-polySize-arcSize,g.Width-arcSize,g.Height-polySize,g.Width,g.Height-polySize)
// middle bottom curve
f.AddQuad((g.Width/2)+polySize+(polySize/4),g.Height-polySize,(g.Width/2),g.Height, (g.Width/2)+polySize-(polySize/4),g.Height-polySize)
f.AddQuad((g.Width/2),g.Height,(g.Width/2)-polySize-(polySize/4),g.Height-polySize, (g.Width/2)-polySize+(polySize/4),g.Height-polySize)
// left bottom
f.AddQuad(arcSize,g.Height-polySize,0,g.Height-polySize-arcSize,0,g.Height-polySize)

g.DrawObject f,0,0
return p.scalePicture(self.Width,self.Height)[/code]

Simply draw in the window works well.

https://www.dropbox.com/s/b8wfot4vfhxo6kj/DrawPopup2.zip?dl=1

Not really.

Have a TextArea above the label, click in the TextArea, click on the label, type some text (the TextArea will still have the focus)

I think the trick would be to have any popup close if another control gained focus or had a keydown event.

Hello guys,

Any chance that we can have something like this but for web version ?

thanks

[quote=380074:@Aurelian Negrea]Hello guys,

Any chance that we can have something like this but for web version ?

thanks[/quote]
I saw an announcement about something for WE not long ago :slight_smile:
https://forum.xojo.com/46695-gtooltip-flexible-styled-and-customized-tooltips-helptags

There’s also GraffitiWebTooltip available at https://graffitisuite.com/

The jquery library I made uses their tooltips and is pretty easy to use:

https://forum.xojo.com/19039-jqueryui-library-drag-drop-animations-custom-menus

There’s also gToolTip, but it’s web-only.

https://www.gate61.com/gtooltip.html

[quote=52728:@Bill Gookin]
Let me know how it works for you…[/quote]

Hey @Bill Gookin! Thanks for this class you made so many years ago. Looks like I’m going to implement it unless you’ve improved upon it in the meantime. :slight_smile:

Nice popOver class. The only problem I see now is when using with a HI-DPI app on Windows. The popUp shown at a quarter size. Any suggestions?

Weird, it shows up okay on Mac but not on Windows. I’ll have to take a look at this…it’s been a loooong time since I’ve touched it. :slight_smile:

1 Like

I think it has to do with GDI32 library. Maybe using OpenGL fix it.
The easy way is to change high DPI settings under compatibility tab on the exe file to use “System (Enhanced)” option