Kirix Support Forums

wxAUI Question (about visibility of floating panes)

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAUI Question (about visibility of floating panes)

Postby T-Rex on Sun Dec 25, 2005 6:59 am

Hello.

I have a small quesiotn... Is it normal behaviour when wxPaneInfo::Show(...) has no affect for floating panes. I managed how to show/hide floating panes (see the code below), but is there more elegant way to do that?

Code: Select all
void wxToolBoxSampleIDEMainFrame::TogglePaneVisibility(wxString pane_name)
{
   wxPaneInfoArray& all_panes = m_FrameManager.GetAllPanes();
   size_t i, count;
   for (i = 0, count = all_panes.GetCount(); i < count; ++i)
   {      
      if(all_panes.Item(i).name == pane_name)
      {
         if(all_panes.Item(i).IsFloating())
         {
            all_panes.Item(i).frame->Show(!all_panes.Item(i).frame->IsShown());
         }
         else
         {
            all_panes.Item(i).Show(!all_panes.Item(i).IsShown());
         }
         m_FrameManager.Update();
         break;
      }
   }
}


Regards,
T-Rex
[url=http://wxwidgets.info]wxwidgets.info - Articles and Tutorials
wxToolBox - wxWidgets components that works like VisualStudio ToolBox
T-Rex
Registered User
 
Posts: 10
Joined: Sun Dec 25, 2005 6:57 am
Location: Ukraine

Postby Ben on Mon Dec 26, 2005 11:07 am

This is a bug in the wxAUI 0.9 release. I'll make a patch to fix it, and then incorporate that in the next release (which will happen soon). Thanks for the report.

All the best,
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Postby Ben on Sat Dec 31, 2005 3:49 pm

Ok. I've fixed the problem. Here is a patch to fix your issue. I'll make sure to include the fix in the next wxAUI release.

Thanks for the bug report.

All the best,
Ben

Code: Select all
Index: src/manager.cpp
===================================================================
--- src/manager.cpp   (revision 774)
+++ src/manager.cpp   (working copy)
@@ -2152,7 +2152,11 @@
                 
                 frame->SetPaneWindow(p);
                 p.frame = frame;
-                frame->Show();
+
+                if (p.IsShown())
+                {
+                    frame->Show();
+                }
             }
              else
             {
@@ -2164,6 +2168,8 @@
                                      -1, -1, wxSIZE_USE_EXISTING);
                     //p.frame->Move(p.floating_pos.x, p.floating_pos.y);
                 }
+
+                 p.frame->Show(p.IsShown());
             }
         }
          else
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Return to wxAUI Questions, Thoughts & Feedback