ToolTipText of a node(widget) ?

I cannot find a property "toolTipText" to set a tooltip for a node (for example a button):
def stop:Button = Button {
text: "Stop"
// toolTipText does not exist
toolTipText: "Stops the progress"
action: function() {mediaPlayer.stop();}
(Look at [http://www.builderau.com.au/program/java/soa/Introducing-JavaFX-Sun-s-new-family-of-Java-based-products/0,339024620,339286272,00.htm|http://www.builderau.com.au/program/java/soa/Introducing-JavaFX-Sun-s-new-family-of-Java-based-products/0,339024620,339286272,00.htm], there is a property called toolTipText, but I cannot find it in the javafx-api)
Should I build my own tooltip?

Well, as expected (feared!), the article is old, way before the release of the 1.0 version.
Articles before December 2008 (date of first release) have, at best, only historical interest...
So, no, JavaFX doesn't offer tooltips out of the box (yet?).
I made my own class, including management of time out. It isn't that hard. I should revise it, as at the time I haven't found a way to find out the scene of the component owning the tooltip, so I had to insert them manually in the scene: not a big problem but not very elegant. I would also now center the text in the rectangle by using the Stack layout...
[EDIT] Ah, too late! :-) I should have refreshed the question before answering it some hours later... ;-)
Edited by: PhiLho on 19 oct. 2009 07:25

Similar Messages

  • [IDCS3] Asserts during tree node creation

    I'm porting a plug-in from CS2 to CS3 and am in the middle of converting a list box widget displayed on a dialog to a tree view, using the WListBoxComposite SDK sample and SDK docs as a guide. I'm getting the message:<br /><br />b CreateObject- ReadWrite for impl kTreeNodeControlViewImpl in class kTreeNodeWidgetBoss read wrong amount in plugin <my plugin ID><br /><br />during RegisterStyleWidget in my widget manager implementation, and <br /><br />b ASSERT 'fUTF16BufferLength >= fNumChars'<br /><br />once the dialog is displayed. If I change my tree view adapter to report zero list items then things work fine. I'm assuming this is due to a problem with the resource definition in my .fr, but I haven't been able to spot anything wrong. Are there other places I should be looking at for the source of these errors?<br /><br />For reference, my node widget is defined as:<br /><pre><br />type MyTreeNodeWidget(kViewRsrcType) : <br />ErasablePrimaryResourcePanelWidget(ClassID = kTreeNodeWidgetBoss){};<br /><br />resource MyTreeNodeWidget(kMyTreeNodeRsrcID + index_enUS)<br />{<br />    __FILE__, __LINE__,         <br />    kMyTreeNodeWidgetID, //Widget ID<br />    kPMRsrcID_None,             //Resource ID<br />    kBindLeft | kBindRight,<br />    Frame(0,0,200,20),<br />    kTrue, kTrue,               //Visible, Enabled<br />    kTrue,                      //Erase before draw<br />    kInterfacePaletteFill,      //Color to erase to<br />    "",<br />    {<br />        InfoStaticTextWidget<br />        (<br />            kMyTreeNodeNameWidgetID,            <br />            kSysStaticTextPMRsrcId,<br />            kBindNone,<br />            Frame(2,0,Width, Height),<br />            kTrue, kTrue,                                   <br />            kAlignLeft,                                     <br />            kDontEllipsize,<br />            "",<br />            0,<br />            kPaletteWindowSystemScriptFontId, <br />            kPaletteWindowSystemScriptHiliteFontId,<br />        ),<br />    }       <br />};<br /><br /></pre>

    ErasablePrimaryResourcePanelWidget is wrong, use StandardTreeNodeWidget for kTreeNodeWidgetBoss. The ControlView implementation on StandardTreeNodeWidget (kTreeNodeControlViewImpl) expects the CControlView values without erase and color values.
    Do your erase outside, in the actual tree view.
    Dirk

  • Cannot move widgets (NetBeans Visual Library)

    Hello,
    I'm currently developping a swing application which also uses netbeans visual library.
    The problem I'm facing is that I cannot move the widget I have created, even though I've specified
    a move action on it.
    Here's the code, which does not need any comments, I think :
    final Scene scene = new Scene ();
              scene.setLayout(new AbsoluteLayout());
              final Widget parentWidget = new Widget(scene);
              // create the icon node widget
              Widget iconNode = new Widget (scene);
              class LabelTextFieldEditor implements TextFieldInplaceEditor {
                  public boolean isEnabled(Widget widget) {
                      return true;
                  public String getText(Widget widget) {
                      return ((LabelWidget) widget).getLabel();
                  public void setText(Widget widget, String text) {
                      ((LabelWidget) widget).setLabel(text);
              // resizeStrategy is described in Listing 4 
              iconNode.getActions().addAction(ActionFactory.createResizeAction());          
              iconNode.getActions().addAction (ActionFactory.createMoveAction());
              WidgetAction action = ActionFactory.createInplaceEditorAction(new LabelTextFieldEditor());
              iconNode.setBorder(BorderFactory.createResizeBorder(6));
              // use a vertical layout
              scene.setLayout (LayoutFactory.createAbsoluteLayout());
              // add a image child widget
              iconNode.addChild (new ImageWidget (scene, Utilities.loadImage ("com/test/generator/png/apple.png")));
              iconNode.setPreferredLocation(new Point(10, 20));
              // add a label child widget
              LabelWidget modifiableLabel = new LabelWidget (scene, "Apple");
              modifiableLabel.getActions().addAction (action);
              iconNode.addChild (modifiableLabel);
              // add it to the scene
              scene.addChild (iconNode);
              JComponent sceneView = scene.createView ();
              JScrollPane panel = new JScrollPane (sceneView);
              panel.setBounds (0, 0, 600, 600);
              sceneView.validate();
              panel4.add (panel);Any idea ?? Even the resize action is not really working. I can move the resize frame, but the picture inside of it does not
    change (but maybe it's another problem).
    Wny help will be appreciated !
    Thanks.
    Steph

    Well, what I've noticed is that I cannot move the widget if it's alone.
    If I add another one, it's working.
    Note that it does not solve my problem, though ...
    Because I'm in the process of writing an interactive screen designer, and I would like it possible
    for the user to move the first widget he puts on the screen to choose its initial position.
    Thanks !

  • [CS3] - TreeView node padding

    Hi all,    I'm creating TreeView which is used in my PlugIn instead of ListBox which is deprecated. Now is everything working fine, I have treeView without displayed root node. But my problem is that after adding new node some nodes are moved to the right about 10px.
    After pressing right arrow nodes are shifted to the left and nodes are in one vertical line.
    Please could you advise me how to force that nodes won't have any padding ?
    Thank you, marxin

    Check the bindings of tree node widgets.

  • Getting some error while opening our plugin in InDesign CC Debugger

    Hi,
    We are loading XML file using our plugin. After opening Indesign documents (Created using the same XML), we have refreshed the tree(using our plugin option). We are getting the below mentioned asserts,
    1. Direct model change to database without transaction. Either process a command or call a utility or facade interface that does what you want, or implement your own cmd if none exist.  Generally, DON'T just call IDataBase::BeginTransaction()/EndTransaction.
    2. Comparing translated string to non-translated string!(Strings are '\\New Technology\37_NATURE2.jpg' and '\'
    Please help us to fix this issue.
    Thanks,
    Vimala L

    Hi,
    2) Comparing translated string to non-translated string, most likely comparing 2 PMStrings, one of them has settranslatable as kFalse.
    Thanks for your reply..Already we have set the settranslatable as kFalse. But getting this error.
    bool16 SampleTVWidgetMgr::ApplyNodeIDToWidget(
      const NodeID& node, IControlView* widget, int32 message) const
      CTreeViewWidgetMgr::ApplyNodeIDToWidget(node, widget);
      do
      // If this node doesn't have any children, don't show expander Widget
      InterfacePtr<IPanelControlData>
      panelControlData(widget, UseDefaultIID());
      ASSERT(panelControlData);
      if(panelControlData==nil) {
      break;
      // Set expander widget to hidden state if this node has no kids
      IControlView* expanderWidget = panelControlData->FindWidget(kTreeNodeExpanderWidgetID);
      ASSERT(expanderWidget);
      if(expanderWidget == nil) {
      break;
      InterfacePtr<const ITreeViewHierarchyAdapter>
      adapter(this, UseDefaultIID());
      ASSERT(adapter);
      if(adapter == nil) {
      break;
      if (expanderWidget) {
      if (adapter->GetNumChildren(node) <= 0) {
      expanderWidget->HideView();
      else {
      expanderWidget->ShowView();
      IControlView* iconView =
      panelControlData->FindWidget(kSampleIconWidgetId);
      ASSERT(iconView);
      if (iconView == nil) {
      break;
      TreeNodePtr<SampleFileNodeID> nodeID(node);
      ASSERT(nodeID);
      if(nodeID == nil) {
      break;
      PMString nodePath =  nodeID->GetPath();
      this->setIconForContent(iconView, nodePath);
      IControlView* displayStringView =
      panelControlData->FindWidget( kSampleNodeNameWidgetID );
      ASSERT(displayStringView);
      if(displayStringView == nil) {
      break;
      InterfacePtr<ITextControlData>
      textControlData( displayStringView, UseDefaultIID() );
      ASSERT(textControlData);
      if(textControlData== nil) {
      break;
      PMString stringToDisplay(SampleUtils::TruncatePath(nodePath));
      if(stringToDisplay.empty()) {
      stringToDisplay="Empty?";
      stringToDisplay.SetTranslatable( kFalse );
      textControlData->SetString(stringToDisplay);
      // Adjust indenting- this may be temporary
      this->indent( node, widget, displayStringView );
      } while(kFalse);
      return kTrue;
    Thanks,
    Vimala L

  • Problem in getting IControlView of IconSuiteWidget which is added in the tree resource

    Hi friends,
    I am facing following problem while working with Tree Widget.
    Please guide me regarding this issue.
    I have added IconSuiteWidget to the tree resource in .fr file.
    Now I wish to hide it after user clicks on the node. I have written
    code for this in the file which is implementation of
    (classTreeObserverImpl) ClassTreeObserver, aggregated on the boss
    class kXXTreeViewWidgetBoss which inherits from the
    kTreeViewWidgetBoss. But I am not getting IControlView of the
    IconSuiteWidget . The work which I have done to get IControlView
    pointer is through using IWidgetParent interface.
    Could anybody tell me which step i am missing, because I am getting
    IControlView of the RollOverIcon which is placed aside of
    IconSuiteWidget(in the resource of tree).
    Please help me regarding this issue,
    Thanks in advance.
    Vijay Choudhari.

    Use IControlView* QueryWidgetFromNode ( const NodeID & node )
    .So the task before you is gettting the NodeID..
    You can get it from ..
    NodeID_rv id = TrvNodeID::Create();
    NodeID nodeID(id);
    Once you get the controlview of the node widget you can get the controlview of any of its child widget by gettting its IPanelControldata..
    Hope this helps..
    regds,
    yopangjo

  • White background an a TreeNode?

    How Do I set the background to white in a three node widget?
    Im using a tree in a panel, and the default background seems to be gray. How do I change to white?
    Best Regards
    / Pontus Hulin

    You need to write your own widget. You can find several examples of this in the CS4 SDK, like sdk/source/open/components/hyperlinkpanel/HyperlinkNameView.cpp

  • Create a dynamic tool tip

    Hi All,
    I am working in an application where I am using the treeview widget. My requirement is to add a dynamic tool tip to the tree nodes. I read in a forum that I have to look into IID_ITIP. But I am still not clear as to how will I create a tool tip and associate the same to the node widget in the treeview. Any help or clues would be appreciated.
    Thanks in Advance
    JRS.

    Hi All,
    I am still not be to get this done. Could anyone guide me or refer some sample code existing?
    Thanks,
    JRS.

  • Problem in TreeView

    Hi, Iam new to Indesign, and working on TreeView Control. I have understood the working and the flow of function calls in PanelTreeView sample(within heirarchy adapter/WidgetMgr/Datamodel cpps).
    Iam making a TreeView which is  different from PanelTreeView sample, in the sense that, In my version of TreeView “mTreeID (Int32)” is a unique id for each node...rather than “path(PMString)”.
    PROBLEM:: lets say a folder “AAA” has another folder “111”,then flow of functions is as follows
    In PanelTreeView Sample
    GetRootNode()--->GetNumChildren()---->GetNthChildData()---->CreateWidgetForNode()
    In My project
    CreateWidgetForNode() is not get called.   Iam not able to detect where is the problem, please help!!
    For better understanding of the problem, I am sending a summary of what we had implemented,as follows:
    1. We had implemented classes for tree view. Before testing with the server data we are first testing with dummy data to see if the implemention is working as expected but the problem is that TreeViewWidgetMgr is not getting the call for creating the node widget. We have reviewed and debugged a couple of times but could not find the root cause.
    2. The implementation is as follows,
    a. Created a class MyData with members
    >int32 mTreeID - This is unique id for each node.
    >PMString mS1
    >PMString mS2....and so on
    b. Implemented  _TVNodeID derived from NodeIDClass. It has member
    >MyData  mMyData.
    c. Implemented  _TVDataNode with members
    >K2Vector<Int32>mChildren
    >MyData
    >mMyData   _TVDataNode* mParent
    d. Implemented  _TVDataModel with members
    >std::map fData  _TV
    >DataNode* fRoot
    >int32 fTreeIDKey
    e. Implemented  _TVHierarchyAdapter and  _TVWidgetMgr.
    In the debug version of InDesign, we get an assert "We're adding an item '...' to the sorted list that already exists. Item will not be added".
    This is the screenshot of the ASSERT iam getting:

    Nope, still no success... Selections are on the verge to unreadable, and I've found no way to change the colour of the font inside the treeview.
    I'll try and make time to report this as a bug or feature request, at https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform
    If you do the same thing, someone at Adobe might might pay attention to the problem and add some functionality to the next version.
    Good to know that I'm not alone,
    Andreas

  • [CS3] WLBCmpEyeballObserver::Update() - How to get NodeID?

    How do you get access to NodeID (and hence the internal data) at user action on a widget in Node widget. WLBCmpEyeballObserver::Update() stops short at displaying an alert box.
    void WLBCmpEyeballObserver::Update
         const ClassID& theChange,
         ISubject* theSubject,
         const PMIID &protocol,
         void* changedBy
         if(theChange == kTrueStateMessage) {
              // Then the button has been activated.
              do {
                        PMString dbgInfoString("WLBCmpEyeballObserver::Update() ");
                        dbgInfoString.SetTranslatable(kFalse);     // only for debug- not real code
                        CAlert::InformationAlert(dbgInfoString);
              } while(0);
    I tried following so far:
    void WLBCmpEyeballObserver::Update
         const ClassID& theChange,
         ISubject* theSubject,
         const PMIID &protocol,
         void* changedBy
         do
              InterfacePtr<IControlView> controlView(theSubject, UseDefaultIID());
              // Get the button ID from the view.
              WidgetID theSelectedWidget = controlView->GetWidgetID();
              if (theSelectedWidget == kWLBCmpListElementEyeballWidgetID
                   && theChange == kTrueStateMessage)
                   // 1st approach - Following returns null
                   InterfacePtr<ITreeNodeIDData> nodeData(this, UseDefaultIID());
                   TreeNodePtr<WLBCmpNodeID> nodeID(nodeData->Get());
                   // 2nd approach - I do get the controller.
                   // But its of no use since my row isn't selected
                   InterfacePtr<IWidgetParent> widgetParent(controlView, UseDefaultIID());
                   InterfacePtr<ITreeViewController> controller(static_cast<ITreeViewController*>(
                        widgetParent->QueryParentFor(ITreeViewController::kDefaultIID)));
                   NodeIDList selectedItems;
                   controller->GetSelectedItems(selectedItems);
                   const int kSelectionLength =  selectedItems.size() ;
                   if (kSelectionLength> 0 )
                        K2Vector<NodeID>::const_iterator iter;
                        for(iter = selectedItems.begin(); iter != selectedItems.end(); ++iter) {
                             const WLBCmpNodeID* oneNode = static_cast<const WLBCmpNodeID*>(iter->Get());
         } while (false);

    Allright finally got it to work. Trick was to get panel control data > find node widget > get node data
    void WLBCmpEyeballObserver::Update
         const ClassID& theChange,
         ISubject* theSubject,
         const PMIID &protocol,
         void* changedBy
         do
              InterfacePtr<IControlView> eyeballControlView(theSubject, UseDefaultIID());
              // Get the button ID from the view.
              WidgetID theSelectedWidget = eyeballControlView->GetWidgetID();
              if (theSelectedWidget == kWLBCmpListElementEyeballWidgetID
                   && theChange == kTrueStateMessage)
                   // Get parent of eyeball widget
                   InterfacePtr<IWidgetParent> eyeBallWidgetParent(eyeballControlView, UseDefaultIID());
                   // Get control view of parent - just in case they are different
                   InterfacePtr<IControlView> nodeWidgetControlView(eyeBallWidgetParent, UseDefaultIID());
                   // Get the panel control data of parent widget
                   InterfacePtr<IPanelControlData> panelControlData(
                        (IPanelControlData*)(eyeBallWidgetParent->QueryParentFor(IPanelControlData::kDefaultIID)));
                   ASSERT(panelControlData);
                   if (!panelControlData) break;
                   // find the node widget id from panel control data
                   IControlView* parentWidgetControlView =
                        panelControlData->FindWidget(kWLBCmpListParentWidgetId);
                   // Get the node data. This is not null
                   InterfacePtr<ITreeNodeIDData> nodeData(parentWidgetControlView, UseDefaultIID());
                   TreeNodePtr<WLBCmpNodeID> wlbCmpNodeID (nodeData->Get());
         } while (false);

  • SCOM 2012 R2 RU 2 Topology widgets Background image and Nod visualization is missing

    After Updating RU 2 in System center OM 2012 R2 no background image and Nod visualization missing in Topology widgets ?
    Santosh Dharamsale

    You will need to Import the MP Microsoft.SystemCenter.Visualization.Library.mpb.
    For more info., You can refer below link
    http://thoughtsonopsmgr.blogspot.com/2014/04/update-rollup-2-for-scom-2012-r2.html
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical | Twitter:
    Mai Ali

  • Tooltiptext for nodes in a JTree

    Hi
    I have a Jtree in a scrollPane ,I want to set Tooltiptext for nodes in THE Tree only & when the part of the node is hidden while squizzing the Pane horrizontally .
    bye

    HI,
    you need a treeCellRenderer for that. Have a look in the swing tutorial.
    There are some examples.

  • How can I display the tooltip in a tree node?

    I implement a TreeCellRenderer and has already set the tooltiptext through the following code:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
            Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
            if(Leaf.class.isInstance(userObject)) {
                    Leaf leaf = (Leaf)userObject;
                    setToolTipText(leaf.getString());
        }Why can't the tree display the tooltip when a move the mouse on the leaf of the tree?
    Thank you!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    public class Test3 extends JFrame {
    public Test3() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container content = getContentPane();
    JTree jt = new JTree() {
    public String getToolTipText(MouseEvent evt) {
    if (getRowForLocation(evt.getX(), evt.getY()) == -1)
    return null;
    TreePath curPath = getPathForLocation(evt.getX(),
    evt.getY());
    return curPath.getLastPathComponent().toString();
    content.add(new JScrollPane(jt), BorderLayout.CENTER);
    jt.setToolTipText("");
    setSize(400, 400);
    setVisible(true);
    public static void main(String[] args) { new Test3();
    }It sounds a solution. I use the following code and also can display the tooltip,but there's also a problem:
        mytree.setCellRenderer(new MyTreeCellRenderer());
        ToolTipManager.sharedInstance().registerComponent(mytree);the above code only effective when the function getTreeCellRendererComponent in MyTreeCellRenderer like the following:
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }but when the code is bellow,it displays nothing(Only the leaf node need tooltip):
        public Component getTreeCellRendererComponent(JTree tree, Object value,
                               boolean selected, boolean expanded,
                               boolean leaf, int row,
                                  boolean hasFocus) {
         String  stringValue = tree.convertValueToText(value, selected,
                                expanded, leaf, row, hasFocus);
         setText(stringValue);
         //setToolTipText(stringValue); //Tooltips used by the tree
         /* Set the icon of the node */
                         Object userObject = ((DefaultMutableTreeNode)value).getUserObject();
                         if(Device.class.isInstance(userObject)) {
             setIcon(deviceIcon);
         } else {
             setIcon(nullIcon);
             Business b = (Business)userObject;
             if(b.isShowOrder())
                 setToolTipText(b.getContaId());  // only some node need tooltip, not all  node
         setFont(defaultFont);
         /* Update the selected flag for the next paint. */
         this.selected = selected;
         this.hasFocus = hasFocus;
         if(selected) // && hasFocus)
             setForeground(Color.white);
         else
             setForeground(Color.black);
         return this;
        }Anyone knows why?

  • How to enable the widgets in Indesign CC..?

    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

    Hi,
    As per ur suggestion,i have done the below changes
    .fr file:
    type SamplePrefListBox
    (kViewRsrcType) : StdListBoxWidgetN
    (ClassID =  kStdListBoxWidgetNewBoss)
    Class
                        kSamplePrefListBoxWidgetBoss,
                         kStdListBoxWidgetNewBoss,
                                  IID_IOBSERVER,kSamplePrefListBoxObserverImpl,
    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
                                  kTrue,                                                                                                                         //Erase before draw
                                  kInterfacePaletteFill,                                                                                 //Interface color
                                  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
                                  0,
                                  0,
                                  kFalse,                                                                                                                         // Display root node
                                  kFalse,                                                                                                                         //  Use Horizontal scroll bar
                                  kTrue,                                                                                                                         //  Use vertical scroll bar
                                  19,                                                                                                                                   //  Vertical scroll button increment
                                  1,                                                                                                                                   //  Vertical thumb scroll increment
                                  0,                                                                                                                                   //  Horizontal scroll button increment
                                  0,                                                                                                                                   // Horizontal thumb scroll increment
                                  1,                                                                                                                                   //  Items selectable 1 = Single selection
                                  kFalse,                                                                                                                         //  Allow children from multibler parents to be selected
                                  kTrue //,                                                                                                               //  Allow discontiguous selection
    I got error...,error R32745: # Error: Expected ')'
    SamplePrefListBoxObserver file:
    void SamplePrefListBoxObserver::AutoAttach()
              InterfacePtr<ISubject> subject(this, UseDefaultIID());
              if (subject != nil)
                        subject->AttachObserver(this, IID_ILISTCONTROLDATA);
    void SamplePrefListBoxObserver::AutoDetach()
              InterfacePtr<ISubject> subject(this, UseDefaultIID());
              if (subject != nil)
                        subject->DetachObserver(this, IID_ILISTCONTROLDATA);
    void SamplePrefListBoxObserver::Update(const ClassID& theChange,ISubject* theSubject,const PMIID &protocol,void* changedBy)
    do {
                                  InterfacePtr<IPanelControlData> iPanelControlData(this, UseDefaultIID());
                                  if(!iPanelControlData)
                                  {CAlert::InformationAlert("iPanelControlData err");break;}
                                  InterfacePtr<IWidgetParent> iWidgetParent(this, UseDefaultIID());
                                  ASSERT(iWidgetParent);
                                  if(!iWidgetParent)
                                  {CAlert::InformationAlert("iWidgetParent err");break;}
                                  InterfacePtr<IPanelControlData>          iPanelControlDataDialog(
                                  (IPanelControlData*)iWidgetParent->QueryParentFor(IID_IPANELCONTROLDATA) );
                                  if(!iPanelControlDataDialog)
                                  {CAlert::InformationAlert("iPanelControlDataDialog err");break;}
                                  InterfacePtr<IControlView> view(theSubject, UseDefaultIID()) ;
                                  if (view == nil)
                                  {CAlert::InformationAlert("Can't find the panel control view");break;}
                                  if (view->GetWidgetID() != SamplePreflistboxWidgetID)
                                            if(view->GetWidgetID() == SamplePrefDragDropScriptlistboxWidgetID)
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefUpdateScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefImportScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefAutoFlowScriptlistboxWidgetID);
                                            else if(view->GetWidgetID() == SamplePrefUpdateScriptlistboxWidgetID)
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefDragDropScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefImportScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefAutoFlowScriptlistboxWidgetID);
                                            else if(view->GetWidgetID() == SamplePrefImportScriptlistboxWidgetID)
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefDragDropScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefUpdateScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefAutoFlowScriptlistboxWidgetID);
                                            else if(view->GetWidgetID() == SamplePrefAutoFlowScriptlistboxWidgetID)
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefDragDropScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefUpdateScriptlistboxWidgetID);
                                                      this->DeSelectList(iPanelControlDataDialog,SamplePrefImportScriptlistboxWidgetID);
                                  if ((protocol == IID_ILISTCONTROLDATA) && (theChange == kListSelectionChangedByUserMessage) )
                                                      if (view->GetWidgetID() ==SamplePreflistboxWidgetID)
                                                                IControlView* generaltab = iPanelControlDataDialog->FindWidget(SamplePrefGeneralTabWidgetID);
                                                                if(!generaltab)
                                                                {CAlert::InformationAlert("generaltab err");break;}
                                                                IControlView* fittingTab = iPanelControlDataDialog->FindWidget(SamplePrefFittingTabWidgetID);
                                                                if(!fittingTab)
                                                                {CAlert::InformationAlert("fittingTab err");break;}
                                                                IControlView* scriptEventTab = iPanelControlDataDialog->FindWidget(SamplePrefScriptEventsTabWidgetID);
                                                                SDKListBoxHelper listHelper(iPanelControlData,kSamplePluginID, SamplePreflistboxWidgetID, kSampleDialogWidgetID);
                                                                IControlView * listBox = listHelper.FindCurrentListBox();
                                                                if(listBox == nil){CAlert::InformationAlert("listBox err");break;}
                                                                InterfacePtr<IListBoxController> listCntl(listBox,IID_ILISTBOXCONTROLLER);
                                                                if(listCntl == nil) {break;}
                                                                int32 Selindex = listCntl->GetSelected();
                                                                if(Selindex!=-1){
                                                                InterfacePtr<IPanelControlData> panelControlData1(listBox, UseDefaultIID());
                                                                if(!panelControlData1) {break;}
                                                                IControlView* cellPanelview = panelControlData1->FindWidget(kCellPanelWidgetID);
                                                                InterfacePtr<IPanelControlData> panelControlData2(cellPanelview, UseDefaultIID());
                                                                if(!panelControlData2) {break;}
                                                                IControlView* cellView = panelControlData2->GetWidget(Selindex);
                                                                InterfacePtr<IPanelControlData> panelControlData3(cellView, UseDefaultIID());
                                                                if(!panelControlData2) {break;}
                                                                IControlView* textView = panelControlData3->FindWidget(SamplePrefOptionTextWidgetID);
                                                                InterfacePtr<ITextControlData> cellText (textView, UseDefaultIID());
                                                                PMString selectedItem = cellText->GetString();
                                                                if(selectedItem=="General")
                                                                          generaltab->ShowView();
                                                                          fittingTab->HideView();
                                                                          scriptEventTab->HideView();
                                                                else if(selectedItem=="Fitting Options")
                                                                          generaltab->HideView();
                                                                          fittingTab->ShowView();
                                                                          scriptEventTab->HideView();
                                                                else if(selectedItem=="Events and Scripts")
                                                                          generaltab->HideView();
                                                                          fittingTab->HideView();
                                                                          scriptEventTab->ShowView();
              } while(0);
    void SamplePrefListBoxObserver::DeSelectList(IPanelControlData* iPanelControlData,WidgetID listBoxWidgetID)
    do
                        SDKListBoxHelper listHelper(iPanelControlData,kSamplePluginID, listBoxWidgetID, kSamplePanelWidgetID);
                        IControlView * listBox = listHelper.FindCurrentListBox();
                        if(listBox == nil) {
                        CAlert::InformationAlert("listBox err");
                        break;
                        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;
                        listCntl->DeselectAll(kTrue,kFalse);
    }while(0);
    please refer the above code and help me to develop the plugin.
    We have used the SDKListBoxHelper file in our plugin.If it works in Indesign CC?
    Thanks,
    Vimala L

  • Using Google GWT to create (Dashcode) widgets for iBook Author  I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pa

    I would like to embed interactive widgets in iBooks using iBookAuthor. The widgets in question started life in Java but GWT has allowed them to be converted to javascript and to run on web pages (for example, http://softoption.us/content/node/437 scroll to the bottom). In theory, iBookAuthor can bring in most html5, and much javascript. The technique is to wrap the html in a folder, with 2 extra files, a plist and a default png and then change the extension of the folder to ‘.wdgt’. This is the technique for making Dashboard widgets for the Mac, and Apple even have the Dashcode software to do it. So what you really do is to make a Dashboard widget, then iBookAuthor can import it.  So far, so good. And some  folk have been doing this, for example http://www.prweb.com/releases/2012/2/prweb9242432.htm http://www.panophoto.org/forums/viewtopic.php?f=64&t=10417&p=158330#p158423 However, if you start with GWT and create a single page with one button and a Hello World, compile it, and get the WAR file (I use Eclipse here)… the Safari browser and others will run it properly (even on an iPad). Then if you wrap it, a proper Dashboard widget is created, which runs properly on a Mac. Then if you go to iBookAuthor and put a custom widget in the Text, then drag it in. It is accepted by the text and shown as being there. However, if you use Preview to look at it on an iPad, it is gone (or was never there in the first place). Anyone any ideas on this? [And iBook Author seems to give no warnings.] The widget is at https://dl.dropbox.com/u/46713473/Test6.wdgt.zip I have bells and whistles that I’d like to get into an iBook!
    Thanks for any insights.
    Martin

    I do have a little to add, which might help someone. Indeed, opening a blank page and dragging the widget straight in seems good in difficult cases. But, actually, I was also able to insert successfully from the Toolbar especially to blank pages. So, it may have been something to do with the columns and stuff like that. Anyway back then the insertion would show in iBooks Author but not in the Preview on the iPad. I moved on to actual Google Web Toolkit output javascript. Basically I had three at hand to try: a Hello World with a button which went straight it, one of moderate complexity, (for example with a built in Lisp interpreter), which also went straight in, and finally a more complex one that initially was rejected by iBook Author. Author complained that there was an unsupported media file (of course, Author does not tell you which one it is, that would be too easy). [Remember, this was a proper working Dashboard widget which could be installed on a Mac]. Among other things I had read remarks about .gif files. When looking through the GWT war directory at the actual javascript etc files, I noticed there were two gifs there one called ‘clear.cache.gif ‘  and a second one called  ‘0F89659FF3F324AE4116F700257E32BD.cache.gif’. (Now, there is obfuscation so the numbers here may be different from case to case.) The clear.cache.gif did not seem to be anything special. But the other one is an animation. It is three little boxes that twinkle (rather like a waiting spinning cursor).  So, I opened that file and saved it to itself (that picks the top frame of the animation and saves only that, leaving you with an unanimated gif). The resulting widget drags and drops into iBooks Author (and seems to work properly at a quick glance). So, if you are having trouble with ‘unsupported media files’ converting animated gifs into unanimated gifs might help in some cases.

Maybe you are looking for