Added a new sample app that is a style editor for wxSTC.

Some other tweaks and fixes.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-08-28 19:21:45 +00:00
parent 555d502faf
commit 00b6c4e33b
22 changed files with 2227 additions and 251 deletions

View File

@@ -1,16 +1,16 @@
from wxPython.lib.PyCrust import PyCrustShell, PyCrustEditor, PyCrustVersion
from wxPython.lib.PyCrust import shell, version
#----------------------------------------------------------------------
intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % PyCrustVersion.version
intro = 'Welcome To PyCrust %s - The Flakiest Python Shell' % version.VERSION
def runTest(frame, nb, log):
shell = PyCrustShell.Shell(nb, intro)
return shell.editor
win = shell.Shell(nb, -1, introText=intro)
return win
#----------------------------------------------------------------------
overview = PyCrustShell.__doc__
overview = shell.__doc__

View File

@@ -19,7 +19,11 @@ class TestVirtualList(wxListCtrl):
self.SetItemCount(1000000)
self.attr1 = wxListItemAttr()
self.attr1.SetBackgroundColour("yellow")
self.attr2 = wxListItemAttr()
self.attr2.SetBackgroundColour("light blue")
def OnGetItemText(self, item, col):
@@ -29,7 +33,12 @@ class TestVirtualList(wxListCtrl):
return 0
def OnGetItemAttr(self, item):
return None
if item % 3 == 1:
return self.attr1
elif item % 3 == 2:
return self.attr2
else:
return None
#----------------------------------------------------------------------

View File

@@ -1361,6 +1361,7 @@ public:
void BeginBatch();
void EndBatch();
int GetBatchCount();
void ForceRefresh();
// ------ edit control functions
@@ -1693,6 +1694,22 @@ public:
bool AltDown();
};
class wxGridEditorCreatedEvent : public wxCommandEvent {
public:
wxGridEditorCreatedEvent(int id, wxEventType type, wxObject* obj,
int row, int col, wxControl* ctrl);
int GetRow();
int GetCol();
wxControl* GetControl();
void SetRow(int row);
void SetCol(int col);
void SetControl(wxControl* ctrl);
};
enum {
wxEVT_GRID_CELL_LEFT_CLICK,
wxEVT_GRID_CELL_RIGHT_CLICK,
@@ -1709,6 +1726,7 @@ enum {
wxEVT_GRID_SELECT_CELL,
wxEVT_GRID_EDITOR_SHOWN,
wxEVT_GRID_EDITOR_HIDDEN,
wxEVT_GRID_EDITOR_CREATED,
};
@@ -1759,6 +1777,9 @@ def EVT_GRID_EDITOR_SHOWN(win, fn):
def EVT_GRID_EDITOR_HIDDEN(win, fn):
win.Connect(-1, -1, wxEVT_GRID_EDITOR_HIDDEN, fn)
def EVT_GRID_EDITOR_CREATED(win, fn):
win.Connect(-1, -1, wxEVT_GRID_EDITOR_CREATED, fn)
"
//---------------------------------------------------------------------------

View File

@@ -23,7 +23,6 @@ class TestPanel(wxPanel):
EVT_SET_FOCUS(t1, self.OnSetFocus)
EVT_KILL_FOCUS(t1, self.OnKillFocus)
l2 = wxStaticText(self, -1, "Passsword")
t2 = wxTextCtrl(self, 20, "", size=(125, -1), style=wxTE_PASSWORD)
EVT_TEXT(self, 20, self.EvtText)
@@ -44,7 +43,7 @@ class TestPanel(wxPanel):
t4.SetStyle(44, 47, wxTextAttr("RED", "YELLOW"))
points = t4.GetFont().GetPointSize() # get the current size
f = wxFont(points+2, wxROMAN, wxITALIC, wxBOLD, true)
f = wxFont(points+3, wxROMAN, wxITALIC, wxBOLD, true)
## print 'a1', sys.getrefcount(f)
## t4.SetStyle(63, 77, wxTextAttr("BLUE", font=f))
t4.SetStyle(63, 77, wxTextAttr("BLUE", wxNullColour, f))