文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Custom Controls → AnalogClock

Custom Controls → AnalogClock

时间:2007-04-18  来源:wxPhoenix

Overview = """\ Just demo digital clock!
reference wxPython document for more detail.
"""    
   
import wx
import wx.lib.analogclock as analogclock

class Frame(wx.Frame):
 
 def __init__(
  self, parent=None, id=wx.ID_ANY, title='AnalogClock', pos=wx.DefaultPosition,
  size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE
  ):
  
  wx.Frame.__init__(self, parent, id, title, pos, size, style)
  self.SetIcon(wx.Icon('wxWidgets.ico', wx.BITMAP_TYPE_ICO))
  
  panel = wx.Panel(self, wx.ID_ANY)
  
  clock = analogclock.AnalogClock(panel, style=wx.RAISED_BORDER,
           hoursStyle=analogclock.TICKS_BINARY,
           minutesStyle=analogclock.TICKS_CIRCLE,
           clockStyle=analogclock.SHOW_HOURS_TICKS|
             analogclock.SHOW_MINUTES_TICKS|
             analogclock.SHOW_HOURS_HAND|
             analogclock.SHOW_MINUTES_HAND|
             analogclock.SHOW_SECONDS_HAND)
  # Set hour-tick's size           
  clock.SetTickSize(12, target=analogclock.HOUR)
  
  # Fill the hand with colour
  colour = wx.Colour(0, 255, 255)
  clock.SetHandFillColour(colour)
  # Set the colour of hand's border
  colour = wx.Colour(179, 0, 89)
  clock.SetHandBorderColour(colour)
  
  # Fill the tick with colour
  colour = wx.Colour(255, 0, 0)
  clock.SetTickFillColour(colour)
  # Set the colour of tick's border
  colour = wx.Colour(0, 255, 0)
  clock.SetTickBorderColour(colour)
  
  # Set the colour of face's border
  colour = wx.Colour(0, 0, 255)
  clock.SetFaceBorderColour(colour)
  
  # Set the colour of the background
  colour = wx.Colour(128, 64, 0)
  clock.SetBackgroundColour(colour)
  
  
  
  sizer = wx.BoxSizer()
  sizer.Add(clock, 1, wx.EXPAND)
  panel.SetSizer(sizer)
  
  
  
def TestFrame():
 app = wx.PySimpleApp()
 frame = Frame(size=(640, 480))
 frame.Centre()
 frame.Show()
 app.MainLoop()
 
 
if __name__ == '__main__':
 TestFrame()
相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载