Quantcast
Channel: Adobe Community : Popular Discussions - InDesign SDK
Viewing all articles
Browse latest Browse all 78596

How to enable the widgets in Indesign CC..?

$
0
0

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


Viewing all articles
Browse latest Browse all 78596

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>