Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Override mouse handler completely

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

    Override mouse handler completely

    Similar issue to handling I had before, by default if you double click the indicator what ever it is, it opens up the indicator window, I subscribed to even mousebutton event and mouse event and tried to shut this off with e.handled but I just need to know which handler corresponds to opening the foresaken indicator window when you click on an indicator.
    thanks in advance

    #2
    What I would suggest is in OnRender, you do as the first thing: if (IsInHitTest) return; then after that base.OnRender(chartControl, chartScale); and whatever else.

    The hit test is how it determins whether when you click on something you're clicking on that, and if you cut it short by returning out of OnRender when it's in the hit test, it will no longer be possible to select or click on the indicator's plots.

    This isn't really what you asked - you're not overriding the mouse handler - but I don't think you really want to do that - it sounds like you just want to stop it from opening the dialog.
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      thanks for the input,
      i think i need to override it complete, because i need to continue rendering, and coagulate user clicks, but the user should be able to click on the indicator twice without opening it

      Comment


        #4
        LMAO im just gonna send the ESC key after each click.
        I am NOT having it

        Comment


          #5
          Alright i got it working only when needed check it out bruce

          var MAIN_WINDOW = System.Windows.Window.GetWindow (ChartControl); // Assuming ChartControl is a reference to the chart panel or control

          if (MAIN_WINDOW != null)
          {
          MAIN_WINDOW.InputBindings.Add (new KeyBinding (ApplicationCommands.Close, new KeyGesture (Key.Escape)));

          try
          {
          MAIN_WINDOW.CommandBindings[0].Command.Execute (null);
          }
          catch (Exception ex)
          {
          // Handle any exceptions
          Console.WriteLine (ex.Message);
          }

          MAIN_WINDOW.InputBindings.Clear ();
          }

          Comment


            #6
            Click the MFING indicator to your hearts desires

            Comment


              #7
              Im not gonna lie either that is in hit test was PEEVING me off, because if you render some kind of background in on render then you cant drag chart, but that's not a problem anymore either so
              #thankful

              Comment


                #8
                Well, if you just return when IsInHitTest you can continue to render whatever you want. All that does is stop it from being clickable. I do this all the time, when, for instance, I want to render a background area but I don't want it to be clickable.
                Bruce DeVault
                QuantKey Trading Vendor Services
                NinjaTrader Ecosystem Vendor - QuantKey

                Comment


                  #9
                  I don't know about sending ESC key gestures all over the place - that seems like a bad idea intuitively but I guess if it works. You'll have to see if there's fallout from this and let us know how it goes.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  646 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  367 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  107 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  569 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  573 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X