Lots of little bug fixes, API updates, etc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -67,12 +67,12 @@ class LayoutAnchors(wxLayoutConstraints):
|
||||
self.setConstraintSides(self.left, wxLeft, left,
|
||||
self.right, wxRight, right,
|
||||
self.width, wxWidth, self.centreX,
|
||||
cPos.x, cSize.x, pSize.x, parent)
|
||||
cPos.x, cSize.width, pSize.width, parent)
|
||||
|
||||
self.setConstraintSides(self.top, wxTop, top,
|
||||
self.bottom, wxBottom, bottom,
|
||||
self.height, wxHeight, self.centreY,
|
||||
cPos.y, cSize.y, pSize.y, parent)
|
||||
cPos.y, cSize.height, pSize.height, parent)
|
||||
|
||||
def setConstraintSides(self, side1, side1Edge, side1Anchor,
|
||||
side2, side2Edge, side2Anchor,
|
||||
|
@@ -155,7 +155,7 @@ class CalDraw:
|
||||
|
||||
if self.outer_border is True:
|
||||
rect = wxRect(self.cx_st, self.cy_st, self.sizew, self.sizeh) # full display window area
|
||||
self.DC.DrawRectangle(rect.x, rect.y, rect.width, rect.height)
|
||||
self.DC.DrawRectangleRect(rect)
|
||||
|
||||
def DrawNumVal(self):
|
||||
self.DrawNum()
|
||||
@@ -226,7 +226,7 @@ class CalDraw:
|
||||
|
||||
tw,th = self.DC.GetTextExtent(month)
|
||||
adjust = self.cx_st + (self.sizew-tw)/2
|
||||
self.DC.DrawText(month, adjust, self.cy_st + th)
|
||||
self.DC.DrawText(month, (adjust, self.cy_st + th))
|
||||
|
||||
year = str(self.year)
|
||||
tw,th = self.DC.GetTextExtent(year)
|
||||
@@ -236,7 +236,7 @@ class CalDraw:
|
||||
|
||||
f = wxFont(sizef, self.font, wxNORMAL, self.bold)
|
||||
self.DC.SetFont(f)
|
||||
self.DC.DrawText(year, self.cx_st + adjust, self.cy_st + th)
|
||||
self.DC.DrawText(year, (self.cx_st + adjust, self.cy_st + th))
|
||||
|
||||
def DrawWeek(self): # draw the week days
|
||||
width = self.gridx[1]-self.gridx[0]
|
||||
@@ -265,7 +265,7 @@ class CalDraw:
|
||||
|
||||
brush = wxBrush(wxNamedColour(self.week_color), wxSOLID)
|
||||
self.DC.SetBrush(brush)
|
||||
# self.DC.DrawRectangle(self.gridx[0], self.gridy[0], rect_w+1, height)
|
||||
# self.DC.DrawRectangle((self.gridx[0], self.gridy[0]), (rect_w+1, height))
|
||||
|
||||
if self.cal_type == "NORMAL":
|
||||
cal_days = CalDays
|
||||
@@ -282,8 +282,8 @@ class CalDraw:
|
||||
|
||||
x = self.gridx[cnt_x]
|
||||
y = self.gridy[cnt_y]
|
||||
self.DC.DrawRectangle(self.gridx[cnt_x], self.gridy[0], width+1, height)
|
||||
self.DC.DrawText(day, x+diffx, y+diffy)
|
||||
self.DC.DrawRectangle((self.gridx[cnt_x], self.gridy[0]), (width+1, height))
|
||||
self.DC.DrawText(day, (x+diffx, y+diffy))
|
||||
cnt_x = cnt_x + 1
|
||||
|
||||
def DrawNum(self): # draw the day numbers
|
||||
@@ -337,7 +337,7 @@ class CalDraw:
|
||||
|
||||
adj_v = adj_v + self.num_indent_vert
|
||||
|
||||
self.DC.DrawText(val, x+adj_h, y+adj_v)
|
||||
self.DC.DrawText(val, (x+adj_h, y+adj_v))
|
||||
if cnt_x < 6:
|
||||
cnt_x = cnt_x + 1
|
||||
else:
|
||||
@@ -367,7 +367,7 @@ class CalDraw:
|
||||
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)
|
||||
self.DC.DrawRectangle((rect.x, rect.y), (rect.width+1, rect.height+1))
|
||||
|
||||
def DrawGrid(self): # calculate and draw the grid lines
|
||||
self.DC.SetPen(wxPen(wxNamedColour(self.grid_color), 0))
|
||||
@@ -384,7 +384,7 @@ class CalDraw:
|
||||
y2 = y1 + self.cheight
|
||||
for i in range(8):
|
||||
if self.hide_grid is False:
|
||||
self.DC.DrawLine(x1, y1, x1, y2)
|
||||
self.DC.DrawLine((x1, y1), (x1, y2))
|
||||
self.gridx.append(x1)
|
||||
x1 = x1 + self.dl_w
|
||||
|
||||
@@ -394,7 +394,7 @@ class CalDraw:
|
||||
x2 = x1 + self.cwidth
|
||||
for i in range(8):
|
||||
if self.hide_grid is False:
|
||||
self.DC.DrawLine(x1, y1, x2, y1)
|
||||
self.DC.DrawLine((x1, y1), (x2, y1))
|
||||
self.gridy.append(y1)
|
||||
if i == 0:
|
||||
y1 = y1 + self.dl_th
|
||||
@@ -439,7 +439,7 @@ class wxCalendar(wxWindow):
|
||||
|
||||
self.select_list = []
|
||||
|
||||
self.SetBackgroundColour(wxNamedColor(self.back_color))
|
||||
self.SetBackgroundColour(wxNamedColour(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)
|
||||
@@ -671,7 +671,7 @@ class wxCalendar(wxWindow):
|
||||
DC.SetPen(wxPen(wxNamedColour(color), width))
|
||||
|
||||
rect = self.rg[key]
|
||||
DC.DrawRectangle(rect.x, rect.y, rect.width+1, rect.height+1)
|
||||
DC.DrawRectangle((rect.x, rect.y), (rect.width+1, rect.height+1))
|
||||
|
||||
DC.EndDrawing()
|
||||
|
||||
@@ -696,7 +696,7 @@ class wxCalendar(wxWindow):
|
||||
|
||||
class CalenDlg(wxDialog):
|
||||
def __init__(self, parent, month=None, day = None, year=None):
|
||||
wxDialog.__init__(self, parent, -1, "Event Calendar", wxPyDefaultPosition, wxSize(280, 360))
|
||||
wxDialog.__init__(self, parent, -1, "Event Calendar", wxDefaultPosition, wxSize(280, 360))
|
||||
|
||||
# set the calendar and attributes
|
||||
self.calend = wxCalendar(self, -1, wxPoint(20, 60), wxSize(240, 200))
|
||||
|
@@ -316,7 +316,7 @@ class EventMacroInfo:
|
||||
win = FakeWindow()
|
||||
try:
|
||||
eventMacro(win, None, None)
|
||||
except TypeError:
|
||||
except (TypeError, AssertionError):
|
||||
eventMacro(win, None)
|
||||
self.lookupTable[eventMacro] = win.eventTypes
|
||||
return win.eventTypes
|
||||
@@ -406,7 +406,7 @@ class EventAdapter:
|
||||
try:
|
||||
func(win, id, self.handleEvent)
|
||||
self.callStyle = 3
|
||||
except TypeError:
|
||||
except (TypeError, AssertionError):
|
||||
func(win, self.handleEvent)
|
||||
self.callStyle = 2
|
||||
|
||||
|
@@ -85,7 +85,7 @@ class RowColSizer(wxPySizer):
|
||||
assert row != -1, "Row must be specified"
|
||||
assert col != -1, "Column must be specified"
|
||||
|
||||
wxPySizer.AddSpacer(self, width, height, option, flag, border,
|
||||
wxPySizer.AddSpacer(self, (width, height), option, flag, border,
|
||||
userData=(row, col, row+rowspan, col+colspan))
|
||||
|
||||
#--------------------------------------------------
|
||||
|
@@ -21,6 +21,7 @@ import os
|
||||
import wx
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
THROBBER_EVENT = wx.NewEventType()
|
||||
def EVT_UPDATE_THROBBER(win, func):
|
||||
win.Connect(-1, -1, THROBBER_EVENT, func)
|
||||
@@ -134,13 +135,13 @@ class Throbber(wx.Panel):
|
||||
|
||||
|
||||
def Draw(self, dc):
|
||||
dc.DrawBitmap(self.submaps[self.sequence[self.current]], 0, 0, True)
|
||||
dc.DrawBitmap(self.submaps[self.sequence[self.current]], (0, 0), True)
|
||||
if self.overlay and self.showOverlay:
|
||||
dc.DrawBitmap(self.overlay, self.overlayX, self.overlayY, True)
|
||||
dc.DrawBitmap(self.overlay, (self.overlayX, self.overlayY), True)
|
||||
if self.label and self.showLabel:
|
||||
dc.DrawText(self.label, self.labelX, self.labelY)
|
||||
dc.DrawText(self.label, (self.labelX, self.labelY))
|
||||
dc.SetTextForeground(wx.WHITE)
|
||||
dc.DrawText(self.label, self.labelX-1, self.labelY-1)
|
||||
dc.DrawText(self.label, (self.labelX-1, self.labelY-1))
|
||||
|
||||
|
||||
def OnPaint(self, event):
|
||||
@@ -194,7 +195,7 @@ class Throbber(wx.Panel):
|
||||
"""Start the animation"""
|
||||
if not self.running:
|
||||
self.running = not self.running
|
||||
self.timer.Start(self.frameDelay * 1000)
|
||||
self.timer.Start(int(self.frameDelay * 1000))
|
||||
|
||||
|
||||
def Stop(self):
|
||||
|
@@ -239,7 +239,7 @@ value to fall within the current bounds.
|
||||
</body></html>
|
||||
"""
|
||||
|
||||
import string, copy
|
||||
import string, copy, types
|
||||
from wxPython.wx import *
|
||||
from wxPython.tools.dbg import Logger
|
||||
from wxPython.lib.maskededit import wxMaskedTextCtrl, Field
|
||||
|
Reference in New Issue
Block a user