How could I open more than one image with a single dialog in Digital Micrograph script?

前端 未结 1 1033
感情败类
感情败类 2021-01-25 16:44

I am writing in DigialMicrograph scripting. I want a script to open more than one image in a single dialog, a multi-select image dialog, similar to when you go to any Windows op

1条回答
  •  囚心锁ツ
    2021-01-25 17:36

    What you are asking for might be a bit more involved. There is no multiple open function in the scripting language, so you can only create it yourself, involving multiple steps:

    • An input for a base-folder (This you could prompt the user for with a GetDirectoryDialog dialog)
    • Using the command GetFilesInDirectory to retrieve a list (TagList) of files in that folder
    • Process that list to filter out what you are interested in
    • Build a custom-dialog (derived from UIFrame) which lists the files with either checkboxes, multiple drop-down menus, or a list-box to select from.
    • Act on the selection made in your custom dialog, i.e. open all those files

    The following script is an example doing that.

    class MyMultiSelect : UIframe
    {
        string root
        TagGroup FileList
        TagGroup DLGlist
    
        TagGroup CreateDLG( object self )
        {
            TagGroup dlg,dlgitems
            dlg = DLGCreateDialog( "MultiOpen", dlgItems )
    
            number nMax = fileList.TagGroupCountTags();
            TagGroup listitems
            DLGlist = DLGCreateList( listitems, 90, nMax+1 )
            DLGlist.DLGMultipleSelect(1)
            for (number i=0; i

    0 讨论(0)
提交回复
热议问题