From: Włodzimierz Skiba Date: Mon, 4 Sep 2006 19:22:57 +0000 (+0000) Subject: Build fix. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b137e49318613a59bea5fca42734ec1b0aaf6f7a Build fix. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41008 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/app.h b/include/wx/app.h index 029e3534a5..da16865843 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -113,7 +113,7 @@ public: // Called from wxExit() function, should terminate the application a.s.a.p. virtual void Exit(); - + // Return the layout direction for the current locale virtual wxLayoutDirection GetLayoutDirection() const; diff --git a/include/wx/intl.h b/include/wx/intl.h index 4a1b2b4ab8..e7dcff8a91 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -16,6 +16,16 @@ #include "wx/defs.h" #include "wx/string.h" +// Make wxLayoutDirection enum available without need for wxUSE_INTL so wxWindow, wxApp +// and other classes are not distrubed by wxUSE_INTL + +enum wxLayoutDirection +{ + wxLayout_Default, + wxLayout_LeftToRight, + wxLayout_RightToLeft +}; + #if wxUSE_INTL #include "wx/fontenc.h" @@ -302,13 +312,6 @@ enum wxLanguage // --- --- --- generated code ends here --- --- --- -enum wxLayoutDirection -{ - wxLayout_Default, - wxLayout_LeftToRight, - wxLayout_RightToLeft -}; - // ---------------------------------------------------------------------------- // wxLanguageInfo: encapsulates wxLanguage to OS native lang.desc. // translation information @@ -604,4 +607,3 @@ inline const wxChar *wxGetTranslation(const wxChar *sz1, const wxChar *sz2, #endif #endif // _WX_INTL_H_ - diff --git a/include/wx/stockitem.h b/include/wx/stockitem.h index a7480db878..65e01d9f72 100644 --- a/include/wx/stockitem.h +++ b/include/wx/stockitem.h @@ -43,9 +43,13 @@ enum wxStockLabelQueryFlag WXDLLEXPORT wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC); -// Returns the accelerator that should be used for given stock UI element -// (e.g. "Ctrl+x" for wxSTOCK_EXIT) -WXDLLEXPORT wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id); +#if wxUSE_ACCEL + + // Returns the accelerator that should be used for given stock UI element + // (e.g. "Ctrl+x" for wxSTOCK_EXIT) + WXDLLEXPORT wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id); + +#endif #ifdef __WXGTK20__ diff --git a/include/wx/window.h b/include/wx/window.h index 739309ac03..e0b685a110 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -191,7 +191,7 @@ public: // it is wxID_ANY which means "don't care" void SetId( wxWindowID winid ) { m_windowId = winid; } wxWindowID GetId() const { return m_windowId; } - + // get or change the layout direction (LTR or RTL) for this window, // wxLayout_Default is returned if layout direction is not supported virtual wxLayoutDirection GetLayoutDirection() const @@ -1042,7 +1042,7 @@ public: wxAccessible* GetOrCreateAccessible() ; #endif - + // Set window transparency if the platform supports it virtual bool SetTransparent(wxByte WXUNUSED(alpha)) { return false; } virtual bool CanSetTransparent() { return false; } diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index fed2b7aab3..fa5db01ac9 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -224,7 +224,7 @@ wxLayoutDirection wxAppConsole::GetLayoutDirection() const { const wxLanguageInfo *const info = wxLocale::GetLanguageInfo(locale->GetLanguage()); - + if ( info ) return info->LayoutDirection; } diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index bac9c10c1f..bda58fced8 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -174,6 +174,8 @@ wxString wxGetStockLabel(wxWindowID id, long flags) stockLabel = wxStripMenuCodes( stockLabel ); } +#if wxUSE_ACCEL + if (!stockLabel.empty() && (flags & wxSTOCK_WITH_ACCELERATOR)) { stockLabel += _T("\t"); @@ -183,9 +185,13 @@ wxString wxGetStockLabel(wxWindowID id, long flags) stockLabel += accel.ToString(); } +#endif // wxUSE_ACCEL + return stockLabel; } +#if wxUSE_ACCEL + wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id) { wxAcceleratorEntry ret; @@ -220,6 +226,8 @@ wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id) return ret; } +#endif // wxUSE_ACCEL + bool wxIsStockLabel(wxWindowID id, const wxString& label) { if (label.empty())