Various odds and ends, minor fixes, and cleanups...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,17 +14,17 @@ class TestPanel(wxPanel):
|
||||
b = wxButton(self, -1, "A real button", (10,10))
|
||||
b.SetDefault()
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
b = wxButton(self, -1, "non-default", (100, 10))
|
||||
b = wxButton(self, -1, "non-default", (140, 10))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
#wxTextCtrl(self, -1, "", (10,40))
|
||||
|
||||
b = wxGenButton(self, -1, 'Hello', (10,65))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
b = wxGenButton(self, -1, 'disabled', (100,65))
|
||||
b = wxGenButton(self, -1, 'disabled', (140,65))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
b.Enable(false)
|
||||
|
||||
b = wxGenButton(self, -1, 'bigger', (195,50))
|
||||
b = wxGenButton(self, -1, 'bigger', (250,50))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false))
|
||||
b.SetBezelWidth(5)
|
||||
@@ -38,7 +38,7 @@ class TestPanel(wxPanel):
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
|
||||
|
||||
b = wxGenBitmapButton(self, -1, None, (100, 130))
|
||||
b = wxGenBitmapButton(self, -1, None, (140, 130))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnButton)
|
||||
bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
|
||||
mask = wxMaskColour(bmp, wxBLUE)
|
||||
@@ -54,7 +54,7 @@ class TestPanel(wxPanel):
|
||||
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
|
||||
|
||||
|
||||
b = wxGenBitmapToggleButton(self, -1, None, (100, 230))
|
||||
b = wxGenBitmapToggleButton(self, -1, None, (140, 230))
|
||||
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
|
||||
bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
|
||||
mask = wxMaskColour(bmp, wxBLUE)
|
||||
|
@@ -66,7 +66,6 @@ else:
|
||||
|
||||
def OnSize(self, event):
|
||||
size = self.GetClientSize()
|
||||
print size
|
||||
if self.GetContext():
|
||||
self.SetCurrent()
|
||||
glViewport(0, 0, size.width, size.height)
|
||||
@@ -76,7 +75,6 @@ else:
|
||||
dc = wxPaintDC(self)
|
||||
|
||||
self.SetCurrent()
|
||||
print self.init
|
||||
|
||||
if not self.init:
|
||||
self.InitGL()
|
||||
|
@@ -3,27 +3,28 @@ from wxPython.wx import *
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
logic = ['']*16
|
||||
def rlf(x):
|
||||
logic[eval(x)]=x
|
||||
logicList = [
|
||||
('wxAND', wxAND),
|
||||
('wxAND_INVERT', wxAND_INVERT),
|
||||
('wxAND_REVERSE', wxAND_REVERSE),
|
||||
('wxCLEAR', wxCLEAR),
|
||||
('wxCOPY', wxCOPY),
|
||||
('wxEQUIV', wxEQUIV),
|
||||
('wxINVERT', wxINVERT),
|
||||
('wxNAND', wxNAND),
|
||||
|
||||
# this one causes an assert on wxGTK, and doesn't seem to
|
||||
# do much on MSW anyway, so I'll just take it out....
|
||||
#('wxNOR', wxNOR),
|
||||
|
||||
rlf('wxAND')
|
||||
rlf('wxAND_INVERT')
|
||||
rlf('wxAND_REVERSE')
|
||||
rlf('wxCLEAR')
|
||||
rlf('wxCOPY')
|
||||
rlf('wxEQUIV')
|
||||
rlf('wxINVERT')
|
||||
rlf('wxNAND')
|
||||
rlf('wxNOR')
|
||||
rlf('wxNO_OP')
|
||||
rlf('wxOR')
|
||||
rlf('wxOR_INVERT')
|
||||
rlf('wxOR_REVERSE')
|
||||
rlf('wxSET')
|
||||
rlf('wxSRC_INVERT')
|
||||
rlf('wxXOR')
|
||||
('wxNO_OP', wxNO_OP),
|
||||
('wxOR', wxOR),
|
||||
('wxOR_INVERT', wxOR_INVERT),
|
||||
('wxOR_REVERSE', wxOR_REVERSE),
|
||||
('wxSET', wxSET),
|
||||
('wxSRC_INVERT', wxSRC_INVERT),
|
||||
('wxXOR', wxXOR),
|
||||
]
|
||||
|
||||
class TestMaskWindow(wxScrolledWindow):
|
||||
def __init__(self, parent):
|
||||
@@ -78,13 +79,13 @@ class TestMaskWindow(wxScrolledWindow):
|
||||
|
||||
# draw array of assorted blit operations
|
||||
mdc = wxMemoryDC()
|
||||
for i in range(16):
|
||||
text = logic[i]
|
||||
i = 0
|
||||
for text, code in logicList:
|
||||
x,y = 120+100*(i%4), 20+100*(i/4)
|
||||
dc.DrawText(text, x,y-20)
|
||||
mdc.SelectObject(self.bmp_withcolourmask)
|
||||
dc.Blit(x,y, cx,cy, mdc, 0,0, i,1)
|
||||
|
||||
dc.Blit(x,y, cx,cy, mdc, 0,0, code, true)
|
||||
i = i + 1
|
||||
|
||||
|
||||
|
||||
|
@@ -45,8 +45,8 @@ def runTest(frame, nb, log):
|
||||
|
||||
|
||||
else:
|
||||
wxMessageBox("Unable to import VTK, which is a required component "
|
||||
"of this demo. You need to download and install the "
|
||||
wxMessageBox("Unable to import VTK, which is a required component\n"
|
||||
"of this demo. You need to download and install the\n"
|
||||
"Python extension module for VTK from http://www.kitware.com/",
|
||||
"Import Error")
|
||||
return None
|
||||
|
Reference in New Issue
Block a user