mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
more minor demo tweaks
This commit is contained in:
@@ -13,7 +13,7 @@ class TestPanel(wx.Panel):
|
|||||||
self.elb = wx.adv.EditableListBox(
|
self.elb = wx.adv.EditableListBox(
|
||||||
self, -1, "List of Stuff", (50,50), (250, 250),
|
self, -1, "List of Stuff", (50,50), (250, 250),
|
||||||
style=wx.adv.EL_DEFAULT_STYLE |
|
style=wx.adv.EL_DEFAULT_STYLE |
|
||||||
wx.adv.EL_NO_REORDER |
|
#wx.adv.EL_NO_REORDER |
|
||||||
wx.adv.EL_ALLOW_NEW |
|
wx.adv.EL_ALLOW_NEW |
|
||||||
wx.adv.EL_ALLOW_EDIT |
|
wx.adv.EL_ALLOW_EDIT |
|
||||||
wx.adv.EL_ALLOW_DELETE)
|
wx.adv.EL_ALLOW_DELETE)
|
||||||
|
|||||||
@@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
# Name: EventManager.py
|
# Name: EventManager.py
|
||||||
# Purpose: A module to demonstrate wxPython.lib.evtmgr.EventManager.
|
# Purpose: A module to demonstrate wx.lib.evtmgr.EventManager.
|
||||||
#
|
#
|
||||||
# Author: Robb Shecter (robb@acm.org)
|
# Author: Robb Shecter (robb@acm.org)
|
||||||
#
|
#
|
||||||
# Created: 16-December-2002
|
# Created: 16-December-2002
|
||||||
# Copyright: (c) 2002 by Robb Shecter (robb@acm.org)
|
# Copyright: (c) 2002-2016 by Robb Shecter (robb@acm.org),
|
||||||
|
# Total Control Software
|
||||||
# Licence: wxWindows license
|
# Licence: wxWindows license
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
@@ -136,7 +137,7 @@ class InnerTile(wx.Window):
|
|||||||
FINAL_COLOR = wx.Colour( 20, 80,240)
|
FINAL_COLOR = wx.Colour( 20, 80,240)
|
||||||
OFF_COLOR = wx.Colour(185,190,185)
|
OFF_COLOR = wx.Colour(185,190,185)
|
||||||
# Some pre-computation.
|
# Some pre-computation.
|
||||||
DELTAS = map(lambda a,b: b-a, START_COLOR.Get(), FINAL_COLOR.Get())
|
DELTAS = list(map(lambda a,b: b-a, START_COLOR.Get(), FINAL_COLOR.Get()))
|
||||||
START_COLOR_TUPLE = START_COLOR.Get()
|
START_COLOR_TUPLE = START_COLOR.Get()
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -185,7 +186,8 @@ class InnerTile(wx.Window):
|
|||||||
self.makeColorFromTuple(mouseEvent.GetPosition())
|
self.makeColorFromTuple(mouseEvent.GetPosition())
|
||||||
|
|
||||||
|
|
||||||
def makeColorFromTuple(self, (x, y)):
|
def makeColorFromTuple(self, xy):
|
||||||
|
x, y = xy
|
||||||
MAX = 180.0
|
MAX = 180.0
|
||||||
scaled = min((x + y) * self.factor, MAX) # In range [0..MAX]
|
scaled = min((x + y) * self.factor, MAX) # In range [0..MAX]
|
||||||
percent = scaled / MAX
|
percent = scaled / MAX
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ class FileCtrl(wx.FileCtrl):
|
|||||||
pos=wx.DefaultPosition, size=wx.DefaultSize, name="filectrl", log=None):
|
pos=wx.DefaultPosition, size=wx.DefaultSize, name="filectrl", log=None):
|
||||||
wx.FileCtrl.__init__(self, parent, id, defaultDirectory, defaultFilename,
|
wx.FileCtrl.__init__(self, parent, id, defaultDirectory, defaultFilename,
|
||||||
wildCard, style, pos, size, name)
|
wildCard, style, pos, size, name)
|
||||||
|
|
||||||
self.BackgroundColour = 'pink'
|
|
||||||
|
|
||||||
self.log = log
|
self.log = log
|
||||||
self.Bind(wx.EVT_FILECTRL_FILEACTIVATED, self.OnFileActivated)
|
self.Bind(wx.EVT_FILECTRL_FILEACTIVATED, self.OnFileActivated)
|
||||||
self.Bind(wx.EVT_FILECTRL_SELECTIONCHANGED, self.OnSelectionChanged)
|
self.Bind(wx.EVT_FILECTRL_SELECTIONCHANGED, self.OnSelectionChanged)
|
||||||
@@ -49,8 +47,12 @@ class TestPanel(wx.Panel):
|
|||||||
self.log = log
|
self.log = log
|
||||||
wx.Panel.__init__(self, parent)
|
wx.Panel.__init__(self, parent)
|
||||||
|
|
||||||
fc = FileCtrl(self, pos=(15,15), log=log)
|
wx.StaticText(self, -1,
|
||||||
|
"This is a generic control with features like a file dialog",
|
||||||
|
pos=(10,10))
|
||||||
|
fc = FileCtrl(self, pos=(10,35), log=log)
|
||||||
|
fc.SetSize((500,350))
|
||||||
|
fc.BackgroundColour = 'sky blue'
|
||||||
|
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -6,12 +6,11 @@ import wx
|
|||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
text = """\
|
text = """\
|
||||||
Right-click on the panel above the line to get a menu. This menu will
|
Right-click on this panel to get a menu. This menu will be managed by a
|
||||||
be managed by a FileHistory object and so the files you select will
|
FileHistory object and so the files you select will automatically be added to
|
||||||
automatically be added to the end of the menu and will be selectable
|
the end of the menu and will be selectable the next time the menu is viewed.
|
||||||
the next time the menu is viewed. The filename selected, either via the
|
The filename selected, either via the Open menu item, or from the history,
|
||||||
Open menu item, or from the history, will be displayed in the log
|
will be displayed in the log window below.
|
||||||
window below.
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user