Data Input (EntryField)

122 views
Skip to first unread message

Andy Blackmore

unread,
Oct 3, 2019, 11:14:56 PM10/3/19
to pinnacle3-users
Hi All, 

I'm trying to use an EntryField widget for a user to enter a number into a menu. The following code works well - BUT - it requires the user to press 'Enter' on the box before Pinnacle notices that the variable is changed. If someone types in the box, then selects another box without pressing enter, the new value is displayed but the variable behind it doesn't change. I'm sure you can appreciate how that's going to lead to problems.....

Does anyone know how to get the value to update without having to press enter on it? E.g. Link updating the variable to typing in the box. 

Thanks, 
Andy

Version = 16.0.2

Code is:

Store.FloatAt.Lateral = 0;

Store.At.Window.AddChild = "";
Store.At.Window.WidgetList.Last = {
    Widget.Class = "EntryField";
    ParentName = "ScrollRegion";
    Name = "LatEntry";
    X = 5;
    Y = 5;
    Width = 100;
    UseQueryForLabel = 1;
    QueryColorKey =  "#2b2a27";
    QueryValueKey = "Store.FloatAt.Lateral";
    AddAction = "";
    ReplaceCurrentAction = "Store.FloatAt.Lateral";
    ResetDependenciesWhenRealized = 1;
};

Andy Blackmore

unread,
Oct 8, 2019, 4:07:58 AM10/8/19
to pinnacle3-users
Workaround in the mean time, I've made the original window just display the current variable value as a label. Then, each value has a 'set' button next to it, which executes a separate file which just pops up a small data entry window.

This data entry window doesn't have a submit button - i.e. the user needs to type the number followed by enter to get rid of the prompt. This window then re-runs the script which creates the original window (effectively closing and re-opening it), and hey-presto, the number is updated.

The text entry field on that popup looks a little like this:

Store.At.SetLat1.AddChild = "";
Store.At.SetLat1.WidgetList.Last = {
    Name = "InputField";
    ParentName = "TopLevel";
    WidgetClass = "Text";
    X = 10;
    Y = 30;
    Width = 280;
    Height = 18;
    AttachLeft = "Prompt";
    AddAction = "";
    ReplaceCurrentAction = "Store.FloatAt.Lat1";
    AddAction = "";
    ReplaceCurrentAction = "Store.At.SetLat1.Unrealize";
    AddAction = "";
    ReplaceCurrentAction = "Script.ExecuteNow = originalMenu.Script";
};

Reply all
Reply to author
Forward
0 new messages