Skip to main content
August 9, 2013
Question

How to create a button Widget

  • August 9, 2013
  • 2 replies
  • 1162 views

Hi,

Can any one tell me how to create a button widget,

I've created one & it can be seen in my plugin, but it doesn't work,

in .fr file i created the widget as,

ButtonWidget

(

           kEXTCODGoButtonWidgetID,      

           kSysButtonPMRsrcId,

            kBindNone,                        // Binding ,kBindRight | kBindBottom,

            Frame(50,70,140,90)                    // Frame (l,t,r,b)

            kTrue, kTrue,                     // Visible, Enabled

            "Run", // PNGIconAttributes, new for InDesign 3.0              

                   



),

in DialogObserver.cpp

for AutoAttach & AutoDetach,,

AttachToWidget(kEXTCODGoButtonWidgetID, IID_ITRISTATECONTROLDATA, panelControlData)



DetachFromWidget(kEXTCODGoButtonWidgetID, IID_ITRISTATECONTROLDATA, panelControlData);

in ::update



WidgetID theSelectedWidget = controlView->GetWidgetID();



if (theChange == kTrueStateMessage)


//if (theSelectedWidget == kEXTCODGoButtonWidgetID



{




switch(theSelectedWidget.Get())




        {




         case kEXTCODGoButtonWidgetID:







 







  this->ViewOutput();







  break;

please tell me what may be the wrong...

This topic has been closed for replies.

2 replies

Inspiring
August 9, 2013

Use IID_IBOOLEANCONTROLDATA instead of IID_ITRISTATECONTROLDATA for ButtonWidget in AutoAttach and AutoDetach.

August 10, 2013

Hi Nirio,

thanks for your reply & your solution is working....

Please, if you know, tell me how to insert a my own icon to a button widget?

i'm currently doing it with Rolleoverbuttoclass, & that time i'm using "IID_ITRISTATECONTROLDATA".

So can i use iconic button widgets even with "kButtonWidgetBoss"?,

Thanks.

Inspiring
August 10, 2013

Use RollOverIconButtonWidget instead of ButtonWidget.

Refer the pictureicon sample in SDK.

Participating Frequently
August 9, 2013

Please take a look at the BasicDialog and BasicSelectableDialog samples included in the SDK.

These samples both have buttons of various kinds that show how to attach observers.

August 10, 2013

Thanks Thimothy..........