mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Add EnableSystemTheme method to the classes which support it
This commit is contained in:
@@ -20,7 +20,6 @@ Starting with this release wxPython has switched to tracking the wxWidgets
|
||||
master branch for the wxWidgets source code, which wxPython is built upon, and
|
||||
which is included in the wxPython source archives.
|
||||
|
||||
|
||||
New and improved in this release:
|
||||
|
||||
* Added wrappers for the OSXEnableAutomaticQuoteSubstitution,
|
||||
@@ -49,6 +48,13 @@ Other changes in this release:
|
||||
* Fixed issue in wx.lib.agw.customtreectrl where label editor could remain
|
||||
stuck forever (#1235).
|
||||
|
||||
* Grafted on a EnableSystemTheme method to the classes which support it. This
|
||||
can be used to disable the default system theme on Windows for native widgets
|
||||
like wx.ListCtrl, wx.TreeCtrl and wx.dataview.DataViewCtrl. It has no effect
|
||||
on the other platforms.
|
||||
|
||||
|
||||
|
||||
|
||||
4.0.6 "Applesauce"
|
||||
------------------
|
||||
|
||||
@@ -374,6 +374,8 @@ def run():
|
||||
tools.fixWindowClass(c)
|
||||
module.addGlobalStr('wxDataViewCtrlNameStr', c)
|
||||
|
||||
tools.addEnableSystemTheme(c, 'wx.dataview.DataViewCtrl')
|
||||
|
||||
c.find('AssociateModel.model').transfer = True
|
||||
c.find('AssociateModel').pyName = '_AssociateModel'
|
||||
c.addPyMethod('AssociateModel', '(self, model)',
|
||||
|
||||
@@ -62,6 +62,7 @@ def run():
|
||||
c.find(name).ignore(False)
|
||||
c.find(name).isVirtual = True
|
||||
|
||||
tools.addEnableSystemTheme(c, 'wx.ListCtrl')
|
||||
|
||||
# Tweaks to allow passing and using a Python callable object for the sort
|
||||
# compare function. First provide a sort callback function that can call the
|
||||
@@ -108,7 +109,6 @@ def run():
|
||||
c.find('SetItemPtrData').ignore()
|
||||
|
||||
|
||||
|
||||
# Change the semantics of GetColumn to return the item as the return
|
||||
# value instead of through a parameter.
|
||||
# bool GetColumn(int col, wxListItem& item) const;
|
||||
|
||||
@@ -80,6 +80,7 @@ def run():
|
||||
tools.fixWindowClass(c)
|
||||
module.addGlobalStr('wxTreeCtrlNameStr', before=c)
|
||||
|
||||
tools.addEnableSystemTheme(c, 'wx.TreeCtrl')
|
||||
|
||||
# Set all wxTreeItemData parameters to transfer ownership. Is this still needed with MappedTypes?
|
||||
for item in c.allItems():
|
||||
|
||||
@@ -16,6 +16,7 @@ import etgtools as extractors
|
||||
from .generators import textfile_open
|
||||
import sys, os
|
||||
import copy
|
||||
import textwrap
|
||||
|
||||
|
||||
PY3 = sys.version_info[0] == 3
|
||||
@@ -656,6 +657,36 @@ def checkForUnitTestModule(module):
|
||||
print('WARNING: Unittest module (%s) not found!' % pathname)
|
||||
|
||||
|
||||
|
||||
def addEnableSystemTheme(klass, klassName):
|
||||
m = extractors.MethodDef(name='EnableSystemTheme', type='void',
|
||||
items=[extractors.ParamDef(type='bool', name='enable', default='true')])
|
||||
m.briefDoc = "Can be used to disable the system theme of controls using it by default."
|
||||
m.detailedDoc = [textwrap.dedent("""\
|
||||
On Windows there an alternative theme available for the list and list-like
|
||||
controls since Windows Vista. This theme is used by Windows Explorer list
|
||||
and tree view and so is arguably more familiar to the users than the standard
|
||||
appearance of these controls. This class automatically uses the new theme,
|
||||
but if that is not desired then this method can be used to turn it off.
|
||||
|
||||
Please note that this method should be called before the widget is
|
||||
actually created, using the 2-phase create pattern. Something like this::
|
||||
|
||||
# This creates the object, but not the window
|
||||
widget = {}()
|
||||
|
||||
# Disable the system theme
|
||||
widget.EnableSystemTheme(False)
|
||||
|
||||
# Now create the window
|
||||
widget.Create(parent, wx.ID_ANY)
|
||||
|
||||
This method has no effect on other platorms
|
||||
""".format(klassName))]
|
||||
|
||||
klass.addItem(m)
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
def addGetIMMethodTemplate(module, klass, fields):
|
||||
|
||||
Reference in New Issue
Block a user