From 944930d5f525ffa2d10b7cefb1ecacaf1e95275c Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 10 Nov 1999 08:03:29 +0000 Subject: [PATCH] Added calendar contributed by Lorne White Some tweaks for wxFloatbar git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4462 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxPython/README.txt | 12 +- utils/wxPython/demo/Calbmp/Calend.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Calbmp/DbDec.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Calbmp/DbInc.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Calbmp/Dec.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Calbmp/Inc.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Calbmp/Pt.bmp | Bin 0 -> 630 bytes utils/wxPython/demo/Main.py | 2 +- utils/wxPython/demo/wxCalendar.py | 445 ++++++++++++++++++++++++ utils/wxPython/demo/wxFloatBar.py | 45 +-- utils/wxPython/lib/CDate.py | 125 +++++++ utils/wxPython/lib/calendar.py | 479 ++++++++++++++++++++++++++ utils/wxPython/lib/floatbar.py | 26 +- utils/wxPython/src/msw/clip_dnd.cpp | 7 +- 14 files changed, 1101 insertions(+), 40 deletions(-) create mode 100644 utils/wxPython/demo/Calbmp/Calend.bmp create mode 100644 utils/wxPython/demo/Calbmp/DbDec.bmp create mode 100644 utils/wxPython/demo/Calbmp/DbInc.bmp create mode 100644 utils/wxPython/demo/Calbmp/Dec.bmp create mode 100644 utils/wxPython/demo/Calbmp/Inc.bmp create mode 100644 utils/wxPython/demo/Calbmp/Pt.bmp create mode 100644 utils/wxPython/demo/wxCalendar.py create mode 100644 utils/wxPython/lib/CDate.py create mode 100644 utils/wxPython/lib/calendar.py diff --git a/utils/wxPython/README.txt b/utils/wxPython/README.txt index 9e73f20ff3..103e9298ea 100644 --- a/utils/wxPython/README.txt +++ b/utils/wxPython/README.txt @@ -47,6 +47,9 @@ Or you can send mail directly to the list using this address: What's new in 2.1.11 -------------------- +Skipped a few version numbers so wxMSW, wxGTK and wxPython are all +syncronized. + wxImage.SetData now makes a copy of the image data before giving it to wxImage. I mistakenly thought that wxImage would copy the data itself. @@ -83,7 +86,14 @@ Added wxFontEnumerator. Many updates to wxMenu, wxMenuBar. wxPyEvent and wxPyCommandEvent derived classes now give you the actual -Python object in the event handler. +Python object in the event handler instead of a new shadow. + +Added a Calendar widget from Lorne White. + +Made some fixes to the wxFloatbar. + +Added the HTML printing classes. + diff --git a/utils/wxPython/demo/Calbmp/Calend.bmp b/utils/wxPython/demo/Calbmp/Calend.bmp new file mode 100644 index 0000000000000000000000000000000000000000..c192c8816f1adfeae0086fbc00e5f42f9682ab51 GIT binary patch literal 630 zcmYk2J#K_B5QUv+CFs~Kw@aCGL^NCEF0Pga$u22V(74J~=+cbDRoKc6(&RlGuXkX~ ze17v|{Plf*H_7f;Kj9yTznK#v*r78#AI{hqpI+lVBRC!e%d+6h9Zj!MWdz5=Ei4Sx{-M*+4xeQniy@}YrS)WWv66Y>th_6f@+h_#@RaR))m|oI?G2{HHum= z%SRExqFvHE71>2)jpT@Qh-(zL@jQ8&IAlO+n}O3<{)cifrtKmwmy;nQHeFI8qDJ*W#b?{*Slc4Uao;Q_aVG;s66+#e(qnn br-dJuqaGUVR+;(plT&{zS$|v$|EBtXgi2eB literal 0 HcmV?d00001 diff --git a/utils/wxPython/demo/Calbmp/DbDec.bmp b/utils/wxPython/demo/Calbmp/DbDec.bmp new file mode 100644 index 0000000000000000000000000000000000000000..970266caca5d5d9959c6ea8377b8e3aae9e6345a GIT binary patch literal 630 zcmeH@u@S={3`Lb(>dfFWbGY|9t|?V$D2kNY2|oeGIa;^*{4WU!366E!pHi`7KWOQC z$cqS2|Gt}A; b#y@+T>d`z7M~_YOtj6AB$w4wPDpuG>rcr?`LxwZ!L>6JOBUy literal 0 HcmV?d00001 diff --git a/utils/wxPython/demo/Calbmp/Dec.bmp b/utils/wxPython/demo/Calbmp/Dec.bmp new file mode 100644 index 0000000000000000000000000000000000000000..64efbb3da4fb547ad4b3e61261e11d868f03294e GIT binary patch literal 630 zcmeHDF%p0v46B~AZ}6CWhr8cl?sei>4E_t#q6c(!H8iD3X$Ouo&SZ$lJGecZXh8*_ zf320(crz0rh`C8(1Zwp zzt2i7TpEe6DMme@2*F4>XBee!Dn%j?OG=RR 0 or year % 400 == 0) + +def FillDate(val): + s = str(val) + if len(s) < 2: + s = '0' + s + return s + + +def julianDay(year, month, day): + b = 0L + year, month, day = long(year), long(month), long(day) + if month > 12L: + year = year + month/12L + month = month%12 + elif month < 1L: + month = -month + year = year - month/12L - 1L + month = 12L - month%12L + if year > 0L: + yearCorr = 0L + else: + yearCorr = 3L + if month < 3L: + year = year - 1L + month = month + 12L + if year*10000L + month*100L + day > 15821014L: + b = 2L - year/100L + year/400L + return (1461L*year - yearCorr)/4L + 306001L*(month + 1L)/10000L + day + 1720994L + b + + +def TodayDay(): + date = time.localtime(time.time()) + year = date[0] + month = date[1] + day = date[2] + julian = julianDay(year, month, day) + daywk = dayOfWeek(julian) + daywk = day_name[daywk] + return(daywk) + +def FormatDay(value): + date = FromFormat(value) + daywk = DateCalc.dayOfWeek(date) + daywk = day_name[daywk] + return(daywk) + +def FromJulian(julian): + julian = long(julian) + if (julian < 2299160L): + b = julian + 1525L + else: + alpha = (4L*julian - 7468861L)/146097L + b = julian + 1526L + alpha - alpha/4L + c = (20L*b - 2442L)/7305L + d = 1461L*c/4L + e = 10000L*(b - d)/306001L + day = int(b - d - 306001L*e/10000L) + if e < 14L: + month = int(e - 1L) + else: + month = int(e - 13L) + if month > 2: + year = c - 4716L + else: + year = c - 4715L + year = int(year) + return year, month, day + +def dayOfWeek(julian): + return int((julian + 1L)%7L) + +def daysPerMonth(month, year): + ndays = mdays[month] + (month == 2 and isleap(year)) + return ndays + +class now: + def __init__(self): + self.date = time.localtime(time.time()) + self.year = self.date[0] + self.month = self.date[1] + self.day = self.date[2] + +class Date: + def __init__(self, year, month, day): + self.julian = julianDay(year, month, day) + self.month = month + self.year = year + self.day_of_week = dayOfWeek(self.julian) + self.days_in_month = daysPerMonth(self.month, self.year) + diff --git a/utils/wxPython/lib/calendar.py b/utils/wxPython/lib/calendar.py new file mode 100644 index 0000000000..690e226eaf --- /dev/null +++ b/utils/wxPython/lib/calendar.py @@ -0,0 +1,479 @@ +#! /usr/local/bin/python +#---------------------------------------------------------------------------- +# Name: wxCalend.py +# Purpose: Calendar display control +# +# Author: Lorne White (email: lwhite1@planet.eon.net) +# +# Created: +# Version 0.5 1999/11/03 +# Licence: wxWindows license +#---------------------------------------------------------------------------- + +from wxPython.wx import * + +try: + from DateTime import * + using_mxDateTime = true +except ImportError: + from CDate import * + using_mxDateTime = false + +import string, time + +CalDays = [6, 0, 1, 2, 3, 4, 5] +AbrWeekday = {6:"Sun", 0:"Mon", 1:"Tue", 2:"Wed", 3:"Thu", 4:"Fri", 5:"Sat"} + + +# calendar drawing routing + +class CalDraw: + def __init__(self): + self.rg = {} + self.y_st = 15 # start of vertical draw default + + def SetSize(self, size): + self.sizew = size.width + self.sizeh = size.height + +# draw the various elements of the calendar + + def DrawCal(self, DC, sel_lst): + self.DC = DC + + self.DrawBorder() + + if self.hide_title is FALSE: + self.DrawMonth() + + self.Center() + + self.DrawGrid() + self.GetRect() + + self.DrawSel(sel_lst) # highlighted days + self.DrawWeek() + self.DrawNum() + +# draw border around the outside of the main display rectangle + + def DrawBorder(self): + rect = wxRect(0, 0, self.sizew, self.sizeh) # full display window area + self.DC.DrawRectangle(rect.x, rect.y, rect.width, rect.height) + + def DrawNumVal(self): + self.DrawNum() + +# calculate the calendar days and offset position + + def SetCal(self, year, month): + self.year = year + self.month = month + + day = 1 + t = Date(year, month, day) + dow = t.day_of_week # start day in month + dim = t.days_in_month # number of days in month + start_pos = dow+1 + self.st_pos = start_pos + + self.cal = [] + for i in range(start_pos): + self.cal.append('') + i = 1 + while i <= dim: + self.cal.append(str(i)) + i = i + 1 + return start_pos + +# get the display rectange list of the day grid + + def GetRect(self): + cnt = 0 + for y in self.gridy[1:-1]: + for x in self.gridx[:-1]: + rect = wxRect(x, y, self.dl_w, self.dl_h) # create rect region + self.rg[cnt] = rect + cnt = cnt + 1 + return self.rg + + def GetCal(self): + return self.cal + + def GetOffset(self): + return self.st_pos + +# month and year title + + def DrawMonth(self): + month = Month[self.month] + + sizef = 12 + if self.sizeh < 200: + sizef = 8 + + f = wxFont(sizef, self.font, wxNORMAL, wxNORMAL) + self.DC.SetFont(f) + + tw,th = self.DC.GetTextExtent(month) + adjust = (self.sizew-tw)/2 + self.DC.DrawText(month, adjust, 10) + + year = str(self.year) + tw,th = self.DC.GetTextExtent(year) + adjust = self.sizew-tw-20 + + self.y_st = th * 3 + + f = wxFont(sizef, self.font, wxNORMAL, wxNORMAL) + self.DC.SetFont(f) + self.DC.DrawText(year, adjust, 10) + +# draw the week days + + def DrawWeek(self): + sizef = 8 + if self.sizeh < 300: + sizef = 6 + + f = wxFont(sizef, self.font, wxNORMAL, wxNORMAL) + self.DC.SetFont(f) + + cnt_x = 0 + cnt_y = 0 + width = self.gridx[1]-self.gridx[0] + height = self.gridy[1] - self.gridy[0] + + for val in CalDays: + day = AbrWeekday[val] + if self.sizew < 200: + day = day[0] + dw,dh = self.DC.GetTextExtent(day) + diffx = (width-dw)/2 + diffy = (height-dh)/2 + + x = self.gridx[cnt_x] + y = self.gridy[cnt_y] + self.DC.DrawText(day, x+diffx, y+diffy) + cnt_x = cnt_x + 1 + +# draw the day numbers + + def DrawNum(self): + sizef = 9 + if self.sizeh < 260: + sizef = 6 + f = wxFont(sizef, self.font, wxNORMAL, wxNORMAL) + self.DC.SetFont(f) + + cnt_x = 0 + cnt_y = 1 + for val in self.cal: + x = self.gridx[cnt_x] + y = self.gridy[cnt_y] + self.DC.DrawText(val, x+5, y+5) + if cnt_x < 6: + cnt_x = cnt_x + 1 + else: + cnt_x = 0 + cnt_y = cnt_y + 1 + +# calculate the dimensions in the center of the drawing area + + def Center(self): + self.x_st = 10 + self.y_end = 10 + + bdw = self.x_st * 2 + bdh = self.y_st + self.y_end + + self.dl_w = (self.sizew-bdw)/7 + self.dl_h = (self.sizeh-bdh)/7 + + self.cwidth = self.dl_w * 7 + self.cheight = self.dl_h * 6 + self.dl_h/2 + +# highlighted selectioned days + + def DrawSel(self, sel_lst): + for key in sel_lst: + brush = wxBrush(wxNamedColour(self.high_color), wxSOLID) + self.DC.SetBrush(brush) + if self.hide_grid is FALSE: + self.DC.SetPen(wxPen(wxNamedColour(self.grid_color), 0)) + else: + self.DC.SetPen(wxPen(wxNamedColour(self.back_color), 0)) + nkey = key + self.st_pos -1 + rect = self.rg[nkey] + self.DC.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1) + +# calculate and draw the grid lines + + def DrawGrid(self): + self.DC.SetPen(wxPen(wxNamedColour(self.grid_color), 0)) + + self.gridx = [] + self.gridy = [] + + x1 = self.x_st + y1 = self.y_st + y1 = self.y_st + y2 = self.y_st + self.cheight + for i in range(8): + if self.hide_grid is FALSE: + self.DC.DrawLine(x1, y1, x1, y2) + self.gridx.append(x1) + x1 = x1 + self.dl_w + + x1 = self.x_st + y1 = self.y_st + x2 = self.x_st + self.cwidth + for i in range(8): + if self.hide_grid is FALSE: + self.DC.DrawLine(x1, y1, x2, y1) + self.gridy.append(y1) + if i == 0: + y1 = y1 + self.dl_h/2 + else: + y1 = y1 + self.dl_h + + +class Calendar(wxWindow): + def __init__(self, parent, id, pos=wxDefaultPosition, size=wxDefaultSize): + wxWindow.__init__(self, parent, id, pos, size) + + # set the calendar control attributes + + self.grid_color = 'BLACK' + self.back_color = 'WHITE' + self.sel_color = 'RED' + self.high_color = 'LIGHT BLUE' + self.font = wxSWISS + + self.SetBackgroundColour(wxNamedColor(self.back_color)) + self.Connect(-1, -1, wxEVT_LEFT_DOWN, self.OnLeftEvent) + self.Connect(-1, -1, wxEVT_LEFT_DCLICK, self.OnLeftDEvent) + self.Connect(-1, -1, wxEVT_RIGHT_DOWN, self.OnRightEvent) + self.Connect(-1, -1, wxEVT_RIGHT_DCLICK, self.OnRightDEvent) + + self.sel_key = None # last used by + self.sel_lst = [] # highlighted selected days + + self.SetNow() # default calendar for current month + + self.size = None + self.hide_title = FALSE + self.hide_grid = FALSE + self.set_day = None + +# control some of the main calendar attributes + + def HideTitle(self): + self.hide_title = TRUE + + def HideGrid(self): + self.hide_grid = TRUE + +# determine the calendar rectangle click area and draw a selection + + def ProcessClick(self, event): + self.x, self.y = event.GetX(), event.GetY() + key = self.GetDayHit(self.x, self.y) + self.SelectDay(key) + +# tab mouse click events and process + + def OnLeftEvent(self, event): + self.click = 'LEFT' + self.ProcessClick(event) + + def OnLeftDEvent(self, event): + self.click = 'DLEFT' + self.ProcessClick(event) + + def OnRightEvent(self, event): + self.click = 'RIGHT' + self.ProcessClick(event) + + def OnRightDEvent(self, event): + self.click = 'DRIGHT' + self.ProcessClick(event) + + def SetSize(self, set_size): + self.size = set_size + + def SetSelDay(self, sel): + self.sel_lst = sel # list of highlighted days + +# get the current date + + def SetNow(self): + dt = now() + self.month = dt.month + self.year = dt.year + self.day = dt.day + +# set the current day + + def SetCurrentDay(self): + self.SetNow() + self.set_day = self.day + +# get the date, day, month, year set in calendar + + def GetDate(self): + return self.day, self.month, self.year + + def GetDay(self): + return self.day + + def GetMonth(self): + return self.month + + def GetYear(self): + return self.year + +# set the day, month, and year + + def SetDayValue(self, day): + self.set_day = day + + def SetMonth(self, month): + if month >= 1 and month <= 12: + self.month = month + else: + self.month = 1 + self.set_day = None + + def SetYear(self, year): + self.year = year + +# increment year and month + + def IncYear(self): + self.year = self.year + 1 + self.set_day = None + + def DecYear(self): + self.year = self.year - 1 + self.set_day = None + + def IncMonth(self): + self.month = self.month + 1 + if self.month > 12: + self.month = 1 + self.year = self.year + 1 + self.set_day = None + + def DecMonth(self): + self.month = self.month - 1 + if self.month < 1: + self.month = 12 + self.year = self.year - 1 + self.set_day = None + +# test to see if the selection has a date and create event + + def TestDay(self, key): + try: + self.day = int(self.cal[key]) + except: + return None + if self.day == "": + return None + else: + evt = wxPyCommandEvent(2100, self.GetId()) + evt.click, evt.day, evt.month, evt.year = self.click, self.day, self.month, self.year + self.GetEventHandler().ProcessEvent(evt) + + self.set_day = self.day + return key + +# find the clicked area rectangle + + def GetDayHit(self, mx, my): + for key in self.rg.keys(): + val = self.rg[key] + rt = wxRegion() + rt.Union(val) + if rt.Contains(mx, my) != 0: + result = self.TestDay(key) + return result + return None + +# calendar drawing + + def OnPaint(self, event): + DC = wxPaintDC(self) + self.DoDrawing(DC) + + def DoDrawing(self, DC): + DC = wxPaintDC(self) + DC.BeginDrawing() + + self.cal = cal = CalDraw() + if self.size is None: + size = self.GetClientSize() + else: + size = self.size + +# drawing attributes + + cal.hide_title = self.hide_title + cal.hide_grid = self.hide_grid + + cal.grid_color = self.grid_color + cal.high_color = self.high_color + cal.back_color = self.back_color + cal.font = self.font + + cal.SetSize(size) + cal.SetCal(self.year, self.month) + cal.DrawCal(DC, self.sel_lst) + + self.rg = cal.GetRect() + self.cal = cal.GetCal() + self.st_pos = cal.GetOffset() + self.ymax = DC.MaxY() + + if self.set_day != None: + self.SetDay(self.set_day) + DC.EndDrawing() + +# draw the selection rectangle + + def DrawRect(self, key, color = 'BLACK', width = 0): + if key == None: + return + DC = wxClientDC(self) + DC.BeginDrawing() + + brush = wxBrush(wxColour(0, 0xFF, 0x80), wxTRANSPARENT) + DC.SetBrush(brush) + DC.SetPen(wxPen(wxNamedColour(color), width)) + + rect = self.rg[key] + DC.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1) + + DC.EndDrawing() + +# set the day selection + + def SetDay(self, day): + day = day + self.st_pos - 1 + self.SelectDay(day) + + def SelectDay(self, key): + sel_size = 1 + self.DrawRect(self.sel_key, self.back_color, sel_size) # clear large selection + if self.hide_grid is FALSE: + self.DrawRect(self.sel_key, self.grid_color) + + self.DrawRect(key, self.sel_color, sel_size) + self.sel_key = key # store last used by + self.select_day = None + + def ClearDsp(self): + self.Clear() + + diff --git a/utils/wxPython/lib/floatbar.py b/utils/wxPython/lib/floatbar.py index fefca18e59..26bf194033 100644 --- a/utils/wxPython/lib/floatbar.py +++ b/utils/wxPython/lib/floatbar.py @@ -16,6 +16,7 @@ class wxFloatBar(wxToolBar): position. Programmatically, call SetFloatable(true) and then Float(true) to float, Float(false) to dock. """ + def __init__(self,*_args,**_kwargs): """ In addition to the usual arguments, wxFloatBar accepts keyword @@ -38,8 +39,10 @@ class wxFloatBar(wxToolBar): self.title = "" EVT_MOUSE_EVENTS(self, self.OnMouse) self.parentframe = wxPyTypeCast(args[1], 'wxFrame') + def IsFloatable(self): return self.floatable + def SetFloatable(self, float): self.floatable = float #Find the size of a title bar. @@ -48,17 +51,22 @@ class wxFloatBar(wxToolBar): test.SetClientSize(wxSize(0,0)) self.titleheight = test.GetSizeTuple()[1] test.Destroy() + def IsFloating(self): return self.floating + def Realize(self): wxToolBar.Realize(self) self.barheight = -1 + def GetTitle(self): return self.title + def SetTitle(self, title): self.title = title if self.IsFloating(): self.floatframe.SetTitle(self.title) + def GetHome(self): """ Returns the frame which this toolbar will return to when @@ -68,6 +76,7 @@ class wxFloatBar(wxToolBar): return self.parentframe else: return wxPyTypeCast(self.GetParent(), 'wxFrame') + def SetHome(self, frame): """ Called when docked, this will remove the toolbar from its @@ -89,12 +98,18 @@ class wxFloatBar(wxToolBar): size = frame.GetSize() frame.SetSize(wxSize(0,0)) frame.SetSize(size) + def Float(self, bool): "Floats or docks the toolbar programmatically." if bool: self.parentframe = wxPyTypeCast(self.GetParent(), 'wxFrame') clientsize = self.parentframe.GetClientSizeTuple() - self.floatframe = wxMiniFrame(self.parentframe, -1, self.title, wxDefaultPosition, wxDefaultSize, wxTHICK_FRAME) + if self.title: + useStyle = wxDEFAULT_FRAME_STYLE + else: + useStyle = 0 #wxTHICK_FRAME + self.floatframe = wxMiniFrame(self.parentframe, -1, self.title, + style = useStyle) self.Reparent(self.floatframe) self.parentframe.SetToolBar(None) self.floating = 1 @@ -111,7 +126,7 @@ class wxFloatBar(wxToolBar): self.floatframe.SetPosition(newpos) self.floatframe.Show(true) EVT_CLOSE(self.floatframe, self.OnDock) -# EVT_MOVE(self.floatframe, self.OnMove) + EVT_MOVE(self.floatframe, self.OnMove) else: self.Reparent(self.parentframe) self.parentframe.SetToolBar(self) @@ -121,6 +136,7 @@ class wxFloatBar(wxToolBar): self.parentframe.SetSize(wxSize(0,0)) self.parentframe.SetSize(size) self.SetBackgroundColour(self.oldcolor) + def OnDock(self, e): self.Float(0) if hasattr(self, 'oldpos'): @@ -130,7 +146,7 @@ class wxFloatBar(wxToolBar): homepos = self.parentframe.GetPositionTuple() homepos = homepos[0], homepos[1] + self.titleheight floatpos = self.floatframe.GetPositionTuple() - if abs(homepos[0]-floatpos[0]) < 35 and abs(homepos[1]-floatpos[1]) < 35: + if abs(homepos[0] - floatpos[0]) < 35 and abs(homepos[1] - floatpos[1]) < 35: self._SetFauxBarVisible(true) else: self._SetFauxBarVisible(false) @@ -142,10 +158,12 @@ class wxFloatBar(wxToolBar): if e.ButtonDown() or e.ButtonUp() or e.ButtonDClick(1) or e.ButtonDClick(2) or e.ButtonDClick(3): e.Skip() if e.ButtonDown(): + self.CaptureMouse() self.oldpos = (e.GetX(), e.GetY()) if e.Entering(): self.oldpos = (e.GetX(), e.GetY()) if e.ButtonUp(): + self.ReleaseMouse() if self.IsFloating(): homepos = self.parentframe.GetPositionTuple() homepos = homepos[0], homepos[1] + self.titleheight @@ -165,7 +183,7 @@ class wxFloatBar(wxToolBar): self.floatframe.SetPosition(pt) def _SetFauxBarVisible(self, vis): -# return + return if vis: if self.parentframe.GetToolBar() == None: if not hasattr(self, 'nullbar'): diff --git a/utils/wxPython/src/msw/clip_dnd.cpp b/utils/wxPython/src/msw/clip_dnd.cpp index 7818d82b81..ef5836c4a9 100644 --- a/utils/wxPython/src/msw/clip_dnd.cpp +++ b/utils/wxPython/src/msw/clip_dnd.cpp @@ -212,12 +212,17 @@ void wxPyBitmapDataObject::SetBitmap(const wxBitmap& bitmap) { class wxPyDropSource : public wxDropSource { public: +#ifdef __WXMSW__ wxPyDropSource(wxWindow *win = NULL, const wxCursor &cursorCopy = wxNullCursor, const wxCursor &cursorMove = wxNullCursor, const wxCursor &cursorStop = wxNullCursor) : wxDropSource(win, cursorCopy, cursorMove, cursorStop) {} - +#else + wxPyDropSource(wxWindow *win = NULL, + const wxIcon &go = wxNullIcon) + : wxDropSource(win, go) {} +#endif DEC_PYCALLBACK_BOOL_DR(GiveFeedback); PYPRIVATE; }; -- 2.45.2