Skip to main content
Known Participant
October 29, 2013
Question

How to enable the widgets in Indesign CC..?

  • October 29, 2013
  • 1 reply
  • 5587 views

Hi,

I am working on porting our Indesign CS6 plugin to Indesign CC plugin.I have completed the porting and the plugins has opened in Indesign CC,but i have one problem in design. Three of our Widgets has not opened in Indesign CC.

The code is the following,

.fr file

resource SampleDialogWidget (kSDKDefDialogResourceID + index_enUS)

{

          __FILE__, __LINE__,

          kSampleDialogWidgetID,                    // WidgetID

          kPMRsrcID_None,                                        // RsrcID

          kBindNone,                                                  // Binding

          0, 0, 700,400,                                        // Frame (l,t,r,b)

          kTrue, kTrue,                                        // Visible, Enabled

          kSampleDialogTitleKey,                    // Dialog name

          {

          //<FREDDYWIDGETDEFLISTUS>

 

SamplePrefListBox

                    (

                              SamplePreflistboxWidgetID,

                              kSysOwnerDrawListBoxPMRsrcId,                                                            // WidgetId, RsrcId

                              kBindAll,                                                                                                              // Frame binding

                              Frame(15,15,170,360)                                                                                // Frame

                              kTrue, kTrue,                                                                                                    // Visible, Enabled

                              1,0,                                                                                                                        // List dimensions

                              19,                                                                                                                                  // Cell height

                              1,                                                                                                                                  // Border width

                              kFalse,kTrue,                                                                                                    // Has scroll bar (h,v)

                              kTrue,                                                                                                                        // Multiselection

                              kTrue,                                                                                                                        // List items can be reordered

                              kTrue,                                                                                                                        // Draggable to new/delete buttons

                              kTrue,                                                                                                                        // Drag/Dropable to other windows

                              kTrue,                                                                                                                        // An item always has to be selected

                              kFalse,                                                                                                                        // Don't notify on reselect

                              kSamplePrefListElementRsrcID                                                                      // Fill list box with widgets with this ID (default is 0)

                              {

                                        CellPanelWidget

                                        (

                                                  kCellPanelWidgetID, kPMRsrcID_None,                              // WidgetId, RsrcId

                                                  kBindAll,                                                                                          // Frame binding

                                                  Frame(-1,1,154,340)                    // Frame

                                                  kTrue, kTrue                                                                                // Visible, Enabled

                                                  {

                                                            // ----- This is the CPanelControlData that holds the widgets

                                                            //                     that are items in the list box. They are not persistent

                                                            //

 

                                                  }

                                        ) 

                              },

                    ),

                    GenericPanelWithBorderWidget

                    (

                SamplePrefGeneralTabWidgetID, kPMRsrcID_None,

                              kBindBottom |kBindRight,

                              Frame(175,10,695,360)                    // Frame

                              kTrue, kTrue,

                              "",

                              {

 

                    StaticTextWidget

                    (

                              kInvalidWidgetID,                                                                                // WidgetId (default=0)

                              kSysStaticTextPMRsrcId,                    // RsrcId

                              kBindNone,                                                            // Frame binding

                              10, 15, 138, 35,                                                  // Frame: left, top, right, bottom.

                              kTrue, kTrue,                                                  // Visible, Enabled

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

                              kSamplePrefProjectPathStringKey,                    // Initial text.

                              kSamplePrefProjectPathTextEditBoxWidgetID          // No associated widget

                    ),

 

 

                    // TextEditBox Widget resource

                    TextEditBoxWidget

                    (

                    kSamplePrefProjectPathTextEditBoxWidgetID, // WidgetId

                    kSysEditBoxPMRsrcId, // RsrcId

                    kBindNone, // Frame binding

                    Frame(140, 15, 420, 35), // Frame (l,t,r,b)

                    kTrue, kTrue // Visible, Enabled

                    0, // Widget id of nudge button (0 so we dont get one)

                    0, 0,// small,large nudge amount

                    0, // max num chars(0 = no limit)

                    kFalse,// is read only

                    kFalse,// should notify each key stroke

                    kFalse,// range checking enabled

                    kFalse,// blank entry allowed

                    0, // Upper bounds

                    0, // Lower bounds

                    "", // Initial text

                    ),

 

                    ButtonWidget

                    (

                              kSampleChooseProjectButtonWidgetID,

                              kSysButtonPMRsrcId,

                              kBindNone,

                              430, 15, 500, 35,

                              kTrue, kTrue,

                              kSampleChooseBtnStringKey,

                    ),

GenericPanelWithBorderWidget

                    (

                              SamplePrefFittingTabWidgetID, kPMRsrcID_None,

                              kBindBottom |kBindRight,

                              Frame(175,10,695,360)                    // Frame

                              kTrue, kTrue,

                              "",

                              {

 

                              StaticTextWidget

                                        (

                                                  kInvalidWidgetID,                    // WidgetId

                                                  kSysStaticTextPMRsrcId,                    // RsrcId

                                                  kBindNone,                              // Frame binding

                                                  Frame( 10,15,300,35  ),          // Frame (l,t,r,b)

                                                  kTrue, kTrue, kAlignLeft,          // Visible, Enabled, Alignment

                                                  kDontEllipsize,kTrue,                              //**new element in InDesign 2.0: don't add any ellipses

                                                  "Drag/Drop Operation",                     // Text

                                                  0// WidgetId for associated control for shortcut focus

                                        ),

 

                                        SeparatorWidget

                                        (

                                                  0,

                                                  kPMRsrcID_None,

                                                  kBindNone,

                                                  Frame(10,37,450,38),

                                                  kTrue,kTrue,

                                        ),

 

                                        StaticTextWidget

                                        (

                                                  0,                    // WidgetId

                                                  kSysStaticTextPMRsrcId,                    // RsrcId

                                                  kBindNone,                              // Frame binding

                                                  Frame( 10, 40, 250, 60  ),          // Frame (l,t,r,b)

                                                  kTrue, kTrue, kAlignLeft,          // Visible, Enabled, Alignment

                                                  kDontEllipsize,kTrue,                              //**new element in InDesign 2.0: don't add any ellipses

                                                  kSampleTextOptionsTextKey,                     // Text

                                                  0                    // WidgetId for associated control for shortcut focus

                                        ),

 

                                        CheckBoxWidget

                                        (

                                                  kSampleTextFitCheckBoxWidgetID,                    // WidgetId

                                                  kSysCheckBoxPMRsrcId,                              // RsrcId

                                                  kBindNone,

                                                  Frame(150, 40, 350, 60) //  left, top, right, bottom

                                                  kTrue,                                                                      // Visible

                                                  kTrue,                                                                      // Enabled

                                                  kAlignLeft,                                                            // Alignment

                                                  kSampleTextFitChkBoxTextKey                    // Initial text

                                        ),

GenericPanelWithBorderWidget

                    (

                              SamplePrefScriptEventsTabWidgetID, kPMRsrcID_None,

                              kBindBottom |kBindRight,

                              Frame(175,10,695,360)                    // Frame

                              kTrue, kTrue,

                              "",

                              {

 

                                        StaticTextWidget

                                        (

                                                  0,                                                                                // WidgetId (default=0)

                                                  kSysStaticTextPMRsrcId,                    // RsrcId

                                                  kBindNone,                                                            // Frame binding

                                                  10, 10, 200, 30,                                                  // Frame: left, top, right, bottom.

                                                  kTrue, kTrue,                                                  // Visible, Enabled

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

                                                  kSampleDropDownEventsTextKey,                    // Initial text.

                                                  0                    // No associated widget

                                        ),

 

SamplePrefListBox

                                        (

                                                   SamplePrefDragDropScriptlistboxWidgetID, kSysOwnerDrawListBoxPMRsrcId,          // WidgetId, RsrcId

                                                  kBindAll,                                                                                                              // Frame binding

                                                  Frame(10, 35, 200, 120)                                                                                          // Frame

                                                  kTrue, kTrue,                                                                                                    // Visible, Enabled

                                                  1,0,                                                                                                                        // List dimensions

                                                  19,                                                                                                                                  // Cell height

                                                  1,                                                                                                                                  // Border width

                                                  kFalse,kTrue,                                                                                                    // Has scroll bar (h,v)

                                                  kTrue,                                                                                                                        // Multiselection

                                                  kTrue,                                                                                                                        // List items can be reordered

                                                  kTrue,                                                                                                                        // Draggable to new/delete buttons

                                                  kFalse,                                                                                                                        // Drag/Dropable to other windows

                                                  kTrue,                                                                                                                        // An item always has to be selected

                                                  kFalse,                                                                                                                        // Don't notify on reselect

                                                  k SamplePrefListElementRsrcID                                                                      // Fill list box with widgets with this ID (default is 0)

                                                  {

                                                            CellPanelWidget

                                                            (

                                                                      kCellPanelWidgetID, kPMRsrcID_None,                              // WidgetId, RsrcId

                                                                      kBindAll,                                                                                          // Frame binding

                                                                      Frame(-1,1,187,243)                    // Frame

                                                                      kTrue, kTrue                                                                                // Visible, Enabled

                                                                      {

                                                                                // ----- This is the CPanelControlData that holds the widgets

                                                                                //                     that are items in the list box. They are not persistent

                                                                                //

 

                                                                      }

                                                            ) 

                                                  },

                                        ),

 

                                        ButtonWidget

                                        (

  SamplePrefDragDropScriptAddBtnWidgetID,

                                        kSysButtonPMRsrcId,

                                        kBindNone,

                                        20, 125, 90, 145,

                                        kTrue, kTrue,

                                        kSampleAddScriptButtonTextKey,

                                        ),

 

                                        ButtonWidget

                                        (

  SamplePrefDragDropScriptRemoveBtnWidgetID,

                                        kSysButtonPMRsrcId,

                                        kBindNone,

                                        100, 125, 180, 145,

                                        kTrue, kTrue,

                                        kSampleRemoveScriptButtonTextKey,

                                        ),

Elements added:

void SampleDialogController::PopulatePrefListElement()

{

do

{

                    InterfacePtr<IPanelControlData> iPanelControlData(this, UseDefaultIID());

                    ASSERT(iPanelControlData);

                    if(!iPanelControlData) {CAlert::InformationAlert("IPanelControlData err");break;}

                    SDKListBoxHelper listHelper(iPanelControlData,kSamplePluginID, SamplePreflistboxWidgetID, kSampletDialogWidgetID);

                    IControlView * listBox = listHelper.FindCurrentListBox();

                    if(listBox == nil) {

                    CAlert::InformationAlert("listBox err");

                    break;

                    }

 

                    listHelper.EmptyCurrentListBox();

                    InterfacePtr<IListBoxController> listCntl(listBox,IID_ILISTBOXCONTROLLER);          // useDefaultIID() not defined for this interface

                    ASSERT_MSG(listCntl != nil, "listCntl nil");

                    if(listCntl == nil) {

                    CAlert::InformationAlert("IListBoxController err");

                    break;

                    }

 

                    //Addin the string to the listbox

                    const int targetDisplayWidgetId =SamplePrefOptionTextWidgetID;

                    listHelper.AddElement("General", targetDisplayWidgetId);

                    listHelper.AddElement("Fitting", targetDisplayWidgetId);

                      listHelper.AddElement("Events and Scripts", targetDisplayWidgetId);

 

                    listCntl->DeselectAll();

 

 

}while(0);

}

I dont know how to enable these three widgets in Indesign CC.please refer this code and help me if anyone has idea regarding this problem.

Thanks in advance,

Vimala L

This topic has been closed for replies.

1 reply

Inspiring
October 30, 2013

WidgetListBoxWidgetN is not supported by InDesign CC.

You need porting to TreeViewWidget.

Refer sdk samples.

Known Participant
October 30, 2013

Thanks for ur reply..I have changed the WidgetListBoxWidgetN to TreeViewWidget,but i got an error.

error R32754: # Error: Expected string.

Changes done:

type SamplePrefListBox(kViewRsrcType) : TreeViewWidget(ClassID = kSamplePrefListBoxWidgetBoss)

{ };

And also i have one doubt.We have used CellPanelWidget in our code but it is not available in EveInfo.fh file. If it works in Indesign CC?please help me to fix this issue.

We have used the TreeViewWidget in below code,

resource SamplePanelWidget(kSDKDefPanelResourceID + index_enUS)

{

          __FILE__, __LINE__,                                                  // Localization macro

          kSamplePanelWidgetID,                                        // WidgetID

          kPMRsrcID_None,                                                            // RsrcID

          kBindNone,                                                                      // Binding (0=none)

          Frame(0, 0, 207, 372),                                                            // Frame: left, top, right, bottom.

          kTrue, kTrue,                                                            // Visible, Enabled

          kFalse,                                                                                // Erase background

          kInterfacePaletteFill,                                        // Erase to color

          kInCatPanelTitleKey,                                        // Panel name

          {

                    // Adding new fields isn't handled by Freddy 2.1

                    // ipaterso changed from GenericPanelWithBorderWidget to Erasable...

                    // as there was redraw glitch when scrolling horizontally added

                    ErasablePrimaryResourcePanelWidget

                    (

                              __FILE__, __LINE__,

                              0, kPMRsrcID_None,

                              kBindAll,

                              Frame(0,5,207,371)          // Frame

                              kTrue, kTrue,

                              kFalse,                                                                      // Erase background

                              kInterfacePaletteFill,                              // Erase to color

                              "",

                              {

  SampleTreeViewWidget

                                        (

                                                  kSampleTreeViewWidgetID, kPMRsrcID_None,// WidgetId, RsrcId

                                                  kBindAll,

                                                  Frame(0,0,208,180)                    // Frame

                                                  kTrue, kTrue,                              // Visible, Enabled

                                                  kTrue,                                                             // EraseBeforeDraw

                                                  kInterfacePaletteFill,                     // InterfaceColor

                                                  "",

                                                  kFalse,                    // Display root node

                                                  kTrue,                    // Use H Scroll bar

                                                  kTrue,                    // Use V scroll bar

                                                  20,                              // fVScrollButtonIncrement

                                                  20,                              // fVThumbScrollIncrement

                                                  20,                              // fHScrollButtonIncrement

                                                  20,                              // fHThumbScrollIncrement

                                                  2,                              // Items selectable, 0 = No Selection, 1 = Single Selection, 2 = Multiple Selection

                                                  kFalse,                    // Allow children from multiple parents to be selected

                                                  kFalse,                    // Allow discontiguous selection

                                                  {

 

                                                  },

                                        ),

 

                                        //Table Cell Widget

                                        TableCellWidget

                                        (

                                                  kTableCellWidgetID,                              // WidgetId

                                                  kPMRsrcID_None,                                        // RsrcId

                                                  kBindLeft | kBindBottom | kBindRight,                                                  // Frame binding

                                                  Frame(1,181,191,328),

                                                  kFalse, kTrue,                                        // Visible, Enabled

                                        ),

 

                                        ScrollBarWidget

                                        (

                                                  kTableCellScrollWidgetID,                                        // WidgetId

                                                  kSysVScrollBarPMRsrcId, //kSysVScrollBarPMRsrcId

                                                  kBindRight | kBindBottom,

                                                  Frame(191,181,208,345),

                                                  kFalse,kTrue,

                                                  // CCounterControlData

                                                  0,                     // min

                                                  100,           // max

                                                  0,            // initial value

                                                  1,                     // small increments

                                                  10,                    // big increments

                                                  // CAccelerateControlData

                                                  0,                    // fThreshold

                                                  0,                    // fMax

                                                  0,                    // fIncrement

                                        ),

                                        ScrollBarWidget

                                        (

                                                  kTableCellHScrollWidgetID,                                        // WidgetId

                                                  kSysHScrollBarPMRsrcId,                                                  // RsrcId

                                                  kBindRight | kBindLeft | kBindBottom,          // Frame binding

                                                  Frame(0,328,191,346),

                                                  kFalse, kTrue,                                                                      // Visible, Enabled

                                                  0,                    // fMin

                                                  1000,          // fMax

                                                  0,                    // fValue

                                                  1,                    // fIncrement

                                                  2,                    // fIncrementMultiple

                                                  // CAccelerateControlData

                                                  0,                    // fThreshold

                                                  0,                    // fMax

                                                  0,                    // fIncrement

                                        ),

}

Is it possible to use TreeViewWidget in SampleDialogWidget?

Thanks,

Vimala L

Inspiring
October 30, 2013

I can't see your code.

Refer List-box widget conversion in poting-guide.pdf of CS3 SDK.