Kirix Support Forums

More Vertical Toolbar changes

Please post any wxAUI patches or modifications you've created here. Thanks!

More Vertical Toolbar changes

Postby epage on Mon Aug 07, 2006 3:08 pm

The toolbars can be a bit too sensitive in their docking behavior. This is a fix for some of it

A docked toolbar, say on the top, when you drag it to the left to line it up, it will instead dock to the left. This fix makes it so if you drag a docked toolbar (well actually anything which it does not seem to be bad behavior so far with docked windows but time and lots of docked windows at once will tell) to one of the four corners will not cause an orientation change. If anyone knows of better ways to improve this behavior, let me know.

wxFrameManager::DoDop - Old
Code: Select all
    if (pt.x < layer_insert_offset &&
        pt.x > layer_insert_offset-auiLayerInsertPixels)
    {
        ...
    }
     else if (pt.y < layer_insert_offset &&
              pt.y > layer_insert_offset-auiLayerInsertPixels)
    {
        ...
    }
     else if (pt.x >= cli_size.x - layer_insert_offset &&
              pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels)
    {
        ...
    }
     else if (pt.y >= cli_size.y - layer_insert_offset &&
              pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
    {
        ...
    }


wxFrameManager::DoDop - New
Code: Select all
    if (pt.x < layer_insert_offset &&
        pt.x > layer_insert_offset-auiLayerInsertPixels)
    {
        if (!target.IsFloating() && (target.dock_direction == wxAUI_DOCK_TOP || target.dock_direction == wxAUI_DOCK_BOTTOM ))
            return false;
        ...
    }
     else if (pt.y < layer_insert_offset &&
              pt.y > layer_insert_offset-auiLayerInsertPixels)
    {
        if (!target.IsFloating() && (target.dock_direction == wxAUI_DOCK_LEFT || target.dock_direction == wxAUI_DOCK_RIGHT ))
            return false;
        ...
    }
     else if (pt.x >= cli_size.x - layer_insert_offset &&
              pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels)
    {
        if (!target.IsFloating() && (target.dock_direction == wxAUI_DOCK_TOP || target.dock_direction == wxAUI_DOCK_BOTTOM ))
            return false;
        ...
    }
     else if (pt.y >= cli_size.y - layer_insert_offset &&
              pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels)
    {
        if (!target.IsFloating() && (target.dock_direction == wxAUI_DOCK_LEFT || target.dock_direction == wxAUI_DOCK_RIGHT ))
            return false;
        ...
    }
epage
Registered User
 
Posts: 10
Joined: Thu Jul 13, 2006 2:16 pm

Return to wxAUI Patches & Modifications