projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
final revision
[wxWidgets.git]
/
src
/
univ
/
menu.cpp
diff --git
a/src/univ/menu.cpp
b/src/univ/menu.cpp
index e2e7f7ab8f9667cfdcb5b30a431f52f37fa79682..2d3fa88a55101453f890433e4a03cf8a24a7f44f 100644
(file)
--- a/
src/univ/menu.cpp
+++ b/
src/univ/menu.cpp
@@
-347,7
+347,7
@@
void wxPopupMenuWindow::SetCurrentItem(wxMenuItemIter node)
void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
{
void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node)
{
- if ( !m_nodeCurrent || (node != m_nodeCurrent) )
+ if ( !m_nodeCurrent ||
!node ||
(node != m_nodeCurrent) )
{
wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
{
wxMenuItemIter nodeOldCurrent = m_nodeCurrent;
@@
-988,7
+988,7
@@
bool wxPopupMenuWindow::ProcessKeyDown(int key)
int idxAccel = item->GetAccelIndex();
if ( idxAccel != -1 &&
int idxAccel = item->GetAccelIndex();
if ( idxAccel != -1 &&
- wxTolower(item->GetLabel()[(size_t)idxAccel])
+
(wxChar)
wxTolower(item->GetLabel()[(size_t)idxAccel])
== chAccel )
{
// ok, found an item with this accel
== chAccel )
{
// ok, found an item with this accel
@@
-1538,18
+1538,12
@@
void wxMenuItem::UpdateAccelInfo()
m_strAccel = m_text.AfterFirst(_T('\t'));
}
m_strAccel = m_text.AfterFirst(_T('\t'));
}
-void wxMenuItem::SetText(const wxString& txt)
+void wxMenuItem::SetText(const wxString& t
e
xt)
{
{
- if ( txt != m_text )
+ if ( t
e
xt != m_text )
{
{
- wxString text = txt;
- if (text.IsEmpty())
- {
- wxASSERT_MSG(wxIsStockID(GetId()), wxT("A non-stock menu item with an empty label?"));
- text = wxGetStockLabel(GetId(), wxSTOCK_WITH_ACCELERATOR|wxSTOCK_WITH_MNEMONIC);
- }
-
// first call the base class version to change m_text
// first call the base class version to change m_text
+ // (and also check if we don't have a stock menu item)
wxMenuItemBase::SetText(text);
UpdateAccelInfo();
wxMenuItemBase::SetText(text);
UpdateAccelInfo();
@@
-2336,8
+2330,7
@@
int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
int idxAccel = info.GetAccelIndex();
if ( idxAccel != -1 &&
int idxAccel = info.GetAccelIndex();
if ( idxAccel != -1 &&
- wxTolower(info.GetLabel()[(size_t)idxAccel])
- == chAccel )
+ (wxChar)wxTolower(info.GetLabel()[(size_t)idxAccel]) == chAccel )
{
// ok, found an item with this accel
if ( idxFound == -1 )
{
// ok, found an item with this accel
if ( idxFound == -1 )