various tweaks, fixes, and doodads

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-04-28 06:49:26 +00:00
parent efecda0bf7
commit 647455ee0f
10 changed files with 691 additions and 102 deletions

View File

@@ -130,7 +130,9 @@ enum {
wxSTC_CMD_LINEDELETE,
wxSTC_CMD_LINETRANSPOSE,
wxSTC_CMD_LOWERCASE,
wxSTC_CMD_UPPERCASE
wxSTC_CMD_UPPERCASE,
wxSTC_CMD_LINESCROLLDOWN,
wxSTC_CMD_LINESCROLLUP
};
@@ -253,7 +255,11 @@ public:
int GetLineStartPos(int line);
int GetLineLengthAtPos(int pos);
int GetLineLength(int line);
wxString GetCurrentLineText();
#ifdef SWIG
wxString GetCurrentLineText(int* OUTPUT);
#else
wxString GetCurrentLineText(int* linePos);
#endif
int GetCurrentLine();
int PositionFromPoint(wxPoint pt);
int LineFromPoint(wxPoint pt);
@@ -274,7 +280,10 @@ public:
void EnsureCaretVisible();
void SetCaretPolicy(int policy, int slop=0);
int GetSelectionType();
int GetLinesOnScreen();
bool IsSelectionRectangle();
void SetUseHorizontalScrollBar(bool use);
bool GetUseHorizontalScrollBar();
// Searching
@@ -303,6 +312,8 @@ public:
void StartStyling(int pos, int mask);
void SetStyleFor(int length, int style);
void SetStyleBytes(int length, char* styleBytes);
void SetLineState(int line, int value);
int GetLineState(int line);
// Style Definition
@@ -348,8 +359,15 @@ public:
// Other settings
void SetBufferedDraw(bool isBuffered);
void SetTabWidth(int numChars);
void SetIndent(int numChars);
void SetUseTabs(bool usetabs);
void SetLineIndentation(int line, int indentation);
int GetLineIndentation(int line);
int GetLineIndentationPos(int line);
void SetWordChars(const wxString& wordChars);
void SetUsePop(bool usepopup);
// Brace highlighting
void BraceHighlight(int pos1, int pos2);
@@ -387,7 +405,9 @@ public:
int AutoCompPosAtStart();
void AutoCompComplete();
void AutoCompStopChars(const wxString& stopChars);
void AutoCompSetSeparator(char separator);
char AutoCompGetSeparator();
void AutoCompSelect(const wxString& stringtoselect);
// Call tips
void CallTipShow(int pos, const wxString& text);

View File

@@ -2,6 +2,8 @@
from wxPython.wx import *
from wxPython.stc import *
import keyword
#----------------------------------------------------------------------
demoText = """\
@@ -39,13 +41,17 @@ class PythonSTC(wxStyledTextCtrl):
wxStyledTextCtrl.__init__(self, parent, ID)
self.SetLexer(wxSTC_LEX_PYTHON)
self.SetKeywords(0,
"and assert break class continue def del elif else except "
"exec finally for from global if import in is lambda None "
"not or pass print raise return try while")
self.SetViewWhitespace(false)
self.SetKeywords(0, string.join(keyword.kwlist))
self.SetProperty("fold", "1")
##self.SetProperty("tab.timmy.whinge.level", "4")
self.SetProperty("tab.timmy.whinge.level", "1")
self.SetMargins(0,0)
self.SetViewWhitespace(false)
#self.SetBufferedDraw(false)
self.SetEdgeMode(wxSTC_EDGE_BACKGROUND)
self.SetEdgeColumn(78)
# Setup a margin to hold fold markers
#self.SetFoldFlags(16) ### WHAT IS THIS VALUE? WHAT ARE THE OTHER FLAGS? DOES IT MATTER?
@@ -87,9 +93,9 @@ class PythonSTC(wxStyledTextCtrl):
# Number
self.StyleSetSpec(2, "fore:#007F7F")
# String
self.StyleSetSpec(3, "fore:#7F007F,italics,face:%(times)s" % faces)
self.StyleSetSpec(3, "fore:#7F007F,italic,face:%(times)s" % faces)
# Single quoted string
self.StyleSetSpec(4, "fore:#7F007F,italics,face:%(times)s" % faces)
self.StyleSetSpec(4, "fore:#7F007F,italic,face:%(times)s" % faces)
# Keyword
self.StyleSetSpec(5, "fore:#00007F,bold")
# Triple quotes
@@ -142,6 +148,8 @@ class PythonSTC(wxStyledTextCtrl):
self.BraceBadlight(braceAtCaret)
else:
self.BraceHighlight(braceAtCaret, braceOpposite)
self.SetCurrentPosition(braceOpposite)
self.SetCurrentPosition(caretPos)
def OnMarginClick(self, evt):