Alaska Software Inc. - XbpMenu() position
Username: Password:
AuthorTopic: XbpMenu() position
Carlos a Beling XbpMenu() position
on Tue, 11 Jan 2011 10:10:53 -0200
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hello:<br>
    good morning.<br>
    <br>
    As I had not answer about the post below that I posted in the NG Bug
    Report, I think that it may be really some thing that might be send
    to you.<br>
    If it is not the case I apologize;<br>
    <br>
    <br>
    &lt;the first one post&gt;<br>
    Em 8/1/2011 13:14, Carlos a Beling escreveu:<br>
    <br>
    <tt>Good afternoon.<br>
    </tt><span class="Apple-style-span" style="border-collapse:
      separate; color: rgb(0, 0, 0); font-family: 'Times New Roman';
      font-style: normal; font-variant: normal; font-weight: normal;
      letter-spacing: normal; line-height: normal; orphans: 2;
      text-indent: 0px; text-transform: none; white-space: normal;
      widows: 2; word-spacing: 0px; font-size: medium;"><span
        class="Apple-style-span" style="font-family: arial,sans-serif;
        font-size: 16px;"><tt><span title="Eu usei o programa
            OwnerDraw.prg e criei uma nova classe."
            style="background-color: rgb(255, 255, 255);">I used the
            program OwnerDraw.prg and created a new one class.<span
              class="Apple-converted-space"> <br>
              I need to know a position of the menu item that is
              highlighted for to show a tip below it.<br>
            </span></span><span title="Estou tendo um problema porque
            seu m&eacute;todo :currentPos()est&aacute; retornando :currentpos()[02]"
            style="background-color: rgb(255, 255, 255);">The problem is
            that the method oXbpMenu:currentPos() is returning strange
            value in oXbpMenu:currentpos()[02]<span
              class="Apple-converted-space"></span></span><span
            title="inv&aacute;lida." style="background-color: rgb(255, 255,
            255);">.<span class="Apple-converted-space">&nbsp;</span><br>
          </span></tt><span title="Exibi a posi&ccedil;&atilde;o atrav&eacute;s dos comandos
          abaixo colocados em :drawItem()" style="background-color:
          rgb(255, 255, 255);"><tt>So, I displayed the positions in the
            oXbpMenu:setParent() in the method oXbpMenu:drawItem()<span
              class="Apple-converted-space"> </span>and I got the
            positions as follow:</tt><br>
          <br>
        </span><span title="cls" style="background-color: rgb(255, 255,
          255);">cls<span class="Apple-converted-space"> <br>
            <tt>QOut('Mouse Position&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ',
              GetPointerPos())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; {160, 153} </tt><br>
          </span></span><tt><span title="QOut('Setparent() ',
            ::setParent()) ==&gt; XbpCrt" style="background-color:
            rgb(255, 255, 255);">QOut('SetParent()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ',
            ::SetParent ())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; XbpCrt<span
              class="Apple-converted-space">&nbsp;</span><br>
          </span><span title="QOut('Setparent():currentpos()',
            ::setParent():currentPos()) ==&gt; {152, 106}"
            style="background-color: rgb(255, 255, 255);">QOut('SetParent():currentpos()',


            ::SetParent():currentPos ()) ==&gt; {152, 106}<span
              class="Apple-converted-space">&nbsp;</span><br>
          </span><span title="QOut('oXbpMenu:CurrentPos() ',
            ::currentPos()) ==&gt; {1, -345}" style="background-color:
            rgb(255, 255, 255);">QOut('oXbpMenu:CurrentPos()&nbsp;&nbsp; ',
            ::currentPos())&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; {1, -345}
            &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;<span
              class="Apple-converted-space"> </span><br>
          </span></tt></span></span><span class="Apple-style-span"
      style="border-collapse: separate; color: rgb(0, 0, 0);
      font-family: 'Times New Roman'; font-style: normal; font-variant:
      normal; font-weight: normal; letter-spacing: normal; line-height:
      normal; orphans: 2; text-indent: 0px; text-transform: none;
      white-space: normal; widows: 2; word-spacing: 0px; font-size:
      medium;"><span class="Apple-style-span" style="font-family:
        arial,sans-serif; font-size: 16px;"><span title="QOut('Bound
          rect ', aInfo[4]) ==&gt; { 0, 1, 200, 24}"
          style="background-color: rgb(255, 255, 255);"><tt>QOut('Bound
            rect &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; ', aInfo[4])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; {0,
            1, 200, 24}</tt></span></span></span><br>
    <span class="Apple-style-span" style="border-collapse: separate;
      color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style:
      normal; font-variant: normal; font-weight: normal; letter-spacing:
      normal; line-height: normal; orphans: 2; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; font-size: medium;"><span
        class="Apple-style-span" style="font-family: arial,sans-serif;
        font-size: 16px;"><tt><span title="QOut('oXbpMenu:CurrentPos()
            ', ::currentPos()) ==&gt; {1, -345}"
            style="background-color: rgb(255, 255, 255);"></span><span
            title="QOut('Item number ', aInfo[1]) ==&gt; 18"
            style="background-color: rgb(255, 255, 255);">QOut('Item
            number&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ', aInfo[1])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; 18<span
              class="Apple-converted-space">&nbsp;</span><br>
          </span><span title="QOut('Action ', aInfo[2]) ==&gt; 1"
            style="background-color: rgb(255, 255, 255);">QOut('Action&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


            ', aInfo[2])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; 1<span
              class="Apple-converted-space">&nbsp;</span><br>
          </span><span title="QOut('State ', aInfo[3]) ==&gt; 256"
            style="background-color: rgb(255, 255, 255);">QOut('State&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;


            ', aInfo[3])&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ==&gt; 256<span
              class="Apple-converted-space">&nbsp;</span><br>
          </span></tt><span title="QOut('Bound rect ', aInfo[4]) ==&gt;
          { 0, 1, 200, 24}" style="background-color: rgb(255, 255,
          255);"><tt><span class="Apple-converted-space"></span></tt><br>
        </span><span title="&Eacute; algum erro j&aacute; conhecido, ou est&aacute; correto?"
          style="background-color: rgb(255, 255, 255);">It is a bug&nbsp;
          already known, or I made some mistake?</span></span></span><br>
    <br>
    Beling<br>
    TIA<br>
    &lt;/the first one post&gt;<br>
    <br>
    &lt;/the second post&gt;<br>
    Good morning:<br>
    trying to have the position of oXbpMenu() in the appdesktop() I used
    the function below:<br>
    <br>
    FUNCTION ApiGetXbpPosition_(oXbp)<br>
    &nbsp;//&nbsp;&nbsp;&nbsp;&nbsp; Return the position of &lt;oXbp&gt; in AppDeskTop(), in the
    format<br>
    &nbsp;//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {nBottomX, nBottomY}<br>
    STATIC&nbsp; cCall<br>
    LOCAL&nbsp; cBinPos, nY, nDll<br>
    <br>
    if cCall == NIL<br>
    &nbsp;&nbsp; nDll := ApiLoadDll_('User32.dll')<br>
    &nbsp;&nbsp; cCall := DllPrepareCall(ndll, DLL_STDCALL, 'ClientToScreen')<br>
    endif<br>
    <br>
    cBinPos := Replicate(Chr(0), 8)<br>
    nY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; := ((AppDesktop():currentSize()[2] - 1) -
    oXbp:currentSize()[2])<br>
    DllExecuteCall(cCall, oXbp:getHWND(), @cBinPos)<br>
    RETURN {Bin2U(Left(cBinPos,4)), (nY - Bin2U(Right(cBinPos,4)))}<br>
    <br>
    The problem is that it always return {0, 515} indenpending on the
    oXbpMenu() position.<br>
    Please, what is wrong?<br>
    <br>
    Beling <br>
    HTH<br>
    <br>
    <br>
    &lt;/the second post&gt;<br>
  </body>
</html>
AUGE_OHRRe: XbpMenu() position
on Tue, 11 Jan 2011 23:56:49 +0100
hi,

>As I had not answer about the post below that I posted in the NG Bug 
>Report,
> I think that it may be really some thing that might be send to you.
>If it is not the case I apologize;

i did have ask you if you use SetMouse() with :mouseMode := 
XBPCRT_MOUSEMODE_PM
all your Coordinate seem me to be XBPCRT_MOUSEMODE_VIO.

about Tooltip : i never have see it in a Menu

greetings by OHR
Jimmy
Carlos a Beling Re: XbpMenu() position
on Wed, 12 Jan 2011 15:51:42 -0200
Hello Jimmy:
good afternoon.
Many thanks.
Excuse me if I did not answer your question about the mouse.
I use ::oCrt:mouseMode    := XBPCRT_MOUSEMODE_VIO
Please see the attached image for seeing what I meant about tooltip.

Beling
Best regards

Em 11/1/2011 20:56, AUGE_OHR escreveu:
> hi,
>
>> As I had not answer about the post below that I posted in the NG Bug
>> Report,
>> I think that it may be really some thing that might be send to you.
>> If it is not the case I apologize;
> i did have ask you if you use SetMouse() with :mouseMode :=
> XBPCRT_MOUSEMODE_PM
> all your Coordinate seem me to be XBPCRT_MOUSEMODE_VIO.
>
> about Tooltip : i never have see it in a Menu
>
> greetings by OHR
> Jimmy
>
>


Tip.gif
Andreas HerdtRe: XbpMenu() position
on Thu, 13 Jan 2011 15:29:35 +0100
Hi,

I can reproduced the behaviour described in <the first post> when the fading
effect is enabled for menus. After I have disabled the fading :currentPos()
returns valid values.

Well, :currentPos() returns valid values when fading is enabled, too. When
fading is enabled the menu is drawn offscreen initialy and then faded into
the desired area.

Hope this helps.

   Andreas Herdt
   Alaska Software

--------------------------------------------------------------------

Technical Support:      support@alaska-software.com

News Server:            news.alaska-software.com
Homepage:               http://www.alaska-software.com
WebKnowledgeBase:       http://www.alaska-software.com/kbase.shtm

Fax European Office:    +49 (0) 61 96 - 77 99 99 23
Fax US Office:          +1 (646) 218 1281
--------------------------------------------------------------------

Am 11.01.2011 13:10, schrieb Carlos a Beling:
> Hello:
> good morning.
>
> As I had not answer about the post below that I posted in the NG Bug Report, I
> think that it may be really some thing that might be send to you.
> If it is not the case I apologize;
>
>
> <the first one post>
> Em 8/1/2011 13:14, Carlos a Beling escreveu:
>
> Good afternoon.
> I used the program OwnerDraw.prg and created a new one class.
> I need to know a position of the menu item that is highlighted for to show a tip
> below it.
> The problem is that the method oXbpMenu:currentPos() is returning strange value
> in oXbpMenu:currentpos()[02].
> So, I displayed the positions in the oXbpMenu:setParent() in the method
> oXbpMenu:drawItem()and I got the positions as follow:
>
> cls
> QOut('Mouse Position ', GetPointerPos()) ==> {160, 153}
> QOut('SetParent() ', ::SetParent ()) ==> XbpCrt
> QOut('SetParent():currentpos()', ::SetParent():currentPos ()) ==> {152, 106}
> QOut('oXbpMenu:CurrentPos() ', ::currentPos()) ==> {1, -345} <<<<<<<<<
> QOut('Bound rect ', aInfo[4]) ==> {0, 1, 200, 24}
> QOut('Item number ', aInfo[1]) ==> 18
> QOut('Action ', aInfo[2]) ==> 1
> QOut('State ', aInfo[3]) ==> 256
>
> It is a bug already known, or I made some mistake?
>
> Beling
> TIA
> </the first one post>
>
> </the second post>
> Good morning:
> trying to have the position of oXbpMenu() in the appdesktop() I used the
> function below:
>
> FUNCTION ApiGetXbpPosition_(oXbp)
> // Return the position of <oXbp> in AppDeskTop(), in the format
> // {nBottomX, nBottomY}
> STATIC cCall
> LOCAL cBinPos, nY, nDll
>
> if cCall == NIL
> nDll := ApiLoadDll_('User32.dll')
> cCall := DllPrepareCall(ndll, DLL_STDCALL, 'ClientToScreen')
> endif
>
> cBinPos := Replicate(Chr(0), 8)
> nY := ((AppDesktop():currentSize()[2] - 1) - oXbp:currentSize()[2])
> DllExecuteCall(cCall, oXbp:getHWND(), @cBinPos)
> RETURN {Bin2U(Left(cBinPos,4)), (nY - Bin2U(Right(cBinPos,4)))}
>
> The problem is that it always return {0, 515} indenpending on the oXbpMenu()
> position.
> Please, what is wrong?
>
> Beling
> HTH
>
>
> </the second post>
Thomas Braun
Re: XbpMenu() position
on Thu, 13 Jan 2011 17:36:05 +0100
Andreas Herdt wrote:

> Well, :currentPos() returns valid values when fading is enabled, too.

valid != useful 

SCNR

Thomas
Carlos a Beling Re: XbpMenu() position
on Mon, 17 Jan 2011 14:53:39 -0200
Hello Andreas:
good evening.
Many thanks.
I´d like to know how do I get the relative position in relatiion to the 
AppDesktop() showing a tip (please see the attach in my answer in this 
NG  to OHR in  12.11.2011, 15:31) or something else.

Beling
Greetings

Em 13/1/2011 12:29, Andreas Herdt escreveu:
> Hi,
>
> I can reproduced the behaviour described in <the first post> when the 
> fading
> effect is enabled for menus. After I have disabled the fading 
> :currentPos()
> returns valid values.
>
> Well, :currentPos() returns valid values when fading is enabled, too. 
> When
> fading is enabled the menu is drawn offscreen initialy and then faded 
> into
> the desired area.
>
> Hope this helps.
>