It sounds a lot easier if an enhancement were made to Amibroker to allow a Windows button to be placed directly onto a chart and then an AFL function tied to it so that when you press the button the function gets called.
--- In [email protected], "Edward Pottasch" <[EMAIL PROTECTED]> wrote: > > hi, > > I am making some test code to get a button into my RT chart window that when pressed can do something. The code draws a rectangle on top of the normal Plot. I want to click the left mouse button in order to execute for instance a sell order. > > GetCursorMouseButtons() I understand. But I also need to define that the X and Y mouse position need to be within the rectangle. > > GetCursonXPosition() and GetCursorYPosition give the position in datetime and $-value format. I want to get it in pixel format. Is this possible? Or is there another way to do it? > > rgds, Ed > > > // set overlay mode: mode = 0 (default) - overlay low-level graphic on top of charts, > // mode = 1 - overlay charts on top of low-level graphic, > // mode =2 - draw only low-level graphic (no regular charts/grid/titles/etc)) > GfxSetOverlayMode( 0 ); > > // get screen height + width > sh = Status ( "pxheight" ); > sw = Status ( "pxwidth" ); > > // draw rectangle > GfxRectangle( sw / 20, sh / 20, 3 * (sw / 20), 2 * (sh / 20) ); > > if( GetCursorMouseButtons() & 1 AND xcursorPos> x1 and xcursorPos < x2 and ycursorPos < x1 and ycursorPos > y2 ) > { > > printf("left mouse button is pressed down" ); > > } > > > > ----- Original Message ----- > From: Tomasz Janeczko > To: [email protected] > Sent: Saturday, June 02, 2007 12:20 PM > Subject: Re: [amibroker] Gfx User Interaction > > > You can execute on-click actions because then the formula is actually executed. > But it is NOT executed on mouse move (hovering over chart). > > Best regards, > Tomasz Janeczko > amibroker.com > ----- Original Message ----- > From: "conrad_faber" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Saturday, June 02, 2007 12:01 PM > Subject: [amibroker] Gfx User Interaction > > > Hi > > > > Does anyone know whether the user can interact with Gfx? > > I am referring to something like: > > > > If (Cursorposition within Rectangle) > > { > > Highlight Rectangle; > > On Mouseclick do Bla-bla; > > } > > > > > > Thanks > > Conrad > > > > > > > > Please note that this group is for discussion between users only. > > > > To get support from AmiBroker please send an e-mail directly to > > SUPPORT {at} amibroker.com > > > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > > http://www.amibroker.com/devlog/ > > > > For other support material please check also: > > http://www.amibroker.com/support.html > > > > Yahoo! Groups Links > > > > > > > > > > >
