Applied patch [ 1039456 ] [wxOS2]Popup menu problems
By Dave Parsons Fixes problems including: titles do not display, title id is already allocated to the menu separator, menus show in totally the wrong position, possible to call DoPopupMenu with out of range parameters, showing a menu enters an infinite loop with 100% cpu usage, ProcessEvent is called destroying the return value from HandleMouseEvent. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -47,7 +47,7 @@ extern wxMenu* wxCurrentPopupMenu;
|
||||
//
|
||||
// The (popup) menu title has this special id
|
||||
//
|
||||
static const int idMenuTitle = -2;
|
||||
static const int idMenuTitle = -3;
|
||||
|
||||
//
|
||||
// The unique ID for Menus
|
||||
@@ -280,7 +280,7 @@ bool wxMenu::DoInsertOrAppend(
|
||||
rItem.id = pItem->GetId();
|
||||
}
|
||||
|
||||
BYTE* pData;
|
||||
BYTE* pData=NULL;
|
||||
|
||||
#if wxUSE_OWNER_DRAWN
|
||||
if (pItem->IsOwnerDrawn())
|
||||
@@ -304,10 +304,18 @@ bool wxMenu::DoInsertOrAppend(
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Menu is just a normal string (passed in data parameter)
|
||||
//
|
||||
rItem.afStyle |= MIS_TEXT;
|
||||
if (pItem->GetId() == idMenuTitle)
|
||||
{
|
||||
// Item is an unselectable title to be passed via pData
|
||||
rItem.afStyle = MIS_STATIC;
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// Menu is just a normal string (passed in data parameter)
|
||||
//
|
||||
rItem.afStyle |= MIS_TEXT;
|
||||
}
|
||||
pData = (char*)pItem->GetText().c_str();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user