Skip to main content
Inspiring
March 19, 2014
Answered

Getting multiple panels in one extension

  • March 19, 2014
  • 1 reply
  • 852 views

Hi,

I'm having trouble setting up multiple panels in my extension. I've seen similar posts on here but what fixed it for them doesn't seem to solve it for me!

My first panel appears fine, but clicking the menu option for the second one does nothing.

I have a WidgetBoss for each:

          Class

          {

                    kPanelAWidgetBoss,

                    kPalettePanelWidgetBoss,

                    {

                  IID_IPANELMENUDATA, kCPanelMenuDataImpl,

                    }

          },

 

          Class

          {

                    kPanelBWidgetBoss,

                    kPalettePanelWidgetBoss,

                    {

                  IID_IPANELMENUDATA, kCPanelMenuDataImpl,

                    }

          },

ALocaleIndex for each:

resource LocaleIndex (kPanelAResourceID)

{

          kViewRsrcType,

          {

                    kWildFS, k_Wild,           kPanelAResourceID + index_enUS

          }

};

resource LocaleIndex (kPanelBResourceID)

{

          kViewRsrcType,

          {

                    kWildFS, k_Wild,           kPanelBResourceID + index_enUS

          }

};

A separate PanelList for each:

resource PanelList (kPanelAResourceID)

{

          {

                    // 1st panel in the list

                    kPanelAResourceID,

                    kPluginID,

                    kNotResizable,

                    kPanelAWidgetActionID,

                    "",

                    kPanelAMenuPath,

                    kPanelAMenuItemPosition,

                    0,0,

                    c_Panel,

          }

};

resource PanelList (kPanelBResourceID)

{

          {

                    // 2nd panel in the list

                    kPanelBResourceID,

                    kPluginID,

                    kNotResizable,

                    kPanelBWidgetActionID,

                    "",

                    kPanelBMenuPath,

                    kPanelBMenuItemPosition,

                    0,0,

                    c_Panel

          }

};

A type definition:

type PanelAWidget(kViewRsrcType) : PalettePanelWidget(ClassID = kPanelAWidgetBoss)

{

          CPanelMenuData;

};

type PanelBWidget(kViewRsrcType) : PalettePanelWidget(ClassID = kPanelBWidgetBoss)

{

          CPanelMenuData;

};

And a definition for the resource itself:

resource PanelAWidget(kPanelAResourceID + index_enUS)

{

          __FILE__, __LINE__,                                                  // Localization macro

          kPanelAWidgetID,                                        // WidgetID

          kPMRsrcID_None,                                                            // RsrcID

          kBindNone,                                                                      // Binding (0=none)

          0, 0, 207, 95,                                                            // Frame: left, top, right, bottom.

          kTrue, kTrue,                                                            // Visible, Enabled

          kFalse,                                                                                // Erase background

          kInterfacePaletteFill,                                        // Erase to color

          kFalse,                                                                                // Draw dropshadow

          kPanelATitleKey,                                        // Panel name

          {

          }

          kInternalPopupMenuNameKey                    // Popup menu name (internal)

};

resource PanelBWidget(kPanelBResourceID + index_enUS)

{

          __FILE__, __LINE__,                                                  // Localization macro

          kPanelBWidgetID,                                        // WidgetID

          kPMRsrcID_None,                                                            // RsrcID

          kBindNone,                                                                      // Binding (0=none)

          0, 0, 207, 95,                                                            // Frame: left, top, right, bottom.

          kTrue, kTrue,                                                            // Visible, Enabled

          kFalse,                                                                                // Erase background

          kInterfacePaletteFill,                                        // Erase to color

          kFalse,                                                                                // Draw dropshadow

          kPanelBTitleKey,                                        // Panel name

          {

          }

          kInternalPopupMenuNameKey                    // Popup menu name (internal)

};

PanelB is nowhere to be seen.

I guess I'm missing something obvious. Can anyone help?

Thanks

Liz

This topic has been closed for replies.
Correct answer Bartek_Kropaczewski

Maybe cleaning all the InDesign caches will help. Otherwise i would recommend adding resize functionality, just for test.

1 reply

Bartek_Kropaczewski
Inspiring
March 19, 2014

Hi

I just copied that into my plugin and it seems to be correct.
Bellow you can find change log from my plugins.

Regards

Bartek

1. Claas definitions

    Class { kPanelAWidgetBoss, kPalettePanelWidgetBoss,

        {   IID_IPANELMENUDATA,             kCPanelMenuDataImpl,                       }},

   

    Class { kPanelBWidgetBoss, kPalettePanelWidgetBoss,

        {   IID_IPANELMENUDATA,             kCPanelMenuDataImpl,                       }},

2. PanelList definitions:

resource PanelList (kPanelAResourceID)

{

    {

        // 1st panel in the list

        kPanelAResourceID,

        kMYUIPluginID,

        kNotResizable,

        kPanelAWidgetActionID,

        "AAA",

        kPanelAMenuPath,

        kPanelAMenuItemPosition,

        0,0,

        c_Panel,

    }

};

 

resource PanelList (kPanelBResourceID)

{

    {

        // 2nd panel in the list

        kPanelBResourceID,

        kMYUIPluginID,

        kNotResizable,

        kPanelBWidgetActionID,

        "BBB",

        kPanelBMenuPath,

        kPanelBMenuItemPosition,

        0,0,

        c_Panel

    }

};

3. Layout definitions

resource PanelAWidget(kPanelAResourceID + index_enUS)

{

    __FILE__, __LINE__,                                                  // Localization macro

    kPanelAWidgetID,                                        // WidgetID

    kPMRsrcID_None,                                                            // RsrcID

    kBindNone,                                                                      // Binding (0=none)

    0, 0, 207, 95,                                                            // Frame: left, top, right, bottom.

    kTrue, kTrue,                                                            // Visible, Enabled

    kFalse,                                                                                // Erase background

    kInterfacePaletteFill,                                        // Erase to color

    kFalse,                                                                                // Draw dropshadow

    kPanelATitleKey,                                        // Panel name

    {

    }

    kMYUIInternalPopupMenuNameKey                    // Popup menu name (internal)

};

resource PanelBWidget(kPanelBResourceID + index_enUS)

{

    __FILE__, __LINE__,                                                  // Localization macro

    kPanelBWidgetID,                                        // WidgetID

    kPMRsrcID_None,                                                            // RsrcID

    kBindNone,                                                                      // Binding (0=none)

    0, 0, 207, 95,                                                            // Frame: left, top, right, bottom.

    kTrue, kTrue,                                                            // Visible, Enabled

    kFalse,                                                                                // Erase background

    kInterfacePaletteFill,                                        // Erase to color

    kFalse,                                                                                // Draw dropshadow

    kPanelBTitleKey,                                        // Panel name

    {

    }

    kMYUIInternalPopupMenuNameKey                    // Popup menu name (internal)

};

4. Locale definitions

resource StringTable (350 + index_enUS)          // No-Translate strings go here:

{   k_enUS,  kEuropeanMacToWinEncodingConverter, // Locale Id, Character encoding converter

          {          kMYUIInternalPopupMenuNameKey,          kMYUIInternalPopupMenuNameKey,

}};

resource LocaleIndex (kPanelAResourceID)

{   kViewRsrcType,

    {   kWildFS, k_Wild,           kPanelAResourceID + index_enUS

}};

resource LocaleIndex (kPanelBResourceID)

{   kViewRsrcType,

    {   kWildFS, k_Wild,           kPanelBResourceID + index_enUS

}};

5. Type definitions:

type PanelAWidget(kViewRsrcType) : PalettePanelWidget(ClassID = kPanelAWidgetBoss)

{

    CPanelMenuData;

};

type PanelBWidget(kViewRsrcType) : PalettePanelWidget(ClassID = kPanelBWidgetBoss)

{

    CPanelMenuData;

};

6. Other definitions:

// Boss classes:

DECLARE_PMID(kClassIDSpace,             kPanelAWidgetBoss,                  kMYUIPrefix + 7 )

DECLARE_PMID(kClassIDSpace,             kPanelBWidgetBoss,                  kMYUIPrefix + 8 )

// Action IDs:

DECLARE_PMID(kActionIDSpace,            kPanelAWidgetActionID,              kMYUIPrefix + 12)

DECLARE_PMID(kActionIDSpace,            kPanelBWidgetActionID,              kMYUIPrefix + 13)

// Widget IDs:

DECLARE_PMID(kWidgetIDSpace,             kPanelAWidgetID,                    kMYUIPrefix + 10)

DECLARE_PMID(kWidgetIDSpace,             kPanelBWidgetID,                    kMYUIPrefix + 11)

   

#define kPanelAMenuPath            ""

#define kPanelBMenuPath            ""

#define kPanelAMenuItemPosition   0.0

#define kPanelBMenuItemPosition   0.0

   

#define kPanelATitleKey         "AAA"

#define kPanelBTitleKey         "BBB"

 

const RsrcID kPanelAResourceID            =    700  + 50;

const RsrcID kPanelBResourceID            =    700  + 51;

LizWAuthor
Inspiring
March 19, 2014

Hi Bartek,

Thanks for the help. That looks pretty much identical to what I have - I've changed a couple of bits so it's doing exactly the same.

I'm seeing something pop up when I click on the panel B option, but it's not a full panel, just the internal menu - see image.

Do you have any ideas on why this might be? Are you seeing a full panel B?

Bartek_Kropaczewski
Bartek_KropaczewskiCorrect answer
Inspiring
March 19, 2014

Maybe cleaning all the InDesign caches will help. Otherwise i would recommend adding resize functionality, just for test.