But I have a
"+ $exception {System.NullReferenceException} System.Exception {System.NullReferenceException}
when I move to another window by doing something like
Glide.MainWindow = WinSetup;
But this happens only if I have a Textbox control.
I am not sure if I have to do something to gracefully exit the window
In my example, the XML file, the control is called mytText bit I used MyText and the name is case sensitive.
I would single step into the function that creates the Window and check each control is not null as you called GetChildByName. This is the best way to find this type of error.
I use the designer.
The text box comes up ok and I am able to enter a value in it.
The error comes only when I am done and switch to a different window.
As Andre says, learn about debugging and setting breakpoints in your. Click on the left margin of the editor window and a red dot will appear. When you run this in debug mode, VS will stop on this line and you can hover over variables to read their values.
If you have never done this type of debugging before, do a search for it and find a few YouTube video’s. It will be your life saver in tracking down bugs like this.
Andre’s idea is a good one as you can then step through the Glide code when you setup the window. I did this recently to find a fault with the datagrid.
Can you show the XML for your WinGraph window? I suspect there is an error in that.
–
Error 1 The type or namespace name ‘Glide’ does not exist in the namespace ‘GHI’ (are you missing an assembly reference?) C:\RemoteDrive\Dropbox\Mic-Share\Software\FirmwareSourceCode\Mainboard\G120-1\TouchLogger-1\TouchLogger\MicGlide.cs 1 11 Logger
I have removed the current Gide DLL and have the Glide source as another project in the same solution.
I am not sure how to add this as a Project reference
The textbox will raise an exception and terminate invalidate() in the middle of the redraw
if you assign a null value to it.
I was doing it to clear the textbox. Now I am assigning empty string “”
I found this was a big issue with the G120 based Cobra 2 and the TE35 display and I gave up on it and working on a new version with my 5" and cap touch. The standard resistive with the built in ADC for touch is just not reliable enough for me.
Since using the 5" I have had no issues with getting reliable 100% touch.
Now I am really worried.
I was thinking to pull this into a product and even 3D printed the front panel.
Now sure if there are 4.3" cap sense touch screens to replace the current one.
Can you send me a link to the 5 inch cap touch display you are using
I was debugging this further and see that the touch point are 3% less in the x axis and 10% less in the y axis.
So after calibration I did this adjustment in Glide code before the points are used. Now it looks reasonable. But not sure if it is the right thing to do.
–GlideTouch.cs-
Can GHI look into why that is the case. I could not debug this further because the lowest level calibration routines are in binary
public bool OnEvent(BaseEvent baseEvent)
{
....
else if (e.EventMessage == 2)
{
if (!MicLCDCal)
{
int eX = e.Touches[0].X;
int eY = e.Touches[0].Y;
e.Touches[0].X = (eX * 103) / 100;
e.Touches[0].Y = (eY * 110) / 100;
}
wasMoveEvent = false;
RaiseTouchUpEvent(this, new TouchEventArgs(e.Touches));
}
}
....
return true;
}
}