diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h index 9b777dd9ed..7f9bc844dc 100644 --- a/include/wx/fontutil.h +++ b/include/wx/fontutil.h @@ -111,7 +111,7 @@ public: static double GetCTSlant( CTFontDescriptorRef font ); CTFontDescriptorRef GetCTFontDescriptor() const; - + void RealizeResource() const; private: // attributes for regenerating a CTFontDescriptor, stay close to native values diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 9326bc22ee..a30e35fadf 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -61,10 +61,10 @@ class wxWidgetCocoaNativeKeyDownSuspender public: // stops sending keydown events for text inserted into this widget explicit wxWidgetCocoaNativeKeyDownSuspender(wxWidgetCocoaImpl *target); - + // resumes sending keydown events ~wxWidgetCocoaNativeKeyDownSuspender(); - + private: wxWidgetCocoaImpl *m_target; NSEvent* m_nsevent; @@ -263,7 +263,7 @@ protected: bool m_hasEditor; friend class wxWidgetCocoaNativeKeyDownSuspender; - + wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWidgetCocoaImpl); }; diff --git a/include/wx/osx/core/cfref.h b/include/wx/osx/core/cfref.h index 902f21d964..62c1da3e73 100644 --- a/include/wx/osx/core/cfref.h +++ b/include/wx/osx/core/cfref.h @@ -24,7 +24,7 @@ #define WX_OSX_BRIDGE __bridge #else #define WX_OSX_BRIDGE_RETAINED -#define WX_OSX_BRIDGE +#define WX_OSX_BRIDGE #endif // #include @@ -354,7 +354,7 @@ public: m_ptr = nullptr; return p; } - + // Autorelease the pointer, i.e. during the next cleanup it will be released refType autorelease() { diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index a771611296..b5957219d2 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -1082,7 +1082,7 @@ public: } return *this; } - + wxNSObjRef& operator=( T ptr ) { if (get() != ptr) diff --git a/include/wx/osx/dataform.h b/include/wx/osx/dataform.h index b82da57309..a276b8aa8d 100644 --- a/include/wx/osx/dataform.h +++ b/include/wx/osx/dataform.h @@ -46,7 +46,7 @@ public: operator NativeFormat() const { return m_format; } void SetId(NativeFormat format); - + // string ids are used for custom types - this SetId() must be used for // application-specific formats wxString GetId() const; diff --git a/include/wx/osx/dnd.h b/include/wx/osx/dnd.h index 2d98f49a64..2b6f2b16aa 100644 --- a/include/wx/osx/dnd.h +++ b/include/wx/osx/dnd.h @@ -60,7 +60,7 @@ class WXDLLIMPEXP_CORE wxDropTarget: public wxDropTargetBase virtual wxDataFormat GetMatchingPair(); bool CurrentDragHasSupportedFormat() ; - + void SetCurrentDragSource( wxOSXDataSource* dragpasteboard ) { m_currentDragPasteboard = dragpasteboard ; } protected : wxOSXDataSource* m_currentDragPasteboard ; diff --git a/interface/wx/anidecod.h b/interface/wx/anidecod.h index 3e727a79ee..ce29514c7a 100644 --- a/interface/wx/anidecod.h +++ b/interface/wx/anidecod.h @@ -28,5 +28,5 @@ public: virtual wxColour GetTransparentColour(unsigned int frame) const; protected: - virtual bool DoCanRead(wxInputStream& stream) const; + virtual bool DoCanRead(wxInputStream& stream) const; }; diff --git a/interface/wx/colordlg.h b/interface/wx/colordlg.h index ca6fba0884..5674e62f1a 100644 --- a/interface/wx/colordlg.h +++ b/interface/wx/colordlg.h @@ -117,7 +117,7 @@ public: wxColourDialogEvent(wxEventType evtType, wxColourDialog* dialog, const wxColour& colour); - + /** Retrieve the colour the user has just selected. */ diff --git a/interface/wx/colour.h b/interface/wx/colour.h index ca0ffa6f7a..0e6f722c98 100644 --- a/interface/wx/colour.h +++ b/interface/wx/colour.h @@ -340,8 +340,8 @@ public: static unsigned char AlphaBlend(unsigned char fg, unsigned char bg, double alpha); /** - Utility function that simply darkens or lightens a color, based on the specified - percentage @a ialpha. @a ialpha of 0 would be make the color completely black, + Utility function that simply darkens or lightens a color, based on the specified + percentage @a ialpha. @a ialpha of 0 would be make the color completely black, 200 completely white and 100 would not change the color. @since 2.9.0 */ diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index a4589e0055..d466397d85 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -86,7 +86,7 @@ @code wxDataViewCtrl *musicCtrl = new wxDataViewCtrl(this, wxID_ANY); wxObjectDataPtr musicModel(new MyMusicModel); - + musicCtrl->AssociateModel(musicModel.get()); // add columns now diff --git a/interface/wx/gifdecod.h b/interface/wx/gifdecod.h index 22c73c73a9..0d0fb5bb38 100644 --- a/interface/wx/gifdecod.h +++ b/interface/wx/gifdecod.h @@ -29,6 +29,6 @@ public: virtual wxColour GetTransparentColour(unsigned int frame) const; protected: - virtual bool DoCanRead(wxInputStream& stream) const; + virtual bool DoCanRead(wxInputStream& stream) const; }; diff --git a/interface/wx/msw/ole/safearray.h b/interface/wx/msw/ole/safearray.h index a8f47d721d..0902d07868 100644 --- a/interface/wx/msw/ole/safearray.h +++ b/interface/wx/msw/ole/safearray.h @@ -27,7 +27,7 @@ @library{wxcore} @category{data} - @see wxAutomationObject, wxVariantDataSafeArray, wxVariant + @see wxAutomationObject, wxVariantDataSafeArray, wxVariant */ template class wxSafeArray diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 3446013eb3..8f0f595dfb 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -2154,7 +2154,7 @@ protected: Clear cells associated with property. @param ignoreWithFlags - Cells will not be cleared for properties having these flags set. + Cells will not be cleared for properties having these flags set. @param recursively If @true, apply this operation recursively in child properties. diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index 6c08fee750..58605c49c8 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2451,7 +2451,7 @@ wxWindow* wxAuiNotebook::DoRemovePage(size_t page_idx) wxCHECK_MSG(page_idx < GetPageCount(), nullptr, "invalid page index"); // Lock the window for changes to avoid flicker when - // removing the active page (there is a noticeable + // removing the active page (there is a noticeable // flicker from the active tab is closed and until a // new one is selected) - this is noticeable on MSW wxWindowUpdateLocker locker { this }; diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index ea146dbc5d..993fa4e0fd 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -132,7 +132,7 @@ long wxListbook::GetListCtrlFlags(bool hasImages) const { flags |= wxLC_LIST; } - + #ifdef __WXQT__ flags |= wxLC_NO_HEADER; #endif diff --git a/src/generic/notifmsgg.cpp b/src/generic/notifmsgg.cpp index f0ed420b67..6dbff08671 100644 --- a/src/generic/notifmsgg.cpp +++ b/src/generic/notifmsgg.cpp @@ -156,7 +156,7 @@ wxNotificationMessageWindow::wxNotificationMessageWindow(wxGenericNotificationMe // Create title and message sizers wxSizer* textSizer = new wxBoxSizer(wxVERTICAL); - + m_messageTitle = new wxStaticText(m_messagePanel, wxID_ANY, wxString()); m_messageTitle->SetFont(m_messageTitle->GetFont().MakeBold()); textSizer->Add(m_messageTitle, wxSizerFlags(0).Border()); diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 7f52e36017..0cb596a13d 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -567,7 +567,7 @@ double wxSpinCtrlGenericBase::AdjustAndSnap(double val) const val = m_min; if ( val > m_max ) val = m_max; - + if ( m_snap_to_ticks && (m_increment != 0) ) { double snap_value = val / m_increment; diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 91f8fc9f9f..540eb6c0ec 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -394,7 +394,7 @@ static int gs_busyCount = 0; static void UpdateCursors(wxWindow* win, GdkCursor* globalCursor) { win->GTKUpdateCursor(globalCursor); - const wxWindowList& children = win->GetChildren(); + const wxWindowList& children = win->GetChildren(); wxWindowList::const_iterator i = children.begin(); for (size_t n = children.size(); n--; ++i) UpdateCursors(*i, globalCursor); diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index 7a1f61cbbf..eb4f2809d1 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -308,7 +308,7 @@ wxFontStyle wxFont::GetStyle() const int wxFont::GetNumericWeight() const { wxCHECK_MSG( IsOk(), wxFONTWEIGHT_MAX, "invalid font" ); - + return M_FONTDATA->m_nativeFontInfo.GetNumericWeight(); } @@ -376,7 +376,7 @@ void wxFont::SetStyle(wxFontStyle style) void wxFont::SetNumericWeight(int weight) { AllocExclusive(); - + M_FONTDATA->SetNumericWeight(weight); } diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index 9251eaffa4..0f0bcc69ac 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -490,7 +490,7 @@ void wxRegionIterator::CreateRects( const wxRegion& region ) if (cairoRegion == nullptr) return; m_numRects = cairo_region_num_rectangles(cairoRegion); - + if (m_numRects) { m_rects = new wxRect[m_numRects]; diff --git a/src/gtk/webview_webkit.cpp b/src/gtk/webview_webkit.cpp index 2651ef7aa3..b752d74bfb 100644 --- a/src/gtk/webview_webkit.cpp +++ b/src/gtk/webview_webkit.cpp @@ -46,7 +46,7 @@ wxgtk_webview_webkit_load_status(GtkWidget* widget, //We have to check if we are actually storing history //If the item isn't added we add it ourselves, it isn't added otherwise //with a custom scheme. - if(!item || (WEBKIT_IS_WEB_HISTORY_ITEM(item) && + if(!item || (WEBKIT_IS_WEB_HISTORY_ITEM(item) && webkit_web_history_item_get_uri(item) != url)) { WebKitWebHistoryItem* @@ -483,7 +483,7 @@ bool wxWebViewWebKit::Create(wxWindow *parent, g_signal_connect_after(m_web_view, "resource-request-starting", G_CALLBACK(wxgtk_webview_webkit_resource_req), this); -#if WEBKIT_CHECK_VERSION(1, 10, 0) +#if WEBKIT_CHECK_VERSION(1, 10, 0) g_signal_connect_after(m_web_view, "context-menu", G_CALLBACK(wxgtk_webview_webkit_context_menu), this); #endif @@ -947,7 +947,7 @@ void wxWebViewWebKit::RegisterHandler(wxSharedPtr handler) void wxWebViewWebKit::EnableContextMenu(bool enable) { #if !WEBKIT_CHECK_VERSION(1, 10, 0) //If we are using an older version - g_object_set(webkit_web_view_get_settings(m_web_view), + g_object_set(webkit_web_view_get_settings(m_web_view), "enable-default-context-menu", enable, nullptr); #endif wxWebView::EnableContextMenu(enable); @@ -956,7 +956,7 @@ void wxWebViewWebKit::EnableContextMenu(bool enable) long wxWebViewWebKit::Find(const wxString& text, int flags) { bool newSearch = false; - if(text != m_findText || + if(text != m_findText || (flags & wxWEBVIEW_FIND_MATCH_CASE) != (m_findFlags & wxWEBVIEW_FIND_MATCH_CASE)) { newSearch = true; @@ -1007,7 +1007,7 @@ long wxWebViewWebKit::Find(const wxString& text, int flags) //Highlight them if needed bool highlight = flags & wxWEBVIEW_FIND_HIGHLIGHT_RESULT ? true : false; - webkit_web_view_set_highlight_text_matches(m_web_view, highlight); + webkit_web_view_set_highlight_text_matches(m_web_view, highlight); if(!webkit_web_view_search_text(m_web_view, text.utf8_str(), matchCase, forward, wrap)) { diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 0d583c67b0..c96af4044a 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -625,7 +625,7 @@ void wxHtmlImageCell::Draw(wxDC& dc, int x, int y, image.Rescale(m_Width, m_Height, wxIMAGE_QUALITY_HIGH); (*m_bitmap) = wxBitmap(image); } -#endif +#endif if (m_Width != m_bitmap->GetLogicalWidth()) imageScaleX = (double) m_Width / (double) m_bitmap->GetLogicalWidth(); @@ -710,7 +710,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG,MAP,AREA") scaleHDPI = 2.0; } } - } + } #endif if (!str) str = m_WParser->OpenURL(wxHTML_URL_IMAGE, tmp); diff --git a/src/msw/notifmsg.cpp b/src/msw/notifmsg.cpp index 76fadf552f..6180728e13 100644 --- a/src/msw/notifmsg.cpp +++ b/src/msw/notifmsg.cpp @@ -276,7 +276,7 @@ void wxBalloonNotifMsgImpl::SetUpIcon(wxWindow *win) } } -bool +bool wxBalloonNotifMsgImpl::Show(int timeout) { // timout active event diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index db6c83220e..bd5cb92198 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -290,7 +290,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* win) { return -1; } - + if ( blinkTime == INFINITE ) // caret does not blink { return 0; diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 6cf747bd6f..e5e1cfad00 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -358,7 +358,7 @@ bool wxSpinButton::MSWOnNotify(int WXUNUSED(idCtrl), WXLPARAM lParam, WXLPARAM * NM_UPDOWN *lpnmud = (NM_UPDOWN *)lParam; if ( lpnmud->hdr.hwndFrom != GetHwnd() || // make sure it is the right control - lpnmud->hdr.code != UDN_DELTAPOS ) // and the right notification + lpnmud->hdr.code != UDN_DELTAPOS ) // and the right notification return false; int newVal = lpnmud->iPos + lpnmud->iDelta; diff --git a/src/osx/bmpbuttn_osx.cpp b/src/osx/bmpbuttn_osx.cpp index 64f690909c..6d8f7f0fe2 100644 --- a/src/osx/bmpbuttn_osx.cpp +++ b/src/osx/bmpbuttn_osx.cpp @@ -32,7 +32,7 @@ bool wxBitmapButton::Create( wxWindow *parent, const wxString& name ) { DontCreatePeer(); - + if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style, validator, name) ) return false; diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 766f644113..140054d7b0 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -269,7 +269,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) -NSShowAllViews YES. Cocoa picks these up from the real argv so our removal of them from the wx copy of it does not affect Cocoa's ability to see them. - + We basically just assume that any "-NS" option and its following argument needs to be removed from argv. We hope that user code does not expect to see -NS options and indeed it's probably a safe bet @@ -477,7 +477,7 @@ void wxApp::MacHandleUnhandledEvent( WXEVENTREF WXUNUSED(evr) ) CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) { CGKeyCode keycode; - + switch (code) { // Clang warns about switch values not of the same type as (enumerated) @@ -515,7 +515,7 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case 'x': case 'X': keycode = kVK_ANSI_X; break; case 'y': case 'Y': keycode = kVK_ANSI_Y; break; case 'z': case 'Z': keycode = kVK_ANSI_Z; break; - + case '0': keycode = kVK_ANSI_0; break; case '1': keycode = kVK_ANSI_1; break; case '2': keycode = kVK_ANSI_2; break; @@ -530,19 +530,19 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) #ifdef __clang__ #pragma clang diagnostic pop #endif // __clang__ - + case WXK_BACK: keycode = kVK_Delete; break; case WXK_TAB: keycode = kVK_Tab; break; case WXK_RETURN: keycode = kVK_Return; break; case WXK_ESCAPE: keycode = kVK_Escape; break; case WXK_SPACE: keycode = kVK_Space; break; case WXK_DELETE: keycode = kVK_ForwardDelete; break; - + case WXK_SHIFT: keycode = kVK_Shift; break; case WXK_ALT: keycode = kVK_Option; break; case WXK_RAW_CONTROL: keycode = kVK_Control; break; case WXK_CONTROL: keycode = kVK_Command; break; - + case WXK_CAPITAL: keycode = kVK_CapsLock; break; case WXK_END: keycode = kVK_End; break; case WXK_HOME: keycode = kVK_Home; break; @@ -550,10 +550,10 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case WXK_UP: keycode = kVK_UpArrow; break; case WXK_RIGHT: keycode = kVK_RightArrow; break; case WXK_DOWN: keycode = kVK_DownArrow; break; - + case WXK_HELP: keycode = kVK_Help; break; - - + + case WXK_NUMPAD0: keycode = kVK_ANSI_Keypad0; break; case WXK_NUMPAD1: keycode = kVK_ANSI_Keypad1; break; case WXK_NUMPAD2: keycode = kVK_ANSI_Keypad2; break; @@ -584,10 +584,10 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case WXK_F18: keycode = kVK_F18; break; case WXK_F19: keycode = kVK_F19; break; case WXK_F20: keycode = kVK_F20; break; - + case WXK_PAGEUP: keycode = kVK_PageUp; break; case WXK_PAGEDOWN: keycode = kVK_PageDown; break; - + case WXK_NUMPAD_DELETE: keycode = kVK_ANSI_KeypadClear; break; case WXK_NUMPAD_EQUAL: keycode = kVK_ANSI_KeypadEquals; break; case WXK_NUMPAD_MULTIPLY: keycode = kVK_ANSI_KeypadMultiply; break; @@ -595,12 +595,12 @@ CGKeyCode wxCharCodeWXToOSX(wxKeyCode code) case WXK_NUMPAD_SUBTRACT: keycode = kVK_ANSI_KeypadMinus; break; case WXK_NUMPAD_DECIMAL: keycode = kVK_ANSI_KeypadDecimal; break; case WXK_NUMPAD_DIVIDE: keycode = kVK_ANSI_KeypadDivide; break; - + default: wxLogDebug( "Unrecognised keycode %d", code ); keycode = static_cast(-1); } - + return keycode; } @@ -818,7 +818,7 @@ bool wxApp::MacSendCharEvent( wxWindow* focus , long keymessage , long modifiers void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymessage , long modifiers , long when , wxChar uniChar ) { #if wxOSX_USE_COCOA_OR_CARBON - + short keycode, keychar ; keychar = short(keymessage & charCodeMask); diff --git a/src/osx/carbon/dataobj.cpp b/src/osx/carbon/dataobj.cpp index 21e9c85466..423da3784a 100644 --- a/src/osx/carbon/dataobj.cpp +++ b/src/osx/carbon/dataobj.cpp @@ -96,7 +96,7 @@ wxDataFormat::NativeFormat wxDataFormat::GetFormatForType(wxDataFormatId type) case wxDF_TEXT: f = kUTTypeTraditionalMacText; break; - + case wxDF_UNICODETEXT: #ifdef wxNEEDS_UTF8_FOR_TEXT_DATAOBJ f = kUTTypeUTF8PlainText; @@ -106,23 +106,23 @@ wxDataFormat::NativeFormat wxDataFormat::GetFormatForType(wxDataFormatId type) #error "one of wxNEEDS_UTF{8,16}_FOR_TEXT_DATAOBJ must be defined" #endif break; - + case wxDF_HTML: f = kUTTypeHTML; break; - + case wxDF_BITMAP: f = kUTTypeTIFF; break; - + case wxDF_METAFILE: f = kUTTypePDF; break; - + case wxDF_FILENAME: f = kUTTypeFileURL; break; - + default: wxFAIL_MSG( wxS("unsupported data format") ); break; @@ -350,7 +350,7 @@ void wxDataObject::WriteToSink(wxOSXDataSink * datatransfer) const if ( thisFormat.GetType() == wxDF_FILENAME ) { wxString filenames; - + filenames = wxString( (const char*)buf, *wxConvFileName ); wxArrayString files = wxStringTokenize( filenames, wxT("\n"), wxTOKEN_STRTOK ); @@ -374,7 +374,7 @@ void wxDataObject::WriteToSink(wxOSXDataSink * datatransfer) const bool wxDataObject::ReadFromSource(wxDataObject * source) { bool transferred = false; - + size_t formatcount = source->GetFormatCount(); wxScopedArray array(formatcount); source->GetAllFormats( array.get() ); @@ -385,7 +385,7 @@ bool wxDataObject::ReadFromSource(wxDataObject * source) { int size = source->GetDataSize( format ); transferred = true; - + if (size == 0) { SetData( format, 0, nullptr ); @@ -421,11 +421,11 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source) wxCFMutableArrayRef typesarray; dataFormat.AddSupportedTypesForSetting(typesarray); size_t itemCount = source->GetItemCount(); - + for ( size_t itemIndex = 0; itemIndex < itemCount && !transferred; ++itemIndex) { std::unique_ptr sitem(source->GetItem(itemIndex)); - + wxDataFormat::NativeFormat nativeFormat = sitem->AvailableType(typesarray); CFDataRef flavorData = sitem->DoGetData(nativeFormat); if (flavorData) @@ -460,21 +460,21 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source) databuf.UngetWriteBuf(flavorDataSize); } } - + if (dataFormat.GetType() == wxDF_FILENAME) { // revert the translation and decomposition to arrive at a proper utf8 string again - + wxCFRef url = CFURLCreateWithBytes(kCFAllocatorDefault, (UInt8*) buf, flavorDataSize, kCFStringEncodingUTF8, nullptr); wxCFStringRef cfString = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); - + CFMutableStringRef cfMutableString = CFStringCreateMutableCopy(nullptr, 0, cfString); CFStringNormalize(cfMutableString, kCFStringNormalizationFormC); // cfMutableString is released by the wxCFStringRef wxString path = wxCFStringRef(cfMutableString).AsString(); if (!path.empty()) filenamesPassed += path + wxS("\n"); - + // if it's the last item, we set the wx data if ( itemIndex + 1 == itemCount ) { @@ -486,7 +486,7 @@ bool wxDataObject::ReadFromSource(wxOSXDataSource * source) else { // because some data implementation expect trailing a trailing NUL, we add some headroom - + if (dataFormat.GetType() == wxDF_TEXT) { for (char* p = static_cast(buf); *p; p++) @@ -516,7 +516,7 @@ wxDataFormat wxDataObject::GetSupportedFormatInSource(wxDataObject *source) cons wxDataFormat format; size_t formatcount = source->GetFormatCount(); wxScopedArray array(formatcount); - + source->GetAllFormats( array.get() ); for (size_t i = 0; i < formatcount; i++) { @@ -534,23 +534,23 @@ wxDataFormat wxDataObject::GetSupportedFormatInSource(wxDataObject *source) cons wxDataFormat wxDataObject::GetSupportedFormatInSource(wxOSXDataSource *source) const { wxDataFormat format; - + size_t formatcount = GetFormatCount(wxDataObject::Set); wxScopedArray array(formatcount); GetAllFormats(array.get(), wxDataObject::Set); - + for (size_t i = 0; i < formatcount; i++) { // go through the data in our order of preference wxDataFormat dataFormat = array[i]; - + if (source->IsSupported(dataFormat)) { format = dataFormat; break; } } - + return format; } diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 6bc50b261b..b4ec4a9e1a 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -139,11 +139,11 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : m_window->GetClientSize( &m_width , &m_height); if ( !m_window->IsShownOnScreen() ) m_width = m_height = 0; - + int x0,y0; DoGetDeviceOrigin(&x0,&y0); SetDeviceOrigin( m_origin.x + x0, m_origin.y + y0 ); - + DoSetClippingRegion( 0 , 0 , m_width , m_height ) ; } diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 0b05ca11c5..04e2e74914 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -329,7 +329,7 @@ void wxFontRefData::AllocIfNeeded() const void wxFontRefData::Alloc() { wxCHECK_RET(m_info.GetPointSize() > 0, wxT("Point size should not be zero.")); - + // use font caching, we cache a font with a certain size and a font with just any size for faster creation wxString lookupnameNoSize = wxString::Format("%s_%d_%d", m_info.GetPostScriptName(), (int)m_info.GetStyle(), m_info.GetNumericWeight()); @@ -976,7 +976,7 @@ void wxNativeFontInfo::CreateCTFontDescriptor() wxASSERT(descriptor != nullptr); m_descriptor = descriptor; - + wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontFamilyNameAttribute)).GetValue(m_familyName); #if wxDEBUG_LEVEL >= 2 @@ -986,15 +986,15 @@ void wxNativeFontInfo::CreateCTFontDescriptor() wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontFamilyNameAttribute)).GetValue(familyname); wxLogTrace(TRACE_CTFONT,"****** CreateCTFontDescriptor ******"); wxLogTrace(TRACE_CTFONT,"Descriptor FontFamilyName: %s",familyname); - + wxString name; wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontNameAttribute)).GetValue(name); wxLogTrace(TRACE_CTFONT,"Descriptor FontName: %s",name); - + wxString display; wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontDisplayNameAttribute)).GetValue(display); wxLogTrace(TRACE_CTFONT,"Descriptor DisplayName: %s",display); - + wxString style; wxCFTypeRef(CTFontDescriptorCopyAttribute(m_descriptor, kCTFontStyleNameAttribute)).GetValue(style); wxLogTrace(TRACE_CTFONT,"Descriptor StyleName: %s",style); @@ -1002,11 +1002,11 @@ void wxNativeFontInfo::CreateCTFontDescriptor() wxString psname; wxCFTypeRef(CTFontCopyPostScriptName(font)).GetValue(psname); wxLogTrace(TRACE_CTFONT,"Created Font PostScriptName: %s",psname); - + wxString fullname; wxCFTypeRef(CTFontCopyFullName(font)).GetValue(fullname); wxLogTrace(TRACE_CTFONT,"Created Font FullName: %s",fullname); - + wxLogTrace(TRACE_CTFONT,"************************************"); #endif } @@ -1366,7 +1366,7 @@ bool wxNativeFontInfo::SetPostScriptName(const wxString& postScriptName) Free(); m_postScriptName = postScriptName; } - + return true; } diff --git a/src/osx/carbon/fontdlgosx.mm b/src/osx/carbon/fontdlgosx.mm index 4872ba546e..02fa8f7677 100644 --- a/src/osx/carbon/fontdlgosx.mm +++ b/src/osx/carbon/fontdlgosx.mm @@ -260,9 +260,9 @@ int RunMixedFontDialog(wxFontDialog* dialog) else [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]]; #endif - + [NSApp runModalForWindow:fontPanel]; - + // if we don't reenable it, FPShowHideFontPanel does not work [[fontPanel standardWindowButton:NSWindowCloseButton] setEnabled:YES] ; // we must pick the selection before closing, otherwise a native textcontrol interferes diff --git a/src/osx/carbon/popupwin.cpp b/src/osx/carbon/popupwin.cpp index 20e2564eeb..5deb68d580 100644 --- a/src/osx/carbon/popupwin.cpp +++ b/src/osx/carbon/popupwin.cpp @@ -57,12 +57,12 @@ bool wxPopupWindow::Show(bool show) { if ( !wxWindow::Show(show) ) return false; - + if ( m_nowpeer && show) m_nowpeer->ShowWithoutActivating(); else if ( m_nowpeer ) m_nowpeer->Show(false); - + if ( show ) { // because apps expect a size event to occur at this moment @@ -70,7 +70,7 @@ bool wxPopupWindow::Show(bool show) event.SetEventObject(this); HandleWindowEvent(event); } - + return true; } diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index a5a118c19e..bed0c5e158 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -110,18 +110,18 @@ wxRegion::wxRegion(const wxRect& rect) #if OSX_USE_SCANLINES /* - + Copyright 1987, 1998 The Open Group - + Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. - + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -129,12 +129,12 @@ wxRegion::wxRegion(const wxRect& rect) OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - + Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. - + */ /* miscanfill.h */ @@ -457,7 +457,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, EdgeTableEntry *start, *prev; ScanLineList *pSLL, *pPrevSLL; ScanLineListBlock *tmpSLLBlock; - + /* * find the right bucket to put the edge into */ @@ -468,7 +468,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, pPrevSLL = pSLL; pSLL = pSLL->next; } - + /* * reassign pSLL (pointer to ScanLineList) if necessary */ @@ -486,13 +486,13 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, *iSLLBlock = 0; } pSLL = &((*SLLBlock)->SLLs[(*iSLLBlock)++]); - + pSLL->next = pPrevSLL->next; pSLL->edgelist = (EdgeTableEntry *)nullptr; pPrevSLL->next = pSLL; } pSLL->scanline = scanline; - + /* * now insert the edge in the right bucket */ @@ -504,7 +504,7 @@ miInsertEdgeInET(EdgeTable *ET, EdgeTableEntry *ETE, int scanline, start = start->next; } ETE->next = start; - + if (prev) prev->next = ETE; else @@ -544,11 +544,11 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry * const wxPoint* top, *bottom; const wxPoint* PrevPt, *CurrPt; int iSLLBlock = 0; - + int dy; - + if (count < 2) return TRUE; - + /* * initialize the Active Edge Table */ @@ -556,7 +556,7 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry * AET->back = (EdgeTableEntry *)nullptr; AET->nextWETE = (EdgeTableEntry *)nullptr; AET->bres.minor = INT_MIN; - + /* * initialize the Edge Table. */ @@ -564,9 +564,9 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry * ET->ymax = INT_MIN; ET->ymin = INT_MAX; pSLLBlock->next = (ScanLineListBlock *)nullptr; - + PrevPt = &pts[count-1]; - + /* * for each vertex in the array of points. * In this loop we are dealing with two vertices at @@ -575,7 +575,7 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry * while (count--) { CurrPt = pts++; - + /* * find out which point is above and which is below. */ @@ -589,31 +589,31 @@ miCreateETandAET(int count, const wxPoint * pts, EdgeTable *ET, EdgeTableEntry * bottom = CurrPt; top = PrevPt; pETEs->ClockWise = 1; } - + /* * don't add horizontal edges to the Edge table. */ if (bottom->y != top->y) { pETEs->ymax = bottom->y-1; /* -1 so we don't get last scanline */ - + /* * initialize integer edge algorithm */ dy = bottom->y - top->y; BRESINITPGONSTRUCT(dy, top->x, bottom->x, pETEs->bres); - + if (!miInsertEdgeInET(ET, pETEs, top->y, &pSLLBlock, &iSLLBlock)) { miFreeStorage(pSLLBlock->next); return FALSE; } - + ET->ymax = wxMax(ET->ymax, PrevPt->y); ET->ymin = wxMin(ET->ymin, PrevPt->y); pETEs++; } - + PrevPt = CurrPt; } return TRUE; @@ -633,7 +633,7 @@ miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) { EdgeTableEntry *pPrevAET; EdgeTableEntry *tmp; - + pPrevAET = AET; AET = AET->next; while (ETEs) @@ -650,7 +650,7 @@ miloadAET(EdgeTableEntry *AET, EdgeTableEntry *ETEs) ETEs->back = pPrevAET; pPrevAET->next = ETEs; pPrevAET = ETEs; - + ETEs = tmp; } } @@ -681,7 +681,7 @@ micomputeWAET(EdgeTableEntry *AET) EdgeTableEntry *pWETE; int inside = 1; int isInside = 0; - + AET->nextWETE = (EdgeTableEntry *)nullptr; pWETE = AET; AET = AET->next; @@ -691,7 +691,7 @@ micomputeWAET(EdgeTableEntry *AET) isInside++; else isInside--; - + if ((!inside && !isInside) || ( inside && isInside)) { @@ -720,7 +720,7 @@ miInsertionSort(EdgeTableEntry *AET) EdgeTableEntry *pETEinsert; EdgeTableEntry *pETEchaseBackTMP; int changed = 0; - + AET = AET->next; while (AET) { @@ -728,7 +728,7 @@ miInsertionSort(EdgeTableEntry *AET) pETEchase = AET; while (pETEchase->back->bres.minor > AET->bres.minor) pETEchase = pETEchase->back; - + AET = AET->next; if (pETEchase != pETEinsert) { @@ -753,8 +753,8 @@ static void miFreeStorage(ScanLineListBlock *pSLLBlock) { ScanLineListBlock *tmpSLLBlock; - - while (pSLLBlock) + + while (pSLLBlock) { tmpSLLBlock = pSLLBlock->next; free(pSLLBlock); @@ -786,10 +786,10 @@ scanFillGeneralPoly( wxRegion* rgn, EdgeTableEntry *pETEs; /* Edge Table Entries buff */ ScanLineListBlock SLLBlock; /* header for ScanLineList */ int fixWAET = 0; - + if (count < 3) return(TRUE); - + if(!(pETEs = (EdgeTableEntry *) malloc(sizeof(EdgeTableEntry) * count))) return(FALSE); @@ -801,7 +801,7 @@ scanFillGeneralPoly( wxRegion* rgn, return(FALSE); } pSLL = ET.scanlines.next; - + if (fillStyle == wxODDEVEN_RULE) { /* @@ -820,7 +820,7 @@ scanFillGeneralPoly( wxRegion* rgn, } pPrevAET = &AET; pAET = AET.next; - + /* * for each active edge */ @@ -830,7 +830,7 @@ scanFillGeneralPoly( wxRegion* rgn, ptsOut++->y = y; *width++ = pAET->next->bres.minor - pAET->bres.minor; nPts++; - + /* * send out the buffer when its full */ @@ -838,7 +838,7 @@ scanFillGeneralPoly( wxRegion* rgn, { // (*pgc->ops->FillSpans)(dst, pgc, // nPts, FirstPoint, FirstWidth,1); - + for ( int i = 0 ; i < nPts; ++i) { wxRect rect; @@ -878,7 +878,7 @@ scanFillGeneralPoly( wxRegion* rgn, pPrevAET = &AET; pAET = AET.next; pWETE = pAET; - + /* * for each active edge */ @@ -895,7 +895,7 @@ scanFillGeneralPoly( wxRegion* rgn, ptsOut++->y = y; *width++ = pAET->nextWETE->bres.minor - pAET->bres.minor; nPts++; - + /* * send out the buffer */ @@ -916,7 +916,7 @@ scanFillGeneralPoly( wxRegion* rgn, width = FirstWidth; nPts = 0; } - + pWETE = pWETE->nextWETE; while (pWETE != pAET) EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); @@ -924,7 +924,7 @@ scanFillGeneralPoly( wxRegion* rgn, } EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET); } - + /* * reevaluate the Winding active edge table if we * just had to resort it or if we just exited an edge. @@ -936,7 +936,7 @@ scanFillGeneralPoly( wxRegion* rgn, } } } - + /* * Get any spans that we missed by buffering */ @@ -961,41 +961,41 @@ scanFillGeneralPoly( wxRegion* rgn, wxRegion::wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle) { - // Set the region to a polygon shape generically using a bitmap with the - // polygon drawn on it. - - m_refData = new wxRegionRefData(); - + // Set the region to a polygon shape generically using a bitmap with the + // polygon drawn on it. + + m_refData = new wxRegionRefData(); + #if OSX_USE_SCANLINES scanFillGeneralPoly(this,n,points,fillStyle); #else - wxCoord mx = 0; - wxCoord my = 0; - wxPoint p; - size_t idx; - - // Find the max size needed to draw the polygon - for (idx=0; idx mx) - mx = pt.x; - if (pt.y > my) - my = pt.y; - } - - // Make the bitmap - wxBitmap bmp(mx, my); - wxMemoryDC dc(bmp); - dc.SetBackground(*wxBLACK_BRUSH); - dc.Clear(); - dc.SetPen(*wxWHITE_PEN); - dc.SetBrush(*wxWHITE_BRUSH); - dc.DrawPolygon(n, (wxPoint*)points, 0, 0, fillStyle); - dc.SelectObject(wxNullBitmap); - bmp.SetMask(new wxMask(bmp, *wxBLACK)); - - // Use it to set this region + wxCoord mx = 0; + wxCoord my = 0; + wxPoint p; + size_t idx; + + // Find the max size needed to draw the polygon + for (idx=0; idx mx) + mx = pt.x; + if (pt.y > my) + my = pt.y; + } + + // Make the bitmap + wxBitmap bmp(mx, my); + wxMemoryDC dc(bmp); + dc.SetBackground(*wxBLACK_BRUSH); + dc.Clear(); + dc.SetPen(*wxWHITE_PEN); + dc.SetBrush(*wxWHITE_BRUSH); + dc.DrawPolygon(n, (wxPoint*)points, 0, 0, fillStyle); + dc.SelectObject(wxNullBitmap); + bmp.SetMask(new wxMask(bmp, *wxBLACK)); + + // Use it to set this region Union(bmp); #endif } @@ -1048,12 +1048,12 @@ bool wxRegion::DoUnionWithRect(const wxRect& rect) m_refData = new wxRegionRefData(rect.x , rect.y , rect.width , rect.height); return true; } - + AllocExclusive(); - + CGRect r = CGRectMake(rect.x , rect.y , rect.width , rect.height); HIShapeUnionWithRect(M_REGION , &r); - + return true; } diff --git a/src/osx/carbon/utilscocoa.mm b/src/osx/carbon/utilscocoa.mm index ab963937d0..9010eec395 100644 --- a/src/osx/carbon/utilscocoa.mm +++ b/src/osx/carbon/utilscocoa.mm @@ -192,7 +192,7 @@ WXImage wxOSXGetSystemImage(const wxString& name) return symbol; } #endif - + NSImage* nsimage = [NSImage imageNamed:cfname.AsNSString()]; return nsimage; } diff --git a/src/osx/checkbox_osx.cpp b/src/osx/checkbox_osx.cpp index f5e1d11d35..eb5dcdca98 100644 --- a/src/osx/checkbox_osx.cpp +++ b/src/osx/checkbox_osx.cpp @@ -25,9 +25,9 @@ bool wxCheckBox::Create(wxWindow *parent, long style, const wxValidator& validator, const wxString& name) -{ +{ DontCreatePeer(); - + if ( !wxCheckBoxBase::Create(parent, id, pos, size, style, validator, name) ) return false; @@ -108,7 +108,7 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) default: break; } - + if (newState == origState) sendEvent = false; else @@ -123,7 +123,7 @@ bool wxCheckBox::OSXHandleClicked( double WXUNUSED(timestampsec) ) Set3StateValue( newState ); } } - + if (sendEvent) { wxCommandEvent event( wxEVT_CHECKBOX, m_windowId ); diff --git a/src/osx/checklst_osx.cpp b/src/osx/checklst_osx.cpp index 025a2d39bf..14c15177cb 100644 --- a/src/osx/checklst_osx.cpp +++ b/src/osx/checklst_osx.cpp @@ -54,8 +54,8 @@ bool wxCheckListBox::Create( long style, const wxValidator& validator, const wxString& name ) -{ - +{ + wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), wxT("only one of listbox selection modes can be specified") ); diff --git a/src/osx/choice_osx.cpp b/src/osx/choice_osx.cpp index 5383a38f6e..61e1f47260 100644 --- a/src/osx/choice_osx.cpp +++ b/src/osx/choice_osx.cpp @@ -62,9 +62,9 @@ bool wxChoice::Create(wxWindow *parent, long style, const wxValidator& validator, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxChoiceBase::Create( parent, id, pos, size, style, validator, name ) ) return false; diff --git a/src/osx/cocoa/appprogress.mm b/src/osx/cocoa/appprogress.mm index 0d9670abaf..5bdd8ca56d 100644 --- a/src/osx/cocoa/appprogress.mm +++ b/src/osx/cocoa/appprogress.mm @@ -33,12 +33,12 @@ [iv setImage:[NSApplication sharedApplication].applicationIconImage]; [m_dockTile setContentView:iv]; [iv release]; - + m_progIndicator = [[NSProgressIndicator alloc] initWithFrame:NSMakeRect(0, 16, m_dockTile.size.width, 24)]; m_progIndicator.style = NSProgressIndicatorBarStyle; [m_progIndicator setIndeterminate:NO]; [iv addSubview:m_progIndicator]; - + [m_progIndicator setBezeled:YES]; [m_progIndicator setMinValue:0]; [m_progIndicator setMaxValue:1]; @@ -58,7 +58,7 @@ [m_progIndicator setHidden:NO]; [m_progIndicator setIndeterminate:NO]; [m_progIndicator setDoubleValue:value]; - + [m_dockTile display]; } @@ -83,7 +83,7 @@ wxAppProgressIndicator::wxAppProgressIndicator(wxWindow* WXUNUSED(parent), int m m_maxValue(maxValue) { wxAppProgressDockIcon* dockIcon = [[wxAppProgressDockIcon alloc] init]; - + m_dockIcon = dockIcon; } diff --git a/src/osx/cocoa/button.mm b/src/osx/cocoa/button.mm index 9a3613461e..7a1322a871 100644 --- a/src/osx/cocoa/button.mm +++ b/src/osx/cocoa/button.mm @@ -100,7 +100,7 @@ void wxButtonCocoaImpl::SetBitmap(const wxBitmapBundle& bitmap) { [GetNSButton() setBezelStyle:NSRoundedBezelStyle]; } - + wxWidgetCocoaImpl::SetBitmap(bitmap); } @@ -109,7 +109,7 @@ void wxButtonCocoaImpl::SetLabelMarkup(const wxString& markup) { wxMarkupToAttrString toAttr(GetWXPeer()->GetFont(), markup); NSMutableAttributedString *attrString = toAttr.GetNSAttributedString(); - + // Button text is always centered. NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; @@ -118,7 +118,7 @@ void wxButtonCocoaImpl::SetLabelMarkup(const wxString& markup) value:paragraphStyle range:NSMakeRange(0, [attrString length])]; [paragraphStyle release]; - + [GetNSButton() setAttributedTitle:attrString]; } #endif // wxUSE_MARKUP @@ -167,7 +167,7 @@ void wxButtonCocoaImpl::SetAcceleratorFromLabel(const wxString& label) NSButton *wxButtonCocoaImpl::GetNSButton() const { wxASSERT( [m_osxView isKindOfClass:[NSButton class]] ); - + return static_cast(m_osxView); } diff --git a/src/osx/cocoa/choice.mm b/src/osx/cocoa/choice.mm index 826ee8fe58..b983b3ef41 100644 --- a/src/osx/cocoa/choice.mm +++ b/src/osx/cocoa/choice.mm @@ -71,7 +71,7 @@ public: { delete m_popUpMenu; } - + void InsertItem( size_t pos, int itemid, const wxString& text) override { m_popUpMenu->Insert( pos, itemid, text ); diff --git a/src/osx/cocoa/colour.mm b/src/osx/cocoa/colour.mm index d78825a469..2d95d6de1b 100644 --- a/src/osx/cocoa/colour.mm +++ b/src/osx/cocoa/colour.mm @@ -18,28 +18,28 @@ class wxNSColorRefData : public wxColourRefData { public: wxNSColorRefData(WX_NSColor color); - + wxNSColorRefData(const wxNSColorRefData& other); virtual ~wxNSColorRefData(); - + virtual CGFloat Red() const override; virtual CGFloat Green() const override; virtual CGFloat Blue() const override; virtual CGFloat Alpha() const override; - + virtual bool IsSolid() const override; CGColorRef GetCGColor() const override; - + virtual wxColourRefData* Clone() const override { return new wxNSColorRefData(*this); } - + virtual WX_NSColor GetNSColor() const override; virtual WX_NSImage GetNSPatternImage() const override; private: static CGFloat GetCGColorComponent(CGColorRef col, int rgbaIndex); WX_NSColor m_nsColour; - + wxDECLARE_NO_ASSIGN_CLASS(wxNSColorRefData); }; @@ -66,16 +66,16 @@ WX_NSColor wxNSColorRefData::GetNSColor() const CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex) { CGFloat value = 0.0; - + if ( col ) { wxCFRef rgbacol; CGColorSpaceModel model = CGColorSpaceGetModel(CGColorGetColorSpace(col)); size_t noComp = CGColorGetNumberOfComponents(col); const CGFloat* components = CGColorGetComponents(col); - + bool isRGB = true; - + if (model == kCGColorSpaceModelMonochrome) { wxASSERT_MSG(1 <= noComp && noComp <= 2, "Monochrome Color unexpected components"); @@ -99,7 +99,7 @@ CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex) isRGB = false; } } - + if (isRGB) { wxASSERT_MSG(3 <= noComp && noComp <= 4, "RGB Color unexpected components"); @@ -110,7 +110,7 @@ CGFloat wxNSColorRefData::GetCGColorComponent(CGColorRef col, int rgbaIndex) value = components[rgbaIndex]; } } - + return value; } @@ -119,7 +119,7 @@ CGFloat wxNSColorRefData::Red() const wxOSXEffectiveAppearanceSetter helper; if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] ) return [colRGBA redComponent]; - + return GetCGColorComponent([m_nsColour CGColor], 0); } @@ -128,7 +128,7 @@ CGFloat wxNSColorRefData::Green() const wxOSXEffectiveAppearanceSetter helper; if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] ) return [colRGBA greenComponent]; - + return GetCGColorComponent([m_nsColour CGColor], 1); } @@ -137,7 +137,7 @@ CGFloat wxNSColorRefData::Blue() const wxOSXEffectiveAppearanceSetter helper; if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] ) return [colRGBA blueComponent]; - + return GetCGColorComponent([m_nsColour CGColor], 2); } @@ -146,7 +146,7 @@ CGFloat wxNSColorRefData::Alpha() const wxOSXEffectiveAppearanceSetter helper; if ( NSColor* colRGBA = [m_nsColour colorUsingColorSpaceName:NSCalibratedRGBColorSpace] ) return [colRGBA alphaComponent]; - + return GetCGColorComponent([m_nsColour CGColor], 3); } diff --git a/src/osx/cocoa/combobox.mm b/src/osx/cocoa/combobox.mm index 983b05b0a8..73184becff 100644 --- a/src/osx/cocoa/combobox.mm +++ b/src/osx/cocoa/combobox.mm @@ -40,7 +40,7 @@ + (void)initialize { static BOOL initialized = NO; - if (!initialized) + if (!initialized) { initialized = YES; wxOSXCocoaClassAddWXMethods( self ); @@ -144,11 +144,11 @@ { wxUnusedVar(textView); wxUnusedVar(control); - + BOOL handled = NO; // send back key events wx' common code knows how to handle - + wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if ( impl ) { @@ -193,7 +193,7 @@ void wxNSComboBoxControl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd) // NSComboBox has its own event loop, which reacts very badly to our synthetic // events used to signal when a wxEvent is posted, so during that time we switch // the wxEventLoop::WakeUp implementation to a lower-level version - + bool reset = false; wxEventLoop* const loop = (wxEventLoop*) wxEventLoopBase::GetActive(); @@ -202,10 +202,10 @@ void wxNSComboBoxControl::mouseEvent(WX_NSEvent event, WXWidget slf, void *_cmd) reset = true; loop->OSXUseLowLevelWakeup(true); } - + wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; superimpl(slf, (SEL)_cmd, event); - + if ( reset ) { loop->OSXUseLowLevelWakeup(false); @@ -324,13 +324,13 @@ void wxNSComboBoxControl::SetEditable(bool editable) [m_comboBox setSelectable:YES]; } -wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer, - wxWindowMac* WXUNUSED(parent), - wxWindowID WXUNUSED(id), +wxWidgetImplType* wxWidgetImpl::CreateComboBox( wxComboBox* wxpeer, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), wxMenu* WXUNUSED(menu), - const wxPoint& pos, + const wxPoint& pos, const wxSize& size, - long style, + long style, long WXUNUSED(extraStyle)) { NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ; @@ -354,26 +354,26 @@ wxSize wxComboBox::DoGetBestSize() const wxSize baseSize = wxWindow::DoGetBestSize(); int lbHeight = baseSize.y; int wLine; - + { wxInfoDC dc(const_cast(this)); - + // Find the widest line for(unsigned int i = 0; i < GetCount(); i++) { wxString str(GetString(i)); - + wxCoord width, height ; dc.GetTextExtent( str , &width, &height); wLine = width ; - + lbWidth = wxMax( lbWidth, wLine ) ; } - + // Add room for the popup arrow lbWidth += 2 * lbHeight ; } - + return wxSize( lbWidth, lbHeight ); } diff --git a/src/osx/cocoa/datetimectrl.mm b/src/osx/cocoa/datetimectrl.mm index 692ec19a16..997e0891df 100644 --- a/src/osx/cocoa/datetimectrl.mm +++ b/src/osx/cocoa/datetimectrl.mm @@ -78,7 +78,7 @@ public: virtual void SetDateTime(const wxDateTime& dt) override { wxDateTime dtFrom, dtTo; - + if ( GetDateRange(&dtFrom,&dtTo) == false || ( (!dtFrom.IsValid() || dtFrom <= dt) && (!dtTo.IsValid() || dt <= dtTo ) ) ) diff --git a/src/osx/cocoa/dialog.mm b/src/osx/cocoa/dialog.mm index 5eec71c3ee..e29cd43d14 100644 --- a/src/osx/cocoa/dialog.mm +++ b/src/osx/cocoa/dialog.mm @@ -23,14 +23,14 @@ extern wxList wxModalDialogs; void wxDialog::DoShowWindowModal() -{ +{ wxTopLevelWindow* parent = static_cast(wxGetTopLevelParent(GetParent())); - + wxASSERT_MSG(parent, "ShowWindowModal requires the dialog to have a parent."); - + NSWindow* parentWindow = parent->GetWXWindow(); NSWindow* theWindow = GetWXWindow(); - + [parentWindow beginSheet:theWindow completionHandler: ^(NSModalResponse returnCode) { diff --git a/src/osx/cocoa/dnd.mm b/src/osx/cocoa/dnd.mm index 0da588fc6d..81fea5a618 100644 --- a/src/osx/cocoa/dnd.mm +++ b/src/osx/cocoa/dnd.mm @@ -188,7 +188,7 @@ void wxOSXPasteboard::DeleteSinkItems() void wxOSXPasteboard::Clear() { [m_pasteboard clearContents]; - DeleteSinkItems(); + DeleteSinkItems(); } void wxOSXPasteboard::Flush() @@ -227,7 +227,7 @@ const wxOSXDataSourceItem* wxOSXPasteboard::GetItem(size_t pos) const { return new wxOSXPasteboardSourceItem([[m_pasteboard pasteboardItems] objectAtIndex: pos], m_pasteboard); } - + // data source methods wxOSXPasteboard* wxOSXPasteboard::GetGeneralClipboard() diff --git a/src/osx/cocoa/evtloop.mm b/src/osx/cocoa/evtloop.mm index 1d85888590..ca1a46a580 100644 --- a/src/osx/cocoa/evtloop.mm +++ b/src/osx/cocoa/evtloop.mm @@ -59,10 +59,10 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat) { // the masking system doesn't really help, as only the lowlevel UI events // are split in a useful way, all others are way to broad - + if ( (cat | wxEVT_CATEGORY_USER_INPUT) && (cat | (~wxEVT_CATEGORY_USER_INPUT) ) ) return NSAnyEventMask; - + NSUInteger mask = 0; if ( cat | wxEVT_CATEGORY_USER_INPUT ) @@ -95,17 +95,17 @@ static NSUInteger CalculateNSEventMaskFromEventCategory(wxEventCategory cat) NSEventMaskEndGesture | 0; } - + if ( cat | (~wxEVT_CATEGORY_USER_INPUT) ) { - mask |= + mask |= NSAppKitDefinedMask | NSSystemDefinedMask | NSApplicationDefinedMask | NSPeriodicMask | NSCursorUpdateMask; } - + return mask; } @@ -142,7 +142,7 @@ bool wxGUIEventLoop::Pending() const // as otherwise we end up in a tight loop when idle events are responded // to by RequestMore(true) wxMacAutoreleasePool autoreleasepool; - + return [[NSApplication sharedApplication] nextEventMatchingMask: NSAnyEventMask untilDate: nil @@ -182,7 +182,7 @@ bool wxGUIEventLoop::Dispatch() { if (wxTheApp) wxTheApp->ProcessPendingEvents(); - + if ( wxTheApp->ProcessIdle() ) m_sleepTime = 0.0 ; else @@ -208,8 +208,8 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) if ( m_modalSession ) { NSInteger response = [NSApp runModalSession:(NSModalSession)m_modalSession]; - - switch (response) + + switch (response) { case NSModalResponseContinue: { @@ -222,7 +222,7 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) inMode: NSDefaultRunLoopMode dequeue: NO] != nil ) return 1; - + return -1; } case NSModalResponseStop: @@ -234,14 +234,14 @@ int wxGUIEventLoop::DoDispatchTimeout(unsigned long timeout) } return -1; } - else - { + else + { NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate dateWithTimeIntervalSinceNow: timeout/1000.0] inMode:NSDefaultRunLoopMode dequeue: YES]; - + if ( event == nil ) return -1; @@ -365,24 +365,24 @@ void wxGUIEventLoop::WakeUp() { // NSEvent* cevent = [NSApp currentEvent]; // NSString* mode = [[NSRunLoop mainRunLoop] currentMode]; - + // when already in a mouse event handler, don't add higher level event // if ( cevent != nil && [cevent type] <= NSMouseMoved && ) if ( m_osxLowLevelWakeUp /* [NSEventTrackingRunLoopMode isEqualToString:mode] */ ) { // NSLog(@"event for wakeup %@ in mode %@",cevent,mode); - wxCFEventLoop::WakeUp(); + wxCFEventLoop::WakeUp(); } else { wxMacAutoreleasePool autoreleasepool; - NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined - location:NSMakePoint(0.0, 0.0) - modifierFlags:0 - timestamp:0 - windowNumber:0 + NSEvent *event = [NSEvent otherEventWithType:NSApplicationDefined + location:NSMakePoint(0.0, 0.0) + modifierFlags:0 + timestamp:0 + windowNumber:0 context:nil - subtype:0 data1:0 data2:0]; + subtype:0 data1:0 data2:0]; [NSApp postEvent:event atStart:FALSE]; } } @@ -456,7 +456,7 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow ) if ( m_modalNestedLevel > 1 ) { wxModalSessionStack* stack = nullptr; - + if ( m_modalNestedLevel == 2 ) { stack = new wxModalSessionStack; @@ -466,28 +466,28 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow ) { stack = gs_modalSessionStackMap[this]; } - + wxModalSessionStackElement element; element.dummyWindow = m_dummyWindow; element.modalSession = m_modalSession; - + stack->push_back(element); - + // shortcut if nothing changed in this level - + if ( m_modalWindow == modalWindow ) return; } - + m_modalWindow = modalWindow; - + if ( modalWindow ) { // we must show now, otherwise beginModalSessionForWindow does it but it // also would do a centering of the window before overriding all our position if ( !modalWindow->IsShownOnScreen() ) modalWindow->Show(); - + wxNonOwnedWindow* now = dynamic_cast (modalWindow); wxASSERT_MSG( now != nullptr, "must pass in a toplevel window for modal event loop" ); nsnow = now ? now->GetWXWindow() : nil; @@ -511,7 +511,7 @@ void wxGUIEventLoop::BeginModalSession( wxWindow* modalWindow ) void wxGUIEventLoop::EndModalSession() { wxASSERT_MSG(m_modalSession != nullptr, "no modal session active"); - + wxASSERT_MSG(m_modalNestedLevel > 0, "incorrect modal nesting level"); m_modalWindow = nullptr; @@ -533,19 +533,19 @@ void wxGUIEventLoop::EndModalSession() wxModalSessionStack* stack = gs_modalSessionStackMap[this]; wxModalSessionStackElement element = stack->back(); stack->pop_back(); - + if( m_modalNestedLevel == 1 ) { gs_modalSessionStackMap.erase(this); delete stack; } - + if ( m_modalSession != element.modalSession ) { [NSApp endModalSession:(NSModalSession)m_modalSession]; m_modalSession = element.modalSession; } - + if ( m_dummyWindow != element.dummyWindow ) { if ( m_dummyWindow ) @@ -560,7 +560,7 @@ void wxGUIEventLoop::EndModalSession() } // -// +// // void wxWindowDisabler::AfterDisable(wxWindow* winToSkip) diff --git a/src/osx/cocoa/filedlg.mm b/src/osx/cocoa/filedlg.mm index 1421a4717a..42cb6e0cb6 100644 --- a/src/osx/cocoa/filedlg.mm +++ b/src/osx/cocoa/filedlg.mm @@ -252,7 +252,7 @@ void wxFileDialog::ShowWindowModal() wxCFStringRef file( m_fileName ); wxNonOwnedWindow* parentWindow = nullptr; - + m_modality = wxDIALOG_MODALITY_WINDOW_MODAL; if (GetParent()) @@ -339,10 +339,10 @@ void wxFileDialog::ShowWindowModal() this->ModalFinishedCallback(sPanel, returnCode); }]; } - else + else { NSOpenPanel* oPanel = [NSOpenPanel openPanel]; - + SetupExtraControls(oPanel); [oPanel setTreatsFilePackagesAsDirectories:NO]; @@ -403,7 +403,7 @@ wxWindow* wxFileDialog::CreateFilterPanel(wxWindow *extracontrol) : static_cast(new wxPanel(this)); wxBoxSizer *verticalSizer = new wxBoxSizer(wxVERTICAL); - + // the file type control { wxBoxSizer *horizontalSizer = new wxBoxSizer(wxHORIZONTAL); @@ -422,7 +422,7 @@ wxWindow* wxFileDialog::CreateFilterPanel(wxWindow *extracontrol) } m_filterChoice->Bind(wxEVT_CHOICE, &wxFileDialog::OnFilterSelected, this); } - + if(extracontrol) { // Either use an extra control's existing sizer or the extra control @@ -484,7 +484,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow) // workaround for crashes we don't support those yet if ( [panel contentView] == nil || getenv("APP_SANDBOX_CONTAINER_ID") != nullptr ) return; - + wxNonOwnedWindow::Create( GetParent(), nativeWindow ); // This won't do anything if there are no extra controls to create and @@ -562,7 +562,7 @@ int wxFileDialog::ShowModal() wxCFEventLoopPauseIdleEvents pause; wxMacAutoreleasePool autoreleasepool; - + wxCFStringRef cf( m_message ); wxCFStringRef dir( m_dir ); @@ -587,7 +587,7 @@ int wxFileDialog::ShowModal() if( HasFlag(wxFD_OPEN) ) { if ( !(wxSystemOptions::HasOption( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) && (wxSystemOptions::GetOptionInt( wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES ) == 1)) ) - m_useFileTypeFilter = false; + m_useFileTypeFilter = false; } m_firstFileTypeFilter = -1; @@ -659,7 +659,7 @@ int wxFileDialog::ShowModal() else { NSOpenPanel* oPanel = [NSOpenPanel openPanel]; - + SetupExtraControls(oPanel); wxOpenSavePanelDelegate* del = [[wxOpenSavePanelDelegate alloc]init]; @@ -692,13 +692,13 @@ int wxFileDialog::ShowModal() [oPanel setAllowedFileTypes: types]; } if ( !m_dir.IsEmpty() ) - [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() + [oPanel setDirectoryURL:[NSURL fileURLWithPath:dir.AsNSString() isDirectory:YES]]; returnCode = [oPanel runModal]; - + ModalFinishedCallback(oPanel, returnCode); } - + OSXEndModalDialog(); @@ -760,7 +760,7 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) } SetReturnCode(wasAccepted ? wxID_OK : wxID_CANCEL); - + // workaround for sandboxed app, see above, must be executed before window modal handler // because there this instance will be deleted if ( m_isNativeWindowWrapper ) @@ -768,7 +768,7 @@ void wxFileDialog::ModalFinishedCallback(void* panel, int returnCode) if (GetModality() == wxDIALOG_MODALITY_WINDOW_MODAL) SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); - + [sPanel setAccessoryView:nil]; } diff --git a/src/osx/cocoa/gauge.mm b/src/osx/cocoa/gauge.mm index b62ab5ce13..8c0a6dd6e0 100644 --- a/src/osx/cocoa/gauge.mm +++ b/src/osx/cocoa/gauge.mm @@ -81,7 +81,7 @@ protected: } } }; - + } // anonymous namespace wxWidgetImplType* wxWidgetImpl::CreateGauge( wxWindowMac* wxpeer, diff --git a/src/osx/cocoa/glcanvas.mm b/src/osx/cocoa/glcanvas.mm index 4ee9ac6cd4..823109cd74 100644 --- a/src/osx/cocoa/glcanvas.mm +++ b/src/osx/cocoa/glcanvas.mm @@ -163,15 +163,15 @@ bool wxGLCanvas::DoCreate(wxWindow *parent, const wxString& name) { DontCreatePeer(); - + if ( !wxWindow::Create(parent, id, pos, size, style, name) ) return false; - + NSRect r = wxOSXGetFrameForControl( this, pos , size ) ; wxNSCustomOpenGLView* v = [[wxNSCustomOpenGLView alloc] initWithFrame:r]; [v setWantsBestResolutionOpenGLSurface:YES]; - + wxWidgetCocoaImpl* c = new wxWidgetCocoaImpl( this, v, wxWidgetImpl::Widget_UserKeyEvents | wxWidgetImpl::Widget_UserMouseEvents ); SetPeer(c); MacPostControlCreate(pos, size) ; diff --git a/src/osx/cocoa/listbox.mm b/src/osx/cocoa/listbox.mm index 6056a2a6dd..5defdb948e 100644 --- a/src/osx/cocoa/listbox.mm +++ b/src/osx/cocoa/listbox.mm @@ -440,7 +440,7 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , con [[col1 dataCell] setControlSize:size]; // although there is no text, it may help to get the correct vertical layout - [[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()]; + [[col1 dataCell] setFont:list->GetFont().OSXGetNSFont()]; } [checkbox release]; diff --git a/src/osx/cocoa/menu.mm b/src/osx/cocoa/menu.mm index 37d850d61e..9ab0a7130e 100644 --- a/src/osx/cocoa/menu.mm +++ b/src/osx/cocoa/menu.mm @@ -176,7 +176,7 @@ public : NSMenuItem* nsmenuitem = (NSMenuItem*) pItem->GetPeer()->GetHMenuItem(); // make sure a call of SetSubMenu is also reflected (occurring after Create) // update the native menu item accordingly - + if ( pItem->IsSubMenu() ) { wxMenu* wxsubmenu = pItem->GetSubMenu(); @@ -187,7 +187,7 @@ public : [nsmenuitem setSubmenu:nssubmenu]; } } - + if ( pos == (size_t) -1 ) [m_osxMenu addItem:nsmenuitem ]; else @@ -198,13 +198,13 @@ public : { [m_osxMenu removeItem:(NSMenuItem*) pItem->GetPeer()->GetHMenuItem()]; } - + virtual void MacSetupAppleMenu() { wxMenu* peer = GetWXPeer(); - + [NSApp setAppleMenu:[[m_osxMenu itemAtIndex:0] submenu]]; - + wxMenuItem *services = peer->FindItem(wxID_OSX_SERVICES); if ( services ) [NSApp setServicesMenu:services->GetSubMenu()->GetHMenu()]; @@ -214,28 +214,28 @@ public : [NSApp setServicesMenu:nil]; #endif } - + virtual void MacSetupHelpMenu() { wxMenu* peer = GetWXPeer(); - + NSMenu* helpMenu = nil; int helpid = peer->FindItem(wxApp::s_macHelpMenuTitleName); if ( helpid == wxNOT_FOUND ) helpid = peer->FindItem(_("&Help")); - + if ( helpid != wxNOT_FOUND ) { wxMenuItem* helpMenuItem = peer->FindItem(helpid); - + if ( helpMenuItem->IsSubMenu() ) helpMenu = helpMenuItem->GetSubMenu()->GetHMenu(); } if ( [NSApp respondsToSelector:@selector(setHelpMenu:)]) [NSApp setHelpMenu:helpMenu]; - + } - + virtual NSMenu* MacCreateOrFindWindowMenu() { NSString* nsWindowMenuTitle = wxNSStringWithWxString(wxStripMenuCodes(wxApp::s_macWindowMenuTitleName, wxStrip_Menu)); @@ -282,7 +282,7 @@ public : } return windowMenu; } - + virtual void MacSetupWindowMenu() { if ( GetWXPeer()->GetMenuBar()->GetAutoWindowMenu() ) @@ -321,7 +321,7 @@ public : MacSetupAppleMenu(); MacSetupHelpMenu(); MacSetupWindowMenu(); - + } virtual void Enable( bool WXUNUSED(enable) ) @@ -347,7 +347,7 @@ public : { // we don't want plug-ins interfering m_osxMenu.allowsContextMenuPlugIns = NO; - + wxTopLevelWindow* tlw = static_cast(wxGetTopLevelParent(win)); NSWindow* nsWindow = tlw->GetWXWindow(); NSRect nsrect = NSZeroRect; @@ -363,7 +363,7 @@ public : eventNumber:0 clickCount:1 pressure:0]; - + [NSMenu popUpContextMenu:m_osxMenu withEvent:rightClick forView:view]; } else @@ -371,7 +371,7 @@ public : [m_osxMenu popUpMenuPositioningItem:nil atLocation:pointInView inView:view]; } } - + virtual void GetMenuBarDimensions(int &x, int &y, int &width, int &height) const override { NSRect r = [(NSScreen*)[[NSScreen screens] objectAtIndex:0] frame]; @@ -380,11 +380,11 @@ public : y = r.origin.y; width = r.size.width; } - + void DisableAutoEnable() { [m_osxMenu setAutoenablesItems:NO]; - + wxMenu* menu = GetWXPeer(); for ( wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetFirst(); node; @@ -400,7 +400,7 @@ public : } } - + WXHMENU GetHMenu() override { return m_osxMenu; } static wxMenuImpl* Create( wxMenu* peer, const wxString& title ); diff --git a/src/osx/cocoa/menuitem.mm b/src/osx/cocoa/menuitem.mm index 70ba117f62..8005ba8b08 100644 --- a/src/osx/cocoa/menuitem.mm +++ b/src/osx/cocoa/menuitem.mm @@ -54,7 +54,7 @@ int wxOSXGetIdFromSelector(SEL action ) return sActionToWXMapping[i].menuid; ++i; } - + return 0; } @@ -67,7 +67,7 @@ SEL wxOSXGetSelectorFromID(int menuId ) return sActionToWXMapping[i].action; ++i; } - + return nil; } @@ -144,7 +144,7 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry* if (entry->GetFlags() & wxACCEL_RAW_CTRL) modifiers |= NSControlKeyMask; - + if (entry->GetFlags() & wxACCEL_ALT) modifiers |= NSAlternateKeyMask ; @@ -213,7 +213,7 @@ void wxMacCocoaMenuItemSetAccelerator( NSMenuItem* menuItem, wxAcceleratorEntry* case WXK_NUMPAD_ENTER : shortcut = NSEnterCharacter; break; - + case WXK_BACK : case WXK_RETURN : case WXK_TAB : @@ -288,7 +288,7 @@ public : wxMacCocoaMenuItemSetAccelerator( m_osxMenuItem, entry ); } - + bool DoDefault() override; void * GetHMenuItem() override { return m_osxMenuItem; } @@ -308,7 +308,7 @@ bool wxMenuItemCocoaImpl::DoDefault() { bool handled=false; int menuid = m_peer->GetId(); - + NSApplication *theNSApplication = [NSApplication sharedApplication]; if (menuid == wxID_OSX_HIDE) { @@ -355,18 +355,18 @@ wxMenuItemImpl* wxMenuItemImpl::Create( wxMenuItem* peer, wxMenu *pParentMenu, if ( (pParentMenu == nullptr || !pParentMenu->GetNoEventsMode()) && pSubMenu == nullptr ) { selector = wxOSXGetSelectorFromID(menuid); - + if ( selector == nil ) { selector = @selector(clickedAction:); targetSelf = true; } } - + wxNSMenuItem* menuitem = [ [ wxNSMenuItem alloc ] initWithTitle:cfText.AsNSString() action:selector keyEquivalent:@""]; if ( targetSelf ) [menuitem setTarget:menuitem]; - + if ( pSubMenu ) { pSubMenu->GetPeer()->SetTitle( text ); diff --git a/src/osx/cocoa/msgdlg.mm b/src/osx/cocoa/msgdlg.mm index 1d4c90244f..77dc402fbe 100644 --- a/src/osx/cocoa/msgdlg.mm +++ b/src/osx/cocoa/msgdlg.mm @@ -26,7 +26,7 @@ wxIMPLEMENT_CLASS(wxMessageDialog, wxDialog); -namespace +namespace { NSAlertStyle GetAlertStyleFromWXStyle( long style ) { @@ -60,7 +60,7 @@ int wxMessageDialog::ShowModal() WX_HOOK_MODAL_DIALOG(); wxCFEventLoopPauseIdleEvents pause; - + const long style = GetMessageDialogStyle(); wxASSERT_MSG( (style & 0x3F) != wxYES, wxT("this style is not supported on Mac") ); @@ -99,7 +99,7 @@ int wxMessageDialog::ShowModal() wxCFStringRef cfCancelString( wxControl::GetLabelText(GetCancelLabel()) ); NSAlertStyle alertType = GetAlertStyleFromWXStyle(style); - + int buttonId[4] = { 0, 0, 0, wxID_CANCEL /* time-out */ }; if (style & wxYES_NO) @@ -156,7 +156,7 @@ int wxMessageDialog::ShowModal() int button = -1; button = [alert runModal]; - + OSXEndModalDialog(); ModalFinishedCallback(alert, button); @@ -180,7 +180,7 @@ void wxMessageDialog::ShowWindowModal() if (parentWindow) { NSAlert* alert = (NSAlert*)ConstructNSAlert(); - + NSWindow* nativeParent = parentWindow->GetWXWindow(); [alert beginSheetModalForWindow:nativeParent completionHandler: ^(NSModalResponse returnCode) @@ -203,7 +203,7 @@ void wxMessageDialog::ModalFinishedCallback(void* WXUNUSED(panel), int resultCod resultbutton = wxID_CANCEL; } SetReturnCode(resultbutton); - + if (GetModality() == wxDIALOG_MODALITY_WINDOW_MODAL) SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); } @@ -283,7 +283,7 @@ void* wxMessageDialog::ConstructNSAlert() [alert addButtonWithTitle:cfOKString.AsNSString()]; m_buttonId[ m_buttonCount++ ] = wxID_OK; } - else + else { [alert addButtonWithTitle:cfOKString.AsNSString()]; m_buttonId[ m_buttonCount++ ] = wxID_OK; diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 6846e2a806..20b86b0c5e 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -23,7 +23,7 @@ NSScreen* wxOSXGetMenuScreen() { if ( [NSScreen screens] == nil ) return [NSScreen mainScreen]; - else + else { return [[NSScreen screens] objectAtIndex:0]; } @@ -165,7 +165,7 @@ static bool IsUsingFullScreenApi(WXWindow macWindow) @end // -// wx native implementation +// wx native implementation // static NSResponder* s_nextFirstResponder = nullptr; @@ -225,7 +225,7 @@ static NSResponder* s_formerFirstResponder = nullptr; } } -// We need this for borderless windows, i.e. shaped windows or windows without +// We need this for borderless windows, i.e. shaped windows or windows without // a title bar. For more info, see: // http://lists.apple.com/archives/cocoa-dev/2008/May/msg02091.html - (BOOL)canBecomeKeyWindow @@ -294,12 +294,12 @@ static NSResponder* s_formerFirstResponder = nullptr; { WXEVENTREF formerEvent = wxTheApp == nullptr ? nullptr : wxTheApp->MacGetCurrentEvent(); WXEVENTHANDLERCALLREF formerHandler = wxTheApp == nullptr ? nullptr : wxTheApp->MacGetCurrentEventHandlerCallRef(); - + if (wxTheApp) wxTheApp->MacSetCurrentEvent(event, nullptr); - + [super sendEvent: event]; - + if (wxTheApp) wxTheApp->MacSetCurrentEvent(formerEvent , formerHandler); } @@ -402,8 +402,8 @@ extern int wxOSXGetIdFromSelector(SEL action ); return NO; } -- (BOOL)validateMenuItem:(NSMenuItem *)menuItem -{ +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem +{ SEL action = [menuItem action]; wxMenuBar* mbar = wxMenuBar::MacGetInstalledMenuBar(); @@ -420,19 +420,19 @@ extern int wxOSXGetIdFromSelector(SEL action ); return YES; } -- (void)undo:(id)sender +- (void)undo:(id)sender { wxUnusedVar(sender); [self triggerMenu:_cmd sender:sender]; } -- (void)redo:(id)sender +- (void)redo:(id)sender { wxUnusedVar(sender); [self triggerMenu:_cmd sender:sender]; } -- (void)cut:(id)sender +- (void)cut:(id)sender { wxUnusedVar(sender); [self triggerMenu:_cmd sender:sender]; @@ -450,13 +450,13 @@ extern int wxOSXGetIdFromSelector(SEL action ); [self triggerMenu:_cmd sender:sender]; } -- (void)delete:(id)sender +- (void)delete:(id)sender { wxUnusedVar(sender); [self triggerMenu:_cmd sender:sender]; } -- (void)selectAll:(id)sender +- (void)selectAll:(id)sender { wxUnusedVar(sender); [self triggerMenu:_cmd sender:sender]; @@ -665,7 +665,7 @@ static void SendFullScreenWindowEvent(NSNotification* notification, bool fullscr NSRect viewframe = [view frame]; NSUInteger stylemask = [window styleMask] | NSFullScreenWindowMask; NSRect expectedframerect = [NSWindow contentRectForFrameRect: windowframe styleMask: stylemask]; - + if ( !NSEqualSizes(expectedframerect.size, viewframe.size) ) { [view setFrameSize: expectedframerect.size]; @@ -761,8 +761,8 @@ wxNonOwnedWindowCocoaImpl::~wxNonOwnedWindowCocoaImpl() { [(wxNonOwnedWindowController*)[m_macWindow delegate] removeObservers:m_macWindow]; [m_macWindow setDelegate:nil]; - - // make sure we remove this first, otherwise the ref count will not lead to the + + // make sure we remove this first, otherwise the ref count will not lead to the // native window's destruction if ([m_macWindow parentWindow] != nullptr) [[m_macWindow parentWindow] removeChildWindow: m_macWindow]; @@ -812,21 +812,21 @@ long style, long extraStyle, const wxString& WXUNUSED(name) ) wclass = kDrawerWindowClass; */ } - + if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) || ( style & wxCLOSE_BOX ) || ( style & wxSYSTEM_MENU ) || ( style & wxCAPTION ) ) { windowstyle |= NSTitledWindowMask ; if ( ( style & wxMINIMIZE_BOX ) ) windowstyle |= NSMiniaturizableWindowMask ; - + if ( ( style & wxMAXIMIZE_BOX ) ) windowstyle |= NSResizableWindowMask ; - + if ( ( style & wxCLOSE_BOX) ) windowstyle |= NSClosableWindowMask ; } - + if ( ( style & wxRESIZE_BORDER ) ) windowstyle |= NSResizableWindowMask ; @@ -858,24 +858,24 @@ long style, long extraStyle, const wxString& WXUNUSED(name) ) } // if we just have a title bar with no buttons needed, hide them - if ( (windowstyle & NSTitledWindowMask) && + if ( (windowstyle & NSTitledWindowMask) && !(style & wxCLOSE_BOX) && !(style & wxMAXIMIZE_BOX) && !(style & wxMINIMIZE_BOX) ) { [[m_macWindow standardWindowButton:NSWindowZoomButton] setHidden:YES]; [[m_macWindow standardWindowButton:NSWindowCloseButton] setHidden:YES]; [[m_macWindow standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES]; } - + m_macWindowLevel = level; SetUpForModalParent(); [m_macWindow setLevel:m_macWindowLevel]; [m_macWindow setDelegate:controller]; [controller addObservers:m_macWindow]; - + if ( !(style & wxFRAME_TOOL_WINDOW) ) [m_macWindow setHidesOnDeactivate:NO]; - + if ( GetWXPeer()->GetBackgroundStyle() == wxBG_STYLE_TRANSPARENT ) { [m_macWindow setOpaque:NO]; @@ -948,7 +948,7 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show) { if ( show ) { - wxNonOwnedWindow* wxpeer = GetWXPeer(); + wxNonOwnedWindow* wxpeer = GetWXPeer(); if ( wxpeer ) { // add to parent window before showing @@ -975,18 +975,18 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show) } } } - + SetUpForModalParent(); if (!(wxpeer->GetWindowStyle() & wxFRAME_TOOL_WINDOW)) [m_macWindow makeKeyAndOrderFront:nil]; - else - [m_macWindow orderFront:nil]; + else + [m_macWindow orderFront:nil]; } [[m_macWindow contentView] setNeedsDisplay: YES]; } else { - // avoid propagation of orderOut to parent + // avoid propagation of orderOut to parent if ([m_macWindow parentWindow] != nullptr) [[m_macWindow parentWindow] removeChildWindow: m_macWindow]; [m_macWindow orderOut:nil]; @@ -1042,7 +1042,7 @@ void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style ) if (!m_wxPeer->IsNativeWindowWrapper() && m_macWindow) { NSInteger level = NSNormalWindowLevel; - + if (style & wxSTAY_ON_TOP) level = NSModalPanelWindowLevel; else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW )) @@ -1273,7 +1273,7 @@ bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long style) NSRect contentRect; [m_macWindow setStyleMask:data->m_formerStyleMask & ~ NSResizableWindowMask]; - + contentRect = [NSWindow contentRectForFrameRect: frame styleMask: [m_macWindow styleMask]]; screenframe.origin.y += (frame.origin.y - contentRect.origin.y); @@ -1285,19 +1285,19 @@ bool wxNonOwnedWindowCocoaImpl::ShowFullScreen(bool show, long style) /* | kUIOptionDisableProcessSwitch | kUIOptionDisableForceQuit - */); + */); } else if ( m_macFullScreenData != nullptr ) { FullScreenData *data = (FullScreenData *) m_macFullScreenData ; - + [m_macWindow setFrame:data->m_formerFrame display:YES]; [m_macWindow setStyleMask:data->m_formerStyleMask]; delete data ; m_macFullScreenData = nullptr ; - SetSystemUIMode(kUIModeNormal, 0); + SetSystemUIMode(kUIModeNormal, 0); } return true; diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index a0a455478f..8a755fb72f 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -267,13 +267,13 @@ public: int TabHitTest(const wxPoint & pt, long* flags) override { int retval = wxNOT_FOUND; - + NSPoint nspt = wxToNSPoint( m_osxView, pt ); - + wxNSTabView* slf = (wxNSTabView*) m_osxView; - + NSTabViewItem* hitItem = [slf tabViewItemAtPoint:nspt]; - + if (!hitItem) { if ( flags ) *flags = wxBK_HITTEST_NOWHERE; @@ -282,8 +282,8 @@ public: if ( flags ) *flags = wxBK_HITTEST_ONLABEL; } - - return retval; + + return retval; } private: diff --git a/src/osx/cocoa/notifmsg.mm b/src/osx/cocoa/notifmsg.mm index 1fa5578154..7c53a31c2d 100644 --- a/src/osx/cocoa/notifmsg.mm +++ b/src/osx/cocoa/notifmsg.mm @@ -55,13 +55,13 @@ public: { UseHandler(); m_notif = [[NSUserNotification alloc] init]; - + // Build Id to unqiuely idendify this notification m_id = wxString::Format("%d_%d", (int)wxGetProcessId(), ms_notifIdBase++); - + // Register the notification ms_activeNotifications[m_id] = this; - + wxCFStringRef cfId(m_id); m_notif.userInfo = @{ @"wxId" : cfId.AsNSString() @@ -79,63 +79,63 @@ public: { NSUserNotificationCenter* nc = [NSUserNotificationCenter defaultUserNotificationCenter]; [nc deliverNotification:m_notif]; - + return true; } - + virtual bool Close() override { NSUserNotificationCenter* nc = [NSUserNotificationCenter defaultUserNotificationCenter]; [nc removeDeliveredNotification:m_notif]; - + return true; } - + virtual void SetTitle(const wxString& title) override { wxCFStringRef cftitle(title); m_notif.title = cftitle.AsNSString(); } - + virtual void SetMessage(const wxString& message) override { wxCFStringRef cfmsg(message); m_notif.informativeText = cfmsg.AsNSString(); } - + virtual void SetParent(wxWindow *WXUNUSED(parent)) override { } - + virtual void SetFlags(int WXUNUSED(flags)) override { // On OS X we do not add an icon based on the flags, // as this is primarily meant for custom icons } - + virtual void SetIcon(const wxIcon& icon) override { m_notif.contentImage = icon.GetNSImage(); } - + virtual bool AddAction(wxWindowID actionid, const wxString &label) override { if (m_actions.size() >= 1) // Currently only 1 actions are supported return false; - + wxString strLabel = label; if (strLabel.empty()) strLabel = wxGetStockLabel(actionid, wxSTOCK_NOFLAGS); wxCFStringRef cflabel(strLabel); - + m_actions.push_back(actionid); - + if (m_actions.size() == 1) m_notif.actionButtonTitle = cflabel.AsNSString(); - + return true; } - + void Activated(NSUserNotificationActivationType activationType) { switch (activationType) @@ -172,19 +172,19 @@ public: Close(); break; } - + default: break; } } - + static void NotificationActivated(const wxString& notificationId, NSUserNotificationActivationType activationType) { wxUserNotificationMsgImpl* impl = ms_activeNotifications[notificationId]; if (impl) impl->Activated(activationType); } - + static void UseHandler() { if (!ms_handler) @@ -193,17 +193,17 @@ public: [NSUserNotificationCenter defaultUserNotificationCenter].delegate = ms_handler; } } - + static void ReleaseHandler() { - + } private: NSUserNotification* m_notif; wxString m_id; wxVector m_actions; - + static wxUserNotificationHandler* ms_handler; static std::map ms_activeNotifications; static int ms_notifIdBase; diff --git a/src/osx/cocoa/overlay.mm b/src/osx/cocoa/overlay.mm index fb5dc96d1a..03c1a69a50 100644 --- a/src/osx/cocoa/overlay.mm +++ b/src/osx/cocoa/overlay.mm @@ -249,9 +249,9 @@ void wxOverlayImpl::BeginDrawing( wxDC* dc) wxGraphicsContext* ctx = wxGraphicsContext::CreateFromNative( m_overlayContext ); ctx->Translate(0, ySize); ctx->Scale(1,-1); - + win_impl->SetGraphicsContext( ctx ); - + if (m_window) dc->SetDeviceOrigin(dc->LogicalToDeviceX(-m_x), dc->LogicalToDeviceY(-m_y)); dc->SetClippingRegion(m_x, m_y, m_width, m_height); diff --git a/src/osx/cocoa/printdlg.mm b/src/osx/cocoa/printdlg.mm index 489dd6a7ef..6fb234238a 100644 --- a/src/osx/cocoa/printdlg.mm +++ b/src/osx/cocoa/printdlg.mm @@ -79,7 +79,7 @@ int wxMacPrintDialog::ShowModal() m_printDialogData.GetPrintData().ConvertFromNative(); ((wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferTo( &m_printDialogData ); } - + OSXEndModalDialog(); return result; @@ -96,7 +96,7 @@ int wxMacPageSetupDialog::ShowModal() NSPageLayout *pageLayout = [NSPageLayout pageLayout]; NSPrintInfo* printInfo = ((wxOSXCocoaPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->GetNSPrintInfo(); - + OSXBeginModalDialog(); if ( [pageLayout runModalWithPrintInfo:printInfo] == NSModalResponseOK ) @@ -107,7 +107,7 @@ int wxMacPageSetupDialog::ShowModal() } OSXEndModalDialog(); - + return result; } diff --git a/src/osx/cocoa/radiobut.mm b/src/osx/cocoa/radiobut.mm index fd9664acb6..dc4fc6f500 100644 --- a/src/osx/cocoa/radiobut.mm +++ b/src/osx/cocoa/radiobut.mm @@ -111,7 +111,7 @@ wxWidgetImplType* wxWidgetImpl::CreateRadioButton( wxWindowMac* wxpeer, [v setAlignment:NSLeftTextAlignment]; static int alternateAction = 1; - + [v setAction: NSSelectorFromString([NSString stringWithFormat: alternateActionsSelector, alternateAction])]; if ( ++alternateAction > maxAlternateActions ) alternateAction = 1; diff --git a/src/osx/cocoa/settings.mm b/src/osx/cocoa/settings.mm index 5bc180cd17..2850392c4c 100644 --- a/src/osx/cocoa/settings.mm +++ b/src/osx/cocoa/settings.mm @@ -88,7 +88,7 @@ bool wxSystemAppearance::IsDark() const wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) { wxOSXEffectiveAppearanceSetter helper; - + NSColor* sysColor = nil; switch( index ) { diff --git a/src/osx/cocoa/spinbutt.mm b/src/osx/cocoa/spinbutt.mm index 083d68e0b3..e97318cde3 100644 --- a/src/osx/cocoa/spinbutt.mm +++ b/src/osx/cocoa/spinbutt.mm @@ -159,7 +159,7 @@ wxWidgetImplType* wxWidgetImpl::CreateSpinButton( wxWindowMac* wxpeer, if ( style & wxSP_WRAP ) wrap = YES; [v setValueWraps:wrap]; - + wxWidgetCocoaImpl* c = new wxSpinButtonCocoaImpl( wxpeer, v ); return c; } diff --git a/src/osx/cocoa/srchctrl.mm b/src/osx/cocoa/srchctrl.mm index 4718d2bad9..f4e3e9e309 100644 --- a/src/osx/cocoa/srchctrl.mm +++ b/src/osx/cocoa/srchctrl.mm @@ -79,19 +79,19 @@ // NSString* partialString; // partialString = [[textView string] substringWithRange:charRange]; matches = [NSMutableArray array]; - + // wxTextWidgetImpl* impl = (wxTextWidgetImpl* ) wxWidgetImpl::FindFromWXWidget( self ); wxArrayString completions; - + // adapt to whatever strategy we have for getting the strings // impl->GetTextEntry()->GetCompletions(wxCFStringRef::AsString(partialString), completions); - + for (size_t i = 0; i < completions.GetCount(); ++i ) [matches addObject: wxCFStringRef(completions[i]).AsNSString()]; - + // [matches sortUsingSelector:@selector(compare:)]; - - + + return matches; } diff --git a/src/osx/cocoa/stattext.mm b/src/osx/cocoa/stattext.mm index 22f79bd11c..c5d8b4ed1b 100644 --- a/src/osx/cocoa/stattext.mm +++ b/src/osx/cocoa/stattext.mm @@ -53,32 +53,32 @@ [super dealloc]; } -- (void) setEnabled:(BOOL) flag +- (void) setEnabled:(BOOL) flag { bool wasEnabled = [self isEnabled]; - [super setEnabled: flag]; - + [super setEnabled: flag]; + if (![self drawsBackground]) { // Static text is drawn incorrectly when disabled. // For an explanation, see // http://www.cocoabuilder.com/archive/message/cocoa/2006/7/21/168028 if (flag) - { + { if (m_textColor) [self setTextColor: m_textColor]; } - else + else { if (wasEnabled) { [m_textColor release]; m_textColor = [[self textColor] retain]; } - [self setTextColor: [NSColor disabledControlTextColor]]; - } - } -} + [self setTextColor: [NSColor disabledControlTextColor]]; + } + } +} @end diff --git a/src/osx/cocoa/taskbar.mm b/src/osx/cocoa/taskbar.mm index 807a83c07a..7941a783c5 100644 --- a/src/osx/cocoa/taskbar.mm +++ b/src/osx/cocoa/taskbar.mm @@ -44,7 +44,7 @@ public: void OnMenuEvent(wxCommandEvent& event); void OnUpdateUIEvent(wxUpdateUIEvent& event); - + private: wxTaskBarIconImpl *m_impl; wxDECLARE_EVENT_TABLE(); @@ -58,14 +58,14 @@ class wxTaskBarIconImpl { public: wxTaskBarIconImpl(wxTaskBarIcon *taskBarIcon); - + virtual bool IsStatusItem() const { return false; } virtual bool SetIcon(const wxBitmapBundle& icon, const wxString& tooltip = wxEmptyString) = 0; virtual bool RemoveIcon() = 0; - + bool IsIconInstalled() const { return m_icon.IsOk(); } - + virtual bool PopupMenu(wxMenu *menu) = 0; virtual ~wxTaskBarIconImpl(); inline wxTaskBarIcon* GetTaskBarIcon() { return m_taskBarIcon; } @@ -125,7 +125,7 @@ class wxTaskBarIconCustomStatusItemImpl: public wxTaskBarIconImpl public: wxTaskBarIconCustomStatusItemImpl(wxTaskBarIcon *taskBarIcon); virtual ~wxTaskBarIconCustomStatusItemImpl(); - + virtual bool IsStatusItem() const override { return true; } virtual bool SetIcon(const wxBitmapBundle& icon, const wxString& tooltip = wxEmptyString) override; @@ -198,7 +198,7 @@ bool wxTaskBarIcon::IsIconInstalled() const { if ( m_impl ) return m_impl->IsIconInstalled(); - + return false; } @@ -263,7 +263,7 @@ WX_NSMenu wxTaskBarIconDockImpl::OSXGetDockHMenu() { if(sm_dockIcon) return sm_dockIcon->OSXDoGetDockHMenu(); - + return nil; } @@ -284,9 +284,9 @@ WX_NSMenu wxTaskBarIconDockImpl::OSXDoGetDockHMenu() } m_pMenu->SetInvokingWindow(m_eventWindow); - + m_pMenu->UpdateUI(); - + return (WX_NSMenu)m_pMenu->GetHMenu(); } @@ -320,7 +320,7 @@ bool wxTaskBarIconDockImpl::PopupMenu(wxMenu *WXUNUSED(menu)) - (NSMenu*)applicationDockMenu:(NSApplication *)sender { wxUnusedVar(sender); - + return wxTaskBarIconDockImpl::OSXGetDockHMenu(); } @end @@ -345,7 +345,7 @@ bool wxTaskBarIconDockImpl::PopupMenu(wxMenu *WXUNUSED(menu)) { impl->PopupMenu(menu); delete menu; - } + } } - (void)setImplementation: (wxTaskBarIconCustomStatusItemImpl *) theImplementation @@ -399,7 +399,7 @@ bool wxTaskBarIconCustomStatusItemImpl::SetIcon(const wxBitmapBundle& icon, cons return YES; }]; [[m_statusItem button] setImage:statusBarScaledImage]; - + wxCFStringRef cfTooltip(tooltip); [[m_statusItem button] setToolTip:cfTooltip.AsNSString()]; return true; @@ -411,9 +411,9 @@ bool wxTaskBarIconCustomStatusItemImpl::RemoveIcon() m_statusItem = nil; [m_target release]; m_target = nil; - + m_icon = wxBitmap(); - + return true; } @@ -438,7 +438,7 @@ wxBEGIN_EVENT_TABLE(wxTaskBarIconWindow, wxWindow) EVT_UPDATE_UI(-1, wxTaskBarIconWindow::OnUpdateUIEvent) wxEND_EVENT_TABLE() -wxTaskBarIconWindow::wxTaskBarIconWindow(wxTaskBarIconImpl *impl) +wxTaskBarIconWindow::wxTaskBarIconWindow(wxTaskBarIconImpl *impl) : m_impl(impl) { } diff --git a/src/osx/cocoa/tglbtn.mm b/src/osx/cocoa/tglbtn.mm index d0f44aecd6..7a84623e92 100644 --- a/src/osx/cocoa/tglbtn.mm +++ b/src/osx/cocoa/tglbtn.mm @@ -89,7 +89,7 @@ wxWidgetImplType* wxWidgetImpl::CreateBitmapToggleButton( wxWindowMac* wxpeer, wxNSButton* v = [[wxNSButton alloc] initWithFrame:r]; SetToggleButtonStyle(v, style); - + if (label.IsOk()) [v setImage: wxOSXGetImageFromBundle(label) ]; diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 483d05fa47..166aefbbd7 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -734,14 +734,14 @@ bool wxToolBar::Create( } wxToolBar::~wxToolBar() -{ +{ // removal only works while the toolbar is there wxFrame *frame = wxDynamicCast(GetParent(), wxFrame); if ( frame && frame->GetToolBar() == this ) { frame->SetToolBar(nullptr); } - + #if wxOSX_USE_NATIVE_TOOLBAR [(NSToolbar*)m_macToolbar setDelegate:nil]; [(NSToolbar*)m_macToolbar release]; @@ -835,14 +835,14 @@ void wxToolBar::DoGetPosition(int*x, int *y) const { #if wxOSX_USE_NATIVE_TOOLBAR bool ownToolbarInstalled; - + MacTopLevelHasNativeToolbar( &ownToolbarInstalled ); if ( ownToolbarInstalled ) { WXWindow tlw = MacGetTopLevelWindowRef(); CGFloat toolbarHeight = 0; NSRect windowFrame = NSMakeRect(0, 0, 0, 0); - + if(m_macToolbar && [(NSToolbar*)m_macToolbar isVisible]) { windowFrame = [NSWindow contentRectForFrameRect:[tlw frame] @@ -850,9 +850,9 @@ void wxToolBar::DoGetPosition(int*x, int *y) const toolbarHeight = NSHeight(windowFrame) - NSHeight([[tlw contentView] frame]); } - + // it is extending to the north of the content area - + if ( x != nullptr ) *x = 0; if ( y != nullptr ) @@ -860,7 +860,7 @@ void wxToolBar::DoGetPosition(int*x, int *y) const } else wxToolBarBase::DoGetPosition( x, y ); - + #else wxToolBarBase::DoGetPosition( x, y ); #endif @@ -869,7 +869,7 @@ void wxToolBar::DoGetPosition(int*x, int *y) const wxSize wxToolBar::DoGetBestSize() const { // was updated in Realize() - + wxSize size = GetMinSize(); return size; @@ -996,7 +996,7 @@ void wxToolBar::MacUninstallNativeToolbar() { if (!m_macToolbar) return; - + WXWindow tlw = MacGetTopLevelWindowRef(); if (tlw) [tlw setToolbar:nil]; @@ -1007,10 +1007,10 @@ void wxToolBar::DoLayout() { int maxToolWidth = 0; int maxToolHeight = 0; - + int tw, th; GetSize( &tw, &th ); - + // find the maximum tool width and height // and the number of stretchable items int numStretchableSpaces = 0; @@ -1022,7 +1022,7 @@ void wxToolBar::DoLayout() if ( tool != nullptr ) { wxSize sz = tool->GetSize(); - + if ( sz.x > maxToolWidth ) maxToolWidth = sz.x; if ( sz.y > maxToolHeight ) @@ -1030,20 +1030,20 @@ void wxToolBar::DoLayout() if ( tool->IsStretchableSpace() ) numStretchableSpaces++; } - + node = node->GetNext(); } - // layout non-native toolbar - + // layout non-native toolbar + bool isHorizontal = !IsVertical(); - + int maxWidth = 0; int maxHeight = 0; - + int x = m_xMargin + kwxMacToolBarLeftMargin; int y = m_yMargin + kwxMacToolBarTopMargin; - + node = m_tools.GetFirst(); while ( node ) { @@ -1053,7 +1053,7 @@ void wxToolBar::DoLayout() node = node->GetNext(); continue; } - + // set tool position: // for the moment just perform a single row/column alignment wxSize cursize = tool->GetSize(); @@ -1061,22 +1061,22 @@ void wxToolBar::DoLayout() maxWidth = x + cursize.x; if ( y + cursize.y > maxHeight ) maxHeight = y + cursize.y; - + // update the item positioning state if ( !isHorizontal ) y += cursize.y + kwxMacToolSpacing; else x += cursize.x + kwxMacToolSpacing; - + node = node->GetNext(); } - + if ( isHorizontal ) { // if not set yet, only one row if ( m_maxRows <= 0 ) SetRows( 1 ); - + maxWidth += m_xMargin + kwxMacToolBarLeftMargin; m_minWidth = maxWidth; m_minHeight = m_maxHeight = maxToolHeight + 2 * (m_yMargin + kwxMacToolBarTopMargin); @@ -1086,12 +1086,12 @@ void wxToolBar::DoLayout() // if not set yet, have one column if ( (GetToolsCount() > 0) && (m_maxRows <= 0) ) SetRows( GetToolsCount() ); - + maxHeight += m_yMargin + kwxMacToolBarTopMargin; m_minHeight = maxHeight; m_minWidth = m_maxWidth = maxToolWidth + 2 * (m_yMargin + kwxMacToolBarTopMargin); } - + int totalStretchableSpace = 0; int spacePerStretchable = 0; if ( numStretchableSpaces > 0 ) @@ -1100,16 +1100,16 @@ void wxToolBar::DoLayout() totalStretchableSpace = tw - maxWidth; else totalStretchableSpace = th - maxHeight; - + if ( totalStretchableSpace > 0 ) - spacePerStretchable = totalStretchableSpace / numStretchableSpaces; + spacePerStretchable = totalStretchableSpace / numStretchableSpaces; } - + // perform real positioning - + x = m_xMargin + kwxMacToolBarLeftMargin; y = m_yMargin + kwxMacToolBarTopMargin; - + node = m_tools.GetFirst(); int currentStretchable = 0; while ( node ) @@ -1120,20 +1120,20 @@ void wxToolBar::DoLayout() node = node->GetNext(); continue; } - + wxSize cursize = tool->GetSize(); if ( tool->IsStretchableSpace() ) { ++currentStretchable; - int thisSpace = currentStretchable == numStretchableSpaces ? + int thisSpace = currentStretchable == numStretchableSpaces ? totalStretchableSpace - (currentStretchable-1)*spacePerStretchable : spacePerStretchable; if ( isHorizontal ) cursize.x += thisSpace; - else + else cursize.y += thisSpace; } - + if ( !isHorizontal ) { int x1 = x + ( maxToolWidth - cursize.x ) / 2; @@ -1144,16 +1144,16 @@ void wxToolBar::DoLayout() int y1 = y + ( maxToolHeight - cursize.y ) / 2; tool->SetPosition( wxPoint(x, y1) ); } - + // update the item positioning state if ( !isHorizontal ) y += cursize.y + kwxMacToolSpacing; else x += cursize.x + kwxMacToolSpacing; - + node = node->GetNext(); } - + } bool wxToolBar::Realize() @@ -1179,7 +1179,7 @@ bool wxToolBar::Realize() node = node->GetNext(); continue; } - + // install in native NSToolbar if ( refTB ) { @@ -1190,13 +1190,13 @@ bool wxToolBar::Realize() // the strings now wxCFStringRef sh( tool->GetShortHelp() ); [hiItemRef setToolTip:sh.AsNSString()]; - + if ( insertAll || (tool->GetIndex() != currentPosition) ) { if ( !insertAll ) { insertAll = true; - + // if this is the first tool that gets newly inserted or repositioned // first remove all 'old' tools from here to the right, because of this // all following tools will have to be reinserted (insertAll). @@ -1205,7 +1205,7 @@ bool wxToolBar::Realize() node2 = node2->GetPrevious() ) { wxToolBarTool *tool2 = (wxToolBarTool*) node2->GetData(); - + const long idx = tool2->GetIndex(); if ( idx != -1 ) { @@ -1214,14 +1214,14 @@ bool wxToolBar::Realize() } } } - + wxCFStringRef cfidentifier; NSString *nsItemId; if (tool->GetStyle() == wxTOOL_STYLE_SEPARATOR) { if ( tool->IsStretchable() ) nsItemId = NSToolbarFlexibleSpaceItemIdentifier; - else + else nsItemId = NSToolbarSpaceItemIdentifier; } else @@ -1229,26 +1229,26 @@ bool wxToolBar::Realize() cfidentifier = wxCFStringRef(wxString::Format("%ld", (long)tool)); nsItemId = cfidentifier.AsNSString(); } - + [refTB insertItemWithItemIdentifier:nsItemId atIndex:currentPosition]; tool->SetIndex( currentPosition ); } - + currentPosition++; } } node = node->GetNext(); } - + #endif - + DoLayout(); - + // adjust radio items - + bool lastIsRadio = false; bool curIsRadio = false; - + node = m_tools.GetFirst(); while ( node ) { @@ -1258,7 +1258,7 @@ bool wxToolBar::Realize() node = node->GetNext(); continue; } - + // update radio button (and group) state lastIsRadio = curIsRadio; curIsRadio = ( tool->IsButton() && (tool->GetKind() == wxITEM_RADIO) ); @@ -1304,16 +1304,16 @@ bool wxToolBar::Realize() SetInitialSize( wxSize(m_minWidth, m_minHeight)); SendSizeEventToParent(); - + return true; } void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags) { wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); - + DoLayout(); -} +} void wxToolBar::DoSetToolBitmapSize(const wxSize& size) { @@ -1439,7 +1439,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) return false; long style = GetWindowStyleFlag(); - + wxSize toolSize = GetToolSize(); WXWidget controlHandle = nullptr; NSRect toolrect = NSMakeRect(0, 0, toolSize.x, toolSize.y + 2 ); @@ -1471,10 +1471,10 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) if (m_macToolbar != nullptr) { NSString * nsItemId = nil; - + if ( tool->IsStretchable() ) nsItemId = NSToolbarFlexibleSpaceItemIdentifier; - else + else nsItemId = NSToolbarSpaceItemIdentifier; NSToolbarItem* item = [[NSToolbarItem alloc] initWithItemIdentifier:nsItemId]; @@ -1501,7 +1501,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) [v setBordered:NO]; [v setButtonType: ( tool->CanBeToggled() ? NSToggleButton : NSMomentaryPushInButton )]; [v setImplementation:tool]; - + controlHandle = v; #if wxOSX_USE_NATIVE_TOOLBAR @@ -1519,7 +1519,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) if ( !(style & wxTB_NOICONS) ) tool->UpdateImages(); tool->UpdateLabel(); - + #if 0 InstallControlEventHandler( (WXWidget) controlHandle, GetwxMacToolBarToolEventHandlerUPP(), @@ -1653,9 +1653,9 @@ void wxToolBar::OnPaint(wxPaintEvent& event) GetSize( &w, &h ); wxPaintDC dc(this); - + wxRect rect(0,0,w,h); - + // TODO determine whether to use flat appearance in earlier system if ( WX_IS_MACOS_AVAILABLE(10, 14 ) ) { @@ -1665,7 +1665,7 @@ void wxToolBar::OnPaint(wxPaintEvent& event) { dc.GradientFillLinear( rect , wxColour( 0xCC,0xCC,0xCC ), wxColour( 0xA8,0xA8,0xA8 ) , wxSOUTH ); } - + dc.SetPen( wxPen( wxColour( 0x51,0x51,0x51 ) ) ); if ( direction == wxTB_RIGHT ) diff --git a/src/osx/cocoa/utils.mm b/src/osx/cocoa/utils.mm index e337fbab11..6aa66b7a20 100644 --- a/src/osx/cocoa/utils.mm +++ b/src/osx/cocoa/utils.mm @@ -47,15 +47,15 @@ void wxBell() - (void)applicationWillFinishLaunching:(NSNotification *)application { wxUnusedVar(application); - + // we must install our handlers later than setting the app delegate, because otherwise our handlers // get overwritten in the meantime NSAppleEventManager *appleEventManager = [NSAppleEventManager sharedAppleEventManager]; - + [appleEventManager setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL]; - + [appleEventManager setEventHandler:self andSelector:@selector(handleOpenAppEvent:withReplyEvent:) forEventClass:kCoreEventClass andEventID:kAEOpenApplication]; @@ -149,12 +149,12 @@ void wxBell() { fileList.Add( wxCFStringRef::AsStringWithNormalizationFormC([fileNames objectAtIndex:i]) ); } - + if ( wxTheApp->OSXInitWasCalled() ) wxTheApp->MacPrintFiles(fileList); else wxTheApp->OSXStorePrintFiles(fileList); - + return NSPrintingSuccess; } @@ -218,7 +218,7 @@ void wxBell() wxUnusedVar(sender); if ( !wxTheApp->OSXOnShouldTerminate() ) return NSTerminateCancel; - + return NSTerminateNow; } @@ -246,7 +246,7 @@ void wxBell() wxTopLevelWindow * const win = static_cast(*i); wxNonOwnedWindowImpl* winimpl = win ? win->GetNonOwnedPeer() : nullptr; WXWindow nswindow = win ? win->GetWXWindow() : nil; - + if ( nswindow && [nswindow hidesOnDeactivate] == NO && winimpl) winimpl->RestoreWindowLevel(); } @@ -264,7 +264,7 @@ void wxBell() { wxTopLevelWindow * const win = static_cast(*i); WXWindow nswindow = win ? win->GetWXWindow() : nil; - + if ( nswindow && [nswindow level] == kCGFloatingWindowLevel && [nswindow hidesOnDeactivate] == NO ) [nswindow setLevel:kCGNormalWindowLevel]; } @@ -333,7 +333,7 @@ void wxBell() // NSAlerts don't need nor respond to orderOut if ([sheet respondsToSelector:@selector(orderOut:)]) [sheet orderOut: self]; - + if (impl) impl->ModalFinishedCallback(sheet, returnCode); } @@ -368,7 +368,7 @@ void wxBell() if ([anEvent type] == NSKeyUp && ([anEvent modifierFlags] & NSCommandKeyMask)) [[self keyWindow] sendEvent:anEvent]; else - [super sendEvent:anEvent]; + [super sendEvent:anEvent]; } @end @@ -395,7 +395,7 @@ bool wxApp::DoInitGui() [NSColor setIgnoresAlpha:NO]; } gNSLayoutManager = [[NSLayoutManager alloc] init]; - + // This call makes it so that appplication:openFile: doesn't get bogus calls // from Cocoa doing its own parsing of the argument string. And yes, we need // to use a string with a boolean value in it. That's just how it works. @@ -538,23 +538,23 @@ void wxGetMousePosition( int* x, int* y ) wxMouseState wxGetMouseState() { wxMouseState ms; - + wxPoint pt = wxGetMousePosition(); ms.SetX(pt.x); ms.SetY(pt.y); - + NSUInteger modifiers = [NSEvent modifierFlags]; NSUInteger buttons = [NSEvent pressedMouseButtons]; - + ms.SetLeftDown( (buttons & 0x01) != 0 ); ms.SetMiddleDown( (buttons & 0x04) != 0 ); ms.SetRightDown( (buttons & 0x02) != 0 ); - + ms.SetRawControlDown(modifiers & NSControlKeyMask); ms.SetShiftDown(modifiers & NSShiftKeyMask); ms.SetAltDown(modifiers & NSAlternateKeyMask); ms.SetControlDown(modifiers & NSCommandKeyMask); - + return ms; } @@ -574,10 +574,10 @@ void wxBeginBusyCursor(const wxCursor *cursor) { NSEnumerator *enumerator = [[[NSApplication sharedApplication] windows] objectEnumerator]; id object; - + while ((object = [enumerator nextObject])) { [(NSWindow*) object disableCursorRects]; - } + } gMacStoredActiveCursor = gMacCurrentCursor; cursor->MacInstall(); @@ -597,10 +597,10 @@ void wxEndBusyCursor() { NSEnumerator *enumerator = [[[NSApplication sharedApplication] windows] objectEnumerator]; id object; - + while ((object = [enumerator nextObject])) { [(NSWindow*) object enableCursorRects]; - } + } wxSetCursor(wxNullCursor); @@ -633,10 +633,10 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const // however the new implementation does not take into account the backgroundViews, and I'm not sure about // until we're // sure the replacement is always better - + bool useOldImplementation = false; NSBitmapImageRep *rep = nil; - + if ( useOldImplementation ) { [view lockFocus]; @@ -651,7 +651,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const rep = [view bitmapImageRepForCachingDisplayInRect:[view bounds]]; [view cacheDisplayInRect:[view bounds] toBitmapImageRep:rep]; } - + CGImageRef cgImageRef = (CGImageRef)[rep CGImage]; CGRect r = CGRectMake( 0 , 0 , CGImageGetWidth(cgImageRef) , CGImageGetHeight(cgImageRef) ); @@ -663,7 +663,7 @@ wxBitmap wxWindowDCImpl::DoGetAsBitmap(const wxRect *subrect) const // since our context is upside down we dont use CGContextDrawImage wxMacDrawCGImage( (CGContextRef) bitmap.GetHBITMAP() , &r, cgImageRef ) ; - + if ( useOldImplementation ) [rep release]; } diff --git a/src/osx/cocoa/utils_base.mm b/src/osx/cocoa/utils_base.mm index 3b8275cb71..f5b7a888a7 100644 --- a/src/osx/cocoa/utils_base.mm +++ b/src/osx/cocoa/utils_base.mm @@ -274,16 +274,16 @@ bool wxCocoaLaunch(const char* const* argv, pid_t &pid) } NSWorkspace *ws = [NSWorkspace sharedWorkspace]; - - + + NSRunningApplication *app = nil; - + if ( [params count] > 0 ) app = [ws openURLs:params withApplicationAtURL:url options:NSWorkspaceLaunchAsync configuration:[NSDictionary dictionary] error:&error]; - + if ( app == nil ) { app = [ws launchApplicationAtURL:url @@ -303,7 +303,7 @@ bool wxCocoaLaunch(const char* const* argv, pid_t &pid) } } } - + [params release]; if( app != nil ) diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index b90f088f4f..e243bccfa9 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -131,12 +131,12 @@ WXWidget wxWidgetImpl::FindFocus() wxWidgetImpl* wxWidgetImpl::FindBestFromWXWidget(WXWidget control) { wxWidgetImpl* impl = FindFromWXWidget(control); - + // NSScrollViews can have their subviews like NSClipView // therefore check and use the NSScrollView peer in that case if ( impl == nullptr && [[control superview] isKindOfClass:[NSScrollView class]]) impl = FindFromWXWidget([control superview]); - + return impl; } @@ -249,7 +249,7 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const const UniCharCount maxStringLength = 255; UniCharCount actualStringLength = 0; UniChar unicodeString[maxStringLength]; - + OSStatus status = UCKeyTranslate(keyboardLayout, [self keyCode], kUCKeyActionDown, @@ -260,7 +260,7 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const maxStringLength, &actualStringLength, unicodeString); - + if(status == noErr) result = [NSString stringWithCharacters:unicodeString length:(NSInteger)actualStringLength]; } @@ -383,7 +383,7 @@ long wxOSXTranslateCocoaKey( NSEvent* event, int eventType ) default: break; } - + // Check for NUMPAD keys. For KEY_UP/DOWN events we need to use the // WXK_NUMPAD constants, but for the CHAR event we want to use the // standard ascii values @@ -552,7 +552,7 @@ void wxWidgetCocoaImpl::SetupKeyEvent(wxKeyEvent &wxevent , NSEvent * nsEvent, N static UInt32 g_lastButton = 0; static bool g_lastButtonWasFakeRight = false; -// better scroll wheel support +// better scroll wheel support // see http://lists.apple.com/archives/cocoa-dev/2007/Feb/msg00050.html @interface NSEvent (DeviceDelta) @@ -570,20 +570,20 @@ wxSetupCoordinates(NSView* view, wxCoord &x, wxCoord &y, NSEvent* nsEvent) { NSRect locationInWindow = NSZeroRect; locationInWindow.origin = [nsEvent locationInWindow]; - + // adjust coordinates for the window of the target view if ( [nsEvent window] != [view window] ) { if ( [nsEvent window] != nil ) locationInWindow = [[nsEvent window] convertRectToScreen:locationInWindow]; - + if ( [view window] != nil ) locationInWindow = [[view window] convertRectFromScreen:locationInWindow]; } - + NSPoint locationInView = [view convertPoint:locationInWindow.origin fromView:nil]; wxPoint locationInViewWX = wxFromNSPoint( view, locationInView ); - + x = locationInViewWX.x; y = locationInViewWX.y; @@ -605,7 +605,7 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent ) int eventType = [nsEvent type]; UInt32 modifiers = [nsEvent modifierFlags] ; - + SetupCoordinates(wxevent->m_x, wxevent->m_y, nsEvent); // these parameters are not given for all events @@ -790,7 +790,7 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent ) deltaX = [nsEvent scrollingDeltaX] * 10; deltaY = [nsEvent scrollingDeltaY] * 10; } - + wxevent->m_wheelDelta = 10; wxevent->m_wheelInverted = [nsEvent isDirectionInvertedFromDevice]; wxevent->m_linesPerAction = 1; @@ -839,12 +839,12 @@ wxWidgetCocoaImpl::TranslateMouseEvent( NSEvent * nsEvent ) case NSMouseMoved : wxevent->SetEventType( wxEVT_MOTION ) ; break; - + case NSEventTypeMagnify: wxevent->SetEventType( wxEVT_MAGNIFY ); wxevent->m_magnification = float([nsEvent magnification]); break; - + default : break ; } @@ -896,7 +896,7 @@ static void SetDrawingEnabledIfFrozenRecursive(wxWidgetCocoaImpl *impl, bool ena } } -/* idea taken from webkit sources: overwrite the methods that (private) NSToolTipManager will use to attach its tracking rectangle +/* idea taken from webkit sources: overwrite the methods that (private) NSToolTipManager will use to attach its tracking rectangle * then when changing the tooltip send fake view-exit and view-enter methods which will lead to a tooltip refresh */ @@ -951,7 +951,7 @@ static void SetDrawingEnabledIfFrozenRecursive(wxWidgetCocoaImpl *impl, bool ena CALayer* layer = self.layer; layer.contentsFormat = kCAContentsFormatRGBA8Uint; } - + [super viewWillDraw]; } #endif @@ -993,7 +993,7 @@ void wxOSX_insertText(NSView* self, SEL _cmd, NSString* text); } - (NSRange)selectedRange -{ +{ return NSMakeRange(NSNotFound, 0); } @@ -1092,7 +1092,7 @@ void wxOSX_cursorUpdate(NSView* self, SEL _cmd, NSEvent *event) wxWidgetCocoaImpl* impl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( self ); if (impl == nullptr) return; - + impl->cursorUpdate(event, self, _cmd); } @@ -1260,7 +1260,7 @@ void wxOSX_drawRect(NSView* self, SEL _cmd, NSRect rect) wxWindow* win = impl->GetWXPeer(); if ( win->UseBgCol() ) { - + CGContextRef context = [[NSGraphicsContext currentContext] CGContext]; CGContextSaveGState( context ); @@ -1271,7 +1271,7 @@ void wxOSX_drawRect(NSView* self, SEL _cmd, NSRect rect) CGContextRestoreGState( context ); } } - else + else { // just call the superclass handler, we don't need any custom wx drawing // here and it seems to work fine: @@ -1556,7 +1556,7 @@ void wxWidgetCocoaImpl::cursorUpdate(WX_NSEvent event, WXWidget slf, void *_cmd) bool wxWidgetCocoaImpl::SetupCursor(WX_NSEvent event) { extern wxCursor gGlobalCursor; - + if ( gGlobalCursor.IsOk() ) { gGlobalCursor.MacInstall(); @@ -1568,7 +1568,7 @@ bool wxWidgetCocoaImpl::SetupCursor(WX_NSEvent event) wxCoord x,y; SetupCoordinates(x, y, event); wxPoint cursorPoint( x , y ) ; - + while ( cursorTarget && !cursorTarget->MacSetupCursor( cursorPoint ) ) { // at least in GTK cursor events are not propagated either ... @@ -1580,7 +1580,7 @@ bool wxWidgetCocoaImpl::SetupCursor(WX_NSEvent event) cursorPoint += cursorTarget->GetPosition(); #endif } - + return cursorTarget != nullptr; } } @@ -1595,7 +1595,7 @@ void wxWidgetCocoaImpl::keyEvent(WX_NSEvent event, WXWidget slf, void *_cmd) if ( [event type] == NSKeyDown ) { - // there are key equivalents that are not command-combos and therefore not handled by cocoa automatically, + // there are key equivalents that are not command-combos and therefore not handled by cocoa automatically, // therefore we call the menubar directly here, exit if the menu is handling the shortcut if ( [[[NSApplication sharedApplication] mainMenu] performKeyEquivalent:event] ) { @@ -1606,13 +1606,13 @@ void wxWidgetCocoaImpl::keyEvent(WX_NSEvent event, WXWidget slf, void *_cmd) BeginNativeKeyDownEvent(event); } - + if ( GetFocusedViewInWindow([slf window]) != slf || m_hasEditor || !DoHandleKeyEvent(event) ) { wxOSX_EventHandlerPtr superimpl = (wxOSX_EventHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; superimpl(slf, (SEL)_cmd, event); } - + if ( [event type] == NSKeyDown ) { EndNativeKeyDownEvent(); @@ -2391,7 +2391,7 @@ bool wxWidgetCocoaImpl::resignFirstResponder(WXWidget slf, void *_cmd) { wxOSX_FocusHandlerPtr superimpl = (wxOSX_FocusHandlerPtr) [[slf superclass] instanceMethodForSelector:(SEL)_cmd]; BOOL r = superimpl(slf, (SEL)_cmd); - + // wxNSTextFields and wxNSComboBoxes have an editor as real responder, therefore they get // a resign notification when their editor takes over, don't trigger event here, the control // gets a controlTextDidEndEditing notification which will send a focus kill. @@ -2415,7 +2415,7 @@ bool wxWidgetCocoaImpl::isFlipped(WXWidget slf, void *WXUNUSED(_cmd)) void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) { // preparing the update region - + wxRegion updateRgn; // since adding many rects to a region is a costly process, by default use the bounding rect @@ -2430,7 +2430,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) #else updateRgn.Union(wxFromNSRect(slf,*(NSRect*)rect)); #endif - + wxWindow* wxpeer = GetWXPeer(); if ( wxpeer->MacGetLeftBorderSize() != 0 || wxpeer->MacGetTopBorderSize() != 0 ) @@ -2438,13 +2438,13 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) // as this update region is in native window locals we must adapt it to wx window local updateRgn.Offset( wxpeer->MacGetLeftBorderSize() , wxpeer->MacGetTopBorderSize() ); } - + // Restrict the update region to the shape of the window, if any, and also // remember the region that we need to clear later. wxNonOwnedWindow* const tlwParent = wxpeer->MacGetTopLevelWindow(); if ( tlwParent == nullptr ) return; - + const bool isTopLevel = tlwParent == wxpeer; wxRegion clearRgn; if ( tlwParent->GetWindowStyle() & wxFRAME_SHAPED ) @@ -2468,7 +2468,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) } } } - + wxpeer->GetUpdateRegion() = updateRgn; // setting up the drawing context @@ -2478,7 +2478,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) if ( context != nullptr ) { CGContextSaveGState( context ); - + #if OSX_DEBUG_DRAWING CGContextBeginPath( context ); CGContextMoveToPoint(context, 0, 0); @@ -2493,7 +2493,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) CGContextClosePath( context ); CGContextStrokePath(context); #endif - + if ( ![slf isFlipped] ) { CGContextTranslateCTM( context, 0, [m_osxView bounds].size.height ); @@ -2507,7 +2507,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) CGContextRestoreGState( context ); CGContextSaveGState( context ); } - + if ( !handled ) { // call super @@ -2520,7 +2520,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) CGContextSaveGState( context ); } } - + if ( context != nullptr ) { // as we called restore above, we have to flip again if necessary @@ -2529,7 +2529,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) CGContextTranslateCTM( context, 0, [m_osxView bounds].size.height ); CGContextScaleCTM( context, 1, -1 ); } - + if ( isTopLevel ) { // We also need to explicitly draw the part of the top level window @@ -2543,7 +2543,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) dc.SetDeviceClippingRegion(clearRgn); dc.Clear(); } - + #if wxUSE_GRAPHICS_CONTEXT // If the window shape is defined by a path, stroke the path to show // the window border. @@ -2557,7 +2557,7 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd)) } #endif // wxUSE_GRAPHICS_CONTEXT } - + wxpeer->MacPaintChildrenBorders(); CGContextRestoreGState( context ); } @@ -2581,7 +2581,7 @@ void wxWidgetCocoaImpl::controlDoubleAction( WXWidget WXUNUSED(slf), void *WXUNU void wxWidgetCocoaImpl::controlTextDidChange() { wxWindow* wxpeer = (wxWindow*)GetWXPeer(); - if ( wxpeer ) + if ( wxpeer ) { // since native rtti doesn't have to be enabled and wx' rtti is not aware of the mixin wxTextEntry, workaround is needed if ( wxTextCtrl *tc = wxDynamicCast( wxpeer , wxTextCtrl ) ) @@ -2591,7 +2591,7 @@ void wxWidgetCocoaImpl::controlTextDidChange() } else if ( wxComboBox *cb = wxDynamicCast( wxpeer , wxComboBox ) ) cb->SendTextUpdatedEventIfAllowed(); - else + else { wxFAIL_MSG("Unexpected class for controlTextDidChange event"); } @@ -2633,7 +2633,7 @@ void wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags) wxOSX_CLASS_ADD_METHOD(c, @selector(mouseDragged:), (IMP) wxOSX_mouseEvent, "v@:@" ) wxOSX_CLASS_ADD_METHOD(c, @selector(rightMouseDragged:), (IMP) wxOSX_mouseEvent, "v@:@" ) wxOSX_CLASS_ADD_METHOD(c, @selector(otherMouseDragged:), (IMP) wxOSX_mouseEvent, "v@:@" ) - + wxOSX_CLASS_ADD_METHOD(c, @selector(acceptsFirstMouse:), (IMP) wxOSX_acceptsFirstMouse, "v@:@" ) wxOSX_CLASS_ADD_METHOD(c, @selector(scrollWheel:), (IMP) wxOSX_mouseEvent, "v@:@" ) @@ -2657,7 +2657,7 @@ void wxOSXCocoaClassAddWXMethods(Class c, wxOSXSkipOverrides skipFlags) #if !wxOSX_USE_NATIVE_FLIPPED wxOSX_CLASS_ADD_METHOD(c, @selector(isFlipped), (IMP) wxOSX_isFlipped, "c@:" ) #endif - + if ( !(skipFlags & wxOSXSKIP_DRAW) ) wxOSX_CLASS_ADD_METHOD(c, @selector(drawRect:), (IMP) wxOSX_drawRect, "v@:{_NSRect={_NSPoint=ff}{_NSSize=ff}}" ) @@ -2705,7 +2705,7 @@ wxWidgetImpl( peer, flags ) // check if the user wants to create the control initially hidden if ( !peer->IsShown() ) SetVisibility(false); - + // gc aware handling if ( m_osxView ) CFRetain(m_osxView); @@ -2734,7 +2734,7 @@ wxWidgetCocoaImpl::~wxWidgetCocoaImpl() { if ( GetWXPeer() && GetWXPeer()->IsFrozen() ) SetDrawingEnabled(true); - + RemoveAssociations( this ); if ( !IsRootControl() ) @@ -2788,7 +2788,7 @@ wxWidgetCocoaNativeKeyDownSuspender::wxWidgetCocoaNativeKeyDownSuspender( wxWidg { m_nsevent = m_target->m_lastKeyDownEvent; m_wxsent = m_target->m_lastKeyDownWXSent; - + m_target->m_lastKeyDownEvent = nil; } @@ -2806,7 +2806,7 @@ bool wxWidgetCocoaImpl::IsVisible() const void wxWidgetCocoaImpl::SetVisibility( bool visible ) { [m_osxView setHidden:(visible ? NO:YES)]; - + // trigger redraw upon shown for layer-backed views if ( WX_IS_MACOS_AVAILABLE(10, 14 ) ) if( !m_osxView.isHiddenOrHasHiddenAncestor ) @@ -3209,7 +3209,7 @@ void wxWidgetCocoaImpl::GetPosition( int &x, int &y ) const wxRect r = wxFromNSRect( [m_osxView superview], [m_osxView frame] ); x = r.GetLeft(); y = r.GetTop(); - + // under Cocoa we might have a contentView in the wxParent to which we have to // adjust the coordinates wxWindowMac* parent = GetWXPeer()->GetParent(); @@ -3275,7 +3275,7 @@ void wxWidgetCocoaImpl::GetLayoutInset(int &left , int &top , int &right, int &b namespace { - + void SetSubviewsNeedDisplay( NSView *view ) { for ( NSView *sub in view.subviews ) @@ -3483,7 +3483,7 @@ void wxWidgetCocoaImpl::Embed( wxWidgetImpl *parent ) wxASSERT_MSG( container != nullptr , wxT("No valid mac container control") ) ; [container addSubview:m_osxView]; - + // User panes will be frozen elsewhere if( m_wxPeer->IsFrozen() && !IsUserPane() ) SetDrawingEnabled(false); @@ -3512,14 +3512,14 @@ void wxWidgetCocoaImpl::SetBackgroundColour( const wxColour &col ) bool wxWidgetCocoaImpl::SetBackgroundStyle( wxBackgroundStyle style ) { BOOL opaque = ( style == wxBG_STYLE_PAINT ); - + if ( [m_osxView respondsToSelector:@selector(setOpaque:) ] ) { [m_osxView setOpaque: opaque]; if ( style == wxBG_STYLE_TRANSPARENT ) [m_osxView setBackgroundColor:[NSColor clearColor]]; } - + return true ; } @@ -3575,7 +3575,7 @@ void wxWidgetCocoaImpl::SetLabel( const wxString& title ) [attrString endEditing]; [(id)m_osxView setAttributedTitle:attrString]; - + [attrString release]; return; @@ -3824,7 +3824,7 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant ) if ( [m_osxView isKindOfClass:[NSScrollView class] ] ) { NSView* targetView = [(NSScrollView*) m_osxView documentView]; - + if ( [targetView respondsToSelector:@selector(setControlSize:)] ) [targetView setControlSize:size]; else if ([targetView respondsToSelector:@selector(cell)]) @@ -3873,7 +3873,7 @@ void wxWidgetCocoaImpl::SetToolTip(wxToolTip* tooltip) wxCFStringRef cf( tooltip->GetTip() ); [m_osxView setToolTip: cf.AsNSString()]; } - else + else { [m_osxView setToolTip:nil]; } @@ -3892,7 +3892,7 @@ void wxWidgetCocoaImpl::InstallEventHandler( WXWidget control ) } else [c setAction: @selector(controlAction:)]; - + if ([c respondsToSelector:@selector(setDoubleAction:)]) { [c setDoubleAction: @selector(controlDoubleAction:)]; @@ -3927,7 +3927,7 @@ bool wxWidgetCocoaImpl::EnableTouchEvents(int eventsMask) new wxCocoaGesturesImpl(this, m_osxView, eventsMask) ); #endif - + [m_osxView setAcceptsTouchEvents:YES]; } @@ -3951,12 +3951,12 @@ bool wxWidgetCocoaImpl::DoHandleCharEvent(NSEvent *event, NSString *text) ++it ) { wxKeyEvent wxevent(wxEVT_CHAR); - + // if we have exactly one character resulting from the event, then // set the corresponding modifiers and raw data from the nsevent // otherwise leave these at defaults, as they probably would be incorrect // anyway (IME input) - + if ( event != nil && length == 1) { SetupKeyEvent(wxevent,event,text); @@ -3970,14 +3970,14 @@ bool wxWidgetCocoaImpl::DoHandleCharEvent(NSEvent *event, NSString *text) const wxUniChar aunichar = *it; wxevent.m_uniChar = aunichar; wxevent.m_keyCode = aunichar < 0x80 ? aunichar : WXK_NONE; - + wxevent.SetEventObject(peer); wxevent.SetId(peer->GetId()); if ( event ) wxevent.SetTimestamp( static_cast([event timestamp] * 1000) ) ; } - + result = peer->OSXHandleKeyEvent(wxevent) || result; } } @@ -4104,7 +4104,7 @@ void wxWidgetCocoaImpl::DoNotifyFocusSet() NSResponder* responder = wxNonOwnedWindowCocoaImpl::GetFormerFirstResponder(); NSView* otherView = wxOSXGetViewFromResponder(responder); wxWidgetImpl* otherWindow = FindFromWXWidget(otherView); - + // It doesn't make sense to notify about the focus set if it's the same // control in the end, and just a different subview if ( otherWindow != this ) @@ -4116,7 +4116,7 @@ void wxWidgetCocoaImpl::DoNotifyFocusLost() NSResponder * responder = wxNonOwnedWindowCocoaImpl::GetNextFirstResponder(); NSView* otherView = wxOSXGetViewFromResponder(responder); wxWidgetImpl* otherWindow = FindBestFromWXWidget(otherView); - + // It doesn't make sense to notify about the loss of focus if it's the same // control in the end, and just a different subview if ( otherWindow != this ) @@ -4168,8 +4168,8 @@ void wxWidgetCocoaImpl::SetCursor(const wxCursor& cursor) NSRect location = NSZeroRect; location.origin = [NSEvent mouseLocation]; location = [[m_osxView window] convertRectFromScreen:location]; - NSPoint locationInView = [m_osxView convertPoint:location.origin fromView:nil]; - + NSPoint locationInView = [m_osxView convertPoint:location.origin fromView:nil]; + if( NSMouseInRect(locationInView, [m_osxView bounds], YES) ) { [(NSCursor*)cursor.GetHCURSOR() set]; @@ -4287,7 +4287,7 @@ wxWidgetImpl* wxWidgetImpl::CreateUserPane( wxWindowMac* wxpeer, wxWindowMac* WX wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) { NSWindow* tlw = now->GetWXWindow(); - + wxWidgetCocoaImpl* c = nullptr; if ( now->IsNativeWindowWrapper() ) { diff --git a/src/osx/combobox_osx.cpp b/src/osx/combobox_osx.cpp index 96d40380d8..40916b5fae 100644 --- a/src/osx/combobox_osx.cpp +++ b/src/osx/combobox_osx.cpp @@ -57,10 +57,10 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, const wxString& name) { DontCreatePeer(); - + m_text = nullptr; m_choice = nullptr; - + if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; diff --git a/src/osx/core/bitmap.cpp b/src/osx/core/bitmap.cpp index a696714196..27c5ba20e7 100644 --- a/src/osx/core/bitmap.cpp +++ b/src/osx/core/bitmap.cpp @@ -490,7 +490,7 @@ IconRef wxBitmapRefData::GetIconRef() const sz = 512; else if ( sz <= 1024) sz = 1024; - + switch (sz) { case 1024: @@ -500,11 +500,11 @@ IconRef wxBitmapRefData::GetIconRef() const case 512: dataType = kIconServices512PixelDataARGB; break; - + case 256: dataType = kIconServices256PixelDataARGB; break; - + case 128: dataType = kIconServices128PixelDataARGB ; break; @@ -1945,7 +1945,7 @@ bool wxICNSResourceHandler::LoadFile(wxBitmap *bitmap, if ( theId != 0 ) { IconRef iconRef = nullptr ; - + wxOSX_VERIFY_NOERR(GetIconRef( kOnSystemDisk, kSystemIconsCreator, theId, &iconRef )) ; img = wxOSXGetNSImageFromIconRef(iconRef); } @@ -1956,10 +1956,10 @@ bool wxICNSResourceHandler::LoadFile(wxBitmap *bitmap, wxCFStringRef restype(GetExtension().Lower()); iconURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, nullptr)); - + img = wxOSXGetNSImageFromCFURL(iconURL); } - + if ( img ) { bitmap->Create(img); @@ -1980,9 +1980,9 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, wxString ext = GetExtension().Lower(); wxCFStringRef restype(ext); double scale = 1.0; - + wxCFRef imageURL; - + const int contentScaleFactor = wxRound(wxOSXGetMainScreenContentScaleFactor()); if ( contentScaleFactor > 1 ) { @@ -1990,20 +1990,20 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, nullptr)); scale = contentScaleFactor; } - + if ( imageURL.get() == nullptr ) { wxCFStringRef resname(name); imageURL.reset(CFBundleCopyResourceURL(CFBundleGetMainBundle(), resname, restype, nullptr)); scale = 1.0; } - + if ( imageURL.get() != nullptr ) { // Create the data provider object wxCFRef provider(CGDataProviderCreateWithURL (imageURL) ); CGImageRef image = nullptr; - + if ( ext == "jpeg" ) image = CGImageCreateWithJPEGDataProvider (provider, nullptr, true, kCGRenderingIntentDefault); @@ -2017,7 +2017,7 @@ bool wxBundleResourceHandler::LoadFile(wxBitmap *bitmap, return true; } } - + return false ; } diff --git a/src/osx/core/display.cpp b/src/osx/core/display.cpp index 7ac37076c4..d77af12b12 100644 --- a/src/osx/core/display.cpp +++ b/src/osx/core/display.cpp @@ -320,7 +320,7 @@ static int wxOSXCGDisplayModeGetBitsPerPixel( CGDisplayModeRef theValue ) depth = 16; else if ( CFStringCompare( pixelEncoding, CFSTR(IO8BitIndexedPixels) , kCFCompareCaseInsensitive) == kCFCompareEqualTo ) depth = 8; - + return depth; } @@ -329,17 +329,17 @@ wxArrayVideoModes wxDisplayImplMacOSX::GetModes(const wxVideoMode& mode) const wxArrayVideoModes resultModes; wxCFRef theArray(CGDisplayCopyAllDisplayModes( m_id ,nullptr ) ); - + for (CFIndex i = 0; i < CFArrayGetCount(theArray); ++i) { CGDisplayModeRef theValue = static_cast(const_cast(CFArrayGetValueAtIndex(theArray, i))); - + wxVideoMode theMode( CGDisplayModeGetWidth(theValue), CGDisplayModeGetHeight(theValue), wxOSXCGDisplayModeGetBitsPerPixel(theValue), int(CGDisplayModeGetRefreshRate(theValue))); - + if (theMode.Matches( mode )) resultModes.Add( theMode ); } @@ -350,7 +350,7 @@ wxArrayVideoModes wxDisplayImplMacOSX::GetModes(const wxVideoMode& mode) const wxVideoMode wxDisplayImplMacOSX::GetCurrentMode() const { wxCFRef theValue( CGDisplayCopyDisplayMode( m_id ) ); - + return wxVideoMode( CGDisplayModeGetWidth(theValue), CGDisplayModeGetHeight(theValue), @@ -370,20 +370,20 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode ) wxCHECK_MSG( mode.GetWidth() && mode.GetHeight(), false, wxT("at least the width and height must be specified") ); - + bool bOK = false; wxCFRef theArray(CGDisplayCopyAllDisplayModes( m_id ,nullptr ) ); - + for (CFIndex i = 0; i < CFArrayGetCount(theArray); ++i) { CGDisplayModeRef theValue = static_cast(const_cast(CFArrayGetValueAtIndex(theArray, i))); - + wxVideoMode theMode( CGDisplayModeGetWidth(theValue), CGDisplayModeGetHeight(theValue), wxOSXCGDisplayModeGetBitsPerPixel(theValue), int(CGDisplayModeGetRefreshRate(theValue))); - + if ( theMode.GetWidth() == mode.GetWidth() && theMode.GetHeight() == mode.GetHeight() && ( mode.GetDepth() == 0 || theMode.GetDepth() == mode.GetDepth() ) && ( mode.GetRefresh() == 0 || theMode.GetRefresh() == mode.GetRefresh() ) ) @@ -393,7 +393,7 @@ bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode ) break; } } - + return bOK; } diff --git a/src/osx/core/evtloop_cf.cpp b/src/osx/core/evtloop_cf.cpp index 718fc2425b..505a626f85 100644 --- a/src/osx/core/evtloop_cf.cpp +++ b/src/osx/core/evtloop_cf.cpp @@ -118,7 +118,7 @@ wxCFEventLoop::DefaultModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(observe if ( activity & kCFRunLoopBeforeTimers ) { } - + if ( activity & kCFRunLoopBeforeWaiting ) { } @@ -134,7 +134,7 @@ wxCFEventLoop::wxCFEventLoop() #if wxUSE_UIACTIONSIMULATOR m_shouldWaitForEvent = false; #endif - + m_runLoop = CFGetCurrentRunLoop(); CFRunLoopObserverContext ctxt; diff --git a/src/osx/core/fontenum.cpp b/src/osx/core/fontenum.cpp index 753151901c..b53f68a1f3 100644 --- a/src/osx/core/fontenum.cpp +++ b/src/osx/core/fontenum.cpp @@ -47,7 +47,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, #elif wxOSX_USE_IPHONE cfFontFamilies = CopyAvailableFontFamilyNames(); #endif - + CFIndex count = CFArrayGetCount(cfFontFamilies); for(CFIndex i = 0; i < count; i++) { @@ -62,20 +62,20 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, if ( fontFamiliyEncoding != macEncoding ) continue; } - + if ( fixedWidthOnly ) { CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(font); if ( (traits & kCTFontMonoSpaceTrait) == 0 ) continue; } - + } - + wxCFStringRef cfName(wxCFRetain(fontName)) ; fontFamilies.Add(cfName.AsString()); } - + CFRelease(cfFontFamilies); } for ( size_t i = 0 ; i < fontFamilies.Count() ; ++i ) diff --git a/src/osx/core/stdpaths.mm b/src/osx/core/stdpaths.mm index 024e04b713..78d9709792 100644 --- a/src/osx/core/stdpaths.mm +++ b/src/osx/core/stdpaths.mm @@ -122,7 +122,7 @@ wxString wxStandardPaths::GetUserDir(Dir userDir) const dirType = NSDocumentDirectory; break; } - + return GetFMDirectory(dirType, NSUserDomainMask) + subdir; } diff --git a/src/osx/dialog_osx.cpp b/src/osx/dialog_osx.cpp index a8311dc79a..79f19b9353 100644 --- a/src/osx/dialog_osx.cpp +++ b/src/osx/dialog_osx.cpp @@ -40,7 +40,7 @@ void wxDialog::OSXBeginModalDialog() s_modalStack.back()->OSXSetWorksWhenModal(false); s_modalWorksStack.push_back(OSXGetWorksWhenModal()); #endif - + s_modalStack.push_back(this); } @@ -50,7 +50,7 @@ void wxDialog::OSXEndModalDialog() s_modalStack.pop_back(); #if wxOSX_USE_COCOA s_modalWorksStack.pop_back(); - + // restore worksWhenModal if ( s_modalStack.size() > 0 ) s_modalStack.back()->OSXSetWorksWhenModal(s_modalWorksStack.back()); diff --git a/src/osx/dnd_osx.cpp b/src/osx/dnd_osx.cpp index ab8818282d..494f94f114 100644 --- a/src/osx/dnd_osx.cpp +++ b/src/osx/dnd_osx.cpp @@ -41,15 +41,15 @@ wxDataFormat wxDropTarget::GetMatchingPair() if ( wxDropSource* currentSource = wxDropSource::GetCurrentDropSource() ) { wxDataObject* data = currentSource->GetDataObject(); - + if ( data ) supported = m_dataObject->GetSupportedFormatInSource(data); } - + if ( supported == wxDF_INVALID ) supported = m_dataObject->GetSupportedFormatInSource( m_currentDragPasteboard ); } - + return supported; } diff --git a/src/osx/gauge_osx.cpp b/src/osx/gauge_osx.cpp index 0ba05818b2..dbd1f62e4f 100644 --- a/src/osx/gauge_osx.cpp +++ b/src/osx/gauge_osx.cpp @@ -24,9 +24,9 @@ bool wxGauge::Create( wxWindow *parent, long style, const wxValidator& validator, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxGaugeBase::Create( parent, id, range, pos, s, style & 0xE0FFFFFF, validator, name ) ) return false; diff --git a/src/osx/glcanvas_osx.cpp b/src/osx/glcanvas_osx.cpp index 0c181bcb05..a018039f53 100644 --- a/src/osx/glcanvas_osx.cpp +++ b/src/osx/glcanvas_osx.cpp @@ -480,7 +480,7 @@ bool wxGLCanvas::Create(wxWindow *parent, if ( !wxGLCanvas::DoCreate(parent,id,pos,size,style,name) ) return false; - + return true; } diff --git a/src/osx/iphone/checkbox.mm b/src/osx/iphone/checkbox.mm index be93418aee..2a9cd5789f 100644 --- a/src/osx/iphone/checkbox.mm +++ b/src/osx/iphone/checkbox.mm @@ -42,13 +42,13 @@ public: { m_control = v; } - + wxInt32 GetValue() const { return [m_control isOn] ? 1 : 0; } - - void SetValue( wxInt32 v ) + + void SetValue( wxInt32 v ) { [m_control setOn:v != 0 animated:NO]; } diff --git a/src/osx/iphone/dialog.mm b/src/osx/iphone/dialog.mm index e8937af856..161eb754fe 100644 --- a/src/osx/iphone/dialog.mm +++ b/src/osx/iphone/dialog.mm @@ -23,7 +23,7 @@ extern wxList wxModalDialogs; void wxDialog::DoShowWindowModal() -{ +{ m_modality = wxDIALOG_MODALITY_APP_MODAL; ShowModal(); SendWindowModalDialogEvent ( wxEVT_WINDOW_MODAL_DIALOG_CLOSED ); diff --git a/src/osx/iphone/evtloop.mm b/src/osx/iphone/evtloop.mm index 3cfa2232a1..89dcb09d0c 100644 --- a/src/osx/iphone/evtloop.mm +++ b/src/osx/iphone/evtloop.mm @@ -86,7 +86,7 @@ void wxGUIEventLoop::OSXDoRun() const char* appname = "app"; UIApplicationMain( 1, (char**) &appname, @"UIApplication", @"wxAppDelegate" ); } - else + else { wxCFEventLoop::OSXDoRun(); } diff --git a/src/osx/iphone/glcanvas.mm b/src/osx/iphone/glcanvas.mm index cdf44882ff..1b263a35f6 100644 --- a/src/osx/iphone/glcanvas.mm +++ b/src/osx/iphone/glcanvas.mm @@ -48,7 +48,7 @@ + (void)initialize { static BOOL initialized = NO; - if (!initialized) + if (!initialized) { initialized = YES; wxOSXIPhoneClassAddWXMethods( self ); @@ -65,7 +65,7 @@ WXGLContext WXGLCreateContext( WXGLPixelFormat pixelFormat, WXGLContext shareContext ) { WXGLContext context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES1]; - + if ( !context ) wxFAIL_MSG("NSOpenGLContext creation failed"); return context ; @@ -106,7 +106,7 @@ WXGLPixelFormat WXGLChoosePixelFormat(const int *GLAttrs, bool wxGLContext::SetCurrent(const wxGLCanvas& win) const { if ( !m_glContext ) - return false; + return false; wxUICustomOpenGLView* v = (wxUICustomOpenGLView*) win.GetPeer()->GetWXWidget(); if ( v.context != m_glContext ) { @@ -114,7 +114,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const [v bindDrawable]; } WXGLSetCurrentContext(m_glContext); - + return true; } diff --git a/src/osx/iphone/nonownedwnd.mm b/src/osx/iphone/nonownedwnd.mm index 2c712cc256..9da62bf3d8 100644 --- a/src/osx/iphone/nonownedwnd.mm +++ b/src/osx/iphone/nonownedwnd.mm @@ -178,7 +178,7 @@ bool wxNonOwnedWindowIPhoneImpl::Show(bool show) wxNonOwnedWindow* now = dynamic_cast (GetWXPeer()); wxShowEvent eventShow(now->GetId(), true); eventShow.SetEventObject(now); - + now->HandleWindowEvent(eventShow); m_initialShowSent = true; @@ -368,10 +368,10 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) [contentview release]; [contentview setController:controller]; [contentview setHidden:YES]; - + wxWidgetIPhoneImpl* impl = new wxWidgetIPhoneImpl( now, contentview, Widget_IsRoot ); impl->InstallEventHandler(); - + if ([toplevelwindow respondsToSelector:@selector(setRootViewController:)]) { toplevelwindow.rootViewController = controller; @@ -408,7 +408,7 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) wxOSXIPhoneClassAddWXMethods( self ); } } - + @end @implementation wxUIContentViewController @@ -417,9 +417,9 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) { wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] ); wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); - + // TODO: determine NO or YES based on min size requirements (whether it fits on the new orientation) - + return YES; } @@ -434,15 +434,15 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) { return UIInterfaceOrientationMaskAll; } - - + + - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] ); wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); - + now->HandleResized(0); } @@ -451,12 +451,12 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) wxWidgetIPhoneImpl* impl = (wxWidgetIPhoneImpl* ) wxWidgetImpl::FindFromWXWidget( [self view] ); wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast (now->GetNonOwnedPeer()); - + if ( nowimpl->InitialShowEventSent() ) { wxShowEvent eventShow(now->GetId(), true); eventShow.SetEventObject(now); - + now->HandleWindowEvent(eventShow); } } @@ -468,12 +468,12 @@ wxWidgetImpl* wxWidgetImpl::CreateContentView( wxNonOwnedWindow* now ) { wxNonOwnedWindow* now = dynamic_cast (impl->GetWXPeer()); wxNonOwnedWindowIPhoneImpl* nowimpl = dynamic_cast (now->GetNonOwnedPeer()); - + if ( nowimpl->InitialShowEventSent() ) { wxShowEvent eventShow(now->GetId(), false); eventShow.SetEventObject(now); - + now->HandleWindowEvent(eventShow); } } diff --git a/src/osx/iphone/slider.mm b/src/osx/iphone/slider.mm index ff4d8f9034..40b920f3f5 100644 --- a/src/osx/iphone/slider.mm +++ b/src/osx/iphone/slider.mm @@ -45,12 +45,12 @@ public : ~wxSliderIPhoneImpl() { } - + void controlAction(void* sender, wxUint32 controlEvent, WX_UIEvent rawEvent) { if ( controlEvent == UIControlEventValueChanged ) GetWXPeer()->TriggerScrollEvent(wxEVT_SCROLL_THUMBTRACK); - else + else wxWidgetIPhoneImpl::controlAction(sender,controlEvent,rawEvent); } @@ -58,12 +58,12 @@ public : { [m_control setMaximumValue:m]; } - + void SetMinimum(wxInt32 m) { [m_control setMinimumValue:m]; } - + void SetValue(wxInt32 n) { [m_control setValue:n]; @@ -73,7 +73,7 @@ public : { return [m_control value]; } - + private: UISlider* m_control; }; diff --git a/src/osx/iphone/stattext.mm b/src/osx/iphone/stattext.mm index 269ce85641..7363d4e32b 100644 --- a/src/osx/iphone/stattext.mm +++ b/src/osx/iphone/stattext.mm @@ -55,7 +55,7 @@ public: { wxUILabel* v = (wxUILabel*)GetWXWidget(); wxCFStringRef text( title ); - + [v setText:text.AsNSString()]; } private : @@ -95,7 +95,7 @@ wxWidgetImplType* wxWidgetImpl::CreateStaticText( wxWindowMac* wxpeer, [v setTextAlignment: NSTextAlignmentCenter]; else if (style & wxALIGN_RIGHT) [v setTextAlignment: NSTextAlignmentRight]; - + wxWidgetIPhoneImpl* c = new wxStaticTextIPhoneImpl( wxpeer, v ); return c; } diff --git a/src/osx/iphone/textctrl.mm b/src/osx/iphone/textctrl.mm index 7712ec4663..ec96cb1a18 100644 --- a/src/osx/iphone/textctrl.mm +++ b/src/osx/iphone/textctrl.mm @@ -123,7 +123,7 @@ protected : @end -#if 0 +#if 0 @implementation wxUITextFieldEditor - (void) keyDown:(NSEvent*) event @@ -302,7 +302,7 @@ protected : // wxUITextViewControl // -wxUITextViewControl::wxUITextViewControl( wxTextCtrl *wxPeer, UITextView* v) : +wxUITextViewControl::wxUITextViewControl( wxTextCtrl *wxPeer, UITextView* v) : wxWidgetIPhoneImpl(wxPeer, v), wxTextWidgetImpl(wxPeer) { @@ -447,7 +447,7 @@ void wxUITextViewControl::SetFont(const wxFont & font) bool wxUITextViewControl::GetStyle(long position, wxTextAttr& style) { if (m_textView && position >=0) - { + { // UIFont* font = nullptr; // NSColor* bgcolor = nullptr; // NSColor* fgcolor = nullptr; @@ -455,7 +455,7 @@ bool wxUITextViewControl::GetStyle(long position, wxTextAttr& style) // but that UITextStorage does not accept length as a valid position. // Therefore we return the default control style in that case. /* - if (position < [[m_textView string] length]) + if (position < [[m_textView string] length]) { UITextStorage* storage = [m_textView textStorage]; font = [[storage attribute:NSFontAttributeName atIndex:position effectiveRange:nullptr] autorelease]; @@ -543,7 +543,7 @@ wxSize wxUITextViewControl::GetBestSize() const // wxUITextFieldControl // -wxUITextFieldControl::wxUITextFieldControl( wxTextCtrl *wxPeer, UITextField* w ) : +wxUITextFieldControl::wxUITextFieldControl( wxTextCtrl *wxPeer, UITextField* w ) : wxWidgetIPhoneImpl(wxPeer, w), wxTextWidgetImpl(wxPeer) { diff --git a/src/osx/iphone/toolbar.mm b/src/osx/iphone/toolbar.mm index 1ff1ab2e9c..0bc76d3d07 100644 --- a/src/osx/iphone/toolbar.mm +++ b/src/osx/iphone/toolbar.mm @@ -66,34 +66,34 @@ public: wxObject *clientData, const wxString& shortHelp, const wxString& longHelp ); - + wxToolBarTool(wxToolBar *tbar, wxControl *control, const wxString& label); - + virtual ~wxToolBarTool(); - + void Action() { wxToolBar *tbar = (wxToolBar*) GetToolBar(); if (CanBeToggled()) { bool shouldToggle; - + shouldToggle = !IsToggled(); tbar->ToggleTool( GetId(), shouldToggle ); } - + tbar->OnLeftClick( GetId(), IsToggled() ); } - + UIBarButtonItem* GetUIBarButtonItem() const {return m_toolbarItem;} private: - + void Init() { m_toolbarItem = nullptr; m_index = -1; } - + UIBarButtonItem* m_toolbarItem; // position in its toolbar, -1 means not inserted CFIndex m_index; @@ -121,7 +121,7 @@ wxToolBarToolBase( UIBarButtonItem* bui = [UIBarButtonItem alloc]; UIBarButtonItemStyle style = UIBarButtonItemStylePlain; wxUIToolbar* toolbar = (wxUIToolbar*) tbar->GetHandle(); - + if ( id == wxID_SEPARATOR ) { bui = [bui initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil]; @@ -138,7 +138,7 @@ wxToolBarToolBase( style = UIBarButtonItemStyleDone; else style = UIBarButtonItemStyleBordered; - + bui = [bui initWithTitle:wxCFStringRef(label).AsNSString() style:style target:toolbar action:@selector(clickedAction:)]; } @@ -152,9 +152,9 @@ wxToolBarTool::wxToolBarTool(wxToolBar *tbar, wxControl *control, const wxString { Init(); UIBarButtonItem* bui = [UIBarButtonItem alloc]; - + [bui initWithCustomView:control->GetHandle() ]; - + m_toolbarItem = bui; wxToolBarToolList[bui] = this; } @@ -204,7 +204,7 @@ void wxToolBar::Init() { m_maxWidth = -1; m_maxHeight = -1; - + m_macToolbar = nullptr; } @@ -223,15 +223,15 @@ bool wxToolBar::Create( if ( !wxToolBarBase::Create( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; - + FixupStyle(); - + CGRect r = CGRectMake( pos.x, pos.y, size.x, size.y) ; - + wxUIToolbar* toolbar = [[wxUIToolbar alloc] init]; [toolbar sizeToFit]; - - switch ( [[UIApplication sharedApplication] statusBarStyle] ) + + switch ( [[UIApplication sharedApplication] statusBarStyle] ) { #ifdef __IPHONE_3_0 case UIStatusBarStyleBlackOpaque: @@ -248,7 +248,7 @@ bool wxToolBar::Create( } m_macToolbar = toolbar; - SetPeer(new wxWidgetIPhoneImpl( this, toolbar )); + SetPeer(new wxWidgetIPhoneImpl( this, toolbar )); MacPostControlCreate(pos, size) ; return true; } @@ -262,8 +262,8 @@ bool wxToolBar::Realize() { if ( !wxToolBarBase::Realize() ) return false; - - + + return true; } @@ -275,9 +275,9 @@ void wxToolBar::DoLayout() void wxToolBar::DoSetSize(int x, int y, int width, int height, int sizeFlags) { wxToolBarBase::DoSetSize(x, y, width, height, sizeFlags); - + DoLayout(); -} +} void wxToolBar::DoSetToolBitmapSize(const wxSize& size) { @@ -304,7 +304,7 @@ void wxToolBar::SetToolNormalBitmap( int id, const wxBitmapBundle& bitmap ) if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); - + tool->SetNormalBitmap(bitmap); } } @@ -315,9 +315,9 @@ void wxToolBar::SetToolDisabledBitmap( int id, const wxBitmapBundle& bitmap ) if ( tool ) { wxCHECK_RET( tool->IsButton(), wxT("Can only set bitmap on button tools.")); - + tool->SetDisabledBitmap(bitmap); - + // TODO: what to do for this one? } } @@ -349,30 +349,30 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) wxToolBarTool *tool = static_cast< wxToolBarTool*>(toolBase ); if (tool == nullptr) return false; - + wxSize toolSize = GetToolSize(); - + switch (tool->GetStyle()) { case wxTOOL_STYLE_SEPARATOR: break; - + case wxTOOL_STYLE_BUTTON: break; - + case wxTOOL_STYLE_CONTROL: // right now there's nothing to do here break; - + default: break; } - + [(wxUIToolbar*)m_macToolbar insertTool:tool->GetUIBarButtonItem() atIndex:pos]; InvalidateBestSize(); - + return true; - + } void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) @@ -385,14 +385,14 @@ bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolbase) wxToolBarTool* tool = static_cast< wxToolBarTool*>(toolbase ); [(wxUIToolbar*)m_macToolbar removeTool:pos]; - + return true; } void wxToolBar::SetWindowStyleFlag( long style ) { wxToolBarBase::SetWindowStyleFlag( style ); - + } @implementation wxUIToolbar @@ -409,7 +409,7 @@ void wxToolBar::SetWindowStyleFlag( long style ) - (void)clickedAction:(id)sender { ToolBarToolMap::iterator node = wxToolBarToolList.find(sender); - + if ( node != wxToolBarToolList.end() ) node->second->Action(); } @@ -425,7 +425,7 @@ void wxToolBar::SetWindowStyleFlag( long style ) [mutableBarItems removeObjectAtIndex:pos]; [super setItems:mutableBarItems]; } - + @end #endif // wxUSE_TOOLBAR diff --git a/src/osx/iphone/utils.mm b/src/osx/iphone/utils.mm index 897e42f9bd..3220c9c844 100644 --- a/src/osx/iphone/utils.mm +++ b/src/osx/iphone/utils.mm @@ -61,7 +61,7 @@ wxTheApp->OSXOnDidFinishLaunching(); } -- (void)applicationWillTerminate:(UIApplication *)application { +- (void)applicationWillTerminate:(UIApplication *)application { wxUnusedVar(application); wxTheApp->OSXOnWillTerminate(); } @@ -132,7 +132,7 @@ wxMouseState wxGetMouseState() { wxMouseState ms; return ms; -} +} // Get size of display diff --git a/src/osx/iphone/window.mm b/src/osx/iphone/window.mm index dcf75464cc..510d289bd2 100644 --- a/src/osx/iphone/window.mm +++ b/src/osx/iphone/window.mm @@ -425,7 +425,7 @@ void wxWidgetIPhoneImpl::SetForegroundColour( const wxColour &col ) // TODO: use textColor if available? } -bool wxWidgetIPhoneImpl::SetBackgroundStyle(wxBackgroundStyle style) +bool wxWidgetIPhoneImpl::SetBackgroundStyle(wxBackgroundStyle style) { if ( style == wxBG_STYLE_PAINT ) [m_osxView setOpaque: YES ]; @@ -515,7 +515,7 @@ bool wxWidgetIPhoneImpl::IsEnabled() const if ( [targetView respondsToSelector:@selector(isEnabled) ] ) return [targetView isEnabled]; - + return true; } @@ -558,11 +558,11 @@ void wxWidgetIPhoneImpl::SetControlSize( wxWindowVariant variant ) { } -double wxWidgetIPhoneImpl::GetContentScaleFactor() const +double wxWidgetIPhoneImpl::GetContentScaleFactor() const { if ( [m_osxView respondsToSelector:@selector(contentScaleFactor) ]) return [m_osxView contentScaleFactor]; - else + else return 1.0; } @@ -574,7 +574,7 @@ void wxWidgetIPhoneImpl::InstallEventHandler( WXWidget control ) { WXWidget c = control ? control : (WXWidget) m_osxView; wxWidgetImpl::Associate( c, this ) ; - + if ([c isKindOfClass:[UIControl class] ]) { UIControl* cc = (UIControl*) c; @@ -705,7 +705,7 @@ void wxWidgetIPhoneImpl::drawRect(CGRect* rect, WXWidget slf, void *WXUNUSED(_cm wxpeer->MacPaintChildrenBorders(); CGContextRestoreGState( context ); } - + wxpeer->MacSetCGContextRef( nullptr ); } @@ -714,7 +714,7 @@ void wxWidgetIPhoneImpl::touchEvent(NSSet* touches, UIEvent *event, WXWidget slf bool inRecursion = false; if ( inRecursion ) return; - + UITouch *touch = [touches anyObject]; CGPoint clickLocation; if ( [touch view] != slf && IsRootControl() ) @@ -723,18 +723,18 @@ void wxWidgetIPhoneImpl::touchEvent(NSSet* touches, UIEvent *event, WXWidget slf inRecursion = true; inRecursion = false; } - else + else { clickLocation = [touch locationInView:slf]; wxPoint pt = wxFromNSPoint( m_osxView, clickLocation ); - + wxMouseEvent wxevent(wxEVT_LEFT_DOWN); SetupMouseEvent( wxevent , touches, event ) ; wxevent.m_x = pt.x; wxevent.m_y = pt.y; wxevent.SetEventObject( GetWXPeer() ) ; //?wxevent.SetId( GetWXPeer()->GetId() ) ; - + GetWXPeer()->HandleWindowEvent(wxevent); } } @@ -748,7 +748,7 @@ void wxWidgetIPhoneImpl::controlAction(void* sender, wxUint32 controlEvent, WX_U void wxWidgetIPhoneImpl::controlTextDidChange() { wxTextCtrl* wxpeer = wxDynamicCast((wxWindow*)GetWXPeer(),wxTextCtrl); - if ( wxpeer ) + if ( wxpeer ) { wxCommandEvent event(wxEVT_TEXT, wxpeer->GetId()); event.SetEventObject( wxpeer ); diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index ba09926093..f494572f64 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -131,10 +131,10 @@ void wxListBox::FreeData() void wxListBox::DoSetFirstItem(int n) { - // osx actually only has an implementation for ensuring the visibility of a row, it does so + // osx actually only has an implementation for ensuring the visibility of a row, it does so // by scrolling the minimal amount necessary from the current scrolling position. - // in order to get the same behaviour I'd have to make sure first that the last line is visible, - // followed by a scrollRowToVisible for the desired line + // in order to get the same behaviour I'd have to make sure first that the last line is visible, + // followed by a scrollRowToVisible for the desired line GetListPeer()->ListScrollTo( GetCount()-1 ); GetListPeer()->ListScrollTo( n ); } diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index 4e7ae6fbe1..11e0dedf9f 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -380,7 +380,7 @@ bool wxMenu::HandleCommandProcess( wxMenuItem* item ) if(!processed) { - processed = item->GetPeer()->DoDefault(); + processed = item->GetPeer()->DoDefault(); } return processed; @@ -527,7 +527,7 @@ static wxMenu *CreateAppleMenu() appleMenu->Append( wxID_OSX_SHOWALL, wxGETTEXT_IN_CONTEXT("macOS menu item", "Show All") ); appleMenu->AppendSeparator(); - + // Do always add "Quit" item unconditionally however, it can't be disabled. wxString quitLabel; if ( wxTheApp ) @@ -547,7 +547,7 @@ void wxMenuBar::Init() gs_emptyMenuBar.reset( new wxMenu() ); gs_emptyMenuBar->AppendSubMenu(CreateAppleMenu(), "\x14") ; } - + m_eventHandler = this; m_menuBarFrame = nullptr; m_rootMenu = new wxMenu(); @@ -615,9 +615,9 @@ void wxMenuBar::MacInstallMenuBar() return ; m_rootMenu->GetPeer()->MakeRoot(); - + // hide items in the apple menu that don't exist in the wx menubar - + wxMenuItem* appleItem = nullptr; wxMenuItem* wxItem = nullptr; @@ -628,10 +628,10 @@ void wxMenuBar::MacInstallMenuBar() { if ( wxItem == nullptr ) appleItem->GetPeer()->Hide(); - else + else appleItem->SetItemLabel(wxItem->GetItemLabel()); } - + menuid = wxApp::s_macPreferencesMenuItemId; appleItem = m_appleMenu->FindItem(menuid); wxItem = FindItem(menuid); @@ -639,7 +639,7 @@ void wxMenuBar::MacInstallMenuBar() { if ( wxItem == nullptr ) appleItem->GetPeer()->Hide(); - else + else appleItem->SetItemLabel(wxItem->GetItemLabel()); } @@ -764,7 +764,7 @@ bool wxMenuBar::Append(wxMenu *menu, const wxString& title) void wxMenuBar::DoGetPosition(int *x, int *y) const { int _x,_y,_width,_height; - + m_rootMenu->GetPeer()->GetMenuBarDimensions(_x, _y, _width, _height); if (x) @@ -776,7 +776,7 @@ void wxMenuBar::DoGetPosition(int *x, int *y) const void wxMenuBar::DoGetSize(int *width, int *height) const { int _x,_y,_width,_height; - + m_rootMenu->GetPeer()->GetMenuBarDimensions(_x, _y, _width, _height); if (width) diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index c6aaeee575..af95506bdc 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -260,7 +260,7 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c ) { if ( !wxWindow::SetBackgroundColour(c) && m_hasBgCol ) return false ; - + // only set the native background color if the toplevel window's // background is not supposed to be transparent, otherwise the // transparency is lost @@ -473,7 +473,7 @@ void wxNonOwnedWindow::DoGetClientSize( int *width, int *height ) const #else m_nowpeer->GetContentArea(left, top, w, h); #endif - + if (width) *width = w ; if (height) diff --git a/src/osx/notebook_osx.cpp b/src/osx/notebook_osx.cpp index 0f5dbb851f..2b29dc18d4 100644 --- a/src/osx/notebook_osx.cpp +++ b/src/osx/notebook_osx.cpp @@ -40,9 +40,9 @@ bool wxNotebook::Create( wxWindow *parent, const wxSize& size, long style, const wxString& name ) -{ +{ DontCreatePeer(); - + if (! (style & wxBK_ALIGN_MASK)) style |= wxBK_TOP; diff --git a/src/osx/radiobox_osx.cpp b/src/osx/radiobox_osx.cpp index f2ee77409f..51d69fef5e 100644 --- a/src/osx/radiobox_osx.cpp +++ b/src/osx/radiobox_osx.cpp @@ -99,9 +99,9 @@ bool wxRadioBox::Create( wxWindow *parent, int n, const wxString choices[], int majorDim, long style, const wxValidator& val, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxControl::Create( parent, id, pos, size, style, val, name ) ) return false; diff --git a/src/osx/radiobut_osx.cpp b/src/osx/radiobut_osx.cpp index 528b5f3b66..0716aad9ed 100644 --- a/src/osx/radiobut_osx.cpp +++ b/src/osx/radiobut_osx.cpp @@ -23,9 +23,9 @@ bool wxRadioButton::Create( wxWindow *parent, long style, const wxValidator& validator, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; diff --git a/src/osx/scrolbar_osx.cpp b/src/osx/scrolbar_osx.cpp index 5a7e4daf90..fa2536f733 100644 --- a/src/osx/scrolbar_osx.cpp +++ b/src/osx/scrolbar_osx.cpp @@ -32,9 +32,9 @@ bool wxScrollBar::Create( wxWindow *parent, long style, const wxValidator& validator, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxControl::Create( parent, id, pos, size, style, validator, name ) ) return false; diff --git a/src/osx/slider_osx.cpp b/src/osx/slider_osx.cpp index 1ce95f34e9..9efdf26ac7 100644 --- a/src/osx/slider_osx.cpp +++ b/src/osx/slider_osx.cpp @@ -103,9 +103,9 @@ bool wxSlider::Create(wxWindow *parent, const wxSize& size, long style, const wxValidator& validator, const wxString& name) -{ +{ DontCreatePeer(); - + m_macMinimumStatic = nullptr; m_macMaximumStatic = nullptr; m_macValueStatic = nullptr; diff --git a/src/osx/spinbutt_osx.cpp b/src/osx/spinbutt_osx.cpp index 18f0c62d8f..d95092f699 100644 --- a/src/osx/spinbutt_osx.cpp +++ b/src/osx/spinbutt_osx.cpp @@ -23,7 +23,7 @@ wxSpinButton::wxSpinButton() bool wxSpinButton::Create( wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) -{ +{ DontCreatePeer(); if ( !wxSpinButtonBase::Create( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; @@ -136,7 +136,7 @@ void wxSpinButton::TriggerScrollEvent(wxEventType scrollEvent) SetValue( newValue ); - // send a thumbtrack event if EVT_SPIN_UP/DOWN wasn't vetoed + // send a thumbtrack event if EVT_SPIN_UP/DOWN wasn't vetoed if ( newValue != oldValue ) SendThumbTrackEvent() ; } diff --git a/src/osx/statbox_osx.cpp b/src/osx/statbox_osx.cpp index c7d3b0e267..ca2468af7e 100644 --- a/src/osx/statbox_osx.cpp +++ b/src/osx/statbox_osx.cpp @@ -21,9 +21,9 @@ bool wxStaticBox::Create( wxWindow *parent, const wxSize& size, long style, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; @@ -38,7 +38,7 @@ bool wxStaticBox::Create( wxWindow *parent, void wxStaticBox::GetBordersForSizer(int *borderTop, int *borderOther) const { - static int extraTop = 11; + static int extraTop = 11; static int other = 11; *borderTop = extraTop; diff --git a/src/osx/statline_osx.cpp b/src/osx/statline_osx.cpp index 2c83b4f257..bfc785514b 100644 --- a/src/osx/statline_osx.cpp +++ b/src/osx/statline_osx.cpp @@ -43,9 +43,9 @@ bool wxStaticLine::Create( wxWindow *parent, const wxSize &size, long style, const wxString &name) -{ +{ DontCreatePeer(); - + if ( !wxStaticLineBase::Create(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; diff --git a/src/osx/stattext_osx.cpp b/src/osx/stattext_osx.cpp index e36fc73eb8..8ebf993d57 100644 --- a/src/osx/stattext_osx.cpp +++ b/src/osx/stattext_osx.cpp @@ -33,9 +33,9 @@ bool wxStaticText::Create( wxWindow *parent, const wxSize& size, long style, const wxString& name ) -{ +{ DontCreatePeer(); - + if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) ) return false; diff --git a/src/osx/textentry_osx.cpp b/src/osx/textentry_osx.cpp index cfd2ab7076..912139a709 100644 --- a/src/osx/textentry_osx.cpp +++ b/src/osx/textentry_osx.cpp @@ -236,15 +236,15 @@ bool wxTextEntry::SendMaxLenEvent() { wxWindow *win = GetEditableWindow(); wxCHECK_MSG( win, false, "can't send an event without a window" ); - + wxCommandEvent event(wxEVT_TEXT_MAXLEN, win->GetId()); - + // do not do this as it could be very inefficient if the text control // contains a lot of text and we're not using ref-counted wxString // implementation -- instead, event.GetString() will query the control for // its current text if needed //event.SetString(win->GetValue()); - + event.SetEventObject(win); return win->HandleWindowEvent(event); } diff --git a/src/osx/tglbtn_osx.cpp b/src/osx/tglbtn_osx.cpp index 8c8525d260..3d19aaced2 100644 --- a/src/osx/tglbtn_osx.cpp +++ b/src/osx/tglbtn_osx.cpp @@ -46,7 +46,7 @@ bool wxToggleButton::Create(wxWindow *parent, wxWindowID id, const wxString& name) { DontCreatePeer(); - + m_marginX = m_marginY = 0; @@ -113,7 +113,7 @@ bool wxBitmapToggleButton::Create(wxWindow *parent, wxWindowID id, const wxString& name) { DontCreatePeer(); - + if ( !wxToggleButton::Create(parent, id, wxEmptyString, pos, size, style | wxBU_NOTEXT | wxBU_EXACTFIT, validator, name) ) return false; diff --git a/src/osx/toplevel_osx.cpp b/src/osx/toplevel_osx.cpp index 2e18918e68..d05c0d58e9 100644 --- a/src/osx/toplevel_osx.cpp +++ b/src/osx/toplevel_osx.cpp @@ -99,7 +99,7 @@ bool wxTopLevelWindowMac::Destroy() // loop iteration if ( !wxPendingDelete.Member(this) ) wxPendingDelete.Append(this); - + Hide(); return true; } diff --git a/src/osx/uiaction_osx.cpp b/src/osx/uiaction_osx.cpp index 17e74fcbdc..6bc8be0fec 100644 --- a/src/osx/uiaction_osx.cpp +++ b/src/osx/uiaction_osx.cpp @@ -29,7 +29,7 @@ namespace { - + CGEventTapLocation tap = kCGSessionEventTap; CGEventType CGEventTypeForMouseButton(int button, bool isDown) @@ -52,23 +52,23 @@ CGEventType CGEventTypeForMouseButton(int button, bool isDown) return isDown ? kCGEventOtherMouseDown : kCGEventOtherMouseUp; } } - + CGEventType CGEventTypeForMouseDrag(int button) { switch ( button ) { case wxMOUSE_BTN_LEFT: return kCGEventLeftMouseDragged; - + case wxMOUSE_BTN_RIGHT: return kCGEventRightMouseDragged; - + // All the other buttons use the constant OtherMouseDown but we still // want to check for invalid parameters so assert first default: wxFAIL_MSG("Unsupported button passed in."); wxFALLTHROUGH;// fall back to the only known remaining case - + case wxMOUSE_BTN_MIDDLE: return kCGEventOtherMouseDragged; } @@ -81,21 +81,21 @@ CGMouseButton CGButtonForMouseButton(int button) { case wxMOUSE_BTN_LEFT: return kCGMouseButtonLeft; - + case wxMOUSE_BTN_RIGHT: return kCGMouseButtonRight; - + // All the other buttons use the constant OtherMouseDown but we still // want to check for invalid parameters so assert first default: wxFAIL_MSG("Unsupported button passed in."); wxFALLTHROUGH;// fall back to the only known remaining case - + case wxMOUSE_BTN_MIDDLE: return kCGMouseButtonCenter; } } - + CGPoint GetMousePosition() { int x, y; @@ -163,7 +163,7 @@ bool wxUIActionSimulatorOSXImpl::MouseDown(int button) loop->SetShouldWaitForEvent(true); wait_for_events(); - + return true; } @@ -188,7 +188,7 @@ bool wxUIActionSimulatorOSXImpl::MouseMove(long x, long y) loop->SetShouldWaitForEvent(true); wait_for_events(); - + return true; } @@ -208,7 +208,7 @@ bool wxUIActionSimulatorOSXImpl::MouseUp(int button) loop->SetShouldWaitForEvent(true); wait_for_events(); - + return true; } @@ -218,20 +218,20 @@ bool wxUIActionSimulatorOSXImpl::MouseDblClick(int button) CGEventType uptype = CGEventTypeForMouseButton(button, false); wxCFRef event( CGEventCreateMouseEvent(nullptr, downtype, GetMousePosition(), CGButtonForMouseButton(button))); - + if ( !event ) return false; - + CGEventSetType(event,downtype); CGEventPost(tap, event); - + CGEventSetType(event, uptype); CGEventPost(tap, event); - + CGEventSetIntegerValueField(event, kCGMouseEventClickState, 2); CGEventSetType(event, downtype); CGEventPost(tap, event); - + CGEventSetType(event, uptype); CGEventPost(tap, event); wxCFEventLoop* loop = dynamic_cast(wxEventLoop::GetActive()); @@ -239,7 +239,7 @@ bool wxUIActionSimulatorOSXImpl::MouseDblClick(int button) loop->SetShouldWaitForEvent(true); wait_for_events(); - + return true; } @@ -258,27 +258,27 @@ bool wxUIActionSimulatorOSXImpl::MouseDragDrop(long x1, long y1, long x2, long y wxCFRef event( CGEventCreateMouseEvent(nullptr, kCGEventMouseMoved, pos1, CGButtonForMouseButton(button))); - + if ( !event ) return false; - + CGEventSetType(event,kCGEventMouseMoved); CGEventPost(tap, event); - + CGEventSetType(event,downtype); CGEventPost(tap, event); - - + + CGEventSetType(event, dragtype); CGEventSetLocation(event,pos2); CGEventPost(tap, event); - + CGEventSetType(event, uptype); CGEventPost(tap, event); wxCFEventLoop* loop = dynamic_cast(wxEventLoop::GetActive()); if (loop) loop->SetShouldWaitForEvent(true); - + wait_for_events(); diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index f198988975..954e22c62d 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -235,7 +235,7 @@ wxWindowMac::~wxWindowMac() wxLogLastError(wxT("UnregisterHotKey")); } } - } + } #endif MacInvalidateBorders() ; @@ -275,8 +275,8 @@ WXWidget wxWindowMac::GetHandle() const return nullptr; } -wxOSXWidgetImpl* wxWindowMac::GetPeer() const -{ +wxOSXWidgetImpl* wxWindowMac::GetPeer() const +{ return m_peer == kOSXNoWidgetImpl ? nullptr : m_peer ; } @@ -291,7 +291,7 @@ void wxWindowMac::DontCreatePeer() } void wxWindowMac::SetWrappingPeer(wxOSXWidgetImpl* wrapper) -{ +{ wxOSXWidgetImpl* inner = GetPeer(); wxASSERT_MSG( inner != nullptr && inner->IsOk(), "missing or incomplete inner peer" ); wxASSERT_MSG( wrapper != nullptr && wrapper->IsOk(), "missing or incomplete wrapper" ); @@ -345,8 +345,8 @@ void wxWindowMac::SetPeer(wxOSXWidgetImpl* peer) } } -bool wxWindowMac::MacIsUserPane() const -{ +bool wxWindowMac::MacIsUserPane() const +{ return GetPeer() == nullptr || GetPeer()->IsUserPane(); } @@ -1183,7 +1183,7 @@ void wxWindowMac::DoSetClientSize(int clientwidth, int clientheight) } } -double wxWindowMac::GetContentScaleFactor() const +double wxWindowMac::GetContentScaleFactor() const { return GetPeer()->GetContentScaleFactor(); } @@ -2421,7 +2421,7 @@ wxHotKeyHandler(EventHandlerCallRef WXUNUSED(nextHandler), wxKeyEvent wxevent(wxEVT_HOTKEY); wxevent.SetId(hotKeyId.id); - wxTheApp->MacCreateKeyEvent( wxevent, s_hotkeys[i].window , keymessage , + wxTheApp->MacCreateKeyEvent( wxevent, s_hotkeys[i].window , keymessage , modifiers , when , 0 ) ; s_hotkeys[i].window->HandleWindowEvent(wxevent); @@ -2504,7 +2504,7 @@ bool wxWindowMac::UnregisterHotKey(int hotkeyId) return false; } - else + else return true; } } @@ -2649,7 +2649,7 @@ wxIMPLEMENT_ABSTRACT_CLASS(wxWidgetImpl, wxObject); wxWidgetImpl::wxWidgetImpl( wxWindowMac* peer , int flags ) { - Init(); + Init(); m_isRootControl = flags & Widget_IsRoot; m_isUserPane = flags & Widget_IsUserPane; m_wantsUserKey = m_isUserPane || (flags & Widget_UserKeyEvents); diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 639b71991c..9914abcc03 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -97,7 +97,7 @@ static const char gs_svg_noncatmode[] = "" "" "" -"" +"" ""; // Default Page Icon. diff --git a/src/qt/graphics.cpp b/src/qt/graphics.cpp index 9f2e5d6646..d23cff4c1a 100644 --- a/src/qt/graphics.cpp +++ b/src/qt/graphics.cpp @@ -1453,7 +1453,7 @@ wxGraphicsBrush wxQtGraphicsRenderer::CreateBrush(const wxBrush& brush) wxGraphicsBrush wxQtGraphicsRenderer::CreateLinearGradientBrush( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, - const wxGraphicsGradientStops& stops, + const wxGraphicsGradientStops& stops, const wxGraphicsMatrix& WXUNUSED(matrix)) { wxGraphicsBrush p; @@ -1466,7 +1466,7 @@ wxGraphicsBrush wxQtGraphicsRenderer::CreateLinearGradientBrush( wxGraphicsBrush wxQtGraphicsRenderer::CreateRadialGradientBrush( wxDouble startX, wxDouble startY, wxDouble endX, wxDouble endY, wxDouble r, - const wxGraphicsGradientStops& stops, + const wxGraphicsGradientStops& stops, const wxGraphicsMatrix& WXUNUSED(matrix)) { wxGraphicsBrush p; diff --git a/src/ribbon/art_msw.cpp b/src/ribbon/art_msw.cpp index 26a0b30c08..8ebcaaba7b 100644 --- a/src/ribbon/art_msw.cpp +++ b/src/ribbon/art_msw.cpp @@ -963,25 +963,25 @@ wxColour wxRibbonMSWArtProvider::GetColour(int id) const case wxRIBBON_ART_TOOL_BACKGROUND_TOP_COLOUR: return m_tool_background_top_colour; case wxRIBBON_ART_TOOL_BACKGROUND_TOP_GRADIENT_COLOUR: - return m_tool_background_top_gradient_colour; + return m_tool_background_top_gradient_colour; case wxRIBBON_ART_TOOL_BACKGROUND_COLOUR: - return m_tool_background_colour; + return m_tool_background_colour; case wxRIBBON_ART_TOOL_BACKGROUND_GRADIENT_COLOUR: - return m_tool_background_gradient_colour; + return m_tool_background_gradient_colour; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_COLOUR: - return m_tool_hover_background_top_colour; + return m_tool_hover_background_top_colour; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR: - return m_tool_hover_background_top_gradient_colour; + return m_tool_hover_background_top_gradient_colour; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_COLOUR: - return m_tool_hover_background_colour; + return m_tool_hover_background_colour; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_GRADIENT_COLOUR: - return m_tool_hover_background_gradient_colour; + return m_tool_hover_background_gradient_colour; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_COLOUR: - return m_tool_active_background_top_colour; + return m_tool_active_background_top_colour; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR: - return m_tool_active_background_top_gradient_colour; + return m_tool_active_background_top_gradient_colour; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR: - return m_tool_active_background_colour; + return m_tool_active_background_colour; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR: return m_tool_active_background_gradient_colour; default: @@ -1300,37 +1300,37 @@ void wxRibbonMSWArtProvider::SetColour(int id, const wxColor& colour) break; case wxRIBBON_ART_TOOL_BACKGROUND_TOP_GRADIENT_COLOUR: m_tool_background_top_gradient_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_BACKGROUND_COLOUR: m_tool_background_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_BACKGROUND_GRADIENT_COLOUR: m_tool_background_gradient_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_COLOUR: m_tool_hover_background_top_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_TOP_GRADIENT_COLOUR: m_tool_hover_background_top_gradient_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_COLOUR: m_tool_hover_background_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_HOVER_BACKGROUND_GRADIENT_COLOUR: m_tool_hover_background_gradient_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_COLOUR: m_tool_active_background_top_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_TOP_GRADIENT_COLOUR: m_tool_active_background_top_gradient_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_COLOUR: m_tool_active_background_colour = colour; - break; + break; case wxRIBBON_ART_TOOL_ACTIVE_BACKGROUND_GRADIENT_COLOUR: m_tool_active_background_gradient_colour = colour; - break; + break; default: wxFAIL_MSG("Invalid Metric Ordinal"); break; diff --git a/src/ribbon/buttonbar.cpp b/src/ribbon/buttonbar.cpp index 5407e9bd77..aca2e8f4a4 100644 --- a/src/ribbon/buttonbar.cpp +++ b/src/ribbon/buttonbar.cpp @@ -1105,7 +1105,7 @@ void wxRibbonButtonBar::MakeLayouts() wxRIBBON_BUTTONBAR_BUTTON_MEDIUM); } - // TODO: small buttons are not implemented yet in + // TODO: small buttons are not implemented yet in // art_msw.cpp:2581 and will be invisible /*iLast = btn_count; while(iLast-- > 0) diff --git a/src/richtext/richtextbackgroundpage.cpp b/src/richtext/richtextbackgroundpage.cpp index ce7151883d..fa38dbc18b 100644 --- a/src/richtext/richtextbackgroundpage.cpp +++ b/src/richtext/richtextbackgroundpage.cpp @@ -131,7 +131,7 @@ void wxRichTextBackgroundPage::Init() */ void wxRichTextBackgroundPage::CreateControls() -{ +{ ////@begin wxRichTextBackgroundPage content construction wxRichTextBackgroundPage* itemRichTextDialogPage1 = this; @@ -368,7 +368,7 @@ bool wxRichTextBackgroundPage::TransferDataToWindow() } m_useShadow->SetValue(attr->GetTextBoxAttr().GetShadow().IsValid()); - + wxArrayInt units; units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); @@ -418,7 +418,7 @@ bool wxRichTextBackgroundPage::TransferDataFromWindow() { attr->SetFlags(attr->GetFlags() & ~wxTEXT_ATTR_BACKGROUND_COLOUR); } - + if (!m_useShadow->GetValue()) attr->GetTextBoxAttr().GetShadow().Reset(); else diff --git a/src/richtext/richtextborderspage.cpp b/src/richtext/richtextborderspage.cpp index 2c5a7b7cf3..7bf06cfbb1 100644 --- a/src/richtext/richtextborderspage.cpp +++ b/src/richtext/richtextborderspage.cpp @@ -206,7 +206,7 @@ void wxRichTextBordersPage::Init() */ void wxRichTextBordersPage::CreateControls() -{ +{ ////@begin wxRichTextBordersPage content construction wxRichTextBordersPage* itemRichTextDialogPage1 = this; @@ -622,12 +622,12 @@ void wxRichTextBordersPage::CreateControls() FillStyleComboBox(m_rightBorderStyle); FillStyleComboBox(m_topBorderStyle); FillStyleComboBox(m_bottomBorderStyle); - + FillStyleComboBox(m_leftOutlineStyle); FillStyleComboBox(m_rightOutlineStyle); FillStyleComboBox(m_topOutlineStyle); FillStyleComboBox(m_bottomOutlineStyle); - + m_borderPreviewCtrl->SetAttributes(GetAttributes()); m_ignoreUpdates = false; @@ -690,14 +690,14 @@ void wxRichTextBordersPage::FillStyleComboBox(wxComboBox* styleComboBox) { styleComboBox->Freeze(); styleComboBox->Append(m_borderStyleNames); - styleComboBox->Thaw(); + styleComboBox->Thaw(); } // Updates the synchronization checkboxes to reflect the state of the attributes void wxRichTextBordersPage::UpdateSyncControls() { bool ignoreUpdates = m_ignoreUpdates; - + m_ignoreUpdates = true; if (GetAttributes()->GetTextBoxAttr().GetBorder().GetLeft() == GetAttributes()->GetTextBoxAttr().GetBorder().GetRight() && @@ -710,7 +710,7 @@ void wxRichTextBordersPage::UpdateSyncControls() { m_borderSyncCtrl->SetValue(false); } - + if (GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft() == GetAttributes()->GetTextBoxAttr().GetOutline().GetRight() && GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft() == GetAttributes()->GetTextBoxAttr().GetOutline().GetTop() && GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft() == GetAttributes()->GetTextBoxAttr().GetOutline().GetBottom()) @@ -721,7 +721,7 @@ void wxRichTextBordersPage::UpdateSyncControls() { m_outlineSyncCtrl->SetValue(false); } - + m_ignoreUpdates = ignoreUpdates; } @@ -754,7 +754,7 @@ bool wxRichTextBordersPage::TransferDataToWindow() units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); - + wxRichTextFormattingDialog::SetDimensionValue(GetAttributes()->GetTextBoxAttr().GetCornerRadius(), m_cornerRadiusText, m_cornerRadiusUnits, nullptr, & units); @@ -791,7 +791,7 @@ bool wxRichTextBordersPage::TransferDataFromWindow() units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); - + wxRichTextFormattingDialog::GetDimensionValue(GetAttributes()->GetTextBoxAttr().GetCornerRadius(), m_cornerRadiusText, m_cornerRadiusUnits, nullptr, & units); @@ -833,16 +833,16 @@ void wxRichTextBordersPage::SetBorderValue(wxTextAttrBorder& border, wxTextCtrl* units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); - + wxRichTextFormattingDialog::SetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, nullptr, & units); int sel = borderStyles.Index(border.GetStyle()); if (sel == -1) sel = 1; - styleCtrl->SetSelection(sel); + styleCtrl->SetSelection(sel); colourCtrl->SetColour(border.GetColour()); - + if (sel == 0) checkBox->Set3StateValue(wxCHK_UNCHECKED); else @@ -858,7 +858,7 @@ void wxRichTextBordersPage::GetBorderValue(wxTextAttrBorder& border, wxTextCtrl* units.Add(wxTEXT_ATTR_UNITS_PIXELS); units.Add(wxTEXT_ATTR_UNITS_TENTHS_MM); units.Add(wxTEXT_ATTR_UNITS_HUNDREDTHS_POINT); - + wxRichTextFormattingDialog::GetDimensionValue(border.GetWidth(), widthValueCtrl, widthUnitsCtrl, nullptr, & units); @@ -1042,14 +1042,14 @@ void wxRichTextBordersPage::OnRichtextBorderCheckboxClick( wxCommandEvent& event checkBox = m_bottomBorderCheckbox; comboBox = m_bottomBorderStyle; } - + if (checkBox && comboBox) { if (checkBox->Get3StateValue() == wxCHK_UNCHECKED || checkBox->Get3StateValue() == wxCHK_UNDETERMINED) comboBox->SetSelection(0); else comboBox->SetSelection(1); - + if (event.GetId() == ID_RICHTEXT_BORDER_LEFT_CHECKBOX && m_borderSyncCtrl->GetValue()) { m_topBorderCheckbox->Set3StateValue(checkBox->Get3StateValue()); @@ -1061,7 +1061,7 @@ void wxRichTextBordersPage::OnRichtextBorderCheckboxClick( wxCommandEvent& event m_bottomBorderCheckbox->Set3StateValue(checkBox->Get3StateValue()); m_bottomBorderStyle->SetSelection(comboBox->GetSelection()); } - + if (event.GetId() == ID_RICHTEXT_OUTLINE_LEFT_CHECKBOX && m_outlineSyncCtrl->GetValue()) { m_topOutlineCheckbox->Set3StateValue(checkBox->Get3StateValue()); @@ -1073,7 +1073,7 @@ void wxRichTextBordersPage::OnRichtextBorderCheckboxClick( wxCommandEvent& event m_bottomOutlineCheckbox->Set3StateValue(checkBox->Get3StateValue()); m_bottomOutlineStyle->SetSelection(comboBox->GetSelection()); } - + TransferDataFromWindow(); m_borderPreviewCtrl->Refresh(); } @@ -1089,13 +1089,13 @@ void wxRichTextBordersPage::OnRichtextBorderSynchronizeClick( wxCommandEvent& ev { if (m_ignoreUpdates) return; - + if (event.IsChecked()) { TransferDataFromWindow(); GetAttributes()->GetTextBoxAttr().GetBorder().GetTop() = GetAttributes()->GetTextBoxAttr().GetBorder().GetLeft(); GetAttributes()->GetTextBoxAttr().GetBorder().GetRight() = GetAttributes()->GetTextBoxAttr().GetBorder().GetLeft(); - GetAttributes()->GetTextBoxAttr().GetBorder().GetBottom() = GetAttributes()->GetTextBoxAttr().GetBorder().GetLeft(); + GetAttributes()->GetTextBoxAttr().GetBorder().GetBottom() = GetAttributes()->GetTextBoxAttr().GetBorder().GetLeft(); m_ignoreUpdates = true; TransferDataToWindow(); m_ignoreUpdates = false; @@ -1133,7 +1133,7 @@ void wxRichTextBordersPage::OnRichtextBorderLeftValueTextUpdated( wxCommandEvent { if (m_ignoreUpdates) return; - + if (m_borderSyncCtrl->GetValue()) { wxString value = event.GetString(); @@ -1159,7 +1159,7 @@ void wxRichTextBordersPage::OnRichtextBorderLeftUnitsSelected( wxCommandEvent& W { if (m_ignoreUpdates) return; - + if (m_borderSyncCtrl->GetValue()) { m_ignoreUpdates = true; @@ -1184,7 +1184,7 @@ void wxRichTextBordersPage::OnRichtextBorderLeftStyleSelected( wxCommandEvent& W { if (m_ignoreUpdates) return; - + if (m_borderSyncCtrl->GetValue()) { m_ignoreUpdates = true; @@ -1209,13 +1209,13 @@ void wxRichTextBordersPage::OnRichtextOutlineSynchronizeClick( wxCommandEvent& e { if (m_ignoreUpdates) return; - + if (event.IsChecked()) { TransferDataFromWindow(); GetAttributes()->GetTextBoxAttr().GetOutline().GetTop() = GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft(); GetAttributes()->GetTextBoxAttr().GetOutline().GetRight() = GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft(); - GetAttributes()->GetTextBoxAttr().GetOutline().GetBottom() = GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft(); + GetAttributes()->GetTextBoxAttr().GetOutline().GetBottom() = GetAttributes()->GetTextBoxAttr().GetOutline().GetLeft(); m_ignoreUpdates = true; TransferDataToWindow(); m_ignoreUpdates = false; @@ -1253,7 +1253,7 @@ void wxRichTextBordersPage::OnRichtextOutlineLeftTextUpdated( wxCommandEvent& ev { if (m_ignoreUpdates) return; - + if (m_outlineSyncCtrl->GetValue()) { wxString value = event.GetString(); @@ -1279,7 +1279,7 @@ void wxRichTextBordersPage::OnRichtextOutlineLeftUnitsSelected( wxCommandEvent& { if (m_ignoreUpdates) return; - + if (m_outlineSyncCtrl->GetValue()) { m_ignoreUpdates = true; @@ -1304,7 +1304,7 @@ void wxRichTextBordersPage::OnRichtextOutlineLeftStyleSelected( wxCommandEvent& { if (m_ignoreUpdates) return; - + if (m_outlineSyncCtrl->GetValue()) { m_ignoreUpdates = true; @@ -1346,7 +1346,7 @@ void wxRichTextBorderPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) if (m_attributes) { wxRect rect = GetClientRect(); - + wxRichTextAttr attr; attr.GetTextBoxAttr().GetBorder() = m_attributes->GetTextBoxAttr().GetBorder(); attr.GetTextBoxAttr().GetOutline() = m_attributes->GetTextBoxAttr().GetOutline(); @@ -1354,7 +1354,7 @@ void wxRichTextBorderPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) attr.GetTextBoxAttr().SetCornerRadius(m_attributes->GetTextBoxAttr().GetCornerRadius()); if (m_attributes->HasBackgroundColour()) attr.SetBackgroundColour(m_attributes->GetBackgroundColour()); - + wxTextAttrDimension marginDim(10, wxTEXT_ATTR_UNITS_PIXELS); attr.GetTextBoxAttr().GetMargins().GetLeft() = marginDim; attr.GetTextBoxAttr().GetMargins().GetTop() = marginDim; @@ -1366,7 +1366,7 @@ void wxRichTextBorderPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) rect.y += margin; rect.width -= 2*margin; rect.height -= 2*margin; - + wxRichTextObject::DrawBoxAttributes(dc, nullptr, attr, rect); } } diff --git a/src/richtext/richtextfontpage.cpp b/src/richtext/richtextfontpage.cpp index 060c09a5bf..b12f21cdf0 100644 --- a/src/richtext/richtextfontpage.cpp +++ b/src/richtext/richtextfontpage.cpp @@ -340,7 +340,7 @@ void wxRichTextFontPage::CreateControls() if ((GetAllowedTextEffects() & wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION) == 0) m_rtlParentSizer->Show(m_suppressHyphenationCtrl, false); - if ((GetAllowedTextEffects() & (wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION|wxTEXT_ATTR_EFFECT_RTL)) == 0) + if ((GetAllowedTextEffects() & (wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION|wxTEXT_ATTR_EFFECT_RTL)) == 0) m_innerSizer->Show(m_rtlParentSizer, false); m_faceListBox->UpdateFonts(); @@ -725,7 +725,7 @@ bool wxRichTextFontPage::TransferDataToWindow() m_rtlCtrl->Set3StateValue(wxCHK_UNCHECKED); } else - m_rtlCtrl->Set3StateValue(wxCHK_UNDETERMINED); + m_rtlCtrl->Set3StateValue(wxCHK_UNDETERMINED); } if (GetAllowedTextEffects() & wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION) @@ -738,7 +738,7 @@ bool wxRichTextFontPage::TransferDataToWindow() m_suppressHyphenationCtrl->Set3StateValue(wxCHK_UNCHECKED); } else - m_suppressHyphenationCtrl->Set3StateValue(wxCHK_UNDETERMINED); + m_suppressHyphenationCtrl->Set3StateValue(wxCHK_UNDETERMINED); } } else diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 720a881dfb..0dfe0281ba 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -600,7 +600,7 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT { if (checkBox) checkBox->SetValue(true); - + if (dim.GetUnits() == wxTEXT_ATTR_UNITS_PIXELS) { unitsIdx = 0; // By default, the 1st in the list. @@ -628,7 +628,7 @@ void wxRichTextFormattingDialog::SetDimensionValue(wxTextAttrDimension& dim, wxT unitsIdx = 3; // By default, the 4th in the list (we don't have points and hundredths of points in the same list) valueCtrl->SetValue(wxString::Format(wxT("%d"), (int) dim.GetValue())); } - + if (units) { unitsIdx = units->Index(dim.GetUnits()); diff --git a/src/richtext/richtextmarginspage.cpp b/src/richtext/richtextmarginspage.cpp index f47f669a9f..590709c6db 100644 --- a/src/richtext/richtextmarginspage.cpp +++ b/src/richtext/richtextmarginspage.cpp @@ -154,7 +154,7 @@ void wxRichTextMarginsPage::Init() */ void wxRichTextMarginsPage::CreateControls() -{ +{ ////@begin wxRichTextMarginsPage content construction wxRichTextMarginsPage* itemRichTextDialogPage1 = this; diff --git a/src/richtext/richtextsizepage.cpp b/src/richtext/richtextsizepage.cpp index 600d261027..6be3c9bb5d 100644 --- a/src/richtext/richtextsizepage.cpp +++ b/src/richtext/richtextsizepage.cpp @@ -118,7 +118,7 @@ wxRichTextSizePage::~wxRichTextSizePage() sm_enablePositionAndSizeUnits = true; sm_enablePositionAndSizeCheckboxes = true; sm_showMoveObjectControls = true; - + ////@begin wxRichTextSizePage destruction ////@end wxRichTextSizePage destruction } @@ -721,7 +721,7 @@ void wxRichTextSizePage::CreateControls() if (!sm_showPositionControls) m_parentSizer->Show(m_positionControls, false); - + if (!sm_showMinMaxSizeControls) { m_sizeSizer->Show(m_minWidthCheckbox, false); diff --git a/src/richtext/richtextstylepage.cpp b/src/richtext/richtextstylepage.cpp index 3cf8adfa3f..dcc38c8efb 100644 --- a/src/richtext/richtextstylepage.cpp +++ b/src/richtext/richtextstylepage.cpp @@ -54,7 +54,7 @@ wxRichTextStylePage::wxRichTextStylePage( wxWindow* parent, wxWindowID id, const void wxRichTextStylePage::Init() { m_nameIsEditable = false; - + ////@begin wxRichTextStylePage member initialisation m_styleName = nullptr; m_basedOn = nullptr; diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index bf7c4cf9d8..c1f0c5fb98 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -2231,7 +2231,7 @@ wxString wxRichTextXMLHelper::AddAttributes(wxRichTextObject* obj, bool isPara) if (!obj->IsShown()) style << wxT(" show=\"0\""); return style; -} +} // Write the properties bool wxRichTextXMLHelper::WriteProperties(wxOutputStream& stream, const wxRichTextProperties& properties, int level) diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 29a6793cfa..5b9a4ab486 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -936,7 +936,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) { wxTextCoord colStart, colEnd, lineStart, lineEnd; - // as convention, ( src/gtk/textctrl.cpp:1411, src/msw/textctrl.cpp:759, + // as convention, ( src/gtk/textctrl.cpp:1411, src/msw/textctrl.cpp:759, // test/controls/textentrytest.cpp:171 ) // if `to` equal -1, it means go to the last position if ( to == -1 ) @@ -970,7 +970,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) // set selection range for GetSelection and GetInsertionPoint call // if give a range but the text length that give doesn't equal the range - // it mean clear the text in the range and set the text after `from` + // it mean clear the text in the range and set the text after `from` if ( (to - from) != (wxTextPos)text.Len() ) { m_selStart = from; @@ -1362,7 +1362,7 @@ wxTextPos wxTextCtrl::GetInsertionPoint() const long from; if ( HasSelection() ) GetSelection(&from, nullptr); - else + else from = m_curPos; return from; } diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index 8cb0c5d99a..ba739c2b22 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -998,7 +998,7 @@ void wxGTKRenderer::DrawRadioButtonBitmap(wxDC& dc, DrawBackground(dc, wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT), rect); dc.SetPen(m_penDarkGrey); - dc.SetBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT)); + dc.SetBrush(wxSCHEME_COLOUR(m_scheme, CONTROL_CURRENT)); // draw the normal border dc.DrawCircle(xRight/2,yBottom/2,yMid); diff --git a/src/unix/sound_sdl.cpp b/src/unix/sound_sdl.cpp index 10f26d2160..4ef5b7af16 100644 --- a/src/unix/sound_sdl.cpp +++ b/src/unix/sound_sdl.cpp @@ -211,7 +211,7 @@ bool wxSoundBackendSDL::OpenAudio() char driver[256]; #if SDL_MAJOR_VERSION == 1 SDL_AudioDriverName(driver, 256); -#elif SDL_MAJOR_VERSION > 1 +#elif SDL_MAJOR_VERSION > 1 wxStrlcpy(driver, SDL_GetCurrentAudioDriver(), 256); #endif wxLogTrace(wxT("sound"), wxT("opened audio, driver '%s'"), diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 2bd8a8d064..621edf51ee 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -1609,7 +1609,7 @@ void wxWindowDCImpl::DoDrawRotatedText(const wxString& text, cairo_destroy(cr); #else #warning "Drawing rotated text is not implemented without Cairo" -#endif +#endif } void wxWindowDCImpl::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height, diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index 3c273468ff..803389c4df 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -177,7 +177,7 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre xcol.blue = (unsigned short)blue[i] << 8; pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel; - // store the RGB value(0-255) to palette directly, + // store the RGB value(0-255) to palette directly, // no need to calculate the color again in GetRGB() col_red[i] = red[i]; col_green[i] = green[i]; diff --git a/tests/controls/styledtextctrltest.cpp b/tests/controls/styledtextctrltest.cpp index cd5e2c31ae..c79018960d 100644 --- a/tests/controls/styledtextctrltest.cpp +++ b/tests/controls/styledtextctrltest.cpp @@ -106,7 +106,7 @@ TEST_CASE_METHOD(StcPopupWindowsTestCase, } // This test is used to verify that a call tip receives mouse clicks. However -// the clicks do sent with the UI simulator do not seem to be received on +// the clicks do sent with the UI simulator do not seem to be received on // cocoa for some reason, so skip the test there for now. #if !defined(__WXOSX_COCOA__) TEST_CASE_METHOD(StcPopupWindowsTestCase, diff --git a/tests/graphics/clippingbox.cpp b/tests/graphics/clippingbox.cpp index cf0f409468..502ce790e9 100644 --- a/tests/graphics/clippingbox.cpp +++ b/tests/graphics/clippingbox.cpp @@ -4692,7 +4692,7 @@ static void RegionsAndPushPopState(std::unique_ptr& gc, const return; } #endif - + // Get rectangle of the entire drawing area. double x, y, w, h; gc->GetClipBox(&x, &y, &w, &h);