no message

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6147 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2000-02-18 23:35:39 +00:00
parent 3dbeaa523d
commit 0fe536e3f6
3 changed files with 82 additions and 47 deletions

View File

@@ -166,6 +166,7 @@ public:
// get the menu handle // get the menu handle
WXHMENU GetHMenu() const { return m_hMenu; } WXHMENU GetHMenu() const { return m_hMenu; }
unsigned long GetMenubarId() const { return m_ulMenubarId; }
// if the menubar is modified, the display is not updated automatically, // if the menubar is modified, the display is not updated automatically,
// call this function to update it (m_menuBarFrame should be !NULL) // call this function to update it (m_menuBarFrame should be !NULL)
@@ -183,8 +184,9 @@ protected:
wxArrayString m_titles; wxArrayString m_titles;
wxFrame *m_menuBarFrame; wxFrame* m_menuBarFrame;
WXHMENU m_hMenu; WXHMENU m_hMenu;
unsigned long m_ulMenubarId;
#if wxUSE_ACCEL #if wxUSE_ACCEL
// the accelerator table for all accelerators in all our menus // the accelerator table for all accelerators in all our menus

View File

@@ -494,6 +494,7 @@ protected:
#endif // wxUSE_MOUSEEVENT_HACK #endif // wxUSE_MOUSEEVENT_HACK
WXHMENU m_hMenu; // Menu, if any WXHMENU m_hMenu; // Menu, if any
unsigned long m_ulMenubarId; // it's Id, if any
// the return value of WM_GETDLGCODE handler // the return value of WM_GETDLGCODE handler
long m_lDlgCode; long m_lDlgCode;

View File

@@ -438,51 +438,74 @@ bool wxFrame::IsMaximized() const
return (vSwp.fl & SWP_MAXIMIZE); return (vSwp.fl & SWP_MAXIMIZE);
} // end of wxFrame::IsMaximized } // end of wxFrame::IsMaximized
void wxFrame::SetIcon(const wxIcon& icon) void wxFrame::SetIcon(
const wxIcon& rIcon
)
{ {
wxFrameBase::SetIcon(icon); wxFrameBase::SetIcon(rIcon);
// TODO: if (m_icon.Ok())
/*
if ( m_icon.Ok() )
{ {
SendMessage(GetHwnd(), WM_SETICON, WinSendMessage( GetHwnd()
(WPARAM)TRUE, (LPARAM)(HICON) m_icon.GetHICON()); ,WM_SETICON
,(HICON) m_icon.GetHICON()
,NULL
)
} }
*/ } // end of wxFrame::SetIcon
}
#if wxUSE_STATUSBAR #if wxUSE_STATUSBAR
wxStatusBar *wxFrame::OnCreateStatusBar(int number, wxStatusBar* wxFrame::OnCreateStatusBar(
long style, int nNumber
wxWindowID id, , long lStyle
const wxString& name) , wxWindowID vId
, const wxString& rName
)
{ {
wxStatusBar *statusBar = NULL; wxStatusBar* pStatusBar = NULL;
statusBar = wxFrameBase::OnCreateStatusBar(number, style, id, name); pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber
,lStyle
return statusBar; ,vId
} ,rName
);
return pStatusBar;
} // end of wxFrame::OnCreateStatusBar
void wxFrame::PositionStatusBar() void wxFrame::PositionStatusBar()
{ {
// TODO: //
/* // Native status bar positions itself
// native status bar positions itself //
if ( m_frameStatusBar ) if (m_frameStatusBar)
{ {
int w, h; int nWidth
GetClientSize(&w, &h); int nHeight;
int sw, sh; int nStatbarWidth
m_frameStatusBar->GetSize(&sw, &sh); int nStatbarHeight;
HWND hWndClient;
RECTL vRect;
hWndClient = ::WinWindowFromId(GetHwnd(), FID_CLIENT);
::WinQueryWindowRect(hWndClient, &vRect);
nWidth = vRect.xRight - vRect.xLeft;
nHeight = vRect.xTop - vRect.xBottom;
m_frameStatusBar->GetSize( &nStatbarWidth
,&nStatbarHeight
);
//
// Since we wish the status bar to be directly under the client area, // Since we wish the status bar to be directly under the client area,
// we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS.
m_frameStatusBar->SetSize(0, h, w, sh); //
m_frameStatusBar->SetSize( 0
,nHeight
,nWidth
,nStatbarHeight
);
} }
*/ } // end of wxFrame::PositionStatusBar
}
#endif // wxUSE_STATUSBAR #endif // wxUSE_STATUSBAR
void wxFrame::DetachMenuBar() void wxFrame::DetachMenuBar()
@@ -492,42 +515,51 @@ void wxFrame::DetachMenuBar()
m_frameMenuBar->Detach(); m_frameMenuBar->Detach();
m_frameMenuBar = NULL; m_frameMenuBar = NULL;
} }
} } // end of wxFrame::DetachMenuBar
void wxFrame::SetMenuBar(wxMenuBar *menu_bar) void wxFrame::SetMenuBar(
wxMenuBar* pMenuBbar
)
{ {
if (!menu_bar) if (!pMenuBar)
{ {
DetachMenuBar(); DetachMenuBar();
return; return;
} }
wxCHECK_RET( !menu_bar->GetFrame(), wxT("this menubar is already attached") ); wxCHECK_RET(!pMenuBar->GetFrame(), wxT("this menubar is already attached"));
if (m_frameMenuBar) if (m_frameMenuBar)
delete m_frameMenuBar; delete m_frameMenuBar;
m_hMenu = menu_bar->Create(); m_hMenu = pMenuBbar->Create();
m_ulMenubarId = pMenubar->GetMenubarId();
if (m_ulMenubarId != FID_MENU)
{
::WinSetWIndowUShort( m_hMenu
,QWS_ID
,(unsigned short(m_ulMenubarId)
);
}
if ( !m_hMenu ) if (!m_hMenu)
return; return;
InternalSetMenuBar(); InternalSetMenuBar();
m_frameMenuBar = menu_bar; m_frameMenuBar = menu_bar;
menu_bar->Attach(this); menu_bar->Attach(this);
} } // end of wxFrame::SetMenuBar
void wxFrame::InternalSetMenuBar() void wxFrame::InternalSetMenuBar()
{ {
// TODO:
/* ::WinPostMsg( GetHwnd()
if ( !::SetMenu(GetHwnd(), (HMENU)m_hMenu) ) ,WM_UPDATEFRAME
{ ,FCF_MENU
wxLogLastError("SetMenu"); ,NULL
} );
*/ } // end of wxFrame::InternalSetMenuBar
}
// Responds to colour changes, and passes event on to children. // Responds to colour changes, and passes event on to children.
void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event) void wxFrame::OnSysColourChanged(wxSysColourChangedEvent& event)