Popovers (my solution)

  1. ‹ Older
  2. 6 years ago

    Bill G

    17 Dec 2013 Pre-Release Testers

    Perhaps I'm not thinking of the word border in the same way, but I don't have a border when I run it on my Mac, nor do I want one. Can you post a screenshot? I have a feeling I'm about to feel dumb. LOL

  3. Massimo V

    17 Dec 2013 Pre-Release Testers, Xojo Pro Europe (Germany, Würzburg)

    You can see two things here:

    • The Mac version has a thin nice border all around the popover shape, while the Windows one has no border and thus it’s confused with the main window.
    • The region cut for Windows doesn’t match with the picture.

    -image-
    -image-

  4. Bill G

    17 Dec 2013 Pre-Release Testers
    Edited 6 years ago

    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!

  5. Massimo V

    17 Dec 2013 Pre-Release Testers, Xojo Pro Europe (Germany, Würzburg)

    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%.
    -image-

    - 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.
    -image-

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

  6. Bill G

    17 Dec 2013 Pre-Release Testers

    Awesome explanation - thank you again!

  7. 5 years ago

    Markus W

    20 Oct 2014 Pre-Release Testers #JeSuisHuman New Zealand, Auc...

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

  8. Bill G

    20 Oct 2014 Pre-Release Testers

    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.

  9. 4 years ago

    Markus W

    19 Jul 2015 Pre-Release Testers #JeSuisHuman New Zealand, Auc...

    Hi Bill, any progress?

  10. 3 years ago

    Axel S

    is not verified 22 Feb 2016 Europe (Germany, Erfurt)

    here a Version for Linux

    -image-

  11. 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:

      const kScale = 6 // or 4
      dim arcSize as integer = kArcSize*kScale
      dim polySize as integer = kPolySize*kScale
      
      dim p as new Picture(self.Width*kScale,self.Height*kScale)
      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)
  12. Axel S

    is not verified 9 Dec 2016 Europe (Germany, Erfurt)

    Simply draw in the window works well.

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

    -image-

  13. 2 years ago

    Markus W

    14 Jan 2017 Pre-Release Testers #JeSuisHuman New Zealand, Auc...

    @Axel S Simply draw in the window works well.

    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)

  14. Stephen D

    3 Feb 2017 Pre-Release Testers, Xojo Pro

    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.

  15. Emile S

    3 Feb 2017 Europe (France, Strasbourg)
    Edited 2 years ago

    Right now, this conversation was read by 6775 persons. What a success.

    Xojo, when will we get Popovers to include them in our own Xojo created applications ?

  16. last year

    Aurelian N

    29 Mar 2018 Pre-Release Testers, Xojo Pro

    Hello guys,

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

    thanks

  17. Albin K

    29 Mar 2018 Europe (Sweden)
    Edited last year

    @Aurelian N Hello guys,

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

    thanks

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

  18. Anthony C

    29 Mar 2018 Pre-Release Testers, Xojo Pro GraffitiSuite Developer

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

  19. Brock N

    29 Mar 2018 Pre-Release Testers, Xojo Pro

    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

  20. Julia T

    29 Mar 2018 Sandy Hook, Connecticut

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

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

  21. 2 weeks ago

    Stephen D

    Jul 4 Pre-Release Testers, Xojo Pro

    @Bill G Let me know how it works for you...

    Hey @Bill G! 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. :)

or Sign Up to reply!