Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Tracking CheckBox Event in a Panel

New Here ,
Dec 03, 2008 Dec 03, 2008
Hi,

I ve created a plugin with 4 checkboxes and an iconic button.
I ve called a JavaScript on clicking that button. But i need to call different scripts depending on whih checkbox is clicked.
I was able to track the checkbox event in a dialog. In a dialog, the code used for this is:

bool16 visibility = (GetTriStateControlData(kBscDlgRadioButtonWidgetID) == ITriStateControlData::kSelected);

if(visibility)
CAlert::InformationAlert("RadioButton checked");
else
CAlert::InformationAlert("RadioButton not checked");

This code will be put in:
void BscDlgDialogController::ApplyDialogFields( IActiveContext* myContext, const WidgetID& widgetId)

which in turn uses CDialogController.h....

Can i use the same for Panels.. Is it correct to use CDialogController for panels????
I m quite confused...
Or els pls provide the code to track the checkbox event in PANEL...
PLs help.
Thanks.
Someone pls help
TOPICS
SDK
570
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 03, 2008 Dec 03, 2008
You should use an (or several...) observers. You probably want an observer on the panel which autoattaches/detaches to the 4 checkboxes and operates on them in the update method.

Ian
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 03, 2008 Dec 03, 2008
Thanks for ur quick reply Ian...<br /><br />I have an observer class for catching the button event...<br />I think i can give the checkbox event code there itself... Tell me if i m wrong...<br />I don't kno to track the checkbox event in a panel. I mean the code to check if the widget is checked or not.<br /><br />I tried giving this code in the update method of the observer class:<br /><br />#include "CDialogController.h"<br />#include "ITriStateControlData.h"<br />#include "IDialogController.h"<br /><br />update()<br />{<br />InterfacePtr<IDialogController> dialogController(this, UseDefaultIID());<br /> ITriStateControlData::TriState x = dialogController->GetTriStateControlData(kPicIcoVisibleCheckBoxWidgetID); <br /> <br /><br />bool16 visibility = (x == ITriStateControlData::kSelected);<br /><br />//if(visibility)<br />//CAlert::InformationAlert("RadioButton checked");<br />//else<br />//CAlert::InformationAlert("RadioButton not checked");<br />}<br /><br />This gets build, but my appln quits wen i click the button.<br />I kno that this code can be used for dialogs..<br />Can i use the same for panels.<br />If yes, wat could b the reason that m not gettin o/p<br />If not, Pls provide me the code for knowin wether checkbox is clicked or not...<br /><br />Pls Help... I m new to InDesign...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Dec 04, 2008 Dec 04, 2008
LATEST
You are missing basic understanding of the indesign api. You probably crash because there is no dialog controller interface on a panel. There is no short-cut to learning the api, consult the documentation, sample code, etc.

Sorry, I do not work for Adobe and do not have the time to help further - my job pays me to work for them..

Ian
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines