Tuesday, December 6, 2011

Some progress on modeless dialogs...

Hi all,



The last couple of weeks I've been trying to get floating tool windows into photoshop. I'm trying a lot of things and came across this:



Load up the ''FrameSelect'' example project and change the DoUI() function to this:



//-------------------------------------------

SPErr DoUI ()

{

SPErr error = noErr;



//int item = kDNoUI; // Error value.



SaveParameters(); // Save our parameters, just in case.

if (sADMDialog != NULL)

{

sADMDialog-%26gt;Create

(

gPlugInRef,

''FrameSelection'',

kDialogID,

kADMTabbedFloatingDialogStyle,

DoUIInit,

NULL, /* No user data */

0//InOptions = 0

);

}



//if (item != kDOk_button)

// {

// error = 'STOP'; //'STOP' = kUserCancel;

// RestoreParameters();

// }



return error;



}

//-------------------------------------------



The sADMDialog-%26gt;Create functon replaces the sADMDialog-%26gt;Modal function that was there. This is all in the standard PS SDK, just had to go hunting through some header files. When yo run this code you sort of have a floating tabbed tool window. There are still some odd thing that happen but this might get some people on the right track.



G
  • help blackheads
  • No comments:

    Post a Comment