I am finding that the Glide Designer will place a TextBlock, TextBox, Button all in a row using the same Y coordinate. So that they all appear in a neat horizontal line
When you try and craft the same thing up using Button() TextBox(), TextBlock()
I am finding that the TextBox does NOT align, as it does not use the (TOP LEFT) reference point . But some arbitrary point elsewhere, which appear inconsistent with the Glide XML (i.e. Y=“104”),
Any thoughts on this please
all I am trying to do is create so0mething like:
Voltage [24.6 ] Vdc [SET]
TextBlock TextBox TextBlock Button
But they are not lining up horizontally, all objects have the same Height, Y properties
The problem is that the XML works fine,
but when you hand craft a Window using the .AddChild() method using the same Y coordinates
it does not work!
Also the touch sensitive areas for the input is MISALIGNED!
Josh, is it possible to chat or skype you regarding this item, your 14hrs behind my local time) So I can only catch you generally between 9-10am your time (11-midnight my time)
using System.Threading;
using GHIElectronics.NETMF.Glide;
using GHIElectronics.NETMF.Glide.Display;
using GHIElectronics.NETMF.Glide.UI;
namespace Test2
{
public class Program
{
// This will hold the windows.
static Window window;
public static void Main()
{
// Load the windows
window = GlideLoader.LoadWindow(Resources.GetString(Resources.StringResources.Window));
InitWin();
// Activate touch
GlideTouch.Initialize();
// Assigning a window to MainWindow flushes it to the screen.
// This also starts event handling on the window.
Glide.MainWindow = window;
Thread.Sleep(-1);
}
public static void InitWin()
{
Button button = new Button("button", 255, 194, 104, 80, 32);
button.Text = "Button";
window.AddChild(button);
TextBox textBox = new TextBox("textBox", 255, 109, 104, 80, 32);
window.AddChild(textBox);
TextBlock textBlock = new TextBlock("textBlock", 255, 22, 104, 100, 32);
textBlock.Text = "TextBlock";
textBlock.TextVerticalAlign = VerticalAlignment.Middle;
window.AddChild(textBlock);
}
}
}
Hi Josh, as mentioned on Skype, I can get the example to work when the window uses the full LCD WxH, but as I am using multiple windows, it is not, any progress with the supplied project to see my problem?
in my upsidedpwn image:
The red Title area is a window
the white body (where the TextBox is displayed and attached) is a window
The grey status area is a window
Now that I am able to get the emulator working (of sorts):
the ORIGINAL problem still persists:
a) If you use XML to generate your page TextBox, TextBlock, Buttons all line up, GOOD
b) When you use hand crafted code to Addchild() to a Window the TextBox does not line up, when using the exact same Y coordinate as the TextBlock or Button.
But this has other issues, as it introduces magenta borders around textbox objects, even when you set background color and enable background , so hold off until that’s fixed