virtual void Iconize(bool iconize = TRUE);
virtual bool IsIconized() const;
virtual void Restore();
- virtual void SetMenuBar(wxMenuBar *menubar);
virtual void SetIcon(const wxIcon& icon);
// implementation only from now on
// Copy constructors
inline wxIcon(const wxIcon& icon) { Ref(icon); }
- wxIcon( const char **data );
- wxIcon( char **data );
- wxIcon(const char bits[], int width, int height);
+ wxIcon(const char **data);
+ wxIcon(char **data);
+ wxIcon(const char bits[], int width=-1, int height=-1);
wxIcon(const wxString& name, long flags = wxBITMAP_TYPE_ICON_RESOURCE,
int desiredWidth = -1, int desiredHeight = -1);
~wxIcon();
inline wxIcon& operator = (const wxIcon& icon) { if (*this == icon) return (*this); Ref(icon); return *this; }
inline bool operator == (const wxIcon& icon) { return m_refData == icon.m_refData; }
inline bool operator != (const wxIcon& icon) { return m_refData != icon.m_refData; }
+
+ // create from bitmap (which should have a mask unless it's monochrome):
+ // there shouldn't be any implicit bitmap -> icon conversion (i.e. no
+ // ctors, assignment operators...), but it's ok to have such function
+ void CopyFromBitmap(const wxBitmap& bmp);
};
/*
virtual void Check(bool bDoCheck = TRUE);
virtual bool IsChecked() const;
+ virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
+ virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
+
#if wxUSE_ACCEL
virtual wxAcceleratorEntry *GetAccel() const;
#endif // wxUSE_ACCEL
// menu handle depending on what we're
int GetRealId() const;
- static int MacBuildMenuString(StringPtr outMacItemText, SInt16 *outMacShortcutChar , UInt8 *outMacModifiers , const char *inItemName , bool useShortcuts ) ;
+ static int MacBuildMenuString(StringPtr outMacItemText, SInt16 *outMacShortcutChar , UInt8 *outMacModifiers , const char *inItemName , bool useShortcuts ) ;
private:
+ wxBitmap m_bitmap; // Bitmap for menuitem, if any
+
DECLARE_DYNAMIC_CLASS(wxMenuItem)
};
}
}
-void wxFrameMac::SetMenuBar(wxMenuBar *menuBar)
-{
- if (!menuBar)
- {
- return;
- }
-
- m_frameMenuBar = menuBar;
-// m_frameMenuBar->MacInstallMenuBar() ;
- m_frameMenuBar->Attach((wxFrame *)this);
-}
-
-
// Responds to colour changes, and passes event on to children.
void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event)
{
return FALSE;
}
+void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
+{
+ wxIcon *icon = (wxIcon*)(&bmp);
+ *this = *icon;
+}
+
IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler)
bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
}
}
-void wxFrameMac::SetMenuBar(wxMenuBar *menuBar)
-{
- if (!menuBar)
- {
- return;
- }
-
- m_frameMenuBar = menuBar;
-// m_frameMenuBar->MacInstallMenuBar() ;
- m_frameMenuBar->Attach((wxFrame *)this);
-}
-
-
// Responds to colour changes, and passes event on to children.
void wxFrameMac::OnSysColourChanged(wxSysColourChangedEvent& event)
{
return FALSE;
}
+void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
+{
+ wxIcon *icon = (wxIcon*)(&bmp);
+ *this = *icon;
+}
+
IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler)
bool wxICONResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,