Kirix Support Forums

Left and Right Docking State

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

Left and Right Docking State

Postby epage on Wed Jul 26, 2006 4:19 pm

Well, I have moved my companies program over to wxAUI and I have to say, overall the transition was smooth.

Left/Right Docking of Toolbars
At a quick glance through CVS it looked like at least some of the code related to left and right docking was merged (I think I saw GripperTop(bool)). I have applied the patches in 0.9.2 and am working with our in house toolbars that work on all sides

One problem I see is that on Windows with the screen maximized, there is no border to go over to initiate docking. On the bottom you normally have the status bar, and on top you have the menus and titlebar.

My best guess at
wxFrameManager::DoDrop
Code: Select all
// toolbars may only be moved in and to fixed-pane docks,
// otherwise we will try to float the pane.  Also, the pane
// should float if being dragged over center pane windows
if (!part->dock->fixed || part->dock->dock_direction == wxAUI_DOCK_CENTER)


More complicated position code would need to be implemented instead of "part->dock->dock_direction == wxAUI_DOCK_CENTER" to know if we are in a buffer around the edge of the ContentPane

Perspective Loading

With a very dynamic program, custom toolbars, windows, etc, it seems a bit brittle to have wxFrameManager::LoadPerspective fail on any window that doesn't exist anymore or hasn't been loaded yet. Unless there is a different, better way, it seems like it'd be nicer to change

wxFrameManager::LoadPerspective
Code: Select all
wxPaneInfo& p = GetPane(pane.name);
if (!p.IsOk())
{
  // the pane window couldn't be found
  // in the existing layout
  return false;
}

to be

wxFrameManager::LoadPerspective
Code: Select all
wxPaneInfo& p = GetPane(pane.name);
if (!p.IsOk())
{
  // the pane window couldn't be found
  // in the existing layout
  continue;
}


Docking events

For our inhouse toolbar code to work best, we need to be able to change our state, either by some specific event that occurs or some generic function call we overload

States:
Docked Left: Right Gripper Off, Top Gripper On, Resize False
Docked Right: Right Gripper On, Top Gripper Off, Resize False
Floating: Right Gripper Off, Top Gripper Off, Resize True

Floating Resize: Recalculate the number of rows/columns and get a snug fit around it. One approach being to intercept the size event, change it based on our calculations, and then to pass it on so that the frame is set correctly (Doesn't seem like the cleanest but more hypothetical to describe our situation)

What would be the best way to impement these different docking behaviors? Best being judged off of cleanest and most wxWidget-like so that hopefully parts can be brought be merged in and we do not have to keep a seperate patched tree.

I doubt anyone else would be interested in my hiunt change due to its invoking of policy, but if you have a floating toolbar (horizontal) and you are going to dock it vertically, then the drop hint is a lot bigger of a area then what will occur.

So I changed
wxFrameManager::DrawHintRect
Code: Select all
wxSizer* sizer = LayoutAll(panes, docks, uiparts, true);
wxSize client_size = m_frame->GetClientSize();

to

wxFrameManager::DrawHintRect
Code: Select all
wxSizer* sizer = LayoutAll(panes, docks, uiparts, true);
wxSize original_client_size = m_frame->GetClientSize();
wxSize client_size = original_client_size;
if (toolbar)
{
    wxSize client_size.x = std::min (original_client_size.x, original_client_size.y);
    wxSize client_size.y = std::min (original_client_size.x, original_client_size.y);
}

passing in toolbar being a bool passed in from wxFrameManager::OnFloatingPaneMoving

________________________________________

I am appreciative of your work, and am willing to implement these things, but being fairly new to wxWidgets, if I could at least be pointed in the right direction, thanks. Also if people could voice what they would be interested in me submitting back, thatd be great.
epage
Registered User
 
Posts: 10
Joined: Thu Jul 13, 2006 2:16 pm

Return to wxAUI Questions, Thoughts & Feedback