where to find DialogDemo2.txt example macro?

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

where to find DialogDemo2.txt example macro?

Bill Christens-Barry-2
The release notes for ImageJ v1.51v16 mention an example macro named "DialogDemo2.txt" that I've been unable to locate on the ImageJ web site or with my newest download of this ImageJ version for Mac Java 8.

Where should I look to find this or other example macro that illustrates use of the new Dialog.addToSameRow() macro function?

Thanks.

Bill Christens-Barry

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

Re: where to find DialogDemo2.txt example macro?

Philippe CARL
Dear Bill,
You may not be able to find example macro named "DialogDemo2.txt" since this update is still not within an "official release" of ImageJ but only within the daily build version.
This example macro (together with the update code behind) had been created by Michael Schmid and was following discussions between him, Wayne and myself (who actually had asked for such an update).
Nevertheless following your request you will find this example macro below (before I'm sure Wayne integrates it within the ImageJ website).
My best regards,
Philippe

// This macro demonstrates how a macro can display a // data input dialog box. The dialog it creates contains
// one string field, one popup menu, three numeric fields,
// one RadioButtonGroup and one check box.
// It also shows how to have two dialog items in one row.
  title = "Untitled";
  width=512; height=512;
  fillWith = newArray("White","Black","Ramp","Noise");
  msg = "* When closing, ImageJ will ask whether to save\n"
     +"the image even if it has not been modified."
  Dialog.create("New Image");
  Dialog.addString("Title:", title, 20);
  Dialog.addChoice("Type:", newArray("8-bit", "16-bit", "32-bit", "RGB"));
  Dialog.addToSameRow();
  Dialog.addMessage("(Use '32-bit' for float)");
  Dialog.addNumber("Width:", 512);
  Dialog.addToSameRow();
  Dialog.addNumber("Height:", 512);
  Dialog.addNumber("Stack slices:", 1);
  Dialog.addRadioButtonGroup("Fill with", fillWith, 1, 4, "Ramp");
  Dialog.addCheckbox("Mark as changed *", false);
  Dialog.setInsets(0, 0, 0);
  Dialog.addMessage(msg);
  Dialog.show();
  title = Dialog.getString();
  width = Dialog.getNumber();
  height = Dialog.getNumber();
  slices = Dialog.getNumber();
  type = Dialog.getChoice();
  fillType = Dialog.getRadioButton();
  markAsChanged = Dialog.getCheckbox();
  newImage(title, type+" "+fillType, width, height, slices);
  setOption("Changes", markAsChanged)


Le Mercredi 28 Février 2018 20:46 CET, Bill Christens-Barry <[hidden email]> a écrit:

> The release notes for ImageJ v1.51v16 mention an example macro named "DialogDemo2.txt" that I've been unable to locate on the ImageJ web site or with my newest download of this ImageJ version for Mac Java 8.
>
> Where should I look to find this or other example macro that illustrates use of the new Dialog.addToSameRow() macro function?
>
> Thanks.
>
> Bill Christens-Barry
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html





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

Re: where to find DialogDemo2.txt example macro?

Wayne Rasband-2
In reply to this post by Bill Christens-Barry-2
> On Feb 28, 2018, at 2:46 PM, Bill Christens-Barry <[hidden email]> wrote:
>
> The release notes for ImageJ v1.51v16 mention an example macro named "DialogDemo2.txt" that I've been unable to locate on the ImageJ web site or with my newest download of this ImageJ version for Mac Java 8.
>
> Where should I look to find this or other example macro that illustrates use of the new Dialog.addToSameRow() macro function?

This example macro is available at

   http://wsr.imagej.net/macros/DialogDemo2.txt

There is another example macro that demonstrates how to use the Dialog.addToSameRow() macro function at

   http://wsr.imagej.net/macros/AddToSameRowTest.txt

-wayne

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

Re: where to find DialogDemo2.txt example macro?

Bill Christens-Barry-2
In reply to this post by Bill Christens-Barry-2
Many thanks, Carl and Wayne, for pointing me to this macro and other useful material on this topic.

Bill Christens-Barry

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