mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
fix imports, etc. in analogclock
This commit is contained in:
@@ -136,5 +136,5 @@ For updates please visit <http://j.domaindlx.com/elements28/wxpython/>.
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
from analogclock import AnalogClock, AnalogClockWindow
|
||||
from styles import *
|
||||
from .analogclock import AnalogClock, AnalogClockWindow
|
||||
from .styles import *
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
import wx
|
||||
|
||||
from styles import *
|
||||
from helpers import Dyer, Face, Hand, HandSet, TickSet, Box
|
||||
from setup import Setup
|
||||
from .styles import *
|
||||
from .helpers import Dyer, Face, Hand, HandSet, TickSet, Box
|
||||
from .setup import Setup
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from time import strftime, localtime
|
||||
import math
|
||||
import wx
|
||||
|
||||
from styles import *
|
||||
from .styles import *
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -662,7 +662,7 @@ class TickSet:
|
||||
dc.SetFont(self.font)
|
||||
maxsize = size
|
||||
for tick in self.ticks.values():
|
||||
maxsize = max(*(dc.GetTextExtent(tick.text) + (maxsize,)))
|
||||
maxsize = max(*(dc.GetTextExtent(tick.text).Get() + (maxsize,)))
|
||||
|
||||
radius = self.radius = min(clocksize.Get()) / 2. - \
|
||||
self.dyer.width / 2. - \
|
||||
@@ -941,7 +941,7 @@ class Box:
|
||||
for i, attr in enumerate(["TicksH", "TicksM"]):
|
||||
if _targets[i] & target:
|
||||
tick = getattr(self, attr)
|
||||
tick.SetFont(wx.FontFromNativeInfoString(fs))
|
||||
tick.SetFont(wx.Font(fs))
|
||||
|
||||
|
||||
def SetIsRotated(self, rotate):
|
||||
|
||||
@@ -74,7 +74,7 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
n = [self.checkbox_unchecked, self.checkbox_checked, \
|
||||
self.checkbox_tri][value]
|
||||
|
||||
self.tree.SetPyData(item, (value, style))
|
||||
self.tree.SetItemData(item, (value, style))
|
||||
self.tree.SetItemImage(item, n, wx.TreeItemIcon_Normal)
|
||||
|
||||
elif style == wx.RB_SINGLE:
|
||||
@@ -82,25 +82,25 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
parent = self.tree.GetItemParent(item)
|
||||
(child, cookie) = self.tree.GetFirstChild(parent)
|
||||
|
||||
if self.tree.GetPyData(child):
|
||||
self.tree.SetPyData(child, (False, wx.RB_SINGLE))
|
||||
if self.tree.GetItemData(child):
|
||||
self.tree.SetItemData(child, (False, wx.RB_SINGLE))
|
||||
self.tree.SetItemImage(child, self.radiobox_unchecked, \
|
||||
wx.TreeItemIcon_Normal)
|
||||
|
||||
for x in range(1, self.tree.GetChildrenCount(parent, False)):
|
||||
(child, cookie) = self.tree.GetNextChild(parent, cookie)
|
||||
|
||||
if self.tree.GetPyData(child):
|
||||
self.tree.SetPyData(child, (False, wx.RB_SINGLE))
|
||||
if self.tree.GetItemData(child):
|
||||
self.tree.SetItemData(child, (False, wx.RB_SINGLE))
|
||||
self.tree.SetItemImage(child, self.radiobox_unchecked, \
|
||||
wx.TreeItemIcon_Normal)
|
||||
|
||||
self.tree.SetPyData(item, (True, wx.RB_SINGLE))
|
||||
self.tree.SetItemData(item, (True, wx.RB_SINGLE))
|
||||
self.tree.SetItemImage(item, self.radiobox_checked, \
|
||||
wx.TreeItemIcon_Normal)
|
||||
|
||||
else:
|
||||
self.tree.SetPyData(item, (False, wx.RB_SINGLE))
|
||||
self.tree.SetItemData(item, (False, wx.RB_SINGLE))
|
||||
self.tree.SetItemImage(item, self.radiobox_unchecked, \
|
||||
wx.TreeItemIcon_Normal)
|
||||
|
||||
@@ -111,13 +111,13 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
cil = []
|
||||
(child, cookie) = self.tree.GetFirstChild(parent)
|
||||
if child.IsOk():
|
||||
d = self.tree.GetPyData(child)
|
||||
d = self.tree.GetItemData(child)
|
||||
if value is None or (d and d[0] == value):
|
||||
cil.append(child)
|
||||
for x in range(1, self.tree.GetChildrenCount(parent, False)):
|
||||
(child, cookie) = self.tree.GetNextChild(parent, cookie)
|
||||
if child.IsOk():
|
||||
d = self.tree.GetPyData(child)
|
||||
d = self.tree.GetItemData(child)
|
||||
if value is None or (d and d[0] == value):
|
||||
cil.append(child)
|
||||
return cil
|
||||
@@ -134,7 +134,7 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
v = (value, style)
|
||||
|
||||
this_item = self.tree.AppendItem(parent, label)
|
||||
self.tree.SetPyData(this_item, v)
|
||||
self.tree.SetItemData(this_item, v)
|
||||
|
||||
if v:
|
||||
self._doLogicTest(style, value, this_item)
|
||||
@@ -168,13 +168,13 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
|
||||
|
||||
def SetItemValue(self, item, value):
|
||||
data = self.tree.GetPyData(item)
|
||||
data = self.tree.GetItemData(item)
|
||||
if data:
|
||||
self._doLogicTest(data[1], value, item)
|
||||
|
||||
|
||||
def GetItemValue(self, item):
|
||||
data = self.tree.GetPyData(item)
|
||||
data = self.tree.GetItemData(item)
|
||||
if data:
|
||||
return data[0]
|
||||
else:
|
||||
@@ -196,7 +196,7 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
def GetRootItems(self):
|
||||
cil = []
|
||||
for x in range(0, len(self.allitems)):
|
||||
d = self.tree.GetPyData(self.allitems[x])
|
||||
d = self.tree.GetItemData(self.allitems[x])
|
||||
if not d:
|
||||
cil.append(self.allitems[x])
|
||||
return cil
|
||||
@@ -239,7 +239,7 @@ class ButtonTreeCtrlPanel(wx.Panel):
|
||||
def OnLeftClicks(self, evt):
|
||||
item, flags = self.tree.HitTest(evt.GetPosition())
|
||||
if item:
|
||||
text, data = self.tree.GetItemText(item), self.tree.GetPyData(item)
|
||||
text, data = self.tree.GetItemText(item), self.tree.GetItemData(item)
|
||||
if data:
|
||||
style = data[1]
|
||||
if style == wx.CHK_2STATE:
|
||||
|
||||
@@ -57,8 +57,9 @@ class ColourSelect(GenBitmapButton):
|
||||
data = wx.ColourData()
|
||||
data.SetChooseFull(True)
|
||||
data.SetColour(self.value)
|
||||
[data.SetCustomColour(colour_index, win.customcolours[colour_index])
|
||||
for colour_index in range(0, 16)]
|
||||
for idx, clr in enumerate(win.customcolours):
|
||||
if clr:
|
||||
data.SetCustomColour(idx, clr)
|
||||
|
||||
dlg = wx.ColourDialog(win, data)
|
||||
dlg.SetTitle("Select Colour")
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
# Distributed under the wxWidgets license.
|
||||
# Tags: phoenix-port
|
||||
|
||||
import functools
|
||||
|
||||
import wx
|
||||
|
||||
import styles
|
||||
import lib_setup.colourselect as csel
|
||||
import lib_setup.fontselect as fsel
|
||||
import lib_setup.buttontreectrlpanel as bt
|
||||
from . import styles
|
||||
from .lib_setup import colourselect as csel
|
||||
from .lib_setup import fontselect as fsel
|
||||
from .lib_setup import buttontreectrlpanel as bt
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
@@ -313,7 +315,7 @@ class StylesPanel(bt.ButtonTreeCtrlPanel):
|
||||
|
||||
def OnChanged(self, evt):
|
||||
clockStyle, hourStyle, minuteStyle = \
|
||||
[reduce(lambda x, y: x | y,
|
||||
[functools.reduce(lambda x, y: x | y,
|
||||
[getattr(styles, item) \
|
||||
for item in self.GetStringItemsChecked(group)], 0) \
|
||||
for group in self.groups]
|
||||
|
||||
Reference in New Issue
Block a user