Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Add mouse-over and click functionality? Handling windows events in indicator?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by koganam View Post
    Wait a minute. If you are using the c# draw methods to draw your object, then you have the graphics object.

    How are you drawing the object? code?
    I hadn't coded the image yet. I assume something like

    Code:
    graphics.DrawImage(...,...);
    in the Plot() would be enough, assuming I figure out where on the filesystem to load the jpg from.

    Comment


      #17
      Originally posted by adamus View Post
      I hadn't coded the image yet. I assume something like

      Code:
      graphics.DrawImage(...,...);
      in the Plot() would be enough, assuming I figure out where on the filesystem to load the jpg from.
      Treat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.

      Comment


        #18
        Originally posted by koganam View Post
        Treat those drawings like any other object. Declare and initialize them, then assign them. That way you know what the object is, and you can handle it as you please. Take a look at the CustomPlotSample.cs file to see how it is done.
        But I don't get a reference to them when I call the graphics object, and it doesnt seem that I can declare and initialize anything helpful either for the graphics calls either. At least nothing that CustomPlotSample.cs demonstrates.

        AFAIK now I need a control or a sub-class of a control, because that is the only thing I can use to attach events to, but I dont have anything except the ChartControl.

        (The same theory applies to creating tooltips which you suggested earlier, it seems)

        Correct me if I'm wrong, please, but I'm sitting on lame duck here.

        In case there is an obvious solution that I am missing, could you state it in terms of

        Code:
        graphics.FillEllipse(brush, rectangle);
        rather than graphics.DrawImage() which I have abandoned to avoid requiring a file.

        [EDIT] Now that I'm thinking a bit more clearly thanks to some well-timed caffeine, I figured it would be simple to place a control on the chart instead of drawing an image or a circle, and then I won't have any problem attaching the tooltip / label pop-up.

        The question is, would a tiny button be OK in case I have to show 100 of these things on the chart in one plot?

        (Is this still sane? It comes from about 4 hours of googling)
        Last edited by adamus; 07-24-2013, 07:57 AM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by JonesJoker, 04-22-2024, 12:23 PM
        8 responses
        41 views
        0 likes
        Last Post JonesJoker  
        Started by timko, Today, 06:45 AM
        0 responses
        3 views
        0 likes
        Last Post timko
        by timko
         
        Started by Waxavi, 04-19-2024, 02:10 AM
        2 responses
        39 views
        0 likes
        Last Post poeds
        by poeds
         
        Started by chbruno, Yesterday, 04:10 PM
        1 response
        44 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        1 response
        25 views
        0 likes
        Last Post CactusMan  
        Working...
        X