Mac: changes for wxWidgets 3.1.5 that affect only macintosh-specific code

This commit is contained in:
Charlie Fenton 2021-09-30 23:47:09 -07:00
parent c04357bc19
commit 83afef6cc2
3 changed files with 22 additions and 14 deletions

View File

@ -411,7 +411,7 @@ wxMenu *CTaskBarIcon::CreatePopupMenu() {
// Rather than using an entire separate icon, overlay the Dock icon with a badge
// so we don't need additional Snooze and Disconnected icons for branding.
bool CTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& ) {
wxIcon macIcon;
wxImage macIcon;
bool result;
int err = noErr;
int w, h, x, y;
@ -425,18 +425,19 @@ bool CTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& ) {
return true;
m_iconCurrentIcon = icon;
if (m_iconTaskBarDisconnected.IsSameAs(icon))
macIcon = macdisconnectbadge;
macIcon = wxImage(macdisconnectbadge);
else if (m_iconTaskBarSnooze.IsSameAs(icon))
macIcon = macsnoozebadge;
macIcon = wxImage(macsnoozebadge);
else {
err = SetDockBadge(NULL);
return true;
}
// Convert the wxIcon into a wxBitmap so we can perform some
// Convert the wxImage into a wxBitmap so we can perform some
// wxBitmap operations with it
macIcon.InitAlpha();
wxBitmap bmp( macIcon ) ;
// wxMac's XMP image format always uses 32-bit pixels but allows only

View File

@ -247,25 +247,25 @@ static void wxRectToNSRect(wxRect &wxr, NSRect &nsr) {
}
if (isCurrentSortCol) {
if (BOINCView->m_bReverseSort) {
s.Printf(_("(current sort column %d of %d; descending order)"), col+1, numCols);
s.Printf(_("(current sort column %d of %d; descending order)"), (int)col+1, (int)numCols);
} else {
s.Printf(_("(current sort column %d of %d; ascending order)"), col+1, numCols);
s.Printf(_("(current sort column %d of %d; ascending order)"), (int)col+1, (int)numCols);
}
} else {
s.Printf(_("(column %d of %d)"), col+1, numCols);
s.Printf(_("(column %d of %d)"), (int)col+1, (int)numCols);
}
} else {
if (pList->GetItemState(row, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED) {
if (col == 0) {
s.Printf(_("(selected row %d of %d)"), row+1, pList->GetItemCount());
s.Printf(_("(selected row %d of %d)"), (int)row+1, (int)(pList->GetItemCount()));
} else {
s.Printf(_("(selected row %d)"), row+1);
s.Printf(_("(selected row %d)"), (int)row+1);
}
} else {
if (col == 0) { // Row is not selected
s.Printf(_("(row %d of %d)"), row+1, pList->GetItemCount());
s.Printf(_("(row %d of %d)"), (int)row+1, (int)(pList->GetItemCount()));
} else {
s.Printf(_("(row %d)"), row+1);
s.Printf(_("(row %d)"), (int)row+1);
}
}
}
@ -587,7 +587,7 @@ static void wxRectToNSRect(wxRect &wxr, NSRect &nsr) {
} else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) {
wxString s;
s.Printf(_("(row %d)"), row+1);
s.Printf(_("(row %d)"), (int)row+1);
NSString *desc = [NSString stringWithUTF8String:(char *)(s.utf8_str().data())];
return desc;
@ -618,7 +618,7 @@ static void wxRectToNSRect(wxRect &wxr, NSRect &nsr) {
} else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) {
wxString s;
s.Printf(_("row %d"), row+1);
s.Printf(_("row %d"), (int)row+1);
NSString *title = [NSString stringWithUTF8String:(char *)(s.utf8_str().data())];
return title;

View File

@ -15,6 +15,13 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// On Macintosh we use only native controls in Simple View so the macOS
// automatically provides accessibility support. Though wxBitmapComboBox
// does not use MacOS native controls, wxChoice uses NSPopUpButton, so
// we create our own BitmapComboBox on Macintosh based on wxChoice, which
// we have hacked to allow adding bitmaps.
//
#ifndef __MACBITMAPCOMBOBOX__
#define __MACBITMAPCOMBOBOX__