1. wxFrame doesn't show incorrect hints in the status bar for popup items
2. radio box handles wxSIZE_AUTO_WIDTH/HEIGHT correctly (finally!) 3. attempts to fix broken sash git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -179,15 +179,17 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event)
|
|||||||
wxSashEdgePosition edge = m_draggingEdge;
|
wxSashEdgePosition edge = m_draggingEdge;
|
||||||
m_draggingEdge = wxSASH_NONE;
|
m_draggingEdge = wxSASH_NONE;
|
||||||
|
|
||||||
|
y = abs((short)y);
|
||||||
|
|
||||||
wxRect dragRect;
|
wxRect dragRect;
|
||||||
wxSashDragStatus status = wxSASH_STATUS_OK;
|
wxSashDragStatus status = wxSASH_STATUS_OK;
|
||||||
switch (edge)
|
switch (edge)
|
||||||
{
|
{
|
||||||
case wxSASH_TOP:
|
case wxSASH_TOP:
|
||||||
{
|
{
|
||||||
if (y > (yp + h))
|
if ( y > (yp + h))
|
||||||
status = wxSASH_STATUS_OUT_OF_RANGE;
|
status = wxSASH_STATUS_OUT_OF_RANGE;
|
||||||
int newHeight = (h - y);
|
int newHeight = (yp + h - y);
|
||||||
newHeight=wxMax(newHeight,m_minimumPaneSizeY);
|
newHeight=wxMax(newHeight,m_minimumPaneSizeY);
|
||||||
newHeight=wxMin(newHeight,m_maximumPaneSizeY);
|
newHeight=wxMin(newHeight,m_maximumPaneSizeY);
|
||||||
dragRect = wxRect(xp, (yp + h) - newHeight, w, newHeight);
|
dragRect = wxRect(xp, (yp + h) - newHeight, w, newHeight);
|
||||||
|
@@ -636,18 +636,21 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event)
|
|||||||
{
|
{
|
||||||
if (GetStatusBar())
|
if (GetStatusBar())
|
||||||
{
|
{
|
||||||
|
wxString help;
|
||||||
int menuId = event.GetMenuId();
|
int menuId = event.GetMenuId();
|
||||||
if ( menuId != -1 )
|
if ( menuId != -1 )
|
||||||
{
|
{
|
||||||
wxMenuBar *menuBar = GetMenuBar();
|
wxMenuBar *menuBar = GetMenuBar();
|
||||||
if (menuBar && menuBar->FindItem(menuId))
|
if (menuBar && menuBar->FindItem(menuId))
|
||||||
{
|
{
|
||||||
// set status text even if the string is empty - this will at
|
help = menuBar->GetHelpString(menuId);
|
||||||
// least remove the string from the item which was previously
|
|
||||||
// selected
|
|
||||||
SetStatusText(menuBar->GetHelpString(menuId));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// set status text even if the string is empty - this will at
|
||||||
|
// least remove the string from the item which was previously
|
||||||
|
// selected
|
||||||
|
SetStatusText(help);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -972,20 +975,22 @@ bool wxFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu)
|
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
|
||||||
{
|
{
|
||||||
int item;
|
int item;
|
||||||
if ( nFlags == 0xFFFF && hMenu == 0 )
|
if ( flags == 0xFFFF && hMenu == 0 )
|
||||||
{
|
{
|
||||||
// FIXME: what does this do? does it ever happen?
|
// menu was removed from screen
|
||||||
item = -1;
|
item = -1;
|
||||||
}
|
}
|
||||||
else if ((nFlags != MF_SEPARATOR) && (nItem != 0) && (nItem != 65535))
|
else if ( !(flags & MF_POPUP) && !(flags & MF_SEPARATOR) )
|
||||||
{
|
{
|
||||||
item = nItem;
|
item = nItem;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// don't give hints for separators (doesn't make sense) nor for the
|
||||||
|
// items opening popup menus (they don't have them anyhow)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -353,6 +353,9 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
{
|
{
|
||||||
int currentX, currentY;
|
int currentX, currentY;
|
||||||
GetPosition(¤tX, ¤tY);
|
GetPosition(¤tX, ¤tY);
|
||||||
|
int widthOld, heightOld;
|
||||||
|
GetSize(&widthOld, &heightOld);
|
||||||
|
|
||||||
int xx = x;
|
int xx = x;
|
||||||
int yy = y;
|
int yy = y;
|
||||||
|
|
||||||
@@ -418,21 +421,36 @@ void wxRadioBox::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
|||||||
|
|
||||||
int extraHeight = cy1;
|
int extraHeight = cy1;
|
||||||
|
|
||||||
#if !CTL3D
|
#if defined(CTL3D) && !CTL3D
|
||||||
// Requires a bigger group box in plain Windows
|
// Requires a bigger group box in plain Windows
|
||||||
extraHeight *= 3;
|
extraHeight *= 3;
|
||||||
extraHeight /= 2;
|
extraHeight /= 2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
MoveWindow(GetHwnd(), x_offset, y_offset,
|
// only change our width/height if asked for
|
||||||
totWidth+cx1, totHeight+extraHeight,
|
if ( width == -1 )
|
||||||
TRUE);
|
{
|
||||||
|
if ( sizeFlags & wxSIZE_AUTO_WIDTH )
|
||||||
|
width = totWidth + cx1;
|
||||||
|
else
|
||||||
|
width = widthOld;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( height == -1 )
|
||||||
|
{
|
||||||
|
if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
|
||||||
|
height = totHeight + extraHeight;
|
||||||
|
else
|
||||||
|
height = heightOld;
|
||||||
|
}
|
||||||
|
|
||||||
|
MoveWindow(GetHwnd(), x_offset, y_offset, width, height, TRUE);
|
||||||
|
|
||||||
x_offset += cx1;
|
x_offset += cx1;
|
||||||
y_offset += cy1;
|
y_offset += cy1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (!CTL3D)
|
#if defined(CTL3D) && (!CTL3D)
|
||||||
y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
|
y_offset += (int)(cy1/2); // Fudge factor since buttons overlapped label
|
||||||
// JACS 2/12/93. CTL3D draws group label quite high.
|
// JACS 2/12/93. CTL3D draws group label quite high.
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user