Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Position popup on a control



gosub GetXY Send_Message(@Window:".OLE_POPUP", "OLE.ShowAt", x, y) return GetXY: DialogSize = Get_Property(@window, "SIZE") Parent = Get_Property(@window, "PARENT") ParentSize = Get_Property(Parent, "SIZE") MenuSize = Get_Property(Parent[1,'.'], "SIZE") xDialog = DialogSize<1> ;* position of dialog yDialog = DialogSize<2> ;* position of dialog xParent = ParentSize<1> ;* position of parent yParent = ParentSize<2> ;* position of parent xMenu = MenuSize<1> ;* position of Menu yMenu = MenuSize<2> ;* position of Menu xDialog = xParent + xDialog + xMenu yDialog = yParent + yDialog + yMenu CtrlSize=Get_Property(CtrlEntId, "SIZE") xCtrlSize = CtrlSize<1> +CtrlSize<3> yCtrlSize = CtrlSize<2> +CtrlSize<4> xDialog+=xCtrlSize yDialog+=yCtrlSize x=xDialog y=yDialog return

Comments

  • At first blush it looks like you aren't accounting for the position of the form within the desktop itself. The ShowAt method uses the absolute X, Y position of the desktop rather than the relative position of any control or form.

    You have the latest SRP HTTP Framework. If you look at the NDW_HTTP_FRAMEWORK_SETUP_EVENTS event commuter you'll find how we handle this in the DisplayInfoHelp gosub. Pro tip: use the SRP_Get_Window_Rect service to make this a lot easier to calculate.
  • thanks Don, I will take a look
  • If you had an image, how would you calculate the size for the ole.size parameters?
    e.g.
    ToolTipHeading="Deceased Tab filled"
    ToolTip<1>=".\HelpImages\Funerals_ety-Deceased Tab.png"
  • edited October 2019
    If you had an image, how would you calculate the size for the ole.size parameters?
    e.g.
    ToolTipHeading="Deceased Tab filled"
    ToolTip<1>=".\HelpImages\Funerals_ety-Deceased Tab.png"


    I might just create a form with a large picture control on it and use that as my 'popup'
Sign In or Register to comment.