Skip to main content
giladr50726310
Participating Frequently
July 12, 2015
Answered

AEIO_UserOptionsDialog

  • July 12, 2015
  • 1 reply
  • 1057 views

Hello,

I have AEIO project for windows, and I want to port it to macintosh

On windows, there was a function AEIO_FunctionBlock4::AEIO_UserOptionsDialog()

and I look for a similar code for macintosh ? what is the way to do it ? I did not find

in UI examples in the SDK

My code is like this:

BOOL DialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam)

{

    switch(message)

    {

        case WM_INITDIALOG:

            CheckDlgButton(hwndDlg, IDC_FLATTEN, (WPARAM)g_header.bFlattenIndexed);

            CheckDlgButton(hwndDlg, IDC_LZW, (WPARAM)g_header.bLZW);

            CheckDlgButton(hwndDlg, IDC_GEN_MIPMAPS, (WPARAM)g_header.bGenerateMipmaps);

            CheckDlgButton(hwndDlg, IDC_SAVE_ORIGINAL, (WPARAM)g_header.bSaveOrig);

            CheckDlgButton(hwndDlg, IDC_HIGH_QUALITY_DXT, (WPARAM)g_header.bHighQualityDXT);

            CheckRadioButton(hwndDlg, IDC_FORMAT_RAW, IDC_FORMAT_DXT5, g_header.iFormat);

            return TRUE;

        case WM_COMMAND:

            switch(LOWORD(wParam))

            {

                case IDOK:

                    g_header.bFlattenIndexed = IsDlgButtonChecked(hwndDlg, IDC_FLATTEN);

                    g_header.bLZW = IsDlgButtonChecked(hwndDlg, IDC_LZW);

                    g_header.bGenerateMipmaps = IsDlgButtonChecked(hwndDlg, IDC_GEN_MIPMAPS);

                    g_header.bSaveOrig = IsDlgButtonChecked(hwndDlg, IDC_SAVE_ORIGINAL);

                    g_header.bHighQualityDXT = IsDlgButtonChecked(hwndDlg, IDC_HIGH_QUALITY_DXT);

                    if (IsDlgButtonChecked(hwndDlg, IDC_FORMAT_RAW))

                        g_header.iFormat = IDC_FORMAT_RAW;

                    else if (IsDlgButtonChecked(hwndDlg, IDC_FORMAT_DXT1))

                        g_header.iFormat = IDC_FORMAT_DXT1;

                    else

                        g_header.iFormat = IDC_FORMAT_DXT5;

                    EndDialog(hwndDlg, IDOK);

                break;

                case IDCANCEL:

                    EndDialog(hwndDlg, IDCANCEL);

                break;

            }

            break;

        default:

            return FALSE;

    }

    return TRUE;

}

static A_Err

VBNIO_UserOptionsDialog(

  AEIO_BasicData *basic_dataP,

  AEIO_OutSpecH outH,

  const PF_EffectWorld *sample0,

  A_Boolean *user_interacted0)

{

  A_Err err = A_Err_NONE;

  

  VBNIO_FileHeader *headerP = NULL;

  AEGP_SuiteHandler suites(basic_dataP->pica_basicP);

    AEIO_Handle optionsH = NULL;

    AEIO_Handle old_optionsH = NULL;

  err = suites.IOOutSuite4()->AEGP_GetOutSpecOptionsHandle(outH, (void**)&optionsH);

    if (err || !optionsH)

        return err;

    err = suites.MemorySuite1()->AEGP_LockMemHandle(optionsH, (void**)&headerP);

    if (err || !headerP)

        return err;

    g_header = *headerP;

    if (DialogBox(GetModuleHandle("VBNIO.aex"),

              MAKEINTRESOURCE(IDD_VBN_DIALOG),

              NULL,

              (DLGPROC)DialogProc) == IDOK){

     A_long width, height;

     suites.IOOutSuite4()->AEGP_GetOutSpecDimensions(outH, &width, &height);

        if ((g_header.iFormat == IDC_FORMAT_DXT1 || g_header.iFormat == IDC_FORMAT_DXT5) &&

            (width % 4 != 0 || height % 4 != 0)){

     basic_dataP->msg_func(0, "Width and Height should be multiples of 4. Not saving option changes.");

            suites.MemorySuite1()->AEGP_UnlockMemHandle(optionsH);

                return AEIO_Err_INCONSISTENT_PARAMETERS;

        }

        *headerP = g_header;

        *user_interacted0 = TRUE;

    }

  suites.MemorySuite1()->AEGP_UnlockMemHandle(optionsH);

    return err;

};

This topic has been closed for replies.
Correct answer shachar carmi

if i get you correctly, you're asking how to open a window native to osx?

if so, scroll waaaaay down on that discussion. it has some code examples

for carbon, and links for cocoa:

https://forums.adobe.com/thread/559946?tstart=0

you can also open a window in javascript using AEGP_ExecuteScript(), which

uses the same code for windows and osx.

1 reply

shachar carmiCommunity ExpertCorrect answer
Community Expert
July 12, 2015

if i get you correctly, you're asking how to open a window native to osx?

if so, scroll waaaaay down on that discussion. it has some code examples

for carbon, and links for cocoa:

https://forums.adobe.com/thread/559946?tstart=0

you can also open a window in javascript using AEGP_ExecuteScript(), which

uses the same code for windows and osx.

giladr50726310
Participating Frequently
July 12, 2015

Thanks a lot Shachar, you got me correctly.

Where can I find examples for javascript using AEGP_ExecuteScript(), and having a small window

with checkbutton and popup list ?

Community Expert
July 12, 2015

here's an example on how to implement execute script:

https://forums.adobe.com/message/3625857#3625857

as for the script itself, i'd search this forum:

https://forums.adobe.com/community/aftereffects_general_discussion/ae_scripting