• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NumericTextBox Not Accepting Input

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

    NumericTextBox Not Accepting Input

    Hi again.

    Attached an addon that adds a numeric text box to the chart trader. Problem is that I can't type anything in the box.

    Also how would I go about removing the small 'Qty Pad' in the quantity up down control? I've tried setting the style to null but it doesn't work for this control.

    I like that it has built in mouse wheel support so I don't have to manage the events myself, and also the up and down buttons are useful, but when adding it to a chart trader the Qty Pad is taking up too much space in my layout.

    Thanks
    Attached Files

    #2
    Hello anon84,

    The script provided is not a working script. This doesn't do anything but declare a few variable types.

    Below are links to examples of modifying WPF elements Keep in mind, support for custom code like this is undocumented and outside of the realm of what is supported by N\injaTrader Support.
    http://ninjatrader.com/support/forum...327#post499327
    https://ninjatrader.com/support/foru...756#post831756
    http://ninjatrader.com/support/forum/showthread.php?p=515555#post515555
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      It does work. It's an addon.

      Comment


        #4
        Hello anon84,

        My mistake, I missed the TestBox = new NumericTextBox(); line.

        I'm uncertain about this WPF object type. Is the Instrument Overlay Selector appearing when you are typing in this?


        This thread will remain open for any community members that would like to assist with this custom C# code.

        You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.

        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          For anyone interested, I figured out how to remove the Quantity Pad.

          By default the QtyPad button is at child index 3, so you can remove it like this:

          Code:
          ((QtyUpDn.Content as Border).Child as Grid).Children.RemoveAt(3);
          Fine for personal use, but if another script has modified the control then the index may be wrong.
          Safer method:

          Code:
          Grid grid = (QtyUpDn.Content as Border).Child as Grid;
          foreach(FrameworkElement fe in grid.Children)
          {
              if(fe.ToolTip == NinjaTrader.Gui.Resource.GuiQtyPad){ grid.Children.Remove(fe); break; }
          }
          Seemingly the only way to be sure that the item is the QtyPad button is to check the tooltip text.
          That text changes depending on the user's language settings though, so you have to compare via
          NinjaTrader.Gui.Resource.GuiQtyPad which returns the localized string equivalent of "Qty Pad".

          Comment


            #6
            Hi

            No, when typing simply nothing happens. The input gets eaten by something.

            This control works in the AddonFramework example, so I am not sure what is happening when it's added to ChartTrader.

            * Also NumericTextBox appears to be an NT custom control in the namespace NinjaTrader.Gui.Tools - NumericTextBox
            So I thought you'd have an idea of what was going on.

            ** I tested adding an official WPF TextBox and in that case typing does indeed get eaten by the instrument overlay selector.
            Maybe that will help you diagnose the issue with your NumericTextBox variant.
            Last edited by anon84; 05-13-2019, 11:31 AM.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by GTBrooks, Today, 02:44 PM
            0 responses
            1 view
            0 likes
            Last Post GTBrooks  
            Started by GLFX005, Today, 12:22 PM
            2 responses
            35 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by AspenHiker, Today, 08:37 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_Kate  
            Started by MartinT, Yesterday, 01:12 PM
            3 responses
            15 views
            0 likes
            Last Post MartinT
            by MartinT
             
            Started by caveat_lector, Today, 11:58 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Heath  
            Working...
            X