+wxMenuBar::wxMenuBar( long WXUNUSED(style) )
+{
+ Init();
+}
+
+wxMenuBar::wxMenuBar(int count, wxMenu *menus[], const wxString titles[])
+{
+ Init();
+
+ m_menuCount = count;
+ m_menus = menus;
+ m_titles = new wxString[count];
+
+ int i;
+ for ( i = 0; i < count; i++ )
+ m_titles[i] = titles[i];
+
+ for ( i = 0; i < count; i++ )
+ m_menus[i]->Attach(this);
+}
+
+wxMenuBar::~wxMenuBar()
+{
+ for ( int i = 0; i < m_menuCount; i++ )
+ {
+ delete m_menus[i];
+ }
+
+ delete[] m_menus;
+ delete[] m_titles;
+}
+
+// ---------------------------------------------------------------------------
+// wxMenuBar helpers
+// ---------------------------------------------------------------------------
+
+void wxMenuBar::Refresh()
+{
+ wxCHECK_RET( m_menuBarFrame, "can't refresh a menubar withotu a frame" );
+
+ DrawMenuBar((HWND)m_menuBarFrame->GetHWND()) ;
+}
+
+WXHMENU wxMenuBar::Create()
+{
+ wxCHECK_MSG( !m_hMenu, TRUE, "menubar already created" );
+
+ m_hMenu = (WXHMENU)::CreateMenu();
+
+ if ( !m_hMenu )
+ {
+ wxLogLastError("CreateMenu");
+ }
+ else
+ {
+ for ( int i = 0; i < m_menuCount; i++ )
+ {
+ if ( !::AppendMenu((HMENU)m_hMenu, MF_POPUP | MF_STRING,
+ (UINT)m_menus[i]->GetHMenu(),
+ m_titles[i]) )
+ {
+ wxLogLastError("AppendMenu");
+ }
+ }
+ }
+
+ return m_hMenu;
+}
+
+// ---------------------------------------------------------------------------
+// wxMenuBar functions forwarded to wxMenuItem
+// ---------------------------------------------------------------------------
+