Skip navigation
Currently Being Moderated

Issue with having grouped radio button

Feb 29, 2012 7:13 AM

Tags: #indesign #plug-in

Hi, all,

 

i have issue with creating grouped radio button, here i included the code which i use. can any one help me.

 

resource BscPnlPanelWidget(kSDKDefPanelResourceID + index_enUS)

{

    __FILE__, __LINE__,                     

    kBscPnlPanelWidgetID,              

    kPMRsrcID_None,                    

    kBindNone,                           

    0, 0, 800, 300,                    

    kTrue, kTrue,                      

    kBscPnlPanelTitleKey,             

    {

        GroupPanelWidget

        (

        kBscGroupWidgetID,

        kPMRsrcID_None,

        kBindNone,

        Frame(0, 60, 150, 115),

        kTrue,

        kTrue,

        kBscTabWidgetID,

        {

        ClusterPanelWidget

        (

        kBscClusterWidgetID,

        kPMRsrcID_None,

        kBindNone,

        Frame( 0, 0, 60, 70),

        kTrue,

        kTrue,

        "Select Type",

        {   

            RadioButtonWidget

            (

            kBscRadioButton1WidgetID,

            kSysRadioButtonPMRsrcId,

            kBindNone,

            Frame(2, 10, 50, 30),

            kTrue, kTrue,

            "Type 1",

            ),

            RadioButtonWidget

            (

            kBscRadioButton2WidgetID,

            kSysRadioButtonPMRsrcId,

            kBindNone,

            Frame( 2, 32, 50, 52),

            kTrue, kTrue,

            "Type 2",

            ),   

         }

          ),

       }

    ),

   

  }

};

 
Replies
  • Currently Being Moderated
    Feb 29, 2012 3:05 PM   in reply to suren_tringer

    Where is the kBscTabWidgetID referenced by the group as border widget?

    Include a FittedStaticTextWidget as first item in the widget list, same level as that ClusterPanelWidget.

     

    Dirk

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 29, 2012 3:17 PM   in reply to Dirk Becker

    Btw, please include some indicator of the actual problem with your message.

    "I have issue" and "can anyone help" just leaves too much guesswork.

     

    It could mean anything like

    - you just experience compile time errors (which?)

    - you don't see the widgets in the running plugin

    - you crash InDesign on your Mac (provide stack trace?)

    - you crash InDesign on your Windows machine (get a Mac!)

    - you see assertion failures in the debug build (again which?)

    - anything else, you got the idea.

     

    Dirk

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2012 7:57 AM   in reply to suren_tringer

    Your quoted .fr fragment only has one occurence of kBscTabWidgetID.

     

    For a deeper understanding of the resource language, try to follow the declarations ( e.g. starting in Widgets.fh ) and comment every line / data item.

    An example of the relevant entry, formatted my way:

     

    GroupPanelWidget (
        // GroupPanelWidget : CControlView
        kBscGroupWidgetID,                      // WidgetId
        kPMRsrcID_None,                         // RsrcId
        kBindNone,                              // Frame Binding
        Frame(                                  //  Frame
            0, 60,                              //  left,top
            150, 115 )                          //  right,bottom
        kTrue,                                  // Visible
        kTrue,                                  // Enabled
        // GroupPanelWidget : GroupPanelAttributes
        kBscTabWidgetID,                        // widget id of border widget
        // GroupPanelWidget : CPanelControlData
        {
        ...
        }
    )

     

    Then use the interface ID of e.g. GroupPanelAttributes to locate the matching .h interface header:

     

    class IGroupPanelAttributes : public IPMUnknown

    {

    public:

      // ----- Query -----

              enum { kDefaultIID = IID_IGROUPPANELATTRIBUTES };

     

      /** Get the widget id of the widget to use in the top left border of the GroupPanel. 

                                  The widget can have sub-widgets.  If GetBorderWidgetID returns 0,

                                  a simple framed border will be drawn.

     

                        @return the widget id

              */

              virtual WidgetID          GetBorderWidgetID() const = 0;

    ...

     

    This will give you more details on the meaning of the values in the resource.

     

    Dirk

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 2, 2012 7:59 AM   in reply to suren_tringer

    Btw, the FittedStaticTextWidget should of course use that kBscTabWidgetID as ID.

     

    Dirk

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points