Skip to main content
Participant
June 22, 2012
Answered

More than one widget

  • June 22, 2012
  • 1 reply
  • 1175 views

Hi, I'm a newbie in Indesign SDK (CPP), and I have one problem in my code: I can't add two widgets on panel (StaticTextWidget), this following code is my problem:

 

resource BscPnlPanelWidget(kSDKDefPanelResourceID + index_enUS)

{

    __FILE__, __LINE__,                    // Localization macro       

    kBscPnlPanelWidgetID,                // WidgetID

    kPMRsrcID_None,                        // RsrcID

    kBindNone,                            // Binding (0=none)

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

    kTrue, kTrue,                        // Visible, Enabled

    kFalse,                                // Erase background

    kInterfacePaletteFill,                // Erase to color

    kFalse,                                // Draw dropshadow

    kBscPnlPanelTitleKey,                // Panel name   

    {

 

        StaticTextWidget

        (

            0,                                // WidgetId (default=0)

            kSysStaticTextPMRsrcId,        // RsrcId

            kBindNone,                        // Frame binding

            5, 10, 202, 27,                    // Frame: left, top, right, bottom.

            kTrue, kTrue,                    // Visible, Enabled

            kAlignLeft, kEllipsizeEnd, kTrue,        // Alignment, ellipsize style, convert ampersands

            "Add tool",            // Initial text.

            0                                // No associated widget

        ),

       

        StaticTextWidget

        (

            10,                                // WidgetId (default=0)

            kSysStaticTextPMRsrcId,        // RsrcId

            kBindNone,                        // Frame binding

            5, 80, 202, 27,                    // Frame: left, top, right, bottom.

            kTrue, kTrue,                    // Visible, Enabled

            kAlignLeft, kEllipsizeEnd, kTrue,        // Alignment, ellipsize style, convert ampersands

            "Properties",            // Initial text.

            0                                // No associated widget

        ),

       

    }

 

    kBscPnlInternalPopupMenuNameKey        // Popup menu name (internal)

};

 

How I can show all these widgets ?

 

Thanks

This topic has been closed for replies.
Correct answer Manan Joshi

In the second widget place the values of left, top, right bottom as 5, 80, 202, 97

If you still have problems you can use the "Panel Edit Mode" submenu under the "DevTools" menu of the debug version of your Indesign to allign your controls. Your problem seems to be that your controls are placed over each other. Try changing the placement and dimension of the widgets, your problem will solve out.

Manan Joshi

  - Efficient InDesign Solutions -

MetaDesign Solutions

http://metadesignsolutions.com/services/indesign-development.php


1 reply

Inspiring
June 22, 2012

Hi,

  • in the second widget you set the top value to 80 but the bottom value to 27 instead of 97.
  • keep the WidgetId to the default 0, except if you need access to it from the cpp code, then you must define and use a WidgetId defined in your *ID.h file.

Markus

Participant
June 22, 2012

thanks ! I set the 80 value to 37 and widgetid to 0 but the second textwidget not display =[

How I can fix that ?

thanks

Manan JoshiCommunity ExpertCorrect answer
Community Expert
June 23, 2012

In the second widget place the values of left, top, right bottom as 5, 80, 202, 97

If you still have problems you can use the "Panel Edit Mode" submenu under the "DevTools" menu of the debug version of your Indesign to allign your controls. Your problem seems to be that your controls are placed over each other. Try changing the placement and dimension of the widgets, your problem will solve out.

Manan Joshi

  - Efficient InDesign Solutions -

MetaDesign Solutions

http://metadesignsolutions.com/services/indesign-development.php


-Manan