wxGTK1 build fixes after the recent changes
Update wxMenuItem to use wxBitmapBundle and wxSpinCtrl use DoSetIncrement() in wxGTK1 just as it was done in wxGTK. Closes #22157.
This commit is contained in:
parent
e77d5f3094
commit
9129254574
4 changed files with 29 additions and 4 deletions
|
|
@ -32,8 +32,8 @@ public:
|
|||
virtual void Enable( bool enable = TRUE );
|
||||
virtual void Check( bool check = TRUE );
|
||||
virtual bool IsChecked() const;
|
||||
virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; }
|
||||
virtual const wxBitmap& GetBitmap() const { return m_bitmap; }
|
||||
virtual void SetBitmap(const wxBitmapBundle& bitmap) { m_bitmap = bitmap; }
|
||||
virtual wxBitmap GetBitmap() const;
|
||||
|
||||
#if wxUSE_ACCEL
|
||||
virtual wxAcceleratorEntry *GetAccel() const;
|
||||
|
|
@ -65,7 +65,7 @@ private:
|
|||
void DoSetText(const wxString& text);
|
||||
|
||||
wxString m_hotKey;
|
||||
wxBitmap m_bitmap; // Bitmap for menuitem, if any
|
||||
wxBitmapBundle m_bitmap; // Bitmap for menuitem, if any
|
||||
|
||||
GtkWidget *m_menuItem; // GtkMenuItem
|
||||
GtkWidget* m_labelWidget; // Label widget
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@ public:
|
|||
void GtkDisableEvents();
|
||||
void GtkEnableEvents();
|
||||
|
||||
void DoSetIncrement(double inc);
|
||||
void SetIncrement(int inc) { DoSetIncrement(inc); }
|
||||
double DoGetIncrement() const;
|
||||
|
||||
GtkAdjustment *m_adjust;
|
||||
float m_oldPos;
|
||||
|
||||
|
|
|
|||
|
|
@ -870,6 +870,11 @@ wxAcceleratorEntry *wxMenuItem::GetAccel() const
|
|||
|
||||
#endif // wxUSE_ACCEL
|
||||
|
||||
wxBitmap wxMenuItem::GetBitmap() const
|
||||
{
|
||||
return GetBitmapFromBundle(m_bitmap);
|
||||
}
|
||||
|
||||
void wxMenuItem::Check( bool check )
|
||||
{
|
||||
wxCHECK_RET( m_menuItem, wxT("invalid menu item") );
|
||||
|
|
@ -978,7 +983,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
|
|||
else if (mitem->GetBitmap().IsOk())
|
||||
{
|
||||
text = mitem->wxMenuItemBase::GetItemLabel();
|
||||
const wxBitmap *bitmap = &mitem->GetBitmap();
|
||||
const wxBitmap bitmap = mitem->GetBitmap();
|
||||
|
||||
// TODO
|
||||
wxUnusedVar(bitmap);
|
||||
|
|
|
|||
|
|
@ -165,6 +165,22 @@ bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||
return true;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::DoSetIncrement(double inc)
|
||||
{
|
||||
wxCHECK_RET( m_widget, "invalid spin button" );
|
||||
|
||||
GtkAdjustment* adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(m_widget));
|
||||
adj->step_increment = inc;
|
||||
}
|
||||
|
||||
double wxSpinCtrl::DoGetIncrement() const
|
||||
{
|
||||
wxCHECK_MSG( (m_widget != NULL), 0, wxT("invalid spin button") );
|
||||
|
||||
GtkAdjustment* adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(m_widget));
|
||||
return adj->step_increment;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::GtkDisableEvents()
|
||||
{
|
||||
gtk_signal_disconnect_by_func( GTK_OBJECT(m_adjust),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue