non modal dialog box in macros

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

non modal dialog box in macros

CARL Philippe (LBP)
Dear all,

I would like to use a non modal dialog box in macros.

In order to describe a little bit what I would like to do ; in a macro I’m
writing, the user will have to select a ROI from the ROI Manager by clicking
on the given ROI on the picture in the same time that he decides how the
next step of the macro should be done by means of a checkbox choice.

Unfortunately, the Dialog.create features are modal as the waitForUser
window (non modal) doesn’t allow you to add any checkbox.

Of course one solution would be to first use a waitForUser window followed
by a Dialog.create window one.

But given that I will have 2 of these steps (ROI + Checkbox choice) for 2
channels in the macro iterated on all the cells on a given picture and that
there are a whole bunch of pictures, the difference of work for the user
will be from quite a lot to double.

Thus one of the solution would be to have a NonBlockingDialog command
implemented in macros based on the NonBlockingGenericDialog class
additionally to the GenericDialog class used for the Dialog one (if Wayne
thinks this could be useful for the community).

But would there be another solution that I may be missing with the already
available tools in macros?

I thank you very much in advance for your help.

My best regards,

Philippe

 

Philippe CARL

Laboratoire de Biophotonique et Pharmacologie

UMR 7213 CNRS - Université de Strasbourg

Faculté de Pharmacie

74 route du Rhin

67401 ILLKIRCH

Tel : +33(0)3 68 85 41 84

 


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: non modal dialog box in macros

Michael Schmid
Hi Philippe,

it's true that the waitForUser has no checkbox, but if you have only a boolean to ask for,  you can use a keyboard modifier key.

  waitForUser("Select cell. Then press OK if a small, SHIFT OK if a big cell");
  if (isKeyDown("shift"))
    print ("Wow, a big cell!");

Michael
________________________________________________________________
On Jul 24, 2014, at 16:54, Philippe CARL wrote:

> Dear all,
>
> I would like to use a non modal dialog box in macros.
>
> In order to describe a little bit what I would like to do ; in a macro I’m
> writing, the user will have to select a ROI from the ROI Manager by clicking
> on the given ROI on the picture in the same time that he decides how the
> next step of the macro should be done by means of a checkbox choice.
>
> Unfortunately, the Dialog.create features are modal as the waitForUser
> window (non modal) doesn’t allow you to add any checkbox.
>
> Of course one solution would be to first use a waitForUser window followed
> by a Dialog.create window one.
>
> But given that I will have 2 of these steps (ROI + Checkbox choice) for 2
> channels in the macro iterated on all the cells on a given picture and that
> there are a whole bunch of pictures, the difference of work for the user
> will be from quite a lot to double.
>
> Thus one of the solution would be to have a NonBlockingDialog command
> implemented in macros based on the NonBlockingGenericDialog class
> additionally to the GenericDialog class used for the Dialog one (if Wayne
> thinks this could be useful for the community).
>
> But would there be another solution that I may be missing with the already
> available tools in macros?
>
> I thank you very much in advance for your help.
>
> My best regards,
>
> Philippe

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: non modal dialog box in macros

tongtao
It always print "a big cell" regardless of shift is pressed or not, for
some reason.


On Thu, Jul 24, 2014 at 3:38 PM, Michael Schmid <[hidden email]>
wrote:

> Hi Philippe,
>
> it's true that the waitForUser has no checkbox, but if you have only a
> boolean to ask for,  you can use a keyboard modifier key.
>
>   waitForUser("Select cell. Then press OK if a small, SHIFT OK if a big
> cell");
>   if (isKeyDown("shift"))
>     print ("Wow, a big cell!");
>
> Michael
> ________________________________________________________________
> On Jul 24, 2014, at 16:54, Philippe CARL wrote:
>
> > Dear all,
> >
> > I would like to use a non modal dialog box in macros.
> >
> > In order to describe a little bit what I would like to do ; in a macro
> I’m
> > writing, the user will have to select a ROI from the ROI Manager by
> clicking
> > on the given ROI on the picture in the same time that he decides how the
> > next step of the macro should be done by means of a checkbox choice.
> >
> > Unfortunately, the Dialog.create features are modal as the waitForUser
> > window (non modal) doesn’t allow you to add any checkbox.
> >
> > Of course one solution would be to first use a waitForUser window
> followed
> > by a Dialog.create window one.
> >
> > But given that I will have 2 of these steps (ROI + Checkbox choice) for 2
> > channels in the macro iterated on all the cells on a given picture and
> that
> > there are a whole bunch of pictures, the difference of work for the user
> > will be from quite a lot to double.
> >
> > Thus one of the solution would be to have a NonBlockingDialog command
> > implemented in macros based on the NonBlockingGenericDialog class
> > additionally to the GenericDialog class used for the Dialog one (if Wayne
> > thinks this could be useful for the community).
> >
> > But would there be another solution that I may be missing with the
> already
> > available tools in macros?
> >
> > I thank you very much in advance for your help.
> >
> > My best regards,
> >
> > Philippe
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--
Tao Tong

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: non modal dialog box in macros

Herbie-4
Tao Tong,

you are to add the following routine after the macro code:

        setKeyDown("none");

HTH

Herbie

::::::::::::::::::::::::::::::::::
On 25.07.14 03:27, Tao Tong wrote:

> It always print "a big cell" regardless of shift is pressed or not, for
> some reason.
>
>
> On Thu, Jul 24, 2014 at 3:38 PM, Michael Schmid <[hidden email]>
> wrote:
>
>> Hi Philippe,
>>
>> it's true that the waitForUser has no checkbox, but if you have only a
>> boolean to ask for,  you can use a keyboard modifier key.
>>
>>    waitForUser("Select cell. Then press OK if a small, SHIFT OK if a big
>> cell");
>>    if (isKeyDown("shift"))
>>      print ("Wow, a big cell!");
>>
>> Michael
>> ________________________________________________________________
>> On Jul 24, 2014, at 16:54, Philippe CARL wrote:
>>
>>> Dear all,
>>>
>>> I would like to use a non modal dialog box in macros.
>>>
>>> In order to describe a little bit what I would like to do ; in a macro
>> I’m
>>> writing, the user will have to select a ROI from the ROI Manager by
>> clicking
>>> on the given ROI on the picture in the same time that he decides how the
>>> next step of the macro should be done by means of a checkbox choice.
>>>
>>> Unfortunately, the Dialog.create features are modal as the waitForUser
>>> window (non modal) doesn’t allow you to add any checkbox.
>>>
>>> Of course one solution would be to first use a waitForUser window
>> followed
>>> by a Dialog.create window one.
>>>
>>> But given that I will have 2 of these steps (ROI + Checkbox choice) for 2
>>> channels in the macro iterated on all the cells on a given picture and
>> that
>>> there are a whole bunch of pictures, the difference of work for the user
>>> will be from quite a lot to double.
>>>
>>> Thus one of the solution would be to have a NonBlockingDialog command
>>> implemented in macros based on the NonBlockingGenericDialog class
>>> additionally to the GenericDialog class used for the Dialog one (if Wayne
>>> thinks this could be useful for the community).
>>>
>>> But would there be another solution that I may be missing with the
>> already
>>> available tools in macros?
>>>
>>> I thank you very much in advance for your help.
>>>
>>> My best regards,
>>>
>>> Philippe
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>
>
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html