Photoshop 插件选项对话框 UI

发布于 2024-07-23 00:30:15 字数 71 浏览 1 评论 0原文

我正在为 Photoshop 编写一个文件格式插件,我需要弹出一个窗口,其中包含加载和保存选项,例如复选框组合框等,我该怎么做?

Im writting a fileformat plugin for photoshop and I need to popup a window with options on load and save such as checkboxes comboboxes etc, how would I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

愁杀 2024-07-30 00:30:15

最新的 Adobe 的 SDK 有许多使用对话框和窗口的示例。

保存另存为选项上,您的插件需要处理formatSelectorOptionsStart参数并在该代码块中打开选项对话框。

Open 操作中,没有正常的方式来提示选项(您会提示什么样的选项?),但可以显示对话框的事件包括:formatSelectorFilterFileformatSelectorReadPrepareformatSelectorReadStartformatSelectorReadContinueformatSelectorReadFinish

以下是处理不同选择器的插件的示例入口点:

DLLExport MACPASCAL void PluginMain(
  const int16 selector,
  PIPickerParams* pParams,
  intptr_t * data,
  int16 * result)
{
    switch(selector)
    {
        case formatSelectorAbout:
            // display about dialog
            break;
        case formatSelectorReadPrepare:
            // prepare to read in file - adjust memory
            break;
        case formatSelectorReadStart:
            // begin interaction regarding reading 
            // dialog here if needed
            break;
        case formatSelectorReadContinue:
        case formatSelectorReadFinish:
        case formatSelectorOptionsPrepare:
            // handle each appropriately
            break;
        case formatSelectorOptionsStart:
            // HERE is where you'd open your window
            // with options, etc.
            break;
        // etc.
        // etc.
        // etc.
    }
}

The latest SDK from Adobe has a number of examples of using dialogs and windows.

On the Save or Save As options, your plugin needs to handle the formatSelectorOptionsStart param and open your options dialog in that code block.

On the Open action, there's no normal way to prompt for options (what kind of options would you prompt for?) but the events you could display dialogs from include: formatSelectorFilterFile, formatSelectorReadPrepare, formatSelectorReadStart, formatSelectorReadContinue, and formatSelectorReadFinish

Here is an example entry point to your plugin that handles the different selectors:

DLLExport MACPASCAL void PluginMain(
  const int16 selector,
  PIPickerParams* pParams,
  intptr_t * data,
  int16 * result)
{
    switch(selector)
    {
        case formatSelectorAbout:
            // display about dialog
            break;
        case formatSelectorReadPrepare:
            // prepare to read in file - adjust memory
            break;
        case formatSelectorReadStart:
            // begin interaction regarding reading 
            // dialog here if needed
            break;
        case formatSelectorReadContinue:
        case formatSelectorReadFinish:
        case formatSelectorOptionsPrepare:
            // handle each appropriately
            break;
        case formatSelectorOptionsStart:
            // HERE is where you'd open your window
            // with options, etc.
            break;
        // etc.
        // etc.
        // etc.
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文