X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a7a4e10ed18f81a576dcd866cfbf02bf404c00..3d3f3e3749fa5812c1937736b8745d696263a8b5:/src/gtk/menu.cpp diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index aa3a7bee52..f27623a980 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -14,12 +14,11 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/log.h" + #include "wx/app.h" + #include "wx/bitmap.h" #endif -#include "wx/log.h" -#include "wx/app.h" -#include "wx/bitmap.h" - #if wxUSE_ACCEL #include "wx/accel.h" #endif // wxUSE_ACCEL @@ -29,21 +28,14 @@ #include // FIXME: is this right? somehow I don't think so (VZ) -#ifdef __WXGTK20__ - #include - - #define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g)) - #define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g)) - #define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m) - - #define ACCEL_OBJECT GtkWindow - #define ACCEL_OBJECTS(a) (a)->acceleratables - #define ACCEL_OBJ_CAST(obj) ((GtkWindow*) obj) -#else // GTK+ 1.x - #define ACCEL_OBJECT GtkObject - #define ACCEL_OBJECTS(a) (a)->attach_objects - #define ACCEL_OBJ_CAST(obj) GTK_OBJECT(obj) -#endif + +#define gtk_accel_group_attach(g, o) gtk_window_add_accel_group((o), (g)) +//#define gtk_accel_group_detach(g, o) gtk_window_remove_accel_group((o), (g)) +//#define gtk_menu_ensure_uline_accel_group(m) gtk_menu_get_accel_group(m) + +#define ACCEL_OBJECT GtkWindow +#define ACCEL_OBJECTS(a) (a)->acceleratables +#define ACCEL_OBJ_CAST(obj) ((GtkWindow*) obj) // we use normal item but with a special id for the menu title static const int wxGTK_TITLE_ID = -3; @@ -151,7 +143,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow) void wxMenuBar::Init(size_t n, wxMenu *menus[], const wxString titles[], long style) { // the parent window is known after wxFrame::SetMenu() - m_needParent = FALSE; + m_needParent = false; m_style = style; m_invokingWindow = (wxWindow*) NULL; @@ -286,7 +278,7 @@ void wxMenuBar::UnsetInvokingWindow( wxWindow *win ) bool wxMenuBar::Append( wxMenu *menu, const wxString &title ) { if ( !wxMenuBarBase::Append( menu, title ) ) - return FALSE; + return false; return GtkAppend(menu, title); } @@ -332,20 +324,20 @@ bool wxMenuBar::GtkAppend(wxMenu *menu, const wxString& title, int pos) frame->UpdateMenuBarSize(); } - return TRUE; + return true; } bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { if ( !wxMenuBarBase::Insert(pos, menu, title) ) - return FALSE; + return false; // TODO if ( !GtkAppend(menu, title, (int)pos) ) - return FALSE; + return false; - return TRUE; + return true; } wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title) @@ -884,9 +876,9 @@ void wxMenuItem::Enable( bool enable ) bool wxMenuItem::IsChecked() const { - wxCHECK_MSG( m_menuItem, FALSE, wxT("invalid menu item") ); + wxCHECK_MSG( m_menuItem, false, wxT("invalid menu item") ); - wxCHECK_MSG( IsCheckable(), FALSE, + wxCHECK_MSG( IsCheckable(), false, wxT("can't get state of uncheckable item!") ); return ((GtkCheckMenuItem*)m_menuItem)->active != 0; @@ -1086,7 +1078,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) // gtk_widget_lock_accelerators(mitem->GetMenuItem()); } - return TRUE; + return true; } wxMenuItem* wxMenu::DoAppend(wxMenuItem *mitem) @@ -1415,7 +1407,7 @@ static wxString GetGtkHotKey( const wxMenuItem& item ) extern "C" WXDLLIMPEXP_CORE void gtk_pop_hide_callback( GtkWidget *WXUNUSED(widget), bool* is_waiting ) { - *is_waiting = FALSE; + *is_waiting = false; } WXDLLIMPEXP_CORE void SetInvokingWindow( wxMenu *menu, wxWindow* win )