some mingw32 warnings fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-07-03 07:12:20 +00:00
parent 792a17440e
commit 3dd8eab441
3 changed files with 36 additions and 55 deletions

View File

@@ -225,8 +225,10 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
WXHWND wxComboBox::GetEditHWND() const
{
if ( GetWindowStyle() & wxCB_READONLY )
return NULL;
// this function should not be called for wxCB_READONLY controls, it is
// the callers responsability to check this
wxASSERT_MSG( !(GetWindowStyle() & wxCB_READONLY),
_T("read-only combobox doesn't have any edit control") );
POINT pt;
pt.x = pt.y = 4;

View File

@@ -417,71 +417,50 @@ void wxFrame::PositionStatusBar()
void wxFrame::DetachMenuBar()
{
if (m_frameMenuBar)
if ( m_frameMenuBar )
{
m_frameMenuBar->Detach();
m_frameMenuBar = NULL;
}
}
void wxFrame::SetMenuBar(wxMenuBar *menu_bar)
void wxFrame::SetMenuBar(wxMenuBar *menubar)
{
if (!menu_bar)
if ( !menubar )
{
DetachMenuBar();
//actually remove the menu from the frame
m_hMenu=NULL;
// actually remove the menu from the frame
m_hMenu = (WXHMENU)0;
InternalSetMenuBar();
return;
}
m_frameMenuBar = NULL;
// Can set a menubar several times.
// TODO: how to prevent a memory leak if you have a currently-unattached
// menubar? wxWindows assumes that the frame will delete the menu (otherwise
// there are problems for MDI).
if (menu_bar->GetHMenu())
else // set new non NULL menu bar
{
m_hMenu = menu_bar->GetHMenu();
m_frameMenuBar = NULL;
// Can set a menubar several times.
// TODO: how to prevent a memory leak if you have a currently-unattached
// menubar? wxWindows assumes that the frame will delete the menu (otherwise
// there are problems for MDI).
if ( menubar->GetHMenu() )
{
m_hMenu = menubar->GetHMenu();
}
else
{
menubar->Detach();
m_hMenu = menubar->Create();
if ( !m_hMenu )
return;
}
InternalSetMenuBar();
m_frameMenuBar = menubar;
menubar->Attach(this);
}
else
{
menu_bar->Detach();
m_hMenu = menu_bar->Create();
if ( !m_hMenu )
return;
}
InternalSetMenuBar();
m_frameMenuBar = menu_bar;
menu_bar->Attach(this);
#if 0 // Old code that assumes only one call of SetMenuBar per frame.
if (!menu_bar)
{
DetachMenuBar();
return;
}
wxCHECK_RET( !menu_bar->GetFrame(), wxT("this menubar is already attached") );
if (m_frameMenuBar)
delete m_frameMenuBar;
m_hMenu = menu_bar->Create();
if ( !m_hMenu )
return;
InternalSetMenuBar();
m_frameMenuBar = menu_bar;
menu_bar->Attach(this);
#endif
}
void wxFrame::InternalSetMenuBar()

View File

@@ -2195,7 +2195,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
if ( tvhti.flags & TVHT_ONITEM )
{
event.m_item = (WXHTREEITEM) tvhti.hItem;
eventType = hdr->code == NM_DBLCLK
eventType = (int)hdr->code == NM_DBLCLK
? wxEVT_COMMAND_TREE_ITEM_ACTIVATED
: wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
}