fixed typos in last check in

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-07-24 18:30:43 +00:00
parent d6b447a754
commit a6b7a521a4
4 changed files with 56 additions and 29 deletions

View File

@@ -466,21 +466,21 @@ public:
bool DetachPane(wxWindow* window);
void Update();
wxString SavePaneInfo(wxAuiPaneInfo& pane);
void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane);
wxString SavePerspective();
bool LoadPerspective(const wxString& perspective, bool update = true);
void SetDockSizeConstraint(double width_pct, double height_pct);
void GetDockSizeConstraint(double* width_pct, double* height_pct) const;
void ClosePane(wxAuiPaneInfo& pane_info);
void MaximizePane(wxAuiPaneInfo& pane_info);
void RestorePane(wxAuiPaneInfo& pane_info);
void RestoreMaximizedPane();
wxString SavePaneInfo(wxAuiPaneInfo& pane);
void LoadPaneInfo(wxString pane_part, wxAuiPaneInfo &pane);
wxString SavePerspective();
bool LoadPerspective(const wxString& perspective,
bool update = true);
void Update();
public:
virtual wxAuiFloatingFrame* CreateFloatingFrame(wxWindow* parent, const wxAuiPaneInfo& p);
@@ -609,12 +609,15 @@ protected:
wxAuiDockUIPart* m_action_part; // ptr to the part the action happened to
wxWindow* m_action_window; // action frame or window (NULL if none)
wxRect m_action_hintrect; // hint rectangle for the action
bool m_skipping;
bool m_has_maximized;
wxRect m_last_rect;
wxAuiDockUIPart* m_hover_button;// button uipart being hovered over
wxRect m_last_hint; // last hint rectangle
wxPoint m_last_mouse_move; // last mouse move position (see OnMotion)
bool m_skipping;
bool m_has_maximized;
double m_dock_constraint_x; // 0.0 .. 1.0; max pct of window width a dock can consume
double m_dock_constraint_y; // 0.0 .. 1.0; max pct of window height a dock can consume
wxFrame* m_hint_wnd; // transparent hint window, if supported by platform
wxTimer m_hint_fadetimer; // transparent fade timer

View File

@@ -2398,7 +2398,8 @@ void wxAuiNotebook::InitNotebook(long style)
m_dummy_wnd->Show(false);
m_mgr.SetManagedWindow(this);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | (1 << 28) /*wxAUI_MGR_NO_DOCK_SIZE_LIMIT*/);
m_mgr.SetFlags(wxAUI_MGR_DEFAULT);
m_mgr.SetDockSizeConstraint(1.0, 1.0); // no dock size constraint
m_mgr.AddPane(m_dummy_wnd,
wxAuiPaneInfo().Name(wxT("dummy")).Bottom().CaptionVisible(false).Show(false));

View File

@@ -153,9 +153,9 @@ static void DrawGradientRectangle(wxDC& dc,
int r,g,b;
r = start_color.Red() + (high == 0 ? 0 : (((i*rd*100)/high)/100));
g = start_color.Green() + (high == 0 ? 0 : (((i*gd*100)/high)/100));
b = start_color.Blue() + (high == 0 ? 0 : (((i*bd*100)/high)/100));
r = start_color.Red() + (high <= 0 ? 0 : (((i*rd*100)/high)/100));
g = start_color.Green() + (high <= 0 ? 0 : (((i*gd*100)/high)/100));
b = start_color.Blue() + (high <= 0 ? 0 : (((i*bd*100)/high)/100));
wxPen p(wxColor((unsigned char)r,
(unsigned char)g,

View File

@@ -69,11 +69,6 @@ DEFINE_EVENT_TYPE(wxEVT_AUI_FIND_MANAGER)
IMPLEMENT_DYNAMIC_CLASS(wxAuiManagerEvent, wxEvent)
IMPLEMENT_CLASS(wxAuiManager, wxEvtHandler)
// private manager flags (not yet on the public API)
enum wxAuiPrivateManagerOption
{
wxAUI_MGR_NO_DOCK_SIZE_LIMIT = 1 << 28
};
const int auiToolBarLayer = 10;
@@ -504,6 +499,8 @@ wxAuiManager::wxAuiManager(wxWindow* managed_wnd, unsigned int flags)
m_skipping = false;
m_has_maximized = false;
m_frame = NULL;
m_dock_constraint_x = 0.3;
m_dock_constraint_y = 0.3;
if (managed_wnd)
{
@@ -1972,17 +1969,22 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
}
}
if (!(m_flags & wxAUI_MGR_NO_DOCK_SIZE_LIMIT))
{
// new dock's size may not be more than 1/3 of the frame size
if (dock.IsHorizontal())
size = wxMin(size, cli_size.y/3);
else
size = wxMin(size, cli_size.x/3);
}
// new dock's size may not be more than the dock constraint
// parameter specifies. See SetDockSizeConstraint()
int max_dock_x_size = (int)(m_dock_constraint_x * ((double)cli_size.x));
int max_dock_y_size = (int)(m_dock_constraint_y * ((double)cli_size.y));
if (dock.IsHorizontal())
size = wxMin(size, max_dock_y_size);
else
size = wxMin(size, max_dock_x_size);
// absolute minimum size for a dock is 10 pixels
if (size < 10)
size = 10;
dock.size = size;
}
@@ -2215,6 +2217,27 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
}
// SetDockSizeConstraint() allows the dock constraints to be set. For example,
// specifying values of 0.5, 0.5 will mean that upon dock creation, a dock may
// not be larger than half of the window's size
void wxAuiManager::SetDockSizeConstraint(double width_pct, double height_pct)
{
m_dock_constraint_x = wxMax(0.0, wxMin(1.0, width_pct));
m_dock_constraint_y = wxMax(0.0, wxMin(1.0, height_pct));
}
void wxAuiManager::GetDockSizeConstraint(double* width_pct, double* height_pct) const
{
if (width_pct)
*width_pct = m_dock_constraint_x;
if (height_pct)
*height_pct = m_dock_constraint_y;
}
// Update() updates the layout. Whenever changes are made to
// one or more panes, this function should be called. It is the
// external entry point for running the layout engine.