projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
accept files in wxHtmlEasyPrinting::{Print,Preview}File, not only URLs
[wxWidgets.git]
/
wxPython
/
demo
/
VListBox.py
diff --git
a/wxPython/demo/VListBox.py
b/wxPython/demo/VListBox.py
index cbe77076982dabd041b02a4d83bd26934ffab5b3..fe2112ea5ffbdaa38778e642401e4b7edb967a58 100644
(file)
--- a/
wxPython/demo/VListBox.py
+++ b/
wxPython/demo/VListBox.py
@@
-1,13
+1,9
@@
-# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-#
import wx
#----------------------------------------------------------------------
import wx
#----------------------------------------------------------------------
-# The wx
VListBox is much like a regular wx
ListBox except you draw the
+# The wx
.VListBox is much like a regular wx.
ListBox except you draw the
# items yourself and the items can vary in height.
class MyVListBox(wx.VListBox):
# items yourself and the items can vary in height.
class MyVListBox(wx.VListBox):
@@
-18,7
+14,8
@@
class MyVListBox(wx.VListBox):
if self.GetSelection() == n:
c = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
else:
if self.GetSelection() == n:
c = wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
else:
- c = self.GetForegroundColour()#wx.SystemSettings.GetColour(wx.SYS_COLOUR_HIGHLIGHTTEXT)
+ c = self.GetForegroundColour()
+ dc.SetFont(self.GetFont())
dc.SetTextForeground(c)
dc.DrawLabel(self._getItemText(n), rect,
wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL)
dc.SetTextForeground(c)
dc.DrawLabel(self._getItemText(n), rect,
wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL)
@@
-27,11
+24,9
@@
class MyVListBox(wx.VListBox):
# required to draw the n'th item.
def OnMeasureItem(self, n):
height = 0
# required to draw the n'th item.
def OnMeasureItem(self, n):
height = 0
-
for line in self._getItemText(n).split('\n'):
w, h = self.GetTextExtent(line)
height += h
for line in self._getItemText(n).split('\n'):
w, h = self.GetTextExtent(line)
height += h
-
return height + 5
return height + 5
@@
-109,7
+104,7
@@
def runTest(frame, nb, log):
overview = """<html><body>
overview = """<html><body>
-<h2><center>wx
VListBox and wx
HtmlListBox</center></h2>
+<h2><center>wx
.VListBox and wx.
HtmlListBox</center></h2>
<hr>
The "V" in wxVListBox stands for both "virtual" because it can have an
<hr>
The "V" in wxVListBox stands for both "virtual" because it can have an
@@
-119,8
+114,8
@@
interface as wxListBox and also emits the same events so you can use
the same EVT_LISTBOX function to connect a handler.
<p>
the same EVT_LISTBOX function to connect a handler.
<p>
-The wx
HtmlListBox derives from wx
VListBox, but draws each item itself
-as a wxHtmlCell. This means that you just need to provide a snippet
+The wx
.HtmlListBox derives from wx.
VListBox, but draws each item itself
+as a wx
.
HtmlCell. This means that you just need to provide a snippet
of HTML for each item when requested.
</body></html>
of HTML for each item when requested.
</body></html>
@@
-131,5
+126,5
@@
of HTML for each item when requested.
if __name__ == '__main__':
import sys,os
import run
if __name__ == '__main__':
import sys,os
import run
- run.main(['', os.path.basename(sys.argv[0])])
+ run.main(['', os.path.basename(sys.argv[0])]
+ sys.argv[1:]
)