tags:

views:

201

answers:

1

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?

+1  A: 

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.
    }
}
John Weldon
while this helps, it doesn't really answer the question. right now Ive tried QT but cant get it building in visual studio, and MFC/ATL/WTL refuse to work since adobe didn't create the project as an ATL/MFC project so I cant try those.
Tom J Nowell
You should be able to use ATL/MFC/WTL. What is preventing using them?
John Weldon