TabularEditor icon indicating copy to clipboard operation
TabularEditor copied to clipboard

pointer switches to spinning wheel in TE2 but not TE3 (TE3 is ok)

Open bernatagulloesbrina opened this issue 2 years ago • 3 comments

Hello,

when using this function I show at the end and that you provided in another question (works like a charm by the way) in TE2 the pointer becomes a spinning wheel, even though is fully operative, which might be confusing for users. This is not the behavior in TE3

Is there any way to force the pointed to stay as an arrow?

I've tried adding the ScriptHelper.WaitFormVisible = false;

but does not make any difference

using System.Windows.Forms;

ScriptHelper.WaitFormVisible = false;

List<string> sampleList = new List<string>();
sampleList.Add("a");
sampleList.Add("b");
sampleList.Add("c");
// Code that defines a local function "SelectString", which pops up a listbox allowing the user to select a 
// string from a number of options:
Func<IList<string>, string, string> SelectString = (IList<string> options, string title) =>
{
    var form = new Form();
    form.Text = title;
    var buttonPanel = new Panel();
    buttonPanel.Dock = DockStyle.Bottom;
    buttonPanel.Height = 30;
    var okButton = new Button() { DialogResult = DialogResult.OK, Text = "OK" };
    var cancelButton = new Button() { DialogResult = DialogResult.Cancel, Text = "Cancel", Left = 80 };
    var listbox = new ListBox();
    listbox.Dock = DockStyle.Fill;
    listbox.Items.AddRange(options.ToArray());
    listbox.SelectedItem = options[0];
    form.Controls.Add(listbox);
    form.Controls.Add(buttonPanel);
    buttonPanel.Controls.Add(okButton);
    buttonPanel.Controls.Add(cancelButton);
    var result = form.ShowDialog();
    if (result == DialogResult.Cancel) return null;
    return listbox.SelectedItem.ToString();
};
//let the user select the name of the macro to copy
String select = SelectString(sampleList, "Choose a macro");
//check that indeed one macro was selected
if (select == null)
{
    Info("You cancelled!");
    return;
}
//code using "select" variable
Output(select);

bernatagulloesbrina avatar Jun 24 '23 17:06 bernatagulloesbrina

even adding Cursor.Current = Cursors.Default; does not do anything looks like there's some override from TE

bernatagulloesbrina avatar Jun 24 '23 17:06 bernatagulloesbrina

Hi Bernat,

Add the following at the top of your script:

Application.UseWaitCursor = false;

otykier avatar Aug 01 '23 10:08 otykier

Awesome! thank you

bernatagulloesbrina avatar Aug 01 '23 15:08 bernatagulloesbrina