8 Replies Latest reply: Jan 16, 2008 8:06 AM by (leofdiaz) RSS

    Resizing a panel does not force an update

    Community Member
      hello,

      i have several panels with listboxes in my plugin and just ported it to cs3. now when i resize a panel the dialog items are not updated and buttons apears over the list and over buttons. the list and buttons have resize bindings.
      in cs2 all works great. in cs3 the panel is not updated after resizing. only moving/closing/reopening the panel will do the job.

      what is going wrong?
      is this because the resize widget does not exists any more in cs3?

      thanks,

      juergen
        • 1. Re: Resizing a panel does not force an update
          Community Member
          Hi,

          I am also facing the same problem but only on Mac.
          On windows it works fine.

          I will really appreciate if anybody can help?

          Regards,
          Rahul Rastogi
          • 2. Re: Resizing a panel does not force an update
            FarzanaArethwala Community Member
            Hi,

            Even I am facing the same problem. Currently on Mac I have faced this problem. When I hide and show widgets on Palette. It does not refresh the Palette and both the widgets are visible.

            Do we need to update some patch on Application or SDK which might resolve this?

            Regards
            Farzana.
            • 3. Re: Resizing a panel does not force an update
              Community Member
              I'm not sure what your problem is - can't you resize the panels at all or are the resized panels not properly drawn? As Jürgen already stated the resize widget is no longer supported/needed for panels, only for dialogs (take a look at the porting guide doc, p. 35 and following.) In short, remove your resize widgets and define your panel in the panellsit resource definition as "isResizable".Then define the panel's widgets framebindings accordingly. Note that you pobably will have to use some other framebinding-option than "kBindAll" for Listboxes etc ( you can combine then with the or operator "|" (i.e. kBindLeft|kBindTop for binding left and top) to prevent other widgets to draw over or get drawn over by your listboxes. Code snippet:

              //this way we'll start with a single palette containing both panels
              //they can be separated by user via drag&drop
              resource PanelList (kSDKDefPanelResourceID)
              {
              {
              // 1st panel in the list
              kSDKDefPanelResourceID, // Resource ID for this panel (use SDK default rsrc ID)
              kMYPluginID, // ID of plug-in that owns this panel
              isResizable,//notResizable or isResizable,
              kMyFirstPanelWidgetActionID, // Action ID to show/hide the panel
              kMyFirstProjectPanelTitleKey, // Shows up in the Window list.
              "Main:kMyPanelListTitleKey:kMyPanelMenu",//:kMyProjectPanelTitleKey", // Alternate menu path of the form "Main:Foo" if you want your palette menu item in a second place
              0.0, // Alternate Menu position Alternate Menu position for determining menu order
              0,0, // Rsrc ID, Plugin ID for a PNG icon resource to use for this palette
              c_Panel,

              // 2nd panel in the list
              kMyScndManagerPanelID, // Resource ID for this panel
              kMyPluginID, // ID of plug-in that owns this panel
              isResizable,//notResizable,//isResizable,
              kMyScndProjectPanelWidgetActionID, // Action ID to show/hide the panel
              kMyScndPanelTitleKey,// Shows up in the Window list.
              "Main:kALPanelListTitleKey:kALPanelMenu",//:kALJobPanelTitleKey", // Alternate menu path of the form "Main:Foo" if you want your palette menu item in a second place
              0.0, // Alternate Menu position Alternate Menu position for determining menu order
              0,0, // Rsrc ID, Plugin ID for a PNG icon resource to use for this palette
              c_Panel
              }
              };

              /* PanelView definition.
              */
              resource MyFirstProjectPanelWidget (kSDKDefPanelResourceID) //+ index_enUS)
              {
              __FILE__,
              __LINE__, // Localization macro
              kMyFirstProjectPanelWidgetID, // WidgetID
              kPMRsrcID_None, // RsrcID
              kBindNone, // Binding (0=none)
              Frame(20,5,291,511) // Frame: left, top, right, bottom.
              kTrue,
              kTrue, // Visible, Enabled
              kFalse, // Erase background
              kInterfacePaletteFill, // Erase to color
              kFalse, // Draw dropshadow
              kMyFirstProjectPanelTitleKey, // Panel name
              {
              StaticTextWidget
              (
              0, // WidgetId (default=0)
              kSysStaticTextPMRsrcId, // RsrcId
              kBindTop|kBindLeft, // Frame binding //used for resizing,
              [...]
              • 4. Re: Resizing a panel does not force an update
                FarzanaArethwala Community Member
                Hi Marc,

                I have both the conditions. I have one Resizable Palette and in the PanelList resource Definition it is set as is Resizable. Another Palette I have is notResizable. The settings are there as you have mentioned i.e. BindLeft|BindTop.

                In both the palette conditions I am displaying the Widgets such as buttons/popups depending upon certain selection of radio button/popup values. Here it overlaps the buttons / popups overlap each other when I Show/Hide according to my criteria.

                Sometimes it displays a white patch where the button is hidden and overlaps.

                Thank you,

                Regards
                Farzana.
                • 5. Re: Resizing a panel does not force an update
                  Community Member
                  Hi,

                  I am also facing the same problem on Mac.

                  I have ported the project from CS2 to CS3 and remove the resize widgets and made the panel resizable.

                  The Panel does get resized but its widgets overlap and is only removed when panel is moved or made hidden/shown.

                  It sometimes show white patch as mentioned above.

                  Regards,
                  Rahul Rastogi
                  • 6. Re: Resizing a panel does not force an update
                    Community Member
                    Hi,

                    I am still facing the problem.

                    Can anyone help me out?

                    Regards,
                    Rahul Rastogi
                    • 7. Re: Resizing a panel does not force an update
                      Peter S L Community Member
                      in your .fr file where you specify your panel, there is a field that you can set to erase background. Set it to kTrue should solve your problem... if what I saw is what you described.
                      • 8. Re: Resizing a panel does not force an update
                        I was having this problem too and the only solution that I found was to "erase" the panel contents first. Here's some sample code:

                        void MyPanelView::Draw( IViewPort* viewPort, SysRgn updateRgn )
                        {
                        // Erase panel first to avoid drawing artifacts
                        InterfacePtr< IGraphicsPort > graphPort( viewPort, IID_IGRAPHICSPORT );
                        if ( graphPort != nil ) {
                        AGMGraphicsContext gc( viewPort, this, updateRgn );
                        InterfacePtr< IGraphicsPort > gPort( gc.GetViewPort(), UseDefaultIID() );
                        if ( gPort != nil ) {
                        RealAGMColor paletteFillColor( 0.0, 0.0, 0.0 );
                        InterfacePtr< IInterfaceColors > colors( gSession, IID_IINTERFACECOLORS );
                        if ( colors != nil ) {
                        colors->GetRealAGMColor( kInterfacePaletteFill, paletteFillColor );
                        }

                        AutoGSave autoGSave( graphPort );

                        SysRect updateRect = GetRegionRect( updateRgn );
                        gPort->rectpath( updateRect );
                        gPort->setrgbcolor( paletteFillColor.red, paletteFillColor.green, paletteFillColor.blue );
                        gPort->fill();
                        }
                        }

                        PalettePanelView::Draw(viewPort, updateRgn);

                        } // Draw