1 Reply Latest reply on Jun 6, 2014 7:34 AM by falk0

    Weird Layout behaviour in InDesign CC (Mac OS, CC only)

    falk0 Level 1

      Hello,

       

      I'm developing a new version of an extension with Extension Builder 2.1 (Flash Builder 4.6) that targets InDesign CC.

      The layout of my extension is changing based on the selected element of the document. I have layouts for TextFrame, Rectangle, Cell, Group and a "main menu".

      I save the layout data to the script label of the selected element in my application_focusOutHandler. After saving, the main menu layout should be displayed.

       

      I ran into a weird problem with the layout on InDesign CC on Mac OS.

       

      Some code that might be helpful:

      <csxs:CSExtension xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:csxs="com.adobe.csxs.core.*"

         width="220"

         height="344"

         applicationComplete="onCreationComplete()"

         backgroundColor="white"

         fontSize="9" fontFamily="Arial" xmlns:mx="library://ns.adobe.com/flex/mx" >

       

      Setting up the event listener:

      var csxs:CSInterface = CSInterface.instance;
      csxs.addEventListener(StateChangeEvent.WINDOW_LOSE_FOCUS, application_focusOutHandler);

       

       

      The problem:

      For example, when the user selects a TextFrame, my layout looks like this:

      extension4.PNG

       

      When the user clicks on the checkbox (i.e. "Bewegen"), the extension will immediately go back to the "main menu" layout. However, the checkbox is NOT checked and the data is not saved to the script label!

      I can't check any of them by clicking on the extensions UI.

      When holding the left mouse button, the "underlaying" (underlaying as in the same X;Y position of the checkbox-mouse-click) button of the main menu will also be pressed down and execute on release of the mouse button.

       

      extension1.PNG

      I can't reproduce this on Windows. Unfortunately I am not able to debug on our Mac as I have no access to it.

       

      This occurs on the mx as well as the spark checkbox control:

      <s:CheckBox label="Bewegen" id="bMove" selected="{controller.cLabelData.bMove}" height="16"/>
      <mx:CheckBox label="Bewegen" id="bMove2" selected="{controller.cLabelData.bMove}" height="16"/>

       

       

      I use mx:Box containers. I have one box container for every InDesign element type that I listed above. The other components inside the box containers differ from type to type.

      Main menu:

      <mx:Box visible="{controller.ObjType == 0}" x="2" y="0" width="200" height="344" includeInLayout="{controller.ObjType == 0}" horizontalScrollPolicy="off" verticalScrollPolicy="off" verticalGap="1">

      TextFrame:

      <mx:Box visible="{controller.ObjType == 1}" x="2" y="0" width="200" height="344" includeInLayout="{controller.ObjType == 1}" horizontalScrollPolicy="off" verticalScrollPolicy="off" verticalGap="0" >

      etc.

       

      The earlier versions of this extension were targeting older versions of InDesign and worked flawlessly (CS5, CS5.5, CS6).

       

      Thanks for every help!

      Greetings,

        • 1. Re: Weird Layout behaviour in InDesign CC (Mac OS, CC only)
          falk0 Level 1

          Hello,

           

          I have some updates as I now have access to a MacOS computer.

          After setting up my environment with a fresh install of Extension Builder 2.1, I started debugging my extension.

           

          I have investigated that wherever I press on my extension panel, the application_focusOutHandler is called three times.

          It does not matter whether I click on a control like a checkbox or just the extensions "background". The focusOutHandler is still called three times.

           

          Coming back to my problem: This means whenever I try to check a checkbox in my layout, the application_focusOutHandler is called three times while the actual component I try to access remains unchanged. So even after the three events being fired, the component values stay unchanged.

           

          Is there any workaround/fix for this?

           

          Thanks!

          Greetings,