Updated Scintilla to 1.52
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -189,6 +189,7 @@
|
|||||||
#define wxSTC_FIND_MATCHCASE 4
|
#define wxSTC_FIND_MATCHCASE 4
|
||||||
#define wxSTC_FIND_WORDSTART 0x00100000
|
#define wxSTC_FIND_WORDSTART 0x00100000
|
||||||
#define wxSTC_FIND_REGEXP 0x00200000
|
#define wxSTC_FIND_REGEXP 0x00200000
|
||||||
|
#define wxSTC_FIND_POSIX 0x00400000
|
||||||
#define wxSTC_FOLDLEVELBASE 0x400
|
#define wxSTC_FOLDLEVELBASE 0x400
|
||||||
#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
|
#define wxSTC_FOLDLEVELWHITEFLAG 0x1000
|
||||||
#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
|
#define wxSTC_FOLDLEVELHEADERFLAG 0x2000
|
||||||
@@ -327,6 +328,7 @@
|
|||||||
#define wxSTC_LEX_FORTRAN 36
|
#define wxSTC_LEX_FORTRAN 36
|
||||||
#define wxSTC_LEX_F77 37
|
#define wxSTC_LEX_F77 37
|
||||||
#define wxSTC_LEX_CSS 38
|
#define wxSTC_LEX_CSS 38
|
||||||
|
#define wxSTC_LEX_POV 39
|
||||||
|
|
||||||
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
// When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||||
// value assigned in sequence from SCLEX_AUTOMATIC+1.
|
// value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||||
@@ -596,6 +598,8 @@
|
|||||||
#define wxSTC_ERR_DIFF_DELETION 12
|
#define wxSTC_ERR_DIFF_DELETION 12
|
||||||
#define wxSTC_ERR_DIFF_MESSAGE 13
|
#define wxSTC_ERR_DIFF_MESSAGE 13
|
||||||
#define wxSTC_ERR_PHP 14
|
#define wxSTC_ERR_PHP 14
|
||||||
|
#define wxSTC_ERR_ELF 15
|
||||||
|
#define wxSTC_ERR_IFC 16
|
||||||
|
|
||||||
// Lexical states for SCLEX_BATCH
|
// Lexical states for SCLEX_BATCH
|
||||||
#define wxSTC_BAT_DEFAULT 0
|
#define wxSTC_BAT_DEFAULT 0
|
||||||
@@ -791,6 +795,21 @@
|
|||||||
#define wxSTC_CSS_ID 10
|
#define wxSTC_CSS_ID 10
|
||||||
#define wxSTC_CSS_IMPORTANT 11
|
#define wxSTC_CSS_IMPORTANT 11
|
||||||
#define wxSTC_CSS_DIRECTIVE 12
|
#define wxSTC_CSS_DIRECTIVE 12
|
||||||
|
#define wxSTC_CSS_DOUBLESTRING 13
|
||||||
|
#define wxSTC_CSS_SINGLESTRING 14
|
||||||
|
|
||||||
|
// Lexical states for SCLEX_POV
|
||||||
|
#define wxSTC_POV_DEFAULT 0
|
||||||
|
#define wxSTC_POV_COMMENT 1
|
||||||
|
#define wxSTC_POV_COMMENTLINE 2
|
||||||
|
#define wxSTC_POV_COMMENTDOC 3
|
||||||
|
#define wxSTC_POV_NUMBER 4
|
||||||
|
#define wxSTC_POV_WORD 5
|
||||||
|
#define wxSTC_POV_STRING 6
|
||||||
|
#define wxSTC_POV_OPERATOR 7
|
||||||
|
#define wxSTC_POV_IDENTIFIER 8
|
||||||
|
#define wxSTC_POV_BRACE 9
|
||||||
|
#define wxSTC_POV_WORD2 10
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
@@ -972,6 +991,18 @@
|
|||||||
// caret position.
|
// caret position.
|
||||||
#define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348
|
#define wxSTC_CMD_LINEENDDISPLAYEXTEND 2348
|
||||||
|
|
||||||
|
// These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
|
||||||
|
// except they behave differently when word-wrap is enabled:
|
||||||
|
// They go first to the start / end of the display line, like (Home|LineEnd)Display
|
||||||
|
// The difference is that, the cursor is already at the point, it goes on to the start
|
||||||
|
// or end of the document line, as appropriate for (Home|LineEnd|VCHome)Extend.
|
||||||
|
#define wxSTC_CMD_HOMEWRAP 2349
|
||||||
|
#define wxSTC_CMD_HOMEWRAPEXTEND 2450
|
||||||
|
#define wxSTC_CMD_LINEENDWRAP 2451
|
||||||
|
#define wxSTC_CMD_LINEENDWRAPEXTEND 2452
|
||||||
|
#define wxSTC_CMD_VCHOMEWRAP 2453
|
||||||
|
#define wxSTC_CMD_VCHOMEWRAPEXTEND 2454
|
||||||
|
|
||||||
// Move to the previous change in capitalisation.
|
// Move to the previous change in capitalisation.
|
||||||
#define wxSTC_CMD_WORDPARTLEFT 2390
|
#define wxSTC_CMD_WORDPARTLEFT 2390
|
||||||
|
|
||||||
@@ -992,6 +1023,12 @@
|
|||||||
// Delete forwards from the current position to the end of the line.
|
// Delete forwards from the current position to the end of the line.
|
||||||
#define wxSTC_CMD_DELLINERIGHT 2396
|
#define wxSTC_CMD_DELLINERIGHT 2396
|
||||||
|
|
||||||
|
// Move caret between paragraphs (delimited by empty lines)
|
||||||
|
#define wxSTC_CMD_PARADOWN 2413
|
||||||
|
#define wxSTC_CMD_PARADOWNEXTEND 2414
|
||||||
|
#define wxSTC_CMD_PARAUP 2415
|
||||||
|
#define wxSTC_CMD_PARAUPEXTEND 2416
|
||||||
|
|
||||||
|
|
||||||
// END of generated section
|
// END of generated section
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
@@ -1256,6 +1293,9 @@ public:
|
|||||||
// Set the character set of the font in a style.
|
// Set the character set of the font in a style.
|
||||||
void StyleSetCharacterSet(int style, int characterSet);
|
void StyleSetCharacterSet(int style, int characterSet);
|
||||||
|
|
||||||
|
// Set a style to be a hotspot or not.
|
||||||
|
void StyleSetHotSpot(int style, bool hotspot);
|
||||||
|
|
||||||
// Set the foreground colour of the selection and whether to use this setting.
|
// Set the foreground colour of the selection and whether to use this setting.
|
||||||
void SetSelForeground(bool useSetting, const wxColour& fore);
|
void SetSelForeground(bool useSetting, const wxColour& fore);
|
||||||
|
|
||||||
@@ -1680,6 +1720,12 @@ public:
|
|||||||
// Set the background colour for the call tip.
|
// Set the background colour for the call tip.
|
||||||
void CallTipSetBackground(const wxColour& back);
|
void CallTipSetBackground(const wxColour& back);
|
||||||
|
|
||||||
|
// Set the foreground colour for the call tip.
|
||||||
|
void CallTipSetForeground(const wxColour& fore);
|
||||||
|
|
||||||
|
// Set the foreground colour for the highlighted part of the call tip.
|
||||||
|
void CallTipSetForegroundHighlight(const wxColour& fore);
|
||||||
|
|
||||||
// Find the display line of a document line taking hidden lines into account.
|
// Find the display line of a document line taking hidden lines into account.
|
||||||
int VisibleFromDocLine(int line);
|
int VisibleFromDocLine(int line);
|
||||||
|
|
||||||
@@ -1807,7 +1853,6 @@ public:
|
|||||||
void TargetFromSelection();
|
void TargetFromSelection();
|
||||||
|
|
||||||
// Join the lines in the target.
|
// Join the lines in the target.
|
||||||
// This is an experimental feature and may be changed or removed.
|
|
||||||
void LinesJoin();
|
void LinesJoin();
|
||||||
|
|
||||||
// Split the lines in the target into lines that are less wide than pixelWidth
|
// Split the lines in the target into lines that are less wide than pixelWidth
|
||||||
@@ -2002,6 +2047,15 @@ public:
|
|||||||
// Is printing line wrapped.
|
// Is printing line wrapped.
|
||||||
int GetPrintWrapMode();
|
int GetPrintWrapMode();
|
||||||
|
|
||||||
|
// Set a fore colour for active hotspots.
|
||||||
|
void SetHotspotActiveForeground(bool useSetting, const wxColour& fore);
|
||||||
|
|
||||||
|
// Set a back colour for active hotspots.
|
||||||
|
void SetHotspotActiveBackground(bool useSetting, const wxColour& back);
|
||||||
|
|
||||||
|
// Enable / Disable underlining active hotspots.
|
||||||
|
void SetHotspotActiveUnderline(bool underline);
|
||||||
|
|
||||||
// Start notifying the container of all key presses and commands.
|
// Start notifying the container of all key presses and commands.
|
||||||
void StartRecord();
|
void StartRecord();
|
||||||
|
|
||||||
@@ -2139,11 +2193,11 @@ private:
|
|||||||
void NotifyChange();
|
void NotifyChange();
|
||||||
void NotifyParent(SCNotification* scn);
|
void NotifyParent(SCNotification* scn);
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_CLASS(wxStyledTextCtrl)
|
DECLARE_CLASS(wxStyledTextCtrl)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
ScintillaWX* m_swx;
|
ScintillaWX* m_swx;
|
||||||
wxStopWatch m_stopWatch;
|
wxStopWatch m_stopWatch;
|
||||||
wxScrollBar* m_vScrollBar;
|
wxScrollBar* m_vScrollBar;
|
||||||
@@ -2262,6 +2316,8 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
BEGIN_DECLARE_EVENT_TYPES()
|
BEGIN_DECLARE_EVENT_TYPES()
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
|
||||||
@@ -2287,6 +2343,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_HOTSPOT_CLICK, 1673)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_HOTSPOT_DCLICK, 1674)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CALLTIP_CLICK, 1675)
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@@ -2313,6 +2372,9 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
wxEVT_STC_ZOOM,
|
wxEVT_STC_ZOOM,
|
||||||
|
wxEVT_STC_HOTSPOT_CLICK,
|
||||||
|
wxEVT_STC_HOTSPOT_DCLICK,
|
||||||
|
wxEVT_STC_CALLTIP_CLICK
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -2344,6 +2406,10 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
|||||||
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -40,7 +40,26 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
// Make an editor class
|
||||||
|
|
||||||
|
class MySTC : public wxStyledTextCtrl
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MySTC(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos = wxDefaultPosition,
|
||||||
|
const wxSize& size = wxDefaultSize, long style = 0);
|
||||||
|
|
||||||
|
void OnKeyPressed(wxKeyEvent& evt);
|
||||||
|
|
||||||
|
private:
|
||||||
|
DECLARE_EVENT_TABLE()
|
||||||
|
};
|
||||||
|
|
||||||
|
BEGIN_EVENT_TABLE(MySTC, wxStyledTextCtrl)
|
||||||
|
EVT_KEY_DOWN(MySTC::OnKeyPressed)
|
||||||
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
// Define a new frame type: this is going to be our main frame
|
// Define a new frame type: this is going to be our main frame
|
||||||
class MyFrame : public wxFrame
|
class MyFrame : public wxFrame
|
||||||
{
|
{
|
||||||
@@ -51,7 +70,7 @@ public:
|
|||||||
void OnAbout(wxCommandEvent& event);
|
void OnAbout(wxCommandEvent& event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxStyledTextCtrl* ed;
|
MySTC* ed;
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -79,7 +98,7 @@ IMPLEMENT_APP(MyApp)
|
|||||||
bool MyApp::OnInit()
|
bool MyApp::OnInit()
|
||||||
{
|
{
|
||||||
MyFrame *frame = new MyFrame(_T("Testing wxStyledTextCtrl"),
|
MyFrame *frame = new MyFrame(_T("Testing wxStyledTextCtrl"),
|
||||||
wxPoint(5, 5), wxSize(400, 600));
|
wxPoint(5, 5), wxSize(600, 600));
|
||||||
|
|
||||||
frame->Show(TRUE);
|
frame->Show(TRUE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -123,59 +142,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
|||||||
|
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
// Setup the editor
|
// Setup the editor
|
||||||
ed = new wxStyledTextCtrl(this, ID_ED);
|
ed = new MySTC(this, ID_ED);
|
||||||
|
|
||||||
// Default font
|
|
||||||
wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL);
|
|
||||||
ed->StyleSetFont(wxSTC_STYLE_DEFAULT, font);
|
|
||||||
ed->StyleClearAll();
|
|
||||||
|
|
||||||
ed->StyleSetForeground(0, wxColour(0x80, 0x80, 0x80));
|
|
||||||
ed->StyleSetForeground(1, wxColour(0x00, 0x7f, 0x00));
|
|
||||||
//ed->StyleSetForeground(2, wxColour(0x00, 0x7f, 0x00));
|
|
||||||
ed->StyleSetForeground(3, wxColour(0x7f, 0x7f, 0x7f));
|
|
||||||
ed->StyleSetForeground(4, wxColour(0x00, 0x7f, 0x7f));
|
|
||||||
ed->StyleSetForeground(5, wxColour(0x00, 0x00, 0x7f));
|
|
||||||
ed->StyleSetForeground(6, wxColour(0x7f, 0x00, 0x7f));
|
|
||||||
ed->StyleSetForeground(7, wxColour(0x7f, 0x00, 0x7f));
|
|
||||||
ed->StyleSetForeground(8, wxColour(0x00, 0x7f, 0x7f));
|
|
||||||
ed->StyleSetForeground(9, wxColour(0x7f, 0x7f, 0x7f));
|
|
||||||
ed->StyleSetForeground(10, wxColour(0x00, 0x00, 0x00));
|
|
||||||
ed->StyleSetForeground(11, wxColour(0x00, 0x00, 0x00));
|
|
||||||
ed->StyleSetBold(5, TRUE);
|
|
||||||
ed->StyleSetBold(10, TRUE);
|
|
||||||
|
|
||||||
#ifdef __WXMSW__
|
|
||||||
ed->StyleSetSpec(2, _T("fore:#007f00,bold,face:Arial,size:9"));
|
|
||||||
#else
|
|
||||||
ed->StyleSetSpec(2, _T("fore:#007f00,bold,face:Helvetica,size:9"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// give it some text to play with
|
|
||||||
wxString st;
|
|
||||||
wxFileInputStream stream(wxT("stctest.cpp"));
|
|
||||||
size_t sz = stream.GetSize();
|
|
||||||
char* buf = new char[sz + 1];
|
|
||||||
stream.Read((void*) buf, stream.GetSize());
|
|
||||||
buf[sz] = 0;
|
|
||||||
st = wxString::FromAscii(buf);
|
|
||||||
delete[] buf;
|
|
||||||
|
|
||||||
ed->InsertText(0, st);
|
|
||||||
ed->EmptyUndoBuffer();
|
|
||||||
|
|
||||||
ed->SetLexer(wxSTC_LEX_CPP);
|
|
||||||
ed->SetKeyWords(0,
|
|
||||||
_T("asm auto bool break case catch char class const \
|
|
||||||
const_cast continue default delete do double \
|
|
||||||
dynamic_cast else enum explicit export extern \
|
|
||||||
false float for friend goto if inline int long \
|
|
||||||
mutable namespace new operator private protected \
|
|
||||||
public register reinterpret_cast return short signed \
|
|
||||||
sizeof static static_cast struct switch template this \
|
|
||||||
throw true try typedef typeid typename union unsigned \
|
|
||||||
using virtual void volatile wchar_t while"));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -194,3 +161,94 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
wxMessageBox(msg, _T("About This Test"), wxOK | wxICON_INFORMATION, this);
|
wxMessageBox(msg, _T("About This Test"), wxOK | wxICON_INFORMATION, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
wxChar* keywords =
|
||||||
|
_T("asm auto bool break case catch char class const \
|
||||||
|
const_cast continue default delete do double \
|
||||||
|
dynamic_cast else enum explicit export extern \
|
||||||
|
false float for friend goto if inline int long \
|
||||||
|
mutable namespace new operator private protected \
|
||||||
|
public register reinterpret_cast return short signed \
|
||||||
|
sizeof static static_cast struct switch template this \
|
||||||
|
throw true try typedef typeid typename union unsigned \
|
||||||
|
using virtual void volatile wchar_t while");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
MySTC::MySTC(wxWindow *parent, wxWindowID id,
|
||||||
|
const wxPoint& pos, const wxSize& size,
|
||||||
|
long style)
|
||||||
|
: wxStyledTextCtrl(parent, id, pos, size, style)
|
||||||
|
{
|
||||||
|
// Default font
|
||||||
|
wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL);
|
||||||
|
StyleSetFont(wxSTC_STYLE_DEFAULT, font);
|
||||||
|
StyleClearAll();
|
||||||
|
|
||||||
|
StyleSetForeground(0, wxColour(0x80, 0x80, 0x80));
|
||||||
|
StyleSetForeground(1, wxColour(0x00, 0x7f, 0x00));
|
||||||
|
//StyleSetForeground(2, wxColour(0x00, 0x7f, 0x00));
|
||||||
|
StyleSetForeground(3, wxColour(0x7f, 0x7f, 0x7f));
|
||||||
|
StyleSetForeground(4, wxColour(0x00, 0x7f, 0x7f));
|
||||||
|
StyleSetForeground(5, wxColour(0x00, 0x00, 0x7f));
|
||||||
|
StyleSetForeground(6, wxColour(0x7f, 0x00, 0x7f));
|
||||||
|
StyleSetForeground(7, wxColour(0x7f, 0x00, 0x7f));
|
||||||
|
StyleSetForeground(8, wxColour(0x00, 0x7f, 0x7f));
|
||||||
|
StyleSetForeground(9, wxColour(0x7f, 0x7f, 0x7f));
|
||||||
|
StyleSetForeground(10, wxColour(0x00, 0x00, 0x00));
|
||||||
|
StyleSetForeground(11, wxColour(0x00, 0x00, 0x00));
|
||||||
|
StyleSetBold(5, TRUE);
|
||||||
|
StyleSetBold(10, TRUE);
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
StyleSetSpec(2, _T("fore:#007f00,bold,face:Arial,size:9"));
|
||||||
|
#else
|
||||||
|
StyleSetSpec(2, _T("fore:#007f00,bold,face:Helvetica,size:9"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// give it some text to play with
|
||||||
|
wxString st;
|
||||||
|
wxFileInputStream stream(wxT("stctest.cpp"));
|
||||||
|
size_t sz = stream.GetSize();
|
||||||
|
char* buf = new char[sz + 1];
|
||||||
|
stream.Read((void*) buf, stream.GetSize());
|
||||||
|
buf[sz] = 0;
|
||||||
|
st = wxString::FromAscii(buf);
|
||||||
|
delete[] buf;
|
||||||
|
|
||||||
|
InsertText(0, st);
|
||||||
|
EmptyUndoBuffer();
|
||||||
|
|
||||||
|
SetLexer(wxSTC_LEX_CPP);
|
||||||
|
SetKeyWords(0, keywords);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MySTC::OnKeyPressed(wxKeyEvent& evt)
|
||||||
|
{
|
||||||
|
if (CallTipActive())
|
||||||
|
CallTipCancel();
|
||||||
|
|
||||||
|
int key = evt.GetKeyCode();
|
||||||
|
if ( key == WXK_SPACE && evt.ControlDown()) {
|
||||||
|
int pos = GetCurrentPos();
|
||||||
|
|
||||||
|
if (evt.ShiftDown()) {
|
||||||
|
// show how to do CallTips
|
||||||
|
CallTipSetBackground(wxColour(_T("YELLOW")));
|
||||||
|
CallTipShow(pos, _T("lots of of text: blah, blah, blah\n\n"
|
||||||
|
"show some suff, maybe parameters..\n\n"
|
||||||
|
"fubar(param1, param2)"));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// show how to do AutoComplete
|
||||||
|
AutoCompSetIgnoreCase(false);
|
||||||
|
AutoCompShow(0, keywords); // reuse the keyword list here
|
||||||
|
// normally you would build a string of completion texts...
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
evt.Skip();
|
||||||
|
}
|
||||||
|
@@ -49,6 +49,7 @@ OBJECTS=PlatWX.o ScintillaWX.o stc.o \
|
|||||||
LexLisp.o \
|
LexLisp.o \
|
||||||
LexLua.o \
|
LexLua.o \
|
||||||
LexOthers.o \
|
LexOthers.o \
|
||||||
|
LexPOV.o \
|
||||||
LexPascal.o \
|
LexPascal.o \
|
||||||
LexPerl.o \
|
LexPerl.o \
|
||||||
LexPython.o \
|
LexPython.o \
|
||||||
|
@@ -216,9 +216,9 @@ public:
|
|||||||
SurfaceImpl();
|
SurfaceImpl();
|
||||||
~SurfaceImpl();
|
~SurfaceImpl();
|
||||||
|
|
||||||
virtual void Init();
|
virtual void Init(WindowID wid);
|
||||||
virtual void Init(SurfaceID sid);
|
virtual void Init(SurfaceID sid, WindowID wid);
|
||||||
virtual void InitPixMap(int width, int height, Surface *surface_);
|
virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid);
|
||||||
|
|
||||||
virtual void Release();
|
virtual void Release();
|
||||||
virtual bool Initialised();
|
virtual bool Initialised();
|
||||||
@@ -270,7 +270,7 @@ SurfaceImpl::~SurfaceImpl() {
|
|||||||
Release();
|
Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceImpl::Init() {
|
void SurfaceImpl::Init(WindowID wid) {
|
||||||
#if 0
|
#if 0
|
||||||
Release();
|
Release();
|
||||||
hdc = new wxMemoryDC();
|
hdc = new wxMemoryDC();
|
||||||
@@ -279,16 +279,16 @@ void SurfaceImpl::Init() {
|
|||||||
// On Mac and GTK the DC is not really valid until it has a bitmap
|
// On Mac and GTK the DC is not really valid until it has a bitmap
|
||||||
// selected into it. So instead of just creating the DC with no bitmap,
|
// selected into it. So instead of just creating the DC with no bitmap,
|
||||||
// go ahead and give it one.
|
// go ahead and give it one.
|
||||||
InitPixMap(1,1,NULL);
|
InitPixMap(1,1,NULL,wid);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceImpl::Init(SurfaceID hdc_) {
|
void SurfaceImpl::Init(SurfaceID hdc_, WindowID) {
|
||||||
Release();
|
Release();
|
||||||
hdc = (wxDC*)hdc_;
|
hdc = (wxDC*)hdc_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_) {
|
void SurfaceImpl::InitPixMap(int width, int height, Surface *surface_, WindowID) {
|
||||||
Release();
|
Release();
|
||||||
hdc = new wxMemoryDC();
|
hdc = new wxMemoryDC();
|
||||||
hdcOwned = true;
|
hdcOwned = true;
|
||||||
@@ -615,6 +615,7 @@ bool Window::HasFocus() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRectangle Window::GetPosition() {
|
PRectangle Window::GetPosition() {
|
||||||
|
if (! id) return PRectangle();
|
||||||
wxRect rc(GETWIN(id)->GetPosition(), GETWIN(id)->GetSize());
|
wxRect rc(GETWIN(id)->GetPosition(), GETWIN(id)->GetSize());
|
||||||
return PRectangleFromwxRect(rc);
|
return PRectangleFromwxRect(rc);
|
||||||
}
|
}
|
||||||
@@ -629,6 +630,7 @@ void Window::SetPositionRelative(PRectangle rc, Window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PRectangle Window::GetClientPosition() {
|
PRectangle Window::GetClientPosition() {
|
||||||
|
if (! id) return PRectangle();
|
||||||
wxSize sz = GETWIN(id)->GetClientSize();
|
wxSize sz = GETWIN(id)->GetClientSize();
|
||||||
return PRectangle(0, 0, sz.x, sz.y);
|
return PRectangle(0, 0, sz.x, sz.y);
|
||||||
}
|
}
|
||||||
@@ -677,6 +679,8 @@ void Window::SetCursor(Cursor curs) {
|
|||||||
case cursorReverseArrow:
|
case cursorReverseArrow:
|
||||||
cursorId = wxCURSOR_RIGHT_ARROW;
|
cursorId = wxCURSOR_RIGHT_ARROW;
|
||||||
break;
|
break;
|
||||||
|
case cursorHand:
|
||||||
|
cursorId = wxCURSOR_HAND;
|
||||||
default:
|
default:
|
||||||
cursorId = wxCURSOR_ARROW;
|
cursorId = wxCURSOR_ARROW;
|
||||||
break;
|
break;
|
||||||
@@ -736,7 +740,7 @@ public:
|
|||||||
wxWindow(parent, id, wxDefaultPosition, wxSize(0,0), wxNO_BORDER )
|
wxWindow(parent, id, wxDefaultPosition, wxSize(0,0), wxNO_BORDER )
|
||||||
{
|
{
|
||||||
|
|
||||||
SetBackgroundColour(*wxBLUE);
|
SetBackgroundColour(*wxBLACK);
|
||||||
lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize,
|
lv = new wxSTCListBox(this, id, wxDefaultPosition, wxDefaultSize,
|
||||||
wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxNO_BORDER);
|
wxLC_REPORT | wxLC_SINGLE_SEL | wxLC_NO_HEADER | wxNO_BORDER);
|
||||||
lv->SetCursor(wxCursor(wxCURSOR_ARROW));
|
lv->SetCursor(wxCursor(wxCURSOR_ARROW));
|
||||||
@@ -768,9 +772,10 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnSize(wxSizeEvent& event) {
|
void OnSize(wxSizeEvent& event) {
|
||||||
// reset the column widths
|
// resize the child, leaving a 1 pixel border
|
||||||
wxSize sz = GetClientSize();
|
wxSize sz = GetClientSize();
|
||||||
lv->SetSize(1, 1, sz.x-2, sz.y-2);
|
lv->SetSize(1, 1, sz.x-2, sz.y-2);
|
||||||
|
// reset the column widths
|
||||||
lv->SetColumnWidth(0, IconWidth()+4);
|
lv->SetColumnWidth(0, IconWidth()+4);
|
||||||
lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) -
|
lv->SetColumnWidth(1, sz.x - 2 - lv->GetColumnWidth(0) -
|
||||||
wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
|
wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
|
||||||
@@ -1090,6 +1095,9 @@ unsigned int Platform::DoubleClickTime() {
|
|||||||
return 500; // **** ::GetDoubleClickTime();
|
return 500; // **** ::GetDoubleClickTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Platform::MouseButtonBounce() {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
void Platform::DebugDisplay(const char *s) {
|
void Platform::DebugDisplay(const char *s) {
|
||||||
wxLogDebug(stc2wx(s));
|
wxLogDebug(stc2wx(s));
|
||||||
}
|
}
|
||||||
|
@@ -72,21 +72,23 @@ void wxSTCDropTarget::OnLeave() {
|
|||||||
|
|
||||||
class wxSTCCallTip : public wxSTCCallTipBase {
|
class wxSTCCallTip : public wxSTCCallTipBase {
|
||||||
public:
|
public:
|
||||||
wxSTCCallTip(wxWindow* parent, CallTip* ct)
|
wxSTCCallTip(wxWindow* parent, CallTip* ct, ScintillaWX* swx)
|
||||||
: wxSTCCallTipBase(parent, param2)
|
: wxSTCCallTipBase(parent, param2),
|
||||||
|
m_ct(ct), m_swx(swx)
|
||||||
{
|
{
|
||||||
m_ct = ct;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~wxSTCCallTip() {
|
~wxSTCCallTip() {
|
||||||
if (HasCapture()) ReleaseMouse();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AcceptsFocus() const { return FALSE; }
|
||||||
|
|
||||||
void OnPaint(wxPaintEvent& evt) {
|
void OnPaint(wxPaintEvent& evt) {
|
||||||
wxPaintDC dc(this);
|
wxPaintDC dc(this);
|
||||||
Surface* surfaceWindow = Surface::Allocate();
|
Surface* surfaceWindow = Surface::Allocate();
|
||||||
surfaceWindow->Init(&dc);
|
surfaceWindow->Init(&dc, m_ct->wDraw.GetID());
|
||||||
m_ct->PaintCT(surfaceWindow);
|
m_ct->PaintCT(surfaceWindow);
|
||||||
|
surfaceWindow->Release();
|
||||||
delete surfaceWindow;
|
delete surfaceWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -95,6 +97,13 @@ public:
|
|||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OnLeftDown(wxMouseEvent& event) {
|
||||||
|
wxPoint pt = event.GetPosition();
|
||||||
|
Point p(pt.x, pt.y);
|
||||||
|
m_ct->MouseClick(p);
|
||||||
|
m_swx->CallTipClick();
|
||||||
|
}
|
||||||
|
|
||||||
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
|
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
|
||||||
virtual void DoSetSize(int x, int y,
|
virtual void DoSetSize(int x, int y,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
@@ -105,32 +114,18 @@ public:
|
|||||||
GetParent()->ClientToScreen(NULL, &y);
|
GetParent()->ClientToScreen(NULL, &y);
|
||||||
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
|
wxSTCCallTipBase::DoSetSize(x, y, width, height, sizeFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual bool Show( bool show = TRUE ) {
|
|
||||||
bool retval = wxSTCCallTipBase::Show(show);
|
|
||||||
if (show)
|
|
||||||
CaptureMouse();
|
|
||||||
else
|
|
||||||
if (HasCapture()) ReleaseMouse();
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnLeftDown(wxMouseEvent& ) {
|
|
||||||
Show(FALSE);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CallTip* m_ct;
|
CallTip* m_ct;
|
||||||
|
ScintillaWX* m_swx;
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase)
|
BEGIN_EVENT_TABLE(wxSTCCallTip, wxSTCCallTipBase)
|
||||||
EVT_PAINT(wxSTCCallTip::OnPaint)
|
EVT_PAINT(wxSTCCallTip::OnPaint)
|
||||||
EVT_SET_FOCUS(wxSTCCallTip::OnFocus)
|
EVT_SET_FOCUS(wxSTCCallTip::OnFocus)
|
||||||
#if wxUSE_POPUPWIN && wxSTC_USE_POPUP
|
|
||||||
EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown)
|
EVT_LEFT_DOWN(wxSTCCallTip::OnLeftDown)
|
||||||
#endif
|
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -389,8 +384,10 @@ bool ScintillaWX::CanPaste() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
void ScintillaWX::CreateCallTipWindow(PRectangle) {
|
||||||
ct.wCallTip = new wxSTCCallTip(stc, &ct);
|
if (! ct.wCallTip.Created() ) {
|
||||||
|
ct.wCallTip = new wxSTCCallTip(stc, &ct, this);
|
||||||
ct.wDraw = ct.wCallTip;
|
ct.wDraw = ct.wCallTip;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -441,15 +438,16 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
|
|||||||
// because of the little tweak that needs done below for wxGTK.
|
// because of the little tweak that needs done below for wxGTK.
|
||||||
// When updating new versions double check that this is still
|
// When updating new versions double check that this is still
|
||||||
// needed, and that any new code there is copied here too.
|
// needed, and that any new code there is copied here too.
|
||||||
AutoCompleteCancel();
|
|
||||||
if (!ct.wCallTip.Created()) {
|
|
||||||
Point pt = LocationFromPosition(wParam);
|
Point pt = LocationFromPosition(wParam);
|
||||||
|
char* defn = reinterpret_cast<char *>(lParam);
|
||||||
|
AutoCompleteCancel();
|
||||||
pt.y += vs.lineHeight;
|
pt.y += vs.lineHeight;
|
||||||
PRectangle rc = ct.CallTipStart(currentPos, pt,
|
PRectangle rc = ct.CallTipStart(currentPos, pt,
|
||||||
reinterpret_cast<char *>(lParam),
|
defn,
|
||||||
vs.styles[STYLE_DEFAULT].fontName,
|
vs.styles[STYLE_DEFAULT].fontName,
|
||||||
vs.styles[STYLE_DEFAULT].sizeZoomed,
|
vs.styles[STYLE_DEFAULT].sizeZoomed,
|
||||||
IsUnicodeMode());
|
IsUnicodeMode(),
|
||||||
|
wMain);
|
||||||
// If the call-tip window would be out of the client
|
// If the call-tip window would be out of the client
|
||||||
// space, adjust so it displays above the text.
|
// space, adjust so it displays above the text.
|
||||||
PRectangle rcClient = GetClientRectangle();
|
PRectangle rcClient = GetClientRectangle();
|
||||||
@@ -466,7 +464,6 @@ long ScintillaWX::WndProc(unsigned int iMessage, unsigned long wParam, long lPar
|
|||||||
CreateCallTipWindow(rc);
|
CreateCallTipWindow(rc);
|
||||||
ct.wCallTip.SetPositionRelative(rc, wMain);
|
ct.wCallTip.SetPositionRelative(rc, wMain);
|
||||||
ct.wCallTip.Show();
|
ct.wCallTip.Show();
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,7 +482,7 @@ void ScintillaWX::DoPaint(wxDC* dc, wxRect rect) {
|
|||||||
|
|
||||||
paintState = painting;
|
paintState = painting;
|
||||||
Surface* surfaceWindow = Surface::Allocate();
|
Surface* surfaceWindow = Surface::Allocate();
|
||||||
surfaceWindow->Init(dc);
|
surfaceWindow->Init(dc, wMain.GetID());
|
||||||
rcPaint = PRectangleFromwxRect(rect);
|
rcPaint = PRectangleFromwxRect(rect);
|
||||||
PRectangle rcClient = GetClientRectangle();
|
PRectangle rcClient = GetClientRectangle();
|
||||||
paintingAllText = rcPaint.Contains(rcClient);
|
paintingAllText = rcPaint.Contains(rcClient);
|
||||||
@@ -781,7 +778,7 @@ void ScintillaWX::FullPaint() {
|
|||||||
paintingAllText = true;
|
paintingAllText = true;
|
||||||
wxClientDC dc(stc);
|
wxClientDC dc(stc);
|
||||||
Surface* surfaceWindow = Surface::Allocate();
|
Surface* surfaceWindow = Surface::Allocate();
|
||||||
surfaceWindow->Init(&dc);
|
surfaceWindow->Init(&dc, wMain.GetID());
|
||||||
|
|
||||||
dc.BeginDrawing();
|
dc.BeginDrawing();
|
||||||
ClipChildren(dc, rcPaint);
|
ClipChildren(dc, rcPaint);
|
||||||
|
@@ -161,6 +161,9 @@ private:
|
|||||||
wxDragResult dragResult;
|
wxDragResult dragResult;
|
||||||
#endif
|
#endif
|
||||||
int wheelRotation;
|
int wheelRotation;
|
||||||
|
|
||||||
|
|
||||||
|
friend class wxSTCCallTip;
|
||||||
};
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -342,6 +342,10 @@ SOURCE=.\scintilla\src\LexOthers.cxx
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\scintilla\src\LexPOV.cxx
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\scintilla\src\LexPascal.cxx
|
SOURCE=.\scintilla\src\LexPascal.cxx
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -43,6 +43,8 @@ cmdValues = [ (2300, 2349),
|
|||||||
(2390, 2393),
|
(2390, 2393),
|
||||||
(2395, 2396),
|
(2395, 2396),
|
||||||
2404,
|
2404,
|
||||||
|
(2413, 2416),
|
||||||
|
(2450, 2454),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@@ -456,6 +458,11 @@ methodOverrideMap = {
|
|||||||
'CallTipPosStart' : ('CallTipPosAtStart', 0, 0, 0),
|
'CallTipPosStart' : ('CallTipPosAtStart', 0, 0, 0),
|
||||||
'CallTipSetHlt' : ('CallTipSetHighlight', 0, 0, 0),
|
'CallTipSetHlt' : ('CallTipSetHighlight', 0, 0, 0),
|
||||||
'CallTipSetBack' : ('CallTipSetBackground', 0, 0, 0),
|
'CallTipSetBack' : ('CallTipSetBackground', 0, 0, 0),
|
||||||
|
'CallTipSetFore' : ('CallTipSetForeground', 0, 0, 0),
|
||||||
|
'CallTipSetForeHlt' : ('CallTipSetForegroundHighlight', 0, 0, 0),
|
||||||
|
|
||||||
|
'SetHotspotActiveFore' : ('SetHotspotActiveForeground', 0, 0, 0),
|
||||||
|
'SetHotspotActiveBack' : ('SetHotspotActiveBackground', 0, 0, 0),
|
||||||
|
|
||||||
|
|
||||||
'ReplaceTarget' :
|
'ReplaceTarget' :
|
||||||
@@ -544,6 +551,9 @@ methodOverrideMap = {
|
|||||||
'GetFocus' : ('GetSTCFocus', 0, 0, 0),
|
'GetFocus' : ('GetSTCFocus', 0, 0, 0),
|
||||||
|
|
||||||
|
|
||||||
|
'LoadLexerLibrary' : (None, 0,0,0),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Remove all methods that are key commands since they can be
|
# Remove all methods that are key commands since they can be
|
||||||
# executed with CmdKeyExecute
|
# executed with CmdKeyExecute
|
||||||
@@ -592,7 +602,16 @@ methodOverrideMap = {
|
|||||||
'LineScrollDown' : (None, 0, 0, 0),
|
'LineScrollDown' : (None, 0, 0, 0),
|
||||||
'LineScrollUp' : (None, 0, 0, 0),
|
'LineScrollUp' : (None, 0, 0, 0),
|
||||||
'DeleteBackNotLine' : (None, 0, 0, 0),
|
'DeleteBackNotLine' : (None, 0, 0, 0),
|
||||||
|
'HomeWrap' : (None, 0, 0, 0),
|
||||||
|
'HomeWrapExtend' : (None, 0, 0, 0),
|
||||||
|
'LineEndWrap' : (None, 0, 0, 0),
|
||||||
|
'LineEndWrapExtend' : (None, 0, 0, 0),
|
||||||
|
'VCHomeWrap' : (None, 0, 0, 0),
|
||||||
|
'VCHomeWrapExtend' : (None, 0, 0, 0),
|
||||||
|
'ParaDown' : (None, 0, 0, 0),
|
||||||
|
'ParaDownExtend' : (None, 0, 0, 0),
|
||||||
|
'ParaUp' : (None, 0, 0, 0),
|
||||||
|
'ParaUpExtend' : (None, 0, 0, 0),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -48,6 +48,7 @@ OBJECTS = \
|
|||||||
LexLisp.obj \
|
LexLisp.obj \
|
||||||
LexLua.obj \
|
LexLua.obj \
|
||||||
LexOthers.obj \
|
LexOthers.obj \
|
||||||
|
LexPOV.obj \
|
||||||
LexPascal.obj \
|
LexPascal.obj \
|
||||||
LexPerl.obj \
|
LexPerl.obj \
|
||||||
LexPython.obj \
|
LexPython.obj \
|
||||||
|
@@ -36,6 +36,7 @@ OBJECTS = \
|
|||||||
$(S)/LexLisp.$(OBJSUFF) \
|
$(S)/LexLisp.$(OBJSUFF) \
|
||||||
$(S)/LexLua.$(OBJSUFF) \
|
$(S)/LexLua.$(OBJSUFF) \
|
||||||
$(S)/LexOthers.$(OBJSUFF) \
|
$(S)/LexOthers.$(OBJSUFF) \
|
||||||
|
$(S)/LexPOV.$(OBJSUFF) \
|
||||||
$(S)/LexPascal.$(OBJSUFF) \
|
$(S)/LexPascal.$(OBJSUFF) \
|
||||||
$(S)/LexPerl.$(OBJSUFF) \
|
$(S)/LexPerl.$(OBJSUFF) \
|
||||||
$(S)/LexPython.$(OBJSUFF) \
|
$(S)/LexPython.$(OBJSUFF) \
|
||||||
|
@@ -41,6 +41,7 @@ OBJECTS = \
|
|||||||
$(D)\LexLisp.obj \
|
$(D)\LexLisp.obj \
|
||||||
$(D)\LexLua.obj \
|
$(D)\LexLua.obj \
|
||||||
$(D)\LexOthers.obj \
|
$(D)\LexOthers.obj \
|
||||||
|
$(D)\LexPOV.obj \
|
||||||
$(D)\LexPascal.obj \
|
$(D)\LexPascal.obj \
|
||||||
$(D)\LexPerl.obj \
|
$(D)\LexPerl.obj \
|
||||||
$(D)\LexPython.obj \
|
$(D)\LexPython.obj \
|
||||||
|
@@ -45,6 +45,7 @@ OBJECTS = &
|
|||||||
LexLisp.obj &
|
LexLisp.obj &
|
||||||
LexLua.obj &
|
LexLua.obj &
|
||||||
LexOthers.obj &
|
LexOthers.obj &
|
||||||
|
LexPOV.obj &
|
||||||
LexPascal.obj &
|
LexPascal.obj &
|
||||||
LexPerl.obj &
|
LexPerl.obj &
|
||||||
LexPython.obj &
|
LexPython.obj &
|
||||||
|
20
contrib/src/stc/scintilla/License.txt
Normal file
20
contrib/src/stc/scintilla/License.txt
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
License for Scintilla and SciTE
|
||||||
|
|
||||||
|
Copyright 1998-2003 by Neil Hodgson <neilh@scintilla.org>
|
||||||
|
|
||||||
|
All Rights Reserved
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software and its
|
||||||
|
documentation for any purpose and without fee is hereby granted,
|
||||||
|
provided that the above copyright notice appear in all copies and that
|
||||||
|
both that copyright notice and this permission notice appear in
|
||||||
|
supporting documentation.
|
||||||
|
|
||||||
|
NEIL HODGSON DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
|
||||||
|
SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||||
|
AND FITNESS, IN NO EVENT SHALL NEIL HODGSON BE LIABLE FOR ANY
|
||||||
|
SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||||
|
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
|
||||||
|
OR PERFORMANCE OF THIS SOFTWARE.
|
@@ -3,4 +3,4 @@ scintilla/include directories from the Scintilla/SCiTE source
|
|||||||
distribution. All other code needed to implement Scintilla on top of
|
distribution. All other code needed to implement Scintilla on top of
|
||||||
wxWindows is located in the directory above this one.
|
wxWindows is located in the directory above this one.
|
||||||
|
|
||||||
The current version of the Scintilla code is 1.51
|
The current version of the Scintilla code is 1.52
|
||||||
|
@@ -109,6 +109,12 @@ public:
|
|||||||
return (right > other.left) && (left < other.right) &&
|
return (right > other.left) && (left < other.right) &&
|
||||||
(bottom > other.top) && (top < other.bottom);
|
(bottom > other.top) && (top < other.bottom);
|
||||||
}
|
}
|
||||||
|
void Move(int xDelta, int yDelta) {
|
||||||
|
left += xDelta;
|
||||||
|
top += yDelta;
|
||||||
|
right += xDelta;
|
||||||
|
bottom += yDelta;
|
||||||
|
}
|
||||||
int Width() { return right - left; }
|
int Width() { return right - left; }
|
||||||
int Height() { return bottom - top; }
|
int Height() { return bottom - top; }
|
||||||
};
|
};
|
||||||
@@ -299,9 +305,9 @@ public:
|
|||||||
virtual ~Surface() {};
|
virtual ~Surface() {};
|
||||||
static Surface *Allocate();
|
static Surface *Allocate();
|
||||||
|
|
||||||
virtual void Init()=0;
|
virtual void Init(WindowID wid)=0;
|
||||||
virtual void Init(SurfaceID sid)=0;
|
virtual void Init(SurfaceID sid, WindowID wid)=0;
|
||||||
virtual void InitPixMap(int width, int height, Surface *surface_)=0;
|
virtual void InitPixMap(int width, int height, Surface *surface_, WindowID wid)=0;
|
||||||
|
|
||||||
virtual void Release()=0;
|
virtual void Release()=0;
|
||||||
virtual bool Initialised()=0;
|
virtual bool Initialised()=0;
|
||||||
@@ -371,7 +377,7 @@ public:
|
|||||||
void InvalidateAll();
|
void InvalidateAll();
|
||||||
void InvalidateRectangle(PRectangle rc);
|
void InvalidateRectangle(PRectangle rc);
|
||||||
virtual void SetFont(Font &font);
|
virtual void SetFont(Font &font);
|
||||||
enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow };
|
enum Cursor { cursorInvalid, cursorText, cursorArrow, cursorUp, cursorWait, cursorHoriz, cursorVert, cursorReverseArrow, cursorHand };
|
||||||
void SetCursor(Cursor curs);
|
void SetCursor(Cursor curs);
|
||||||
void SetTitle(const char *s);
|
void SetTitle(const char *s);
|
||||||
private:
|
private:
|
||||||
@@ -446,6 +452,7 @@ public:
|
|||||||
static const char *DefaultFont();
|
static const char *DefaultFont();
|
||||||
static int DefaultFontSize();
|
static int DefaultFontSize();
|
||||||
static unsigned int DoubleClickTime();
|
static unsigned int DoubleClickTime();
|
||||||
|
static bool MouseButtonBounce();
|
||||||
static void DebugDisplay(const char *s);
|
static void DebugDisplay(const char *s);
|
||||||
static bool IsKeyDown(int key);
|
static bool IsKeyDown(int key);
|
||||||
static long SendScintilla(
|
static long SendScintilla(
|
||||||
|
@@ -53,6 +53,7 @@
|
|||||||
#define SCLEX_FORTRAN 36
|
#define SCLEX_FORTRAN 36
|
||||||
#define SCLEX_F77 37
|
#define SCLEX_F77 37
|
||||||
#define SCLEX_CSS 38
|
#define SCLEX_CSS 38
|
||||||
|
#define SCLEX_POV 39
|
||||||
#define SCLEX_AUTOMATIC 1000
|
#define SCLEX_AUTOMATIC 1000
|
||||||
#define SCE_P_DEFAULT 0
|
#define SCE_P_DEFAULT 0
|
||||||
#define SCE_P_COMMENTLINE 1
|
#define SCE_P_COMMENTLINE 1
|
||||||
@@ -279,6 +280,8 @@
|
|||||||
#define SCE_ERR_DIFF_DELETION 12
|
#define SCE_ERR_DIFF_DELETION 12
|
||||||
#define SCE_ERR_DIFF_MESSAGE 13
|
#define SCE_ERR_DIFF_MESSAGE 13
|
||||||
#define SCE_ERR_PHP 14
|
#define SCE_ERR_PHP 14
|
||||||
|
#define SCE_ERR_ELF 15
|
||||||
|
#define SCE_ERR_IFC 16
|
||||||
#define SCE_BAT_DEFAULT 0
|
#define SCE_BAT_DEFAULT 0
|
||||||
#define SCE_BAT_COMMENT 1
|
#define SCE_BAT_COMMENT 1
|
||||||
#define SCE_BAT_WORD 2
|
#define SCE_BAT_WORD 2
|
||||||
@@ -444,6 +447,19 @@
|
|||||||
#define SCE_CSS_ID 10
|
#define SCE_CSS_ID 10
|
||||||
#define SCE_CSS_IMPORTANT 11
|
#define SCE_CSS_IMPORTANT 11
|
||||||
#define SCE_CSS_DIRECTIVE 12
|
#define SCE_CSS_DIRECTIVE 12
|
||||||
|
#define SCE_CSS_DOUBLESTRING 13
|
||||||
|
#define SCE_CSS_SINGLESTRING 14
|
||||||
|
#define SCE_POV_DEFAULT 0
|
||||||
|
#define SCE_POV_COMMENT 1
|
||||||
|
#define SCE_POV_COMMENTLINE 2
|
||||||
|
#define SCE_POV_COMMENTDOC 3
|
||||||
|
#define SCE_POV_NUMBER 4
|
||||||
|
#define SCE_POV_WORD 5
|
||||||
|
#define SCE_POV_STRING 6
|
||||||
|
#define SCE_POV_OPERATOR 7
|
||||||
|
#define SCE_POV_IDENTIFIER 8
|
||||||
|
#define SCE_POV_BRACE 9
|
||||||
|
#define SCE_POV_WORD2 10
|
||||||
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -184,6 +184,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SC_CASE_LOWER 2
|
#define SC_CASE_LOWER 2
|
||||||
#define SCI_STYLESETCASE 2060
|
#define SCI_STYLESETCASE 2060
|
||||||
#define SCI_STYLESETCHARACTERSET 2066
|
#define SCI_STYLESETCHARACTERSET 2066
|
||||||
|
#define SCI_STYLESETHOTSPOT 2409
|
||||||
#define SCI_SETSELFORE 2067
|
#define SCI_SETSELFORE 2067
|
||||||
#define SCI_SETSELBACK 2068
|
#define SCI_SETSELBACK 2068
|
||||||
#define SCI_SETCARETFORE 2069
|
#define SCI_SETCARETFORE 2069
|
||||||
@@ -285,6 +286,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCFIND_MATCHCASE 4
|
#define SCFIND_MATCHCASE 4
|
||||||
#define SCFIND_WORDSTART 0x00100000
|
#define SCFIND_WORDSTART 0x00100000
|
||||||
#define SCFIND_REGEXP 0x00200000
|
#define SCFIND_REGEXP 0x00200000
|
||||||
|
#define SCFIND_POSIX 0x00400000
|
||||||
#define SCI_FINDTEXT 2150
|
#define SCI_FINDTEXT 2150
|
||||||
#define SCI_FORMATRANGE 2151
|
#define SCI_FORMATRANGE 2151
|
||||||
#define SCI_GETFIRSTVISIBLELINE 2152
|
#define SCI_GETFIRSTVISIBLELINE 2152
|
||||||
@@ -340,6 +342,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_CALLTIPPOSSTART 2203
|
#define SCI_CALLTIPPOSSTART 2203
|
||||||
#define SCI_CALLTIPSETHLT 2204
|
#define SCI_CALLTIPSETHLT 2204
|
||||||
#define SCI_CALLTIPSETBACK 2205
|
#define SCI_CALLTIPSETBACK 2205
|
||||||
|
#define SCI_CALLTIPSETFORE 2206
|
||||||
|
#define SCI_CALLTIPSETFOREHLT 2207
|
||||||
#define SCI_VISIBLEFROMDOCLINE 2220
|
#define SCI_VISIBLEFROMDOCLINE 2220
|
||||||
#define SCI_DOCLINEFROMVISIBLE 2221
|
#define SCI_DOCLINEFROMVISIBLE 2221
|
||||||
#define SC_FOLDLEVELBASE 0x400
|
#define SC_FOLDLEVELBASE 0x400
|
||||||
@@ -454,6 +458,12 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_HOMEDISPLAYEXTEND 2346
|
#define SCI_HOMEDISPLAYEXTEND 2346
|
||||||
#define SCI_LINEENDDISPLAY 2347
|
#define SCI_LINEENDDISPLAY 2347
|
||||||
#define SCI_LINEENDDISPLAYEXTEND 2348
|
#define SCI_LINEENDDISPLAYEXTEND 2348
|
||||||
|
#define SCI_HOMEWRAP 2349
|
||||||
|
#define SCI_HOMEWRAPEXTEND 2450
|
||||||
|
#define SCI_LINEENDWRAP 2451
|
||||||
|
#define SCI_LINEENDWRAPEXTEND 2452
|
||||||
|
#define SCI_VCHOMEWRAP 2453
|
||||||
|
#define SCI_VCHOMEWRAPEXTEND 2454
|
||||||
#define SCI_MOVECARETINSIDEVIEW 2401
|
#define SCI_MOVECARETINSIDEVIEW 2401
|
||||||
#define SCI_LINELENGTH 2350
|
#define SCI_LINELENGTH 2350
|
||||||
#define SCI_BRACEHIGHLIGHT 2351
|
#define SCI_BRACEHIGHLIGHT 2351
|
||||||
@@ -518,6 +528,13 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETYCARETPOLICY 2403
|
#define SCI_SETYCARETPOLICY 2403
|
||||||
#define SCI_SETPRINTWRAPMODE 2406
|
#define SCI_SETPRINTWRAPMODE 2406
|
||||||
#define SCI_GETPRINTWRAPMODE 2407
|
#define SCI_GETPRINTWRAPMODE 2407
|
||||||
|
#define SCI_SETHOTSPOTACTIVEFORE 2410
|
||||||
|
#define SCI_SETHOTSPOTACTIVEBACK 2411
|
||||||
|
#define SCI_SETHOTSPOTACTIVEUNDERLINE 2412
|
||||||
|
#define SCI_PARADOWN 2413
|
||||||
|
#define SCI_PARADOWNEXTEND 2414
|
||||||
|
#define SCI_PARAUP 2415
|
||||||
|
#define SCI_PARAUPEXTEND 2416
|
||||||
#define SCI_STARTRECORD 3001
|
#define SCI_STARTRECORD 3001
|
||||||
#define SCI_STOPRECORD 3002
|
#define SCI_STOPRECORD 3002
|
||||||
#define SCI_SETLEXER 4001
|
#define SCI_SETLEXER 4001
|
||||||
@@ -526,6 +543,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCI_SETPROPERTY 4004
|
#define SCI_SETPROPERTY 4004
|
||||||
#define SCI_SETKEYWORDS 4005
|
#define SCI_SETKEYWORDS 4005
|
||||||
#define SCI_SETLEXERLANGUAGE 4006
|
#define SCI_SETLEXERLANGUAGE 4006
|
||||||
|
#define SCI_LOADLEXERLIBRARY 4007
|
||||||
#define SC_MOD_INSERTTEXT 0x1
|
#define SC_MOD_INSERTTEXT 0x1
|
||||||
#define SC_MOD_DELETETEXT 0x2
|
#define SC_MOD_DELETETEXT 0x2
|
||||||
#define SC_MOD_CHANGESTYLE 0x4
|
#define SC_MOD_CHANGESTYLE 0x4
|
||||||
@@ -579,6 +597,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
|
|||||||
#define SCN_DWELLSTART 2016
|
#define SCN_DWELLSTART 2016
|
||||||
#define SCN_DWELLEND 2017
|
#define SCN_DWELLEND 2017
|
||||||
#define SCN_ZOOM 2018
|
#define SCN_ZOOM 2018
|
||||||
|
#define SCN_HOTSPOTCLICK 2019
|
||||||
|
#define SCN_HOTSPOTDOUBLECLICK 2020
|
||||||
|
#define SCN_CALLTIPCLICK 2021
|
||||||
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
//--Autogenerated -- end of section automatically generated from Scintilla.iface
|
||||||
|
|
||||||
// These structures are defined to be exactly the same shape as the Win32
|
// These structures are defined to be exactly the same shape as the Win32
|
||||||
|
@@ -412,6 +412,9 @@ set void StyleSetCase=2060(int style, int caseForce)
|
|||||||
# Set the character set of the font in a style.
|
# Set the character set of the font in a style.
|
||||||
set void StyleSetCharacterSet=2066(int style, int characterSet)
|
set void StyleSetCharacterSet=2066(int style, int characterSet)
|
||||||
|
|
||||||
|
# Set a style to be a hotspot or not.
|
||||||
|
set void StyleSetHotSpot=2409(int style, bool hotspot)
|
||||||
|
|
||||||
# Set the foreground colour of the selection and whether to use this setting.
|
# Set the foreground colour of the selection and whether to use this setting.
|
||||||
fun void SetSelFore=2067(bool useSetting, colour fore)
|
fun void SetSelFore=2067(bool useSetting, colour fore)
|
||||||
|
|
||||||
@@ -701,6 +704,7 @@ val SCFIND_WHOLEWORD=2
|
|||||||
val SCFIND_MATCHCASE=4
|
val SCFIND_MATCHCASE=4
|
||||||
val SCFIND_WORDSTART=0x00100000
|
val SCFIND_WORDSTART=0x00100000
|
||||||
val SCFIND_REGEXP=0x00200000
|
val SCFIND_REGEXP=0x00200000
|
||||||
|
val SCFIND_POSIX=0x00400000
|
||||||
|
|
||||||
# Find some text in the document.
|
# Find some text in the document.
|
||||||
fun position FindText=2150(int flags, findtext ft)
|
fun position FindText=2150(int flags, findtext ft)
|
||||||
@@ -883,6 +887,12 @@ fun void CallTipSetHlt=2204(int start, int end)
|
|||||||
# Set the background colour for the call tip.
|
# Set the background colour for the call tip.
|
||||||
set void CallTipSetBack=2205(colour back,)
|
set void CallTipSetBack=2205(colour back,)
|
||||||
|
|
||||||
|
# Set the foreground colour for the call tip.
|
||||||
|
set void CallTipSetFore=2206(colour fore,)
|
||||||
|
|
||||||
|
# Set the foreground colour for the highlighted part of the call tip.
|
||||||
|
set void CallTipSetForeHlt=2207(colour fore,)
|
||||||
|
|
||||||
# Find the display line of a document line taking hidden lines into account.
|
# Find the display line of a document line taking hidden lines into account.
|
||||||
fun int VisibleFromDocLine=2220(int line,)
|
fun int VisibleFromDocLine=2220(int line,)
|
||||||
|
|
||||||
@@ -1040,7 +1050,6 @@ set void SetTwoPhaseDraw=2284(bool twoPhase,)
|
|||||||
fun void TargetFromSelection=2287(,)
|
fun void TargetFromSelection=2287(,)
|
||||||
|
|
||||||
# Join the lines in the target.
|
# Join the lines in the target.
|
||||||
# This is an experimental feature and may be changed or removed.
|
|
||||||
fun void LinesJoin=2288(,)
|
fun void LinesJoin=2288(,)
|
||||||
|
|
||||||
# Split the lines in the target into lines that are less wide than pixelWidth
|
# Split the lines in the target into lines that are less wide than pixelWidth
|
||||||
@@ -1209,6 +1218,19 @@ fun void LineEndDisplay=2347(,)
|
|||||||
# caret position.
|
# caret position.
|
||||||
fun void LineEndDisplayExtend=2348(,)
|
fun void LineEndDisplayExtend=2348(,)
|
||||||
|
|
||||||
|
# These are like their namesakes Home(Extend)?, LineEnd(Extend)?, VCHome(Extend)?
|
||||||
|
# except they behave differently when word-wrap is enabled:
|
||||||
|
# They go first to the start / end of the display line, like (Home|LineEnd)Display
|
||||||
|
# The difference is that, the cursor is already at the point, it goes on to the start
|
||||||
|
# or end of the document line, as appropriate for (Home|LineEnd|VCHome)Extend.
|
||||||
|
|
||||||
|
fun void HomeWrap=2349(,)
|
||||||
|
fun void HomeWrapExtend=2450(,)
|
||||||
|
fun void LineEndWrap=2451(,)
|
||||||
|
fun void LineEndWrapExtend=2452(,)
|
||||||
|
fun void VCHomeWrap=2453(,)
|
||||||
|
fun void VCHomeWrapExtend=2454(,)
|
||||||
|
|
||||||
# Move the caret inside current view if it's not there already.
|
# Move the caret inside current view if it's not there already.
|
||||||
fun void MoveCaretInsideView=2401(,)
|
fun void MoveCaretInsideView=2401(,)
|
||||||
|
|
||||||
@@ -1404,6 +1426,21 @@ set void SetPrintWrapMode=2406(int mode,)
|
|||||||
# Is printing line wrapped.
|
# Is printing line wrapped.
|
||||||
get int GetPrintWrapMode=2407(,)
|
get int GetPrintWrapMode=2407(,)
|
||||||
|
|
||||||
|
# Set a fore colour for active hotspots.
|
||||||
|
set void SetHotspotActiveFore=2410(bool useSetting, colour fore)
|
||||||
|
|
||||||
|
# Set a back colour for active hotspots.
|
||||||
|
set void SetHotspotActiveBack=2411(bool useSetting, colour back)
|
||||||
|
|
||||||
|
# Enable / Disable underlining active hotspots.
|
||||||
|
set void SetHotspotActiveUnderline=2412(bool underline,)
|
||||||
|
|
||||||
|
# Move caret between paragraphs (delimited by empty lines)
|
||||||
|
fun void ParaDown=2413(,)
|
||||||
|
fun void ParaDownExtend=2414(,)
|
||||||
|
fun void ParaUp=2415(,)
|
||||||
|
fun void ParaUpExtend=2416(,)
|
||||||
|
|
||||||
# Start notifying the container of all key presses and commands.
|
# Start notifying the container of all key presses and commands.
|
||||||
fun void StartRecord=3001(,)
|
fun void StartRecord=3001(,)
|
||||||
|
|
||||||
@@ -1428,6 +1465,10 @@ set void SetKeyWords=4005(int keywordSet, string keyWords)
|
|||||||
# Set the lexing language of the document based on string name.
|
# Set the lexing language of the document based on string name.
|
||||||
set void SetLexerLanguage=4006(, string language)
|
set void SetLexerLanguage=4006(, string language)
|
||||||
|
|
||||||
|
# Load a lexer library (dll / so)
|
||||||
|
# NOT YET IMPLEMENTED
|
||||||
|
fun void LoadLexerLibrary=4007(, string path)
|
||||||
|
|
||||||
# Notifications
|
# Notifications
|
||||||
# Type of modification and the action which caused the modification.
|
# Type of modification and the action which caused the modification.
|
||||||
# These are defined as a bit mask to make it easy to specify which notifications are wanted.
|
# These are defined as a bit mask to make it easy to specify which notifications are wanted.
|
||||||
@@ -1524,6 +1565,7 @@ val SCLEX_CPPNOCASE=35
|
|||||||
val SCLEX_FORTRAN=36
|
val SCLEX_FORTRAN=36
|
||||||
val SCLEX_F77=37
|
val SCLEX_F77=37
|
||||||
val SCLEX_CSS=38
|
val SCLEX_CSS=38
|
||||||
|
val SCLEX_POV=39
|
||||||
|
|
||||||
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
# When a lexer specifies its language as SCLEX_AUTOMATIC it receives a
|
||||||
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
# value assigned in sequence from SCLEX_AUTOMATIC+1.
|
||||||
@@ -1791,6 +1833,8 @@ val SCE_ERR_DIFF_ADDITION=11
|
|||||||
val SCE_ERR_DIFF_DELETION=12
|
val SCE_ERR_DIFF_DELETION=12
|
||||||
val SCE_ERR_DIFF_MESSAGE=13
|
val SCE_ERR_DIFF_MESSAGE=13
|
||||||
val SCE_ERR_PHP=14
|
val SCE_ERR_PHP=14
|
||||||
|
val SCE_ERR_ELF=15
|
||||||
|
val SCE_ERR_IFC=16
|
||||||
# Lexical states for SCLEX_BATCH
|
# Lexical states for SCLEX_BATCH
|
||||||
lex Batch=SCLEX_BATCH SCE_BAT_
|
lex Batch=SCLEX_BATCH SCE_BAT_
|
||||||
val SCE_BAT_DEFAULT=0
|
val SCE_BAT_DEFAULT=0
|
||||||
@@ -1988,7 +2032,21 @@ val SCE_CSS_COMMENT=9
|
|||||||
val SCE_CSS_ID=10
|
val SCE_CSS_ID=10
|
||||||
val SCE_CSS_IMPORTANT=11
|
val SCE_CSS_IMPORTANT=11
|
||||||
val SCE_CSS_DIRECTIVE=12
|
val SCE_CSS_DIRECTIVE=12
|
||||||
|
val SCE_CSS_DOUBLESTRING=13
|
||||||
|
val SCE_CSS_SINGLESTRING=14
|
||||||
|
# Lexical states for SCLEX_POV
|
||||||
|
lex POV=SCLEX_POV SCE_POV_
|
||||||
|
val SCE_POV_DEFAULT=0
|
||||||
|
val SCE_POV_COMMENT=1
|
||||||
|
val SCE_POV_COMMENTLINE=2
|
||||||
|
val SCE_POV_COMMENTDOC=3
|
||||||
|
val SCE_POV_NUMBER=4
|
||||||
|
val SCE_POV_WORD=5
|
||||||
|
val SCE_POV_STRING=6
|
||||||
|
val SCE_POV_OPERATOR=7
|
||||||
|
val SCE_POV_IDENTIFIER=8
|
||||||
|
val SCE_POV_BRACE=9
|
||||||
|
val SCE_POV_WORD2=10
|
||||||
# Events
|
# Events
|
||||||
|
|
||||||
evt void StyleNeeded=2000(int position)
|
evt void StyleNeeded=2000(int position)
|
||||||
@@ -2010,6 +2068,9 @@ evt void URIDropped=2015(string text)
|
|||||||
evt void DwellStart=2016(int position)
|
evt void DwellStart=2016(int position)
|
||||||
evt void DwellEnd=2017(int position)
|
evt void DwellEnd=2017(int position)
|
||||||
evt void Zoom=2018(void)
|
evt void Zoom=2018(void)
|
||||||
|
evt void HotSpotClick=2019(int modifiers, int position)
|
||||||
|
evt void HotSpotDoubleClick=2020(int modifiers, int position)
|
||||||
|
evt void CallTipClick=2021(int position)
|
||||||
|
|
||||||
cat Deprecated
|
cat Deprecated
|
||||||
|
|
||||||
|
@@ -18,6 +18,9 @@ CallTip::CallTip() {
|
|||||||
inCallTipMode = false;
|
inCallTipMode = false;
|
||||||
posStartCallTip = 0;
|
posStartCallTip = 0;
|
||||||
val = 0;
|
val = 0;
|
||||||
|
xUp = -100;
|
||||||
|
xDown = -100;
|
||||||
|
lineHeight = 1;
|
||||||
startHighlight = 0;
|
startHighlight = 0;
|
||||||
endHighlight = 0;
|
endHighlight = 0;
|
||||||
|
|
||||||
@@ -35,6 +38,8 @@ CallTip::~CallTip() {
|
|||||||
val = 0;
|
val = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int widthArrow = 14;
|
||||||
|
|
||||||
void CallTip::RefreshColourPalette(Palette &pal, bool want) {
|
void CallTip::RefreshColourPalette(Palette &pal, bool want) {
|
||||||
pal.WantFind(colourBG, want);
|
pal.WantFind(colourBG, want);
|
||||||
pal.WantFind(colourUnSel, want);
|
pal.WantFind(colourUnSel, want);
|
||||||
@@ -43,24 +48,98 @@ void CallTip::RefreshColourPalette(Palette &pal, bool want) {
|
|||||||
pal.WantFind(colourLight, want);
|
pal.WantFind(colourLight, want);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallTip::PaintCT(Surface *surfaceWindow) {
|
void CallTip::DrawChunk(Surface *surface, int &x, const char *s,
|
||||||
if (!val)
|
int posStart, int posEnd, int ytext, PRectangle rcClient,
|
||||||
return ;
|
bool highlight, bool draw) {
|
||||||
|
s += posStart;
|
||||||
|
int len = posEnd - posStart;
|
||||||
|
int maxEnd = 0;
|
||||||
|
int ends[10];
|
||||||
|
for (int i=0;i<len;i++) {
|
||||||
|
if (s[i] <= '\002') {
|
||||||
|
if (i > 0)
|
||||||
|
ends[maxEnd++] = i;
|
||||||
|
ends[maxEnd++] = i+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ends[maxEnd++] = len;
|
||||||
|
int startSeg = 0;
|
||||||
|
int xEnd;
|
||||||
|
for (int seg = 0; seg<maxEnd; seg++) {
|
||||||
|
int endSeg = ends[seg];
|
||||||
|
if (endSeg > startSeg) {
|
||||||
|
if (s[startSeg] <= '\002') {
|
||||||
|
xEnd = x + widthArrow;
|
||||||
|
offsetMain = xEnd;
|
||||||
|
if (draw) {
|
||||||
|
const int halfWidth = widthArrow / 2 - 3;
|
||||||
|
const int centreX = x + widthArrow / 2 - 1;
|
||||||
|
const int centreY = (rcClient.top + rcClient.bottom) / 2;
|
||||||
|
rcClient.left = x;
|
||||||
|
rcClient.right = xEnd;
|
||||||
|
surface->FillRectangle(rcClient, colourBG.allocated);
|
||||||
|
PRectangle rcClientInner(rcClient.left+1, rcClient.top+1, rcClient.right-2, rcClient.bottom-1);
|
||||||
|
surface->FillRectangle(rcClientInner, colourUnSel.allocated);
|
||||||
|
|
||||||
|
if (s[startSeg] == '\001') {
|
||||||
|
// Up arrow
|
||||||
|
Point pts[] = {
|
||||||
|
Point(centreX - halfWidth, centreY + halfWidth / 2),
|
||||||
|
Point(centreX + halfWidth, centreY + halfWidth / 2),
|
||||||
|
Point(centreX, centreY - halfWidth + halfWidth / 2),
|
||||||
|
};
|
||||||
|
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||||
|
colourBG.allocated, colourBG.allocated);
|
||||||
|
} else {
|
||||||
|
// Down arrow
|
||||||
|
Point pts[] = {
|
||||||
|
Point(centreX - halfWidth, centreY - halfWidth / 2),
|
||||||
|
Point(centreX + halfWidth, centreY - halfWidth / 2),
|
||||||
|
Point(centreX, centreY + halfWidth - halfWidth / 2),
|
||||||
|
};
|
||||||
|
surface->Polygon(pts, sizeof(pts) / sizeof(pts[0]),
|
||||||
|
colourBG.allocated, colourBG.allocated);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (s[startSeg] == '\001') {
|
||||||
|
xUp = x+1;
|
||||||
|
} else {
|
||||||
|
xDown = x+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
xEnd = x + surface->WidthText(font, s+startSeg, endSeg - startSeg);
|
||||||
|
if (draw) {
|
||||||
|
rcClient.left = x;
|
||||||
|
rcClient.right = xEnd;
|
||||||
|
surface->DrawTextNoClip(rcClient, font, ytext,
|
||||||
|
s+startSeg, endSeg - startSeg,
|
||||||
|
highlight ? colourSel.allocated : colourUnSel.allocated,
|
||||||
|
colourBG.allocated);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
x = xEnd;
|
||||||
|
startSeg = endSeg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int CallTip::PaintContents(Surface *surfaceWindow, bool draw) {
|
||||||
PRectangle rcClientPos = wCallTip.GetClientPosition();
|
PRectangle rcClientPos = wCallTip.GetClientPosition();
|
||||||
PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left,
|
PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left,
|
||||||
rcClientPos.bottom - rcClientPos.top);
|
rcClientPos.bottom - rcClientPos.top);
|
||||||
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
|
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
|
||||||
|
|
||||||
surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
|
|
||||||
// To make a nice small call tip window, it is only sized to fit most normal characters without accents
|
// To make a nice small call tip window, it is only sized to fit most normal characters without accents
|
||||||
int lineHeight = surfaceWindow->Height(font);
|
|
||||||
int ascent = surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font);
|
int ascent = surfaceWindow->Ascent(font) - surfaceWindow->InternalLeading(font);
|
||||||
|
|
||||||
// For each line...
|
// For each line...
|
||||||
// Draw the definition in three parts: before highlight, highlighted, after highlight
|
// Draw the definition in three parts: before highlight, highlighted, after highlight
|
||||||
int ytext = rcClient.top + ascent + 1;
|
int ytext = rcClient.top + ascent + 1;
|
||||||
|
rcClient.bottom = ytext + surfaceWindow->Descent(font) + 1;
|
||||||
char *chunkVal = val;
|
char *chunkVal = val;
|
||||||
bool moreChunks = true;
|
bool moreChunks = true;
|
||||||
|
int maxWidth = 0;
|
||||||
while (moreChunks) {
|
while (moreChunks) {
|
||||||
char *chunkEnd = strchr(chunkVal, '\n');
|
char *chunkEnd = strchr(chunkVal, '\n');
|
||||||
if (chunkEnd == NULL) {
|
if (chunkEnd == NULL) {
|
||||||
@@ -76,36 +155,38 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
|||||||
int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset);
|
int thisEndHighlight = Platform::Maximum(endHighlight, chunkOffset);
|
||||||
thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset);
|
thisEndHighlight = Platform::Minimum(thisEndHighlight, chunkEndOffset);
|
||||||
thisEndHighlight -= chunkOffset;
|
thisEndHighlight -= chunkOffset;
|
||||||
int x = 5;
|
|
||||||
int xEnd = x + surfaceWindow->WidthText(font, chunkVal, thisStartHighlight);
|
|
||||||
rcClient.left = x;
|
|
||||||
rcClient.top = ytext - ascent - 1;
|
rcClient.top = ytext - ascent - 1;
|
||||||
rcClient.right = xEnd;
|
|
||||||
surfaceWindow->DrawTextNoClip(rcClient, font, ytext,
|
|
||||||
chunkVal, thisStartHighlight,
|
|
||||||
colourUnSel.allocated, colourBG.allocated);
|
|
||||||
x = xEnd;
|
|
||||||
|
|
||||||
xEnd = x + surfaceWindow->WidthText(font, chunkVal + thisStartHighlight,
|
int x = 5;
|
||||||
thisEndHighlight - thisStartHighlight);
|
|
||||||
rcClient.top = ytext;
|
DrawChunk(surfaceWindow, x, chunkVal, 0, thisStartHighlight,
|
||||||
rcClient.left = x;
|
ytext, rcClient, false, draw);
|
||||||
rcClient.right = xEnd;
|
DrawChunk(surfaceWindow, x, chunkVal, thisStartHighlight, thisEndHighlight,
|
||||||
surfaceWindow->DrawTextNoClip(rcClient, font, ytext,
|
ytext, rcClient, true, draw);
|
||||||
chunkVal + thisStartHighlight, thisEndHighlight - thisStartHighlight,
|
DrawChunk(surfaceWindow, x, chunkVal, thisEndHighlight, chunkLength,
|
||||||
colourSel.allocated, colourBG.allocated);
|
ytext, rcClient, false, draw);
|
||||||
x = xEnd;
|
|
||||||
|
|
||||||
xEnd = x + surfaceWindow->WidthText(font, chunkVal + thisEndHighlight,
|
|
||||||
chunkLength - thisEndHighlight);
|
|
||||||
rcClient.left = x;
|
|
||||||
rcClient.right = xEnd;
|
|
||||||
surfaceWindow->DrawTextNoClip(rcClient, font, ytext,
|
|
||||||
chunkVal + thisEndHighlight, chunkLength - thisEndHighlight,
|
|
||||||
colourUnSel.allocated, colourBG.allocated);
|
|
||||||
chunkVal = chunkEnd + 1;
|
chunkVal = chunkEnd + 1;
|
||||||
ytext += lineHeight;
|
ytext += lineHeight;
|
||||||
|
rcClient.bottom += lineHeight;
|
||||||
|
maxWidth = Platform::Maximum(maxWidth, x);
|
||||||
}
|
}
|
||||||
|
return maxWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CallTip::PaintCT(Surface *surfaceWindow) {
|
||||||
|
if (!val)
|
||||||
|
return;
|
||||||
|
PRectangle rcClientPos = wCallTip.GetClientPosition();
|
||||||
|
PRectangle rcClientSize(0, 0, rcClientPos.right - rcClientPos.left,
|
||||||
|
rcClientPos.bottom - rcClientPos.top);
|
||||||
|
PRectangle rcClient(1, 1, rcClientSize.right - 1, rcClientSize.bottom - 1);
|
||||||
|
|
||||||
|
surfaceWindow->FillRectangle(rcClient, colourBG.allocated);
|
||||||
|
|
||||||
|
offsetMain = 5;
|
||||||
|
PaintContents(surfaceWindow, true);
|
||||||
|
|
||||||
// Draw a raised border around the edges of the window
|
// Draw a raised border around the edges of the window
|
||||||
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
|
surfaceWindow->MoveTo(0, rcClientSize.bottom - 1);
|
||||||
surfaceWindow->PenColour(colourShade.allocated);
|
surfaceWindow->PenColour(colourShade.allocated);
|
||||||
@@ -116,9 +197,21 @@ void CallTip::PaintCT(Surface *surfaceWindow) {
|
|||||||
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
|
surfaceWindow->LineTo(0, rcClientSize.bottom - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CallTip::MouseClick(Point pt) {
|
||||||
|
clickPlace = 0;
|
||||||
|
if (pt.y < lineHeight) {
|
||||||
|
if ((pt.x > xUp) && (pt.x < xUp + widthArrow - 2)) {
|
||||||
|
clickPlace = 1;
|
||||||
|
} else if ((pt.x > xDown) && (pt.x < xDown + widthArrow - 2)) {
|
||||||
|
clickPlace = 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
||||||
const char *faceName, int size,
|
const char *faceName, int size,
|
||||||
int codePage_) {
|
int codePage_, Window &wParent) {
|
||||||
|
clickPlace = 0;
|
||||||
if (val)
|
if (val)
|
||||||
delete []val;
|
delete []val;
|
||||||
val = new char[strlen(defn) + 1];
|
val = new char[strlen(defn) + 1];
|
||||||
@@ -129,7 +222,7 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
|||||||
Surface *surfaceMeasure = Surface::Allocate();
|
Surface *surfaceMeasure = Surface::Allocate();
|
||||||
if (!surfaceMeasure)
|
if (!surfaceMeasure)
|
||||||
return PRectangle();
|
return PRectangle();
|
||||||
surfaceMeasure->Init();
|
surfaceMeasure->Init(wParent.GetID());
|
||||||
surfaceMeasure->SetUnicodeMode(SC_CP_UTF8 == codePage);
|
surfaceMeasure->SetUnicodeMode(SC_CP_UTF8 == codePage);
|
||||||
surfaceMeasure->SetDBCSMode(codePage);
|
surfaceMeasure->SetDBCSMode(codePage);
|
||||||
startHighlight = 0;
|
startHighlight = 0;
|
||||||
@@ -140,23 +233,22 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, const char *defn,
|
|||||||
font.Create(faceName, SC_CHARSET_DEFAULT, deviceHeight, false, false);
|
font.Create(faceName, SC_CHARSET_DEFAULT, deviceHeight, false, false);
|
||||||
// Look for multiple lines in the text
|
// Look for multiple lines in the text
|
||||||
// Only support \n here - simply means container must avoid \r!
|
// Only support \n here - simply means container must avoid \r!
|
||||||
int width = 0;
|
|
||||||
int numLines = 1;
|
int numLines = 1;
|
||||||
const char *newline;
|
const char *newline;
|
||||||
const char *look = val;
|
const char *look = val;
|
||||||
|
xUp = -100;
|
||||||
|
xDown = -100;
|
||||||
|
offsetMain = 5;
|
||||||
|
int width = PaintContents(surfaceMeasure, false) + 5;
|
||||||
while ((newline = strchr(look, '\n')) != NULL) {
|
while ((newline = strchr(look, '\n')) != NULL) {
|
||||||
int thisWidth = surfaceMeasure->WidthText(font, look, newline - look);
|
|
||||||
width = Platform::Maximum(width, thisWidth);
|
|
||||||
look = newline + 1;
|
look = newline + 1;
|
||||||
numLines++;
|
numLines++;
|
||||||
}
|
}
|
||||||
int lastWidth = surfaceMeasure->WidthText(font, look, static_cast<int>(strlen(look)));
|
lineHeight = surfaceMeasure->Height(font);
|
||||||
width = Platform::Maximum(width, lastWidth) + 10;
|
|
||||||
int lineHeight = surfaceMeasure->Height(font);
|
|
||||||
// Extra line for border and an empty line at top and bottom
|
// Extra line for border and an empty line at top and bottom
|
||||||
int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
|
int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2;
|
||||||
delete surfaceMeasure;
|
delete surfaceMeasure;
|
||||||
return PRectangle(pt.x -5, pt.y + 1, pt.x + width - 5, pt.y + 1 + height);
|
return PRectangle(pt.x - offsetMain, pt.y + 1, pt.x + width - offsetMain, pt.y + 1 + height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CallTip::CallTipCancel() {
|
void CallTip::CallTipCancel() {
|
||||||
|
@@ -15,9 +15,17 @@ class CallTip {
|
|||||||
int endHighlight;
|
int endHighlight;
|
||||||
char *val;
|
char *val;
|
||||||
Font font;
|
Font font;
|
||||||
|
int xUp;
|
||||||
|
int xDown;
|
||||||
|
int lineHeight;
|
||||||
|
int offsetMain;
|
||||||
// Private so CallTip objects can not be copied
|
// Private so CallTip objects can not be copied
|
||||||
CallTip(const CallTip &) {}
|
CallTip(const CallTip &) {}
|
||||||
CallTip &operator=(const CallTip &) { return *this; }
|
CallTip &operator=(const CallTip &) { return *this; }
|
||||||
|
void DrawChunk(Surface *surface, int &x, const char *s,
|
||||||
|
int posStart, int posEnd, int ytext, PRectangle rcClient,
|
||||||
|
bool highlight, bool draw);
|
||||||
|
int PaintContents(Surface *surfaceWindow, bool draw);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Window wCallTip;
|
Window wCallTip;
|
||||||
@@ -30,6 +38,7 @@ public:
|
|||||||
ColourPair colourShade;
|
ColourPair colourShade;
|
||||||
ColourPair colourLight;
|
ColourPair colourLight;
|
||||||
int codePage;
|
int codePage;
|
||||||
|
int clickPlace;
|
||||||
|
|
||||||
CallTip();
|
CallTip();
|
||||||
~CallTip();
|
~CallTip();
|
||||||
@@ -39,9 +48,11 @@ public:
|
|||||||
|
|
||||||
void PaintCT(Surface *surfaceWindow);
|
void PaintCT(Surface *surfaceWindow);
|
||||||
|
|
||||||
|
void MouseClick(Point pt);
|
||||||
|
|
||||||
/// Setup the calltip and return a rectangle of the area required.
|
/// Setup the calltip and return a rectangle of the area required.
|
||||||
PRectangle CallTipStart(int pos, Point pt, const char *defn,
|
PRectangle CallTipStart(int pos, Point pt, const char *defn,
|
||||||
const char *faceName, int size, int codePage_);
|
const char *faceName, int size, int codePage_, Window &wParent);
|
||||||
|
|
||||||
void CallTipCancel();
|
void CallTipCancel();
|
||||||
|
|
||||||
|
@@ -720,6 +720,33 @@ void Document::ConvertLineEnds(int eolModeSet) {
|
|||||||
EndUndoAction();
|
EndUndoAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Document::ParaDown(int pos) {
|
||||||
|
int line = LineFromPosition(pos);
|
||||||
|
while (line < LinesTotal() && LineStart(line) != LineEnd(line)) { // skip non-empty lines
|
||||||
|
line++;
|
||||||
|
}
|
||||||
|
while (line < LinesTotal() && LineStart(line) == LineEnd(line)) { // skip empty lines
|
||||||
|
line++;
|
||||||
|
}
|
||||||
|
if (line < LinesTotal())
|
||||||
|
return LineStart(line);
|
||||||
|
else // end of a document
|
||||||
|
return LineEnd(line-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int Document::ParaUp(int pos) {
|
||||||
|
int line = LineFromPosition(pos);
|
||||||
|
line--;
|
||||||
|
while (line >= 0 && LineStart(line) == LineEnd(line)) { // skip empty lines
|
||||||
|
line--;
|
||||||
|
}
|
||||||
|
while (line >= 0 && LineStart(line) != LineEnd(line)) { // skip non-empty lines
|
||||||
|
line--;
|
||||||
|
}
|
||||||
|
line++;
|
||||||
|
return LineStart(line);
|
||||||
|
}
|
||||||
|
|
||||||
Document::charClassification Document::WordCharClass(unsigned char ch) {
|
Document::charClassification Document::WordCharClass(unsigned char ch) {
|
||||||
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
|
if ((SC_CP_UTF8 == dbcsCodePage) && (ch >= 0x80))
|
||||||
return ccWord;
|
return ccWord;
|
||||||
@@ -847,7 +874,7 @@ public:
|
|||||||
* Has not been tested with backwards DBCS searches yet.
|
* Has not been tested with backwards DBCS searches yet.
|
||||||
*/
|
*/
|
||||||
long Document::FindText(int minPos, int maxPos, const char *s,
|
long Document::FindText(int minPos, int maxPos, const char *s,
|
||||||
bool caseSensitive, bool word, bool wordStart, bool regExp,
|
bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix,
|
||||||
int *length) {
|
int *length) {
|
||||||
if (regExp) {
|
if (regExp) {
|
||||||
if (!pre)
|
if (!pre)
|
||||||
@@ -864,7 +891,7 @@ long Document::FindText(int minPos, int maxPos, const char *s,
|
|||||||
startPos = MovePositionOutsideChar(startPos, 1, false);
|
startPos = MovePositionOutsideChar(startPos, 1, false);
|
||||||
endPos = MovePositionOutsideChar(endPos, 1, false);
|
endPos = MovePositionOutsideChar(endPos, 1, false);
|
||||||
|
|
||||||
const char *errmsg = pre->Compile(s, *length, caseSensitive);
|
const char *errmsg = pre->Compile(s, *length, caseSensitive, posix);
|
||||||
if (errmsg) {
|
if (errmsg) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -888,16 +915,30 @@ long Document::FindText(int minPos, int maxPos, const char *s,
|
|||||||
for (int line = lineRangeStart; line != lineRangeBreak; line += increment) {
|
for (int line = lineRangeStart; line != lineRangeBreak; line += increment) {
|
||||||
int startOfLine = LineStart(line);
|
int startOfLine = LineStart(line);
|
||||||
int endOfLine = LineEnd(line);
|
int endOfLine = LineEnd(line);
|
||||||
if ((increment == 1) && (line == lineRangeStart)) {
|
if (increment == 1) {
|
||||||
|
if (line == lineRangeStart) {
|
||||||
if ((startPos != startOfLine) && (s[0] == '^'))
|
if ((startPos != startOfLine) && (s[0] == '^'))
|
||||||
continue; // Can't match start of line if start position after start of line
|
continue; // Can't match start of line if start position after start of line
|
||||||
startOfLine = startPos;
|
startOfLine = startPos;
|
||||||
}
|
}
|
||||||
if ((increment == 1) && (line == lineRangeEnd)) {
|
if (line == lineRangeEnd) {
|
||||||
if ((endPos != endOfLine) && (searchEnd == '$'))
|
if ((endPos != endOfLine) && (searchEnd == '$'))
|
||||||
continue; // Can't match end of line if end position before end of line
|
continue; // Can't match end of line if end position before end of line
|
||||||
endOfLine = endPos;
|
endOfLine = endPos;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (line == lineRangeEnd) {
|
||||||
|
if ((endPos != startOfLine) && (s[0] == '^'))
|
||||||
|
continue; // Can't match start of line if end position after start of line
|
||||||
|
startOfLine = endPos;
|
||||||
|
}
|
||||||
|
if (line == lineRangeStart) {
|
||||||
|
if ((startPos != endOfLine) && (searchEnd == '$'))
|
||||||
|
continue; // Can't match end of line if start position before end of line
|
||||||
|
endOfLine = startPos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DocumentIndexer di(this, endOfLine);
|
DocumentIndexer di(this, endOfLine);
|
||||||
int success = pre->Execute(di, startOfLine, endOfLine);
|
int success = pre->Execute(di, startOfLine, endOfLine);
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -905,7 +946,8 @@ long Document::FindText(int minPos, int maxPos, const char *s,
|
|||||||
lenRet = pre->eopat[0] - pre->bopat[0];
|
lenRet = pre->eopat[0] - pre->bopat[0];
|
||||||
if (increment == -1) {
|
if (increment == -1) {
|
||||||
// Check for the last match on this line.
|
// Check for the last match on this line.
|
||||||
while (success && (pre->eopat[0] < endOfLine)) {
|
int repetitions = 1000; // Break out of infinite loop
|
||||||
|
while (success && (pre->eopat[0] < endOfLine) && (repetitions--)) {
|
||||||
success = pre->Execute(di, pre->eopat[0], endOfLine);
|
success = pre->Execute(di, pre->eopat[0], endOfLine);
|
||||||
if (success) {
|
if (success) {
|
||||||
if (pre->eopat[0] <= minPos) {
|
if (pre->eopat[0] <= minPos) {
|
||||||
@@ -1301,3 +1343,16 @@ int Document::WordPartRight(int pos) {
|
|||||||
}
|
}
|
||||||
return pos;
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Document::ExtendStyleRange(int pos, int delta) {
|
||||||
|
int sStart = cb.StyleAt(pos);
|
||||||
|
if (delta < 0) {
|
||||||
|
while (pos > 0 && (cb.StyleAt(pos) == sStart))
|
||||||
|
pos--;
|
||||||
|
pos++;
|
||||||
|
} else {
|
||||||
|
while (pos < (Length()) && (cb.StyleAt(pos) == sStart))
|
||||||
|
pos++;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
|
}
|
||||||
|
@@ -192,7 +192,7 @@ public:
|
|||||||
int NextWordStart(int pos, int delta);
|
int NextWordStart(int pos, int delta);
|
||||||
int Length() { return cb.Length(); }
|
int Length() { return cb.Length(); }
|
||||||
long FindText(int minPos, int maxPos, const char *s,
|
long FindText(int minPos, int maxPos, const char *s,
|
||||||
bool caseSensitive, bool word, bool wordStart, bool regExp, int *length);
|
bool caseSensitive, bool word, bool wordStart, bool regExp, bool posix, int *length);
|
||||||
long FindText(int iMessage, unsigned long wParam, long lParam);
|
long FindText(int iMessage, unsigned long wParam, long lParam);
|
||||||
const char *SubstituteByPosition(const char *text, int *length);
|
const char *SubstituteByPosition(const char *text, int *length);
|
||||||
int LinesTotal();
|
int LinesTotal();
|
||||||
@@ -220,6 +220,9 @@ public:
|
|||||||
bool IsWordPartSeparator(char ch);
|
bool IsWordPartSeparator(char ch);
|
||||||
int WordPartLeft(int pos);
|
int WordPartLeft(int pos);
|
||||||
int WordPartRight(int pos);
|
int WordPartRight(int pos);
|
||||||
|
int ExtendStyleRange(int pos, int delta);
|
||||||
|
int ParaUp(int pos);
|
||||||
|
int ParaDown(int pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
charClassification WordCharClass(unsigned char ch);
|
charClassification WordCharClass(unsigned char ch);
|
||||||
|
@@ -364,7 +364,7 @@ Editor::Editor() {
|
|||||||
modEventMask = SC_MODEVENTMASKALL;
|
modEventMask = SC_MODEVENTMASKALL;
|
||||||
|
|
||||||
pdoc = new Document();
|
pdoc = new Document();
|
||||||
pdoc ->AddRef();
|
pdoc->AddRef();
|
||||||
pdoc->AddWatcher(this, 0);
|
pdoc->AddWatcher(this, 0);
|
||||||
|
|
||||||
recordingMacro = false;
|
recordingMacro = false;
|
||||||
@@ -374,6 +374,9 @@ Editor::Editor() {
|
|||||||
wrapWidth = LineLayout::wrapWidthInfinite;
|
wrapWidth = LineLayout::wrapWidthInfinite;
|
||||||
docLineLastWrapped = -1;
|
docLineLastWrapped = -1;
|
||||||
|
|
||||||
|
hsStart = -1;
|
||||||
|
hsEnd = -1;
|
||||||
|
|
||||||
llc.SetLevel(LineLayoutCache::llcCaret);
|
llc.SetLevel(LineLayoutCache::llcCaret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +423,7 @@ void Editor::RefreshColourPalette(Palette &pal, bool want) {
|
|||||||
void Editor::RefreshStyleData() {
|
void Editor::RefreshStyleData() {
|
||||||
if (!stylesValid) {
|
if (!stylesValid) {
|
||||||
stylesValid = true;
|
stylesValid = true;
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
if (surface) {
|
if (surface) {
|
||||||
vs.Refresh(*surface);
|
vs.Refresh(*surface);
|
||||||
RefreshColourPalette(palette, true);
|
RefreshColourPalette(palette, true);
|
||||||
@@ -496,7 +499,7 @@ const char *ControlCharacterString(unsigned char ch) {
|
|||||||
class AutoLineLayout {
|
class AutoLineLayout {
|
||||||
LineLayoutCache &llc;
|
LineLayoutCache &llc;
|
||||||
LineLayout *ll;
|
LineLayout *ll;
|
||||||
AutoLineLayout &operator=(const AutoLineLayout &) { return *this; }
|
AutoLineLayout &operator=(const AutoLineLayout &) { return * this; }
|
||||||
public:
|
public:
|
||||||
AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {}
|
AutoLineLayout(LineLayoutCache &llc_, LineLayout *ll_) : llc(llc_), ll(ll_) {}
|
||||||
~AutoLineLayout() {
|
~AutoLineLayout() {
|
||||||
@@ -523,7 +526,7 @@ Point Editor::LocationFromPosition(int pos) {
|
|||||||
int line = pdoc->LineFromPosition(pos);
|
int line = pdoc->LineFromPosition(pos);
|
||||||
int lineVisible = cs.DisplayFromDoc(line);
|
int lineVisible = cs.DisplayFromDoc(line);
|
||||||
//Platform::DebugPrintf("line=%d\n", line);
|
//Platform::DebugPrintf("line=%d\n", line);
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
// -1 because of adding in for visible lines in following loop.
|
// -1 because of adding in for visible lines in following loop.
|
||||||
@@ -581,7 +584,7 @@ int Editor::PositionFromLocation(Point pt) {
|
|||||||
return pdoc->Length();
|
return pdoc->Length();
|
||||||
unsigned int posLineStart = pdoc->LineStart(lineDoc);
|
unsigned int posLineStart = pdoc->LineStart(lineDoc);
|
||||||
int retVal = posLineStart;
|
int retVal = posLineStart;
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
||||||
@@ -624,7 +627,7 @@ int Editor::PositionFromLocationClose(Point pt) {
|
|||||||
return INVALID_POSITION;
|
return INVALID_POSITION;
|
||||||
if (lineDoc >= pdoc->LinesTotal())
|
if (lineDoc >= pdoc->LinesTotal())
|
||||||
return INVALID_POSITION;
|
return INVALID_POSITION;
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
||||||
@@ -656,7 +659,7 @@ int Editor::PositionFromLineX(int lineDoc, int x) {
|
|||||||
if (lineDoc >= pdoc->LinesTotal())
|
if (lineDoc >= pdoc->LinesTotal())
|
||||||
return pdoc->Length();
|
return pdoc->Length();
|
||||||
//Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine);
|
//Platform::DebugPrintf("Position of (%d,%d) line = %d top=%d\n", pt.x, pt.y, line, topLine);
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
||||||
int retVal = 0;
|
int retVal = 0;
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
@@ -898,9 +901,9 @@ int Editor::MovePositionTo(int newPos, bool extend, bool ensureVisible) {
|
|||||||
} else {
|
} else {
|
||||||
SetEmptySelection(newPos);
|
SetEmptySelection(newPos);
|
||||||
}
|
}
|
||||||
|
ShowCaretAtCurrentPosition();
|
||||||
if (ensureVisible)
|
if (ensureVisible)
|
||||||
EnsureCaretVisible();
|
EnsureCaretVisible();
|
||||||
ShowCaretAtCurrentPosition();
|
|
||||||
NotifyMove(newPos);
|
NotifyMove(newPos);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -983,7 +986,7 @@ void Editor::MoveCaretInsideView(bool ensureVisible) {
|
|||||||
int Editor::DisplayFromPosition(int pos) {
|
int Editor::DisplayFromPosition(int pos) {
|
||||||
int lineDoc = pdoc->LineFromPosition(pos);
|
int lineDoc = pdoc->LineFromPosition(pos);
|
||||||
int lineDisplay = cs.DisplayFromDoc(lineDoc);
|
int lineDisplay = cs.DisplayFromDoc(lineDoc);
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
||||||
@@ -1146,9 +1149,9 @@ void Editor::EnsureCaretVisible(bool useMargin, bool vert, bool horiz) {
|
|||||||
}
|
}
|
||||||
newTopLine = Platform::Clamp(newTopLine, 0, MaxScrollPos());
|
newTopLine = Platform::Clamp(newTopLine, 0, MaxScrollPos());
|
||||||
if (newTopLine != topLine) {
|
if (newTopLine != topLine) {
|
||||||
|
Redraw();
|
||||||
SetTopLine(newTopLine);
|
SetTopLine(newTopLine);
|
||||||
SetVerticalScrollPos();
|
SetVerticalScrollPos();
|
||||||
Redraw();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1327,7 +1330,7 @@ bool Editor::WrapLines() {
|
|||||||
wrapWidth = rcTextArea.Width();
|
wrapWidth = rcTextArea.Width();
|
||||||
// Ensure all of the document is styled.
|
// Ensure all of the document is styled.
|
||||||
pdoc->EnsureStyledTo(pdoc->Length());
|
pdoc->EnsureStyledTo(pdoc->Length());
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
if (surface) {
|
if (surface) {
|
||||||
int lastLineToWrap = pdoc->LinesTotal();
|
int lastLineToWrap = pdoc->LinesTotal();
|
||||||
while (docLineLastWrapped <= lastLineToWrap) {
|
while (docLineLastWrapped <= lastLineToWrap) {
|
||||||
@@ -1363,10 +1366,17 @@ bool Editor::WrapLines() {
|
|||||||
void Editor::LinesJoin() {
|
void Editor::LinesJoin() {
|
||||||
if (!RangeContainsProtected(targetStart, targetEnd)) {
|
if (!RangeContainsProtected(targetStart, targetEnd)) {
|
||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
|
bool prevNonWS = true;
|
||||||
for (int pos = targetStart; pos < targetEnd; pos++) {
|
for (int pos = targetStart; pos < targetEnd; pos++) {
|
||||||
if (IsEOLChar(pdoc->CharAt(pos))) {
|
if (IsEOLChar(pdoc->CharAt(pos))) {
|
||||||
targetEnd -= pdoc->LenChar(pos);
|
targetEnd -= pdoc->LenChar(pos);
|
||||||
pdoc->DelChar(pos);
|
pdoc->DelChar(pos);
|
||||||
|
if (prevNonWS) {
|
||||||
|
// Ensure at least one space separating previous lines
|
||||||
|
pdoc->InsertChar(pos, ' ');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
prevNonWS = pdoc->CharAt(pos) != ' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pdoc->EndUndoAction();
|
pdoc->EndUndoAction();
|
||||||
@@ -1394,13 +1404,14 @@ void Editor::LinesSplit(int pixelWidth) {
|
|||||||
const char *eol = StringFromEOLMode(pdoc->eolMode);
|
const char *eol = StringFromEOLMode(pdoc->eolMode);
|
||||||
pdoc->BeginUndoAction();
|
pdoc->BeginUndoAction();
|
||||||
for (int line = lineStart; line <= lineEnd; line++) {
|
for (int line = lineStart; line <= lineEnd; line++) {
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
unsigned int posLineStart = pdoc->LineStart(line);
|
unsigned int posLineStart = pdoc->LineStart(line);
|
||||||
LayoutLine(line, surface, vs, ll, pixelWidth);
|
LayoutLine(line, surface, vs, ll, pixelWidth);
|
||||||
for (int subLine = 1; subLine < ll->lines; subLine++) {
|
for (int subLine = 1; subLine < ll->lines; subLine++) {
|
||||||
pdoc->InsertString(posLineStart + subLine - 1 + ll->LineStart(subLine), eol);
|
pdoc->InsertString(posLineStart + (subLine - 1) * strlen(eol) +
|
||||||
|
ll->LineStart(subLine), eol);
|
||||||
targetEnd += strlen(eol);
|
targetEnd += strlen(eol);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1845,7 +1856,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
|
|||||||
}
|
}
|
||||||
|
|
||||||
ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
|
ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackground,
|
||||||
ColourAllocated background, bool inSelection, int styleMain, int i, LineLayout *ll) {
|
ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll) {
|
||||||
if (inSelection) {
|
if (inSelection) {
|
||||||
if (vsDraw.selbackset) {
|
if (vsDraw.selbackset) {
|
||||||
if (primarySelection)
|
if (primarySelection)
|
||||||
@@ -1858,6 +1869,8 @@ ColourAllocated Editor::TextBackground(ViewStyle &vsDraw, bool overrideBackgroun
|
|||||||
(i >= ll->edgeColumn) &&
|
(i >= ll->edgeColumn) &&
|
||||||
!IsEOLChar(ll->chars[i]))
|
!IsEOLChar(ll->chars[i]))
|
||||||
return vsDraw.edgecolour.allocated;
|
return vsDraw.edgecolour.allocated;
|
||||||
|
if (inHotspot)
|
||||||
|
return vsDraw.hotspotBackground.allocated;
|
||||||
if (overrideBackground)
|
if (overrideBackground)
|
||||||
return background;
|
return background;
|
||||||
}
|
}
|
||||||
@@ -1990,7 +2003,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) {
|
if ((rcSegment.left <= rcLine.right) && (rcSegment.right >= rcLine.left)) {
|
||||||
int styleMain = ll->styles[i];
|
int styleMain = ll->styles[i];
|
||||||
bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd);
|
bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd);
|
||||||
ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, styleMain, i, ll);
|
bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
|
||||||
|
ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll);
|
||||||
if (ll->chars[i] == '\t') {
|
if (ll->chars[i] == '\t') {
|
||||||
// Tab display
|
// Tab display
|
||||||
if (drawWhitespaceBackground &&
|
if (drawWhitespaceBackground &&
|
||||||
@@ -2050,11 +2064,17 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
int styleMain = ll->styles[i];
|
int styleMain = ll->styles[i];
|
||||||
ColourAllocated textFore = vsDraw.styles[styleMain].fore.allocated;
|
ColourAllocated textFore = vsDraw.styles[styleMain].fore.allocated;
|
||||||
Font &textFont = vsDraw.styles[styleMain].font;
|
Font &textFont = vsDraw.styles[styleMain].font;
|
||||||
|
//hotspot foreground
|
||||||
|
if (ll->hsStart != -1 && iDoc >= ll->hsStart && iDoc < hsEnd) {
|
||||||
|
if (vsDraw.hotspotForegroundSet)
|
||||||
|
textFore = vsDraw.hotspotForeground.allocated;
|
||||||
|
}
|
||||||
bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd);
|
bool inSelection = (iDoc >= ll->selStart) && (iDoc < ll->selEnd) && (ll->selStart != ll->selEnd);
|
||||||
if (inSelection && (vsDraw.selforeset)) {
|
if (inSelection && (vsDraw.selforeset)) {
|
||||||
textFore = vsDraw.selforeground.allocated;
|
textFore = vsDraw.selforeground.allocated;
|
||||||
}
|
}
|
||||||
ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, styleMain, i, ll);
|
bool inHotspot = (ll->hsStart != -1) && (iDoc >= ll->hsStart) && (iDoc < ll->hsEnd);
|
||||||
|
ColourAllocated textBack = TextBackground(vsDraw, overrideBackground, background, inSelection, inHotspot, styleMain, i, ll);
|
||||||
if (ll->chars[i] == '\t') {
|
if (ll->chars[i] == '\t') {
|
||||||
// Tab display
|
// Tab display
|
||||||
if (!twoPhaseDraw) {
|
if (!twoPhaseDraw) {
|
||||||
@@ -2161,7 +2181,15 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (vsDraw.styles[styleMain].underline) {
|
if (ll->hsStart != -1 && vsDraw.hotspotUnderline && iDoc >= ll->hsStart && iDoc < ll->hsEnd ) {
|
||||||
|
PRectangle rcUL = rcSegment;
|
||||||
|
rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
|
||||||
|
rcUL.bottom = rcUL.top + 1;
|
||||||
|
if (vsDraw.hotspotForegroundSet)
|
||||||
|
surface->FillRectangle(rcUL, vsDraw.hotspotForeground.allocated);
|
||||||
|
else
|
||||||
|
surface->FillRectangle(rcUL, textFore);
|
||||||
|
} else if (vsDraw.styles[styleMain].underline) {
|
||||||
PRectangle rcUL = rcSegment;
|
PRectangle rcUL = rcSegment;
|
||||||
rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
|
rcUL.top = rcUL.top + vsDraw.maxAscent + 1;
|
||||||
rcUL.bottom = rcUL.top + 1;
|
rcUL.bottom = rcUL.top + 1;
|
||||||
@@ -2213,8 +2241,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
|
|||||||
|
|
||||||
void Editor::RefreshPixMaps(Surface *surfaceWindow) {
|
void Editor::RefreshPixMaps(Surface *surfaceWindow) {
|
||||||
if (!pixmapSelPattern->Initialised()) {
|
if (!pixmapSelPattern->Initialised()) {
|
||||||
const int patternSize=8;
|
const int patternSize = 8;
|
||||||
pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow);
|
pixmapSelPattern->InitPixMap(patternSize, patternSize, surfaceWindow, wMain.GetID());
|
||||||
// This complex procedure is to reproduce the checkerboard dithered pattern used by windows
|
// This complex procedure is to reproduce the checkerboard dithered pattern used by windows
|
||||||
// for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half
|
// for scroll bars and Visual Studio for its selection margin. The colour of this pattern is half
|
||||||
// way between the chrome colour and the chrome highlight colour making a nice transition
|
// way between the chrome colour and the chrome highlight colour making a nice transition
|
||||||
@@ -2251,8 +2279,8 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) {
|
|||||||
|
|
||||||
if (!pixmapIndentGuide->Initialised()) {
|
if (!pixmapIndentGuide->Initialised()) {
|
||||||
// 1 extra pixel in height so can handle odd/even positions and so produce a continuous line
|
// 1 extra pixel in height so can handle odd/even positions and so produce a continuous line
|
||||||
pixmapIndentGuide->InitPixMap(1, vs.lineHeight + 1, surfaceWindow);
|
pixmapIndentGuide->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID());
|
||||||
pixmapIndentGuideHighlight->InitPixMap(1, vs.lineHeight + 1, surfaceWindow);
|
pixmapIndentGuideHighlight->InitPixMap(1, vs.lineHeight + 1, surfaceWindow, wMain.GetID());
|
||||||
PRectangle rcIG(0, 0, 1, vs.lineHeight);
|
PRectangle rcIG(0, 0, 1, vs.lineHeight);
|
||||||
pixmapIndentGuide->FillRectangle(rcIG, vs.styles[STYLE_INDENTGUIDE].back.allocated);
|
pixmapIndentGuide->FillRectangle(rcIG, vs.styles[STYLE_INDENTGUIDE].back.allocated);
|
||||||
pixmapIndentGuide->PenColour(vs.styles[STYLE_INDENTGUIDE].fore.allocated);
|
pixmapIndentGuide->PenColour(vs.styles[STYLE_INDENTGUIDE].fore.allocated);
|
||||||
@@ -2270,9 +2298,9 @@ void Editor::RefreshPixMaps(Surface *surfaceWindow) {
|
|||||||
if (!pixmapLine->Initialised()) {
|
if (!pixmapLine->Initialised()) {
|
||||||
PRectangle rcClient = GetClientRectangle();
|
PRectangle rcClient = GetClientRectangle();
|
||||||
pixmapLine->InitPixMap(rcClient.Width(), rcClient.Height(),
|
pixmapLine->InitPixMap(rcClient.Width(), rcClient.Height(),
|
||||||
surfaceWindow);
|
surfaceWindow, wMain.GetID());
|
||||||
pixmapSelMargin->InitPixMap(vs.fixedColumnWidth,
|
pixmapSelMargin->InitPixMap(vs.fixedColumnWidth,
|
||||||
rcClient.Height(), surfaceWindow);
|
rcClient.Height(), surfaceWindow, wMain.GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2405,6 +2433,8 @@ void Editor::Paint(Surface *surfaceWindow, PRectangle rcArea) {
|
|||||||
ll->containsCaret = false;
|
ll->containsCaret = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetHotSpotRange(ll->hsStart, ll->hsEnd);
|
||||||
|
|
||||||
PRectangle rcLine = rcClient;
|
PRectangle rcLine = rcClient;
|
||||||
rcLine.top = ypos;
|
rcLine.top = ypos;
|
||||||
rcLine.bottom = ypos + vs.lineHeight;
|
rcLine.bottom = ypos + vs.lineHeight;
|
||||||
@@ -2583,10 +2613,10 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
|
|||||||
if (!pfr)
|
if (!pfr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
AutoSurface surface(pfr->hdc, CodePage());
|
AutoSurface surface(pfr->hdc, this);
|
||||||
if (!surface)
|
if (!surface)
|
||||||
return 0;
|
return 0;
|
||||||
AutoSurface surfaceMeasure(pfr->hdcTarget, CodePage());
|
AutoSurface surfaceMeasure(pfr->hdcTarget, this);
|
||||||
if (!surfaceMeasure) {
|
if (!surfaceMeasure) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -2758,7 +2788,7 @@ long Editor::FormatRange(bool draw, RangeToFormat *pfr) {
|
|||||||
|
|
||||||
int Editor::TextWidth(int style, const char *text) {
|
int Editor::TextWidth(int style, const char *text) {
|
||||||
RefreshStyleData();
|
RefreshStyleData();
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
if (surface) {
|
if (surface) {
|
||||||
return surface->WidthText(vs.styles[style].font, text, strlen(text));
|
return surface->WidthText(vs.styles[style].font, text, strlen(text));
|
||||||
} else {
|
} else {
|
||||||
@@ -2815,7 +2845,7 @@ void Editor::AddCharUTF(char *s, unsigned int len, bool treatAsDBCS) {
|
|||||||
bool wasSelection = currentPos != anchor;
|
bool wasSelection = currentPos != anchor;
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
|
if (inOverstrike && !wasSelection && !RangeContainsProtected(currentPos, currentPos + 1)) {
|
||||||
if (currentPos < (pdoc->Length() - 1)) {
|
if (currentPos < (pdoc->Length())) {
|
||||||
if (!IsEOLChar(pdoc->CharAt(currentPos))) {
|
if (!IsEOLChar(pdoc->CharAt(currentPos))) {
|
||||||
pdoc->DelChar(currentPos);
|
pdoc->DelChar(currentPos);
|
||||||
}
|
}
|
||||||
@@ -3087,6 +3117,24 @@ void Editor::NotifyDoubleClick(Point, bool) {
|
|||||||
NotifyParent(scn);
|
NotifyParent(scn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
|
||||||
|
SCNotification scn;
|
||||||
|
scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
|
||||||
|
scn.position = position;
|
||||||
|
scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
|
||||||
|
(alt ? SCI_ALT : 0);
|
||||||
|
NotifyParent(scn);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
|
||||||
|
SCNotification scn;
|
||||||
|
scn.nmhdr.code = SCN_HOTSPOTCLICK;
|
||||||
|
scn.position = position;
|
||||||
|
scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
|
||||||
|
(alt ? SCI_ALT : 0);
|
||||||
|
NotifyParent(scn);
|
||||||
|
}
|
||||||
|
|
||||||
void Editor::NotifyUpdateUI() {
|
void Editor::NotifyUpdateUI() {
|
||||||
SCNotification scn;
|
SCNotification scn;
|
||||||
scn.nmhdr.code = SCN_UPDATEUI;
|
scn.nmhdr.code = SCN_UPDATEUI;
|
||||||
@@ -3169,7 +3217,7 @@ void Editor::CheckModificationForWrap(DocModification mh) {
|
|||||||
if (wrapState != eWrapNone) {
|
if (wrapState != eWrapNone) {
|
||||||
int lineDoc = pdoc->LineFromPosition(mh.position);
|
int lineDoc = pdoc->LineFromPosition(mh.position);
|
||||||
if (mh.linesAdded == 0) {
|
if (mh.linesAdded == 0) {
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
AutoLineLayout ll(llc, RetrieveLineLayout(lineDoc));
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
LayoutLine(lineDoc, surface, vs, ll, wrapWidth);
|
||||||
@@ -3336,8 +3384,12 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long
|
|||||||
case SCI_SEARCHPREV:
|
case SCI_SEARCHPREV:
|
||||||
case SCI_LINEDOWN:
|
case SCI_LINEDOWN:
|
||||||
case SCI_LINEDOWNEXTEND:
|
case SCI_LINEDOWNEXTEND:
|
||||||
|
case SCI_PARADOWN:
|
||||||
|
case SCI_PARADOWNEXTEND:
|
||||||
case SCI_LINEUP:
|
case SCI_LINEUP:
|
||||||
case SCI_LINEUPEXTEND:
|
case SCI_LINEUPEXTEND:
|
||||||
|
case SCI_PARAUP:
|
||||||
|
case SCI_PARAUPEXTEND:
|
||||||
case SCI_CHARLEFT:
|
case SCI_CHARLEFT:
|
||||||
case SCI_CHARLEFTEXTEND:
|
case SCI_CHARLEFTEXTEND:
|
||||||
case SCI_CHARRIGHT:
|
case SCI_CHARRIGHT:
|
||||||
@@ -3354,6 +3406,10 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long
|
|||||||
case SCI_HOMEEXTEND:
|
case SCI_HOMEEXTEND:
|
||||||
case SCI_LINEEND:
|
case SCI_LINEEND:
|
||||||
case SCI_LINEENDEXTEND:
|
case SCI_LINEENDEXTEND:
|
||||||
|
case SCI_HOMEWRAP:
|
||||||
|
case SCI_HOMEWRAPEXTEND:
|
||||||
|
case SCI_LINEENDWRAP:
|
||||||
|
case SCI_LINEENDWRAPEXTEND:
|
||||||
case SCI_DOCUMENTSTART:
|
case SCI_DOCUMENTSTART:
|
||||||
case SCI_DOCUMENTSTARTEXTEND:
|
case SCI_DOCUMENTSTARTEXTEND:
|
||||||
case SCI_DOCUMENTEND:
|
case SCI_DOCUMENTEND:
|
||||||
@@ -3370,6 +3426,8 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, unsigned long wParam, long
|
|||||||
case SCI_FORMFEED:
|
case SCI_FORMFEED:
|
||||||
case SCI_VCHOME:
|
case SCI_VCHOME:
|
||||||
case SCI_VCHOMEEXTEND:
|
case SCI_VCHOMEEXTEND:
|
||||||
|
case SCI_VCHOMEWRAP:
|
||||||
|
case SCI_VCHOMEWRAPEXTEND:
|
||||||
case SCI_DELWORDLEFT:
|
case SCI_DELWORDLEFT:
|
||||||
case SCI_DELWORDRIGHT:
|
case SCI_DELWORDRIGHT:
|
||||||
case SCI_DELLINELEFT:
|
case SCI_DELLINELEFT:
|
||||||
@@ -3531,7 +3589,7 @@ void Editor::CursorUpOrDown(int direction, bool extend) {
|
|||||||
int Editor::StartEndDisplayLine(int pos, bool start) {
|
int Editor::StartEndDisplayLine(int pos, bool start) {
|
||||||
RefreshStyleData();
|
RefreshStyleData();
|
||||||
int line = pdoc->LineFromPosition(pos);
|
int line = pdoc->LineFromPosition(pos);
|
||||||
AutoSurface surface(CodePage());
|
AutoSurface surface(this);
|
||||||
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
AutoLineLayout ll(llc, RetrieveLineLayout(line));
|
||||||
int posRet = INVALID_POSITION;
|
int posRet = INVALID_POSITION;
|
||||||
if (surface && ll) {
|
if (surface && ll) {
|
||||||
@@ -3568,6 +3626,12 @@ int Editor::KeyCommand(unsigned int iMessage) {
|
|||||||
case SCI_LINEDOWNEXTEND:
|
case SCI_LINEDOWNEXTEND:
|
||||||
CursorUpOrDown(1, true);
|
CursorUpOrDown(1, true);
|
||||||
break;
|
break;
|
||||||
|
case SCI_PARADOWN:
|
||||||
|
MovePositionTo(pdoc->ParaDown(currentPos));
|
||||||
|
break;
|
||||||
|
case SCI_PARADOWNEXTEND:
|
||||||
|
MovePositionTo(pdoc->ParaDown(currentPos), true);
|
||||||
|
break;
|
||||||
case SCI_LINESCROLLDOWN:
|
case SCI_LINESCROLLDOWN:
|
||||||
ScrollTo(topLine + 1);
|
ScrollTo(topLine + 1);
|
||||||
MoveCaretInsideView(false);
|
MoveCaretInsideView(false);
|
||||||
@@ -3578,6 +3642,12 @@ int Editor::KeyCommand(unsigned int iMessage) {
|
|||||||
case SCI_LINEUPEXTEND:
|
case SCI_LINEUPEXTEND:
|
||||||
CursorUpOrDown(-1, true);
|
CursorUpOrDown(-1, true);
|
||||||
break;
|
break;
|
||||||
|
case SCI_PARAUP:
|
||||||
|
MovePositionTo(pdoc->ParaUp(currentPos));
|
||||||
|
break;
|
||||||
|
case SCI_PARAUPEXTEND:
|
||||||
|
MovePositionTo(pdoc->ParaUp(currentPos), true);
|
||||||
|
break;
|
||||||
case SCI_LINESCROLLUP:
|
case SCI_LINESCROLLUP:
|
||||||
ScrollTo(topLine - 1);
|
ScrollTo(topLine - 1);
|
||||||
MoveCaretInsideView(false);
|
MoveCaretInsideView(false);
|
||||||
@@ -3638,6 +3708,38 @@ int Editor::KeyCommand(unsigned int iMessage) {
|
|||||||
MovePositionTo(pdoc->LineEndPosition(currentPos), true);
|
MovePositionTo(pdoc->LineEndPosition(currentPos), true);
|
||||||
SetLastXChosen();
|
SetLastXChosen();
|
||||||
break;
|
break;
|
||||||
|
case SCI_HOMEWRAP: {
|
||||||
|
int homePos = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1);
|
||||||
|
if (currentPos <= homePos)
|
||||||
|
homePos = pdoc->LineStart(pdoc->LineFromPosition(currentPos));
|
||||||
|
MovePositionTo(homePos);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCI_HOMEWRAPEXTEND: {
|
||||||
|
int homePos = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1);
|
||||||
|
if (currentPos <= homePos)
|
||||||
|
homePos = pdoc->LineStart(pdoc->LineFromPosition(currentPos));
|
||||||
|
MovePositionTo(homePos, true);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCI_LINEENDWRAP: {
|
||||||
|
int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1);
|
||||||
|
if (currentPos >= endPos)
|
||||||
|
endPos = pdoc->LineEndPosition(currentPos);
|
||||||
|
MovePositionTo(endPos);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCI_LINEENDWRAPEXTEND: {
|
||||||
|
int endPos = MovePositionSoVisible(StartEndDisplayLine(currentPos, false), 1);
|
||||||
|
if (currentPos >= endPos)
|
||||||
|
endPos = pdoc->LineEndPosition(currentPos);
|
||||||
|
MovePositionTo(endPos, true);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SCI_DOCUMENTSTART:
|
case SCI_DOCUMENTSTART:
|
||||||
MovePositionTo(0);
|
MovePositionTo(0);
|
||||||
SetLastXChosen();
|
SetLastXChosen();
|
||||||
@@ -3710,6 +3812,26 @@ int Editor::KeyCommand(unsigned int iMessage) {
|
|||||||
MovePositionTo(pdoc->VCHomePosition(currentPos), true);
|
MovePositionTo(pdoc->VCHomePosition(currentPos), true);
|
||||||
SetLastXChosen();
|
SetLastXChosen();
|
||||||
break;
|
break;
|
||||||
|
case SCI_VCHOMEWRAP: {
|
||||||
|
int homePos = pdoc->VCHomePosition(currentPos);
|
||||||
|
int viewLineStart = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1);
|
||||||
|
if ((viewLineStart < currentPos) && (viewLineStart > homePos))
|
||||||
|
homePos = viewLineStart;
|
||||||
|
|
||||||
|
MovePositionTo(homePos);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SCI_VCHOMEWRAPEXTEND: {
|
||||||
|
int homePos = pdoc->VCHomePosition(currentPos);
|
||||||
|
int viewLineStart = MovePositionSoVisible(StartEndDisplayLine(currentPos, true), -1);
|
||||||
|
if ((viewLineStart < currentPos) && (viewLineStart > homePos))
|
||||||
|
homePos = viewLineStart;
|
||||||
|
|
||||||
|
MovePositionTo(homePos, true);
|
||||||
|
SetLastXChosen();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SCI_ZOOMIN:
|
case SCI_ZOOMIN:
|
||||||
if (vs.zoomLevel < 20) {
|
if (vs.zoomLevel < 20) {
|
||||||
vs.zoomLevel++;
|
vs.zoomLevel++;
|
||||||
@@ -3930,7 +4052,7 @@ void Editor::Indent(bool forwards) {
|
|||||||
*/
|
*/
|
||||||
long Editor::FindText(
|
long Editor::FindText(
|
||||||
uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
|
uptr_t wParam, ///< Search modes : @c SCFIND_MATCHCASE, @c SCFIND_WHOLEWORD,
|
||||||
///< @c SCFIND_WORDSTART or @c SCFIND_REGEXP.
|
///< @c SCFIND_WORDSTART, @c SCFIND_REGEXP or @c SCFIND_POSIX.
|
||||||
sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range.
|
sptr_t lParam) { ///< @c TextToFind structure: The text to search for in the given range.
|
||||||
|
|
||||||
TextToFind *ft = reinterpret_cast<TextToFind *>(lParam);
|
TextToFind *ft = reinterpret_cast<TextToFind *>(lParam);
|
||||||
@@ -3940,6 +4062,7 @@ long Editor::FindText(
|
|||||||
(wParam & SCFIND_WHOLEWORD) != 0,
|
(wParam & SCFIND_WHOLEWORD) != 0,
|
||||||
(wParam & SCFIND_WORDSTART) != 0,
|
(wParam & SCFIND_WORDSTART) != 0,
|
||||||
(wParam & SCFIND_REGEXP) != 0,
|
(wParam & SCFIND_REGEXP) != 0,
|
||||||
|
(wParam & SCFIND_POSIX) != 0,
|
||||||
&lengthFound);
|
&lengthFound);
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
ft->chrgText.cpMin = pos;
|
ft->chrgText.cpMin = pos;
|
||||||
@@ -3983,6 +4106,7 @@ long Editor::SearchText(
|
|||||||
(wParam & SCFIND_WHOLEWORD) != 0,
|
(wParam & SCFIND_WHOLEWORD) != 0,
|
||||||
(wParam & SCFIND_WORDSTART) != 0,
|
(wParam & SCFIND_WORDSTART) != 0,
|
||||||
(wParam & SCFIND_REGEXP) != 0,
|
(wParam & SCFIND_REGEXP) != 0,
|
||||||
|
(wParam & SCFIND_POSIX) != 0,
|
||||||
&lengthFound);
|
&lengthFound);
|
||||||
} else {
|
} else {
|
||||||
pos = pdoc->FindText(searchAnchor, 0, txt,
|
pos = pdoc->FindText(searchAnchor, 0, txt,
|
||||||
@@ -3990,6 +4114,7 @@ long Editor::SearchText(
|
|||||||
(wParam & SCFIND_WHOLEWORD) != 0,
|
(wParam & SCFIND_WHOLEWORD) != 0,
|
||||||
(wParam & SCFIND_WORDSTART) != 0,
|
(wParam & SCFIND_WORDSTART) != 0,
|
||||||
(wParam & SCFIND_REGEXP) != 0,
|
(wParam & SCFIND_REGEXP) != 0,
|
||||||
|
(wParam & SCFIND_POSIX) != 0,
|
||||||
&lengthFound);
|
&lengthFound);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4011,6 +4136,7 @@ long Editor::SearchInTarget(const char *text, int length) {
|
|||||||
(searchFlags & SCFIND_WHOLEWORD) != 0,
|
(searchFlags & SCFIND_WHOLEWORD) != 0,
|
||||||
(searchFlags & SCFIND_WORDSTART) != 0,
|
(searchFlags & SCFIND_WORDSTART) != 0,
|
||||||
(searchFlags & SCFIND_REGEXP) != 0,
|
(searchFlags & SCFIND_REGEXP) != 0,
|
||||||
|
(searchFlags & SCFIND_POSIX) != 0,
|
||||||
&lengthFound);
|
&lengthFound);
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
targetStart = pos;
|
targetStart = pos;
|
||||||
@@ -4280,7 +4406,7 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
|
|||||||
SetEmptySelection(newPos);
|
SetEmptySelection(newPos);
|
||||||
bool doubleClick = false;
|
bool doubleClick = false;
|
||||||
// Stop mouse button bounce changing selection type
|
// Stop mouse button bounce changing selection type
|
||||||
if (curTime != lastClickTime) {
|
if (!Platform::MouseButtonBounce() || curTime != lastClickTime) {
|
||||||
if (selectionType == selChar) {
|
if (selectionType == selChar) {
|
||||||
selectionType = selWord;
|
selectionType = selWord;
|
||||||
doubleClick = true;
|
doubleClick = true;
|
||||||
@@ -4308,8 +4434,11 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
|
|||||||
SetEmptySelection(currentPos);
|
SetEmptySelection(currentPos);
|
||||||
}
|
}
|
||||||
//Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos);
|
//Platform::DebugPrintf("Double click: %d - %d\n", anchor, currentPos);
|
||||||
if (doubleClick)
|
if (doubleClick) {
|
||||||
NotifyDoubleClick(pt, shift);
|
NotifyDoubleClick(pt, shift);
|
||||||
|
if (PositionIsHotspot(newPos))
|
||||||
|
NotifyHotSpotDoubleClicked(newPos, shift, ctrl, alt);
|
||||||
|
}
|
||||||
} else { // Single click
|
} else { // Single click
|
||||||
if (inSelMargin) {
|
if (inSelMargin) {
|
||||||
selType = selStream;
|
selType = selStream;
|
||||||
@@ -4339,6 +4468,9 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
|
|||||||
SetMouseCapture(true);
|
SetMouseCapture(true);
|
||||||
selectionType = selLine;
|
selectionType = selLine;
|
||||||
} else {
|
} else {
|
||||||
|
if (PositionIsHotspot(newPos)) {
|
||||||
|
NotifyHotSpotClicked(newPos, shift, ctrl, alt);
|
||||||
|
}
|
||||||
if (!shift) {
|
if (!shift) {
|
||||||
inDragDrop = PointInSelection(pt);
|
inDragDrop = PointInSelection(pt);
|
||||||
}
|
}
|
||||||
@@ -4365,6 +4497,53 @@ void Editor::ButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, b
|
|||||||
ShowCaretAtCurrentPosition();
|
ShowCaretAtCurrentPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Editor::PositionIsHotspot(int position) {
|
||||||
|
return vs.styles[pdoc->StyleAt(position)].hotspot;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Editor::PointIsHotspot(Point pt) {
|
||||||
|
int pos = PositionFromLocation(pt);
|
||||||
|
return PositionIsHotspot(pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Editor::SetHotSpotRange(Point *pt) {
|
||||||
|
if (pt) {
|
||||||
|
int pos = PositionFromLocation(*pt);
|
||||||
|
|
||||||
|
// If we don't limit this to word characters then the
|
||||||
|
// range can encompass more than the run range and then
|
||||||
|
// the underline will not be drawn properly.
|
||||||
|
int hsStart_ = pdoc->ExtendStyleRange(pos, -1);
|
||||||
|
int hsEnd_ = pdoc->ExtendStyleRange(pos, 1);
|
||||||
|
|
||||||
|
// Only invalidate the range if the hotspot range has changed...
|
||||||
|
if (hsStart_ != hsStart || hsEnd_ != hsEnd) {
|
||||||
|
if (hsStart != -1) {
|
||||||
|
InvalidateRange(hsStart, hsEnd);
|
||||||
|
}
|
||||||
|
hsStart = hsStart_;
|
||||||
|
hsEnd = hsEnd_;
|
||||||
|
InvalidateRange(hsStart, hsEnd);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (hsStart != -1) {
|
||||||
|
int hsStart_ = hsStart;
|
||||||
|
int hsEnd_ = hsEnd;
|
||||||
|
hsStart = -1;
|
||||||
|
hsEnd = -1;
|
||||||
|
InvalidateRange(hsStart_, hsEnd_);
|
||||||
|
} else {
|
||||||
|
hsStart = -1;
|
||||||
|
hsEnd = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Editor::GetHotSpotRange(int& hsStart_, int& hsEnd_) {
|
||||||
|
hsStart_ = hsStart;
|
||||||
|
hsEnd_ = hsEnd;
|
||||||
|
}
|
||||||
|
|
||||||
void Editor::ButtonMove(Point pt) {
|
void Editor::ButtonMove(Point pt) {
|
||||||
if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
|
if ((ptMouseLast.x != pt.x) || (ptMouseLast.y != pt.y)) {
|
||||||
DwellEnd(true);
|
DwellEnd(true);
|
||||||
@@ -4409,7 +4588,7 @@ void Editor::ButtonMove(Point pt) {
|
|||||||
if (pt.y > rcClient.bottom) {
|
if (pt.y > rcClient.bottom) {
|
||||||
int lineMove = cs.DisplayFromDoc(LineFromLocation(pt));
|
int lineMove = cs.DisplayFromDoc(LineFromLocation(pt));
|
||||||
if (lineMove < 0) {
|
if (lineMove < 0) {
|
||||||
lineMove = cs.DisplayFromDoc(pdoc->LinesTotal()-1);
|
lineMove = cs.DisplayFromDoc(pdoc->LinesTotal() - 1);
|
||||||
}
|
}
|
||||||
ScrollTo(lineMove - LinesOnScreen() + 5);
|
ScrollTo(lineMove - LinesOnScreen() + 5);
|
||||||
Redraw();
|
Redraw();
|
||||||
@@ -4420,6 +4599,9 @@ void Editor::ButtonMove(Point pt) {
|
|||||||
}
|
}
|
||||||
EnsureCaretVisible(false, false, true);
|
EnsureCaretVisible(false, false, true);
|
||||||
|
|
||||||
|
if (hsStart != -1 && !PositionIsHotspot(movePos))
|
||||||
|
SetHotSpotRange(NULL);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (vs.fixedColumnWidth > 0) { // There is a margin
|
if (vs.fixedColumnWidth > 0) { // There is a margin
|
||||||
if (PointInSelMargin(pt)) {
|
if (PointInSelMargin(pt)) {
|
||||||
@@ -4428,10 +4610,15 @@ void Editor::ButtonMove(Point pt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Display regular (drag) cursor over selection
|
// Display regular (drag) cursor over selection
|
||||||
if (PointInSelection(pt))
|
if (PointInSelection(pt)) {
|
||||||
DisplayCursor(Window::cursorArrow);
|
DisplayCursor(Window::cursorArrow);
|
||||||
else
|
} else if (PointIsHotspot(pt)) {
|
||||||
|
DisplayCursor(Window::cursorHand);
|
||||||
|
SetHotSpotRange(&pt);
|
||||||
|
} else {
|
||||||
DisplayCursor(Window::cursorText);
|
DisplayCursor(Window::cursorText);
|
||||||
|
SetHotSpotRange(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -4443,6 +4630,7 @@ void Editor::ButtonUp(Point pt, unsigned int curTime, bool ctrl) {
|
|||||||
DisplayCursor(Window::cursorReverseArrow);
|
DisplayCursor(Window::cursorReverseArrow);
|
||||||
} else {
|
} else {
|
||||||
DisplayCursor(Window::cursorText);
|
DisplayCursor(Window::cursorText);
|
||||||
|
SetHotSpotRange(NULL);
|
||||||
}
|
}
|
||||||
xEndSelect = pt.x - vs.fixedColumnWidth + xOffset;
|
xEndSelect = pt.x - vs.fixedColumnWidth + xOffset;
|
||||||
ptMouseLast = pt;
|
ptMouseLast = pt;
|
||||||
@@ -4524,6 +4712,7 @@ void Editor::SetFocusState(bool focusState) {
|
|||||||
if (hasFocus) {
|
if (hasFocus) {
|
||||||
ShowCaretAtCurrentPosition();
|
ShowCaretAtCurrentPosition();
|
||||||
} else {
|
} else {
|
||||||
|
CancelModes();
|
||||||
DropCaret();
|
DropCaret();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4668,6 +4857,13 @@ void Editor::SetDocPointer(Document *document) {
|
|||||||
pdoc = document;
|
pdoc = document;
|
||||||
}
|
}
|
||||||
pdoc->AddRef();
|
pdoc->AddRef();
|
||||||
|
|
||||||
|
// Ensure all positions within document
|
||||||
|
currentPos = 0;
|
||||||
|
anchor = 0;
|
||||||
|
targetStart = 0;
|
||||||
|
targetEnd = 0;
|
||||||
|
|
||||||
// Reset the contraction state to fully shown.
|
// Reset the contraction state to fully shown.
|
||||||
cs.Clear();
|
cs.Clear();
|
||||||
cs.InsertLines(0, pdoc->LinesTotal() - 1);
|
cs.InsertLines(0, pdoc->LinesTotal() - 1);
|
||||||
@@ -4676,7 +4872,10 @@ void Editor::SetDocPointer(Document *document) {
|
|||||||
|
|
||||||
pdoc->AddWatcher(this, 0);
|
pdoc->AddWatcher(this, 0);
|
||||||
Redraw();
|
Redraw();
|
||||||
SetScrollBars();
|
// Removed because of reentrance problems of GTK+ 2.x
|
||||||
|
// where changing a scroll bar position causes synchronous
|
||||||
|
// painting before lexer and styling state is set up.
|
||||||
|
//SetScrollBars();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively expand a fold, making lines visible except where they have an unexpanded parent
|
// Recursively expand a fold, making lines visible except where they have an unexpanded parent
|
||||||
@@ -5439,7 +5638,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SCI_TEXTWIDTH:
|
case SCI_TEXTWIDTH:
|
||||||
PLATFORM_ASSERT((wParam >= 0) && (wParam <= STYLE_MAX));
|
PLATFORM_ASSERT(wParam <= STYLE_MAX);
|
||||||
PLATFORM_ASSERT(lParam);
|
PLATFORM_ASSERT(lParam);
|
||||||
return TextWidth(wParam, CharPtrFromSPtr(lParam));
|
return TextWidth(wParam, CharPtrFromSPtr(lParam));
|
||||||
|
|
||||||
@@ -5710,6 +5909,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
InvalidateStyleRedraw();
|
InvalidateStyleRedraw();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case SCI_STYLESETHOTSPOT:
|
||||||
|
if (wParam <= STYLE_MAX) {
|
||||||
|
vs.styles[wParam].hotspot = lParam != 0;
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case SCI_STYLERESETDEFAULT:
|
case SCI_STYLERESETDEFAULT:
|
||||||
vs.ResetDefaultStyle();
|
vs.ResetDefaultStyle();
|
||||||
@@ -5923,8 +6128,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
|
|
||||||
case SCI_LINEDOWN:
|
case SCI_LINEDOWN:
|
||||||
case SCI_LINEDOWNEXTEND:
|
case SCI_LINEDOWNEXTEND:
|
||||||
|
case SCI_PARADOWN:
|
||||||
|
case SCI_PARADOWNEXTEND:
|
||||||
case SCI_LINEUP:
|
case SCI_LINEUP:
|
||||||
case SCI_LINEUPEXTEND:
|
case SCI_LINEUPEXTEND:
|
||||||
|
case SCI_PARAUP:
|
||||||
|
case SCI_PARAUPEXTEND:
|
||||||
case SCI_CHARLEFT:
|
case SCI_CHARLEFT:
|
||||||
case SCI_CHARLEFTEXTEND:
|
case SCI_CHARLEFTEXTEND:
|
||||||
case SCI_CHARRIGHT:
|
case SCI_CHARRIGHT:
|
||||||
@@ -5937,6 +6146,10 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
case SCI_HOMEEXTEND:
|
case SCI_HOMEEXTEND:
|
||||||
case SCI_LINEEND:
|
case SCI_LINEEND:
|
||||||
case SCI_LINEENDEXTEND:
|
case SCI_LINEENDEXTEND:
|
||||||
|
case SCI_HOMEWRAP:
|
||||||
|
case SCI_HOMEWRAPEXTEND:
|
||||||
|
case SCI_LINEENDWRAP:
|
||||||
|
case SCI_LINEENDWRAPEXTEND:
|
||||||
case SCI_DOCUMENTSTART:
|
case SCI_DOCUMENTSTART:
|
||||||
case SCI_DOCUMENTSTARTEXTEND:
|
case SCI_DOCUMENTSTARTEXTEND:
|
||||||
case SCI_DOCUMENTEND:
|
case SCI_DOCUMENTEND:
|
||||||
@@ -5954,6 +6167,8 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
case SCI_FORMFEED:
|
case SCI_FORMFEED:
|
||||||
case SCI_VCHOME:
|
case SCI_VCHOME:
|
||||||
case SCI_VCHOMEEXTEND:
|
case SCI_VCHOMEEXTEND:
|
||||||
|
case SCI_VCHOMEWRAP:
|
||||||
|
case SCI_VCHOMEWRAPEXTEND:
|
||||||
case SCI_ZOOMIN:
|
case SCI_ZOOMIN:
|
||||||
case SCI_ZOOMOUT:
|
case SCI_ZOOMOUT:
|
||||||
case SCI_DELWORDLEFT:
|
case SCI_DELWORDLEFT:
|
||||||
@@ -6037,6 +6252,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
return reinterpret_cast<sptr_t>(pdoc);
|
return reinterpret_cast<sptr_t>(pdoc);
|
||||||
|
|
||||||
case SCI_SETDOCPOINTER:
|
case SCI_SETDOCPOINTER:
|
||||||
|
CancelModes();
|
||||||
SetDocPointer(reinterpret_cast<Document *>(lParam));
|
SetDocPointer(reinterpret_cast<Document *>(lParam));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -6138,6 +6354,23 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
|
|||||||
InvalidateStyleRedraw();
|
InvalidateStyleRedraw();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SCI_SETHOTSPOTACTIVEFORE:
|
||||||
|
vs.hotspotForegroundSet = wParam != 0;
|
||||||
|
vs.hotspotForeground.desired = ColourDesired(lParam);
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCI_SETHOTSPOTACTIVEBACK:
|
||||||
|
vs.hotspotBackgroundSet = wParam != 0;
|
||||||
|
vs.hotspotBackground.desired = ColourDesired(lParam);
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCI_SETHOTSPOTACTIVEUNDERLINE:
|
||||||
|
vs.hotspotUnderline = wParam != 0;
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return DefWndProc(iMessage, wParam, lParam);
|
return DefWndProc(iMessage, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
@@ -58,6 +58,10 @@ public:
|
|||||||
int *positions;
|
int *positions;
|
||||||
char bracePreviousStyles[2];
|
char bracePreviousStyles[2];
|
||||||
|
|
||||||
|
// Hotspot support
|
||||||
|
int hsStart;
|
||||||
|
int hsEnd;
|
||||||
|
|
||||||
// Wrapped line support
|
// Wrapped line support
|
||||||
int widthLine;
|
int widthLine;
|
||||||
int lines;
|
int lines;
|
||||||
@@ -131,40 +135,6 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* A smart pointer class to ensure Surfaces are set up and deleted correctly.
|
|
||||||
*/
|
|
||||||
class AutoSurface {
|
|
||||||
private:
|
|
||||||
Surface *surf;
|
|
||||||
public:
|
|
||||||
AutoSurface(int codePage) {
|
|
||||||
surf = Surface::Allocate();
|
|
||||||
if (surf) {
|
|
||||||
surf->Init();
|
|
||||||
surf->SetUnicodeMode(SC_CP_UTF8 == codePage);
|
|
||||||
surf->SetDBCSMode(codePage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AutoSurface(SurfaceID sid, int codePage) {
|
|
||||||
surf = Surface::Allocate();
|
|
||||||
if (surf) {
|
|
||||||
surf->Init(sid);
|
|
||||||
surf->SetUnicodeMode(SC_CP_UTF8 == codePage);
|
|
||||||
surf->SetDBCSMode(codePage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
~AutoSurface() {
|
|
||||||
delete surf;
|
|
||||||
}
|
|
||||||
Surface *operator->() const {
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
operator Surface *() const {
|
|
||||||
return surf;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class Editor : public DocWatcher {
|
class Editor : public DocWatcher {
|
||||||
@@ -282,6 +252,10 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
|||||||
int foldFlags;
|
int foldFlags;
|
||||||
ContractionState cs;
|
ContractionState cs;
|
||||||
|
|
||||||
|
// Hotspot support
|
||||||
|
int hsStart;
|
||||||
|
int hsEnd;
|
||||||
|
|
||||||
// Wrapping support
|
// Wrapping support
|
||||||
enum { eWrapNone, eWrapWord } wrapState;
|
enum { eWrapNone, eWrapWord } wrapState;
|
||||||
int wrapWidth;
|
int wrapWidth;
|
||||||
@@ -355,7 +329,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
|||||||
LineLayout *RetrieveLineLayout(int lineNumber);
|
LineLayout *RetrieveLineLayout(int lineNumber);
|
||||||
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
|
void LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayout *ll,
|
||||||
int width=LineLayout::wrapWidthInfinite);
|
int width=LineLayout::wrapWidthInfinite);
|
||||||
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, int styleMain, int i, LineLayout *ll);
|
ColourAllocated TextBackground(ViewStyle &vsDraw, bool overrideBackground, ColourAllocated background, bool inSelection, bool inHotspot, int styleMain, int i, LineLayout *ll);
|
||||||
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
|
void DrawIndentGuide(Surface *surface, int lineVisible, int lineHeight, int start, PRectangle rcSegment, bool highlight);
|
||||||
void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
|
void DrawEOL(Surface *surface, ViewStyle &vsDraw, PRectangle rcLine, LineLayout *ll,
|
||||||
int line, int lineEnd, int xStart, int subLine, int subLineStart,
|
int line, int lineEnd, int xStart, int subLine, int subLineStart,
|
||||||
@@ -402,6 +376,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
|||||||
void NotifySavePoint(bool isSavePoint);
|
void NotifySavePoint(bool isSavePoint);
|
||||||
void NotifyModifyAttempt();
|
void NotifyModifyAttempt();
|
||||||
virtual void NotifyDoubleClick(Point pt, bool shift);
|
virtual void NotifyDoubleClick(Point pt, bool shift);
|
||||||
|
void NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt);
|
||||||
|
void NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt);
|
||||||
void NotifyUpdateUI();
|
void NotifyUpdateUI();
|
||||||
void NotifyPainted();
|
void NotifyPainted();
|
||||||
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
|
bool NotifyMarginClick(Point pt, bool shift, bool ctrl, bool alt);
|
||||||
@@ -474,6 +450,11 @@ protected: // ScintillaBase subclass needs access to much of Editor
|
|||||||
void EnsureLineVisible(int lineDoc, bool enforcePolicy);
|
void EnsureLineVisible(int lineDoc, bool enforcePolicy);
|
||||||
int ReplaceTarget(bool replacePatterns, const char *text, int length=-1);
|
int ReplaceTarget(bool replacePatterns, const char *text, int length=-1);
|
||||||
|
|
||||||
|
bool PositionIsHotspot(int position);
|
||||||
|
bool PointIsHotspot(Point pt);
|
||||||
|
void SetHotSpotRange(Point *pt);
|
||||||
|
void GetHotSpotRange(int& hsStart, int& hsEnd);
|
||||||
|
|
||||||
int CodePage() const;
|
int CodePage() const;
|
||||||
|
|
||||||
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;
|
virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0;
|
||||||
@@ -485,6 +466,45 @@ public:
|
|||||||
virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
virtual sptr_t WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam);
|
||||||
// Public so scintilla_set_id can use it.
|
// Public so scintilla_set_id can use it.
|
||||||
int ctrlID;
|
int ctrlID;
|
||||||
|
friend class AutoSurface;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A smart pointer class to ensure Surfaces are set up and deleted correctly.
|
||||||
|
*/
|
||||||
|
class AutoSurface {
|
||||||
|
private:
|
||||||
|
Surface *surf;
|
||||||
|
public:
|
||||||
|
AutoSurface(Editor *ed) : surf(0) {
|
||||||
|
if (ed->wMain.GetID()) {
|
||||||
|
surf = Surface::Allocate();
|
||||||
|
if (surf) {
|
||||||
|
surf->Init(ed->wMain.GetID());
|
||||||
|
surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
|
||||||
|
surf->SetDBCSMode(ed->CodePage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AutoSurface(SurfaceID sid, Editor *ed) : surf(0) {
|
||||||
|
if (ed->wMain.GetID()) {
|
||||||
|
surf = Surface::Allocate();
|
||||||
|
if (surf) {
|
||||||
|
surf->Init(sid, ed->wMain.GetID());
|
||||||
|
surf->SetUnicodeMode(SC_CP_UTF8 == ed->CodePage());
|
||||||
|
surf->SetDBCSMode(ed->CodePage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~AutoSurface() {
|
||||||
|
delete surf;
|
||||||
|
}
|
||||||
|
Surface *operator->() const {
|
||||||
|
return surf;
|
||||||
|
}
|
||||||
|
operator Surface *() const {
|
||||||
|
return surf;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -66,9 +66,13 @@ const KeyToCommand KeyMap::MapDefault[] = {
|
|||||||
{SCK_DOWN, SCI_NORM, SCI_LINEDOWN},
|
{SCK_DOWN, SCI_NORM, SCI_LINEDOWN},
|
||||||
{SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
|
{SCK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
|
||||||
{SCK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN},
|
{SCK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN},
|
||||||
|
{SCK_DOWN, SCI_ALT, SCI_PARADOWN},
|
||||||
|
{SCK_DOWN, SCI_ASHIFT, SCI_PARADOWNEXTEND},
|
||||||
{SCK_UP, SCI_NORM, SCI_LINEUP},
|
{SCK_UP, SCI_NORM, SCI_LINEUP},
|
||||||
{SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
|
{SCK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
|
||||||
{SCK_UP, SCI_CTRL, SCI_LINESCROLLUP},
|
{SCK_UP, SCI_CTRL, SCI_LINESCROLLUP},
|
||||||
|
{SCK_UP, SCI_ALT, SCI_PARAUP},
|
||||||
|
{SCK_UP, SCI_ASHIFT, SCI_PARAUPEXTEND},
|
||||||
{SCK_LEFT, SCI_NORM, SCI_CHARLEFT},
|
{SCK_LEFT, SCI_NORM, SCI_CHARLEFT},
|
||||||
{SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
|
{SCK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
|
||||||
{SCK_LEFT, SCI_CTRL, SCI_WORDLEFT},
|
{SCK_LEFT, SCI_CTRL, SCI_WORDLEFT},
|
||||||
|
@@ -171,6 +171,7 @@ int Scintilla_LinkLexers() {
|
|||||||
LINK_LEXER(lmLatex);
|
LINK_LEXER(lmLatex);
|
||||||
LINK_LEXER(lmPascal);
|
LINK_LEXER(lmPascal);
|
||||||
LINK_LEXER(lmPerl);
|
LINK_LEXER(lmPerl);
|
||||||
|
LINK_LEXER(lmPOV);
|
||||||
LINK_LEXER(lmPython);
|
LINK_LEXER(lmPython);
|
||||||
LINK_LEXER(lmRuby);
|
LINK_LEXER(lmRuby);
|
||||||
LINK_LEXER(lmSQL);
|
LINK_LEXER(lmSQL);
|
||||||
|
@@ -30,7 +30,12 @@ static void ColouriseDocument(
|
|||||||
WordList *keywordlists[],
|
WordList *keywordlists[],
|
||||||
Accessor &styler);
|
Accessor &styler);
|
||||||
|
|
||||||
LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada");
|
static const char * const adaWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmAda(SCLEX_ADA, ColouriseDocument, "ada", NULL, adaWordListDesc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Implementation
|
* Implementation
|
||||||
|
@@ -129,5 +129,14 @@ static void ColouriseAsmDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
sc.Complete();
|
sc.Complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmAsm(SCLEX_ASM, ColouriseAsmDoc, "asm");
|
static const char * const asmWordListDesc[] = {
|
||||||
|
"CPU instructions",
|
||||||
|
"FPU instructions",
|
||||||
|
"Registers",
|
||||||
|
"Directives",
|
||||||
|
"Directive operands",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmAsm(SCLEX_ASM, ColouriseAsmDoc, "asm", 0, asmWordListDesc);
|
||||||
|
|
||||||
|
@@ -30,18 +30,6 @@ static int classifyWordBullant(unsigned int start, unsigned int end, WordList &k
|
|||||||
else {
|
else {
|
||||||
if (keywords.InList(s)) {
|
if (keywords.InList(s)) {
|
||||||
chAttr = SCE_C_WORD;
|
chAttr = SCE_C_WORD;
|
||||||
/* if (strcmp(s, "end method") == 0 ||
|
|
||||||
strcmp(s, "end case") == 0 ||
|
|
||||||
strcmp(s, "end class") == 0 ||
|
|
||||||
strcmp(s, "end debug") == 0 ||
|
|
||||||
strcmp(s, "end test") == 0 ||
|
|
||||||
strcmp(s, "end if") == 0 ||
|
|
||||||
strcmp(s, "end lock") == 0 ||
|
|
||||||
strcmp(s, "end transaction") == 0 ||
|
|
||||||
strcmp(s, "end trap") == 0 ||
|
|
||||||
strcmp(s, "end until") == 0 ||
|
|
||||||
strcmp(s, "end while") == 0)
|
|
||||||
lev = -1;*/
|
|
||||||
if (strcmp(s, "end") == 0)
|
if (strcmp(s, "end") == 0)
|
||||||
lev = -1;
|
lev = -1;
|
||||||
else if (strcmp(s, "method") == 0 ||
|
else if (strcmp(s, "method") == 0 ||
|
||||||
@@ -80,7 +68,6 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle
|
|||||||
char chNext = styler[startPos];
|
char chNext = styler[startPos];
|
||||||
unsigned int lengthDoc = startPos + length;
|
unsigned int lengthDoc = startPos + length;
|
||||||
int visibleChars = 0;
|
int visibleChars = 0;
|
||||||
// int blockChange = 0;
|
|
||||||
styler.StartSegment(startPos);
|
styler.StartSegment(startPos);
|
||||||
int endFoundThisLine = 0;
|
int endFoundThisLine = 0;
|
||||||
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
for (unsigned int i = startPos; i < lengthDoc; i++) {
|
||||||
@@ -230,4 +217,9 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant");
|
static const char * const bullantWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmBullant(SCLEX_BULLANT, ColouriseBullantDoc, "bullant", 0, bullantWordListDesc);
|
||||||
|
@@ -21,10 +21,8 @@
|
|||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "SciLexer.h"
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static inline bool IsAWordChar(const unsigned int ch) {
|
static inline bool IsAWordChar(const unsigned int ch) {
|
||||||
return (isalnum(ch) || ch == '-' || ch >= 161);
|
return (isalnum(ch) || ch == '-' || ch == '_' || ch >= 161); // _ is not in fact correct CSS word-character
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsCssOperator(const char ch) {
|
inline bool IsCssOperator(const char ch) {
|
||||||
@@ -73,6 +71,17 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
if (sc.state == SCE_CSS_COMMENT)
|
if (sc.state == SCE_CSS_COMMENT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (sc.state == SCE_CSS_DOUBLESTRING || sc.state == SCE_CSS_SINGLESTRING) {
|
||||||
|
if (sc.ch != (sc.state == SCE_CSS_DOUBLESTRING ? '\"' : '\''))
|
||||||
|
continue;
|
||||||
|
unsigned int i = sc.currentPos;
|
||||||
|
while (i && styler[i-1] == '\\')
|
||||||
|
i--;
|
||||||
|
if ((sc.currentPos - i) % 2 == 1)
|
||||||
|
continue;
|
||||||
|
sc.ForwardSetState(SCE_CSS_VALUE);
|
||||||
|
}
|
||||||
|
|
||||||
if (sc.state == SCE_CSS_OPERATOR) {
|
if (sc.state == SCE_CSS_OPERATOR) {
|
||||||
if (op == ' ') {
|
if (op == ' ') {
|
||||||
unsigned int i = startPos;
|
unsigned int i = startPos;
|
||||||
@@ -99,7 +108,7 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
sc.SetState(SCE_CSS_DEFAULT);
|
sc.SetState(SCE_CSS_DEFAULT);
|
||||||
break;
|
break;
|
||||||
case ':':
|
case ':':
|
||||||
if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID)
|
if (lastState == SCE_CSS_TAG || lastState == SCE_CSS_PSEUDOCLASS || lastState == SCE_CSS_DEFAULT || lastState == SCE_CSS_CLASS || lastState == SCE_CSS_ID)
|
||||||
sc.SetState(SCE_CSS_PSEUDOCLASS);
|
sc.SetState(SCE_CSS_PSEUDOCLASS);
|
||||||
else if (lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_UNKNOWN_IDENTIFIER)
|
else if (lastState == SCE_CSS_IDENTIFIER || lastState == SCE_CSS_UNKNOWN_IDENTIFIER)
|
||||||
sc.SetState(SCE_CSS_VALUE);
|
sc.SetState(SCE_CSS_VALUE);
|
||||||
@@ -169,17 +178,16 @@ static void ColouriseCssDoc(unsigned int startPos, int length, int initStyle, Wo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && (sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || sc.state == SCE_CSS_ID))
|
if (sc.ch != '.' && sc.ch != ':' && sc.ch != '#' && (sc.state == SCE_CSS_CLASS || sc.state == SCE_CSS_PSEUDOCLASS || sc.state == SCE_CSS_UNKNOWN_PSEUDOCLASS || sc.state == SCE_CSS_ID))
|
||||||
sc.SetState(SCE_CSS_TAG);
|
sc.SetState(SCE_CSS_TAG);
|
||||||
|
|
||||||
if (sc.Match('/', '*')) {
|
if (sc.Match('/', '*')) {
|
||||||
lastStateC = sc.state;
|
lastStateC = sc.state;
|
||||||
sc.SetState(SCE_CSS_COMMENT);
|
sc.SetState(SCE_CSS_COMMENT);
|
||||||
sc.Forward();
|
sc.Forward();
|
||||||
continue;
|
} else if (sc.state == SCE_CSS_VALUE && (sc.ch == '\"' || sc.ch == '\'')) {
|
||||||
}
|
sc.SetState((sc.ch == '\"' ? SCE_CSS_DOUBLESTRING : SCE_CSS_SINGLESTRING));
|
||||||
|
} else if (IsCssOperator(static_cast<char>(sc.ch))
|
||||||
if (IsCssOperator(static_cast<char>(sc.ch))
|
|
||||||
&& (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!')
|
&& (sc.state != SCE_CSS_VALUE || sc.ch == ';' || sc.ch == '}' || sc.ch == '!')
|
||||||
&& (sc.state != SCE_CSS_DIRECTIVE || sc.ch == ';' || sc.ch == '{')
|
&& (sc.state != SCE_CSS_DIRECTIVE || sc.ch == ';' || sc.ch == '{')
|
||||||
) {
|
) {
|
||||||
@@ -243,4 +251,10 @@ static void FoldCSSDoc(unsigned int startPos, int length, int, WordList *[], Acc
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc);
|
static const char * const cssWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
"Pseudo classes",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmCss(SCLEX_CSS, ColouriseCssDoc, "css", FoldCSSDoc, cssWordListDesc);
|
||||||
|
@@ -175,4 +175,10 @@ static void ColouriseConfDoc(unsigned int startPos, int length, int, WordList *k
|
|||||||
delete []buffer;
|
delete []buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf");
|
static const char * const confWordListDesc[] = {
|
||||||
|
"Directives",
|
||||||
|
"Parameters",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmConf(SCLEX_CONF, ColouriseConfDoc, "conf", 0, confWordListDesc);
|
||||||
|
@@ -208,4 +208,11 @@ static void ColouriseNncrontabDoc(unsigned int startPos, int length, int, WordLi
|
|||||||
delete []buffer;
|
delete []buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab");
|
static const char * const cronWordListDesc[] = {
|
||||||
|
"Section keywords and Forth words",
|
||||||
|
"nnCrontab keywords",
|
||||||
|
"Modifiers",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmNncrontab(SCLEX_NNCRONTAB, ColouriseNncrontabDoc, "nncrontab", 0, cronWordListDesc);
|
||||||
|
@@ -226,5 +226,10 @@ static void FoldEiffelDocKeyWords(unsigned int startPos, int length, int /* init
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent);
|
static const char * const eiffelWordListDesc[] = {
|
||||||
LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords);
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmEiffel(SCLEX_EIFFEL, ColouriseEiffelDoc, "eiffel", FoldEiffelDocIndent, eiffelWordListDesc);
|
||||||
|
LexerModule lmEiffelkw(SCLEX_EIFFELKW, ColouriseEiffelDoc, "eiffelkw", FoldEiffelDocKeyWords, eiffelWordListDesc);
|
||||||
|
@@ -192,4 +192,9 @@ static void FoldLispDoc(unsigned int startPos, int length, int /* initStyle */,
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc);
|
static const char * const lispWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmLISP(SCLEX_LISP, ColouriseLispDoc, "lisp", FoldLispDoc, lispWordListDesc);
|
||||||
|
@@ -297,4 +297,14 @@ static void FoldLuaDoc(unsigned int startPos, int length, int /* initStyle */, W
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc, "lua", FoldLuaDoc);
|
static const char * const luaWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
"Basic functions",
|
||||||
|
"String & math functions",
|
||||||
|
"I/O & system facilities",
|
||||||
|
"XXX",
|
||||||
|
"XXX",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmLua(SCLEX_LUA, ColouriseLuaDoc, "lua", FoldLuaDoc, luaWordListDesc);
|
||||||
|
@@ -165,4 +165,9 @@ static void FoldMatlabDoc(unsigned int startPos, int length, int,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc);
|
static const char * const matlabWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmMatlab(SCLEX_MATLAB, ColouriseMatlabDoc, "matlab", FoldMatlabDoc, matlabWordListDesc);
|
||||||
|
@@ -20,6 +20,14 @@
|
|||||||
#include "Scintilla.h"
|
#include "Scintilla.h"
|
||||||
#include "SciLexer.h"
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
static bool Is0To9(char ch) {
|
||||||
|
return (ch >= '0') && (ch <= '9');
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool Is1To9(char ch) {
|
||||||
|
return (ch >= '1') && (ch <= '9');
|
||||||
|
}
|
||||||
|
|
||||||
static inline bool AtEOL(Accessor &styler, unsigned int i) {
|
static inline bool AtEOL(Accessor &styler, unsigned int i) {
|
||||||
return (styler[i] == '\n') ||
|
return (styler[i] == '\n') ||
|
||||||
((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n'));
|
((styler[i] == '\r') && (styler.SafeGetCharAt(i + 1) != '\n'));
|
||||||
@@ -85,7 +93,7 @@ static void ColouriseBatchLine(
|
|||||||
while (offset < lengthLine) {
|
while (offset < lengthLine) {
|
||||||
if (state == SCE_BAT_DEFAULT && lineBuffer[offset] == '%') {
|
if (state == SCE_BAT_DEFAULT && lineBuffer[offset] == '%') {
|
||||||
styler.ColourTo(startLine + offset - 1, state);
|
styler.ColourTo(startLine + offset - 1, state);
|
||||||
if (isdigit(lineBuffer[offset + 1])) {
|
if (Is0To9(lineBuffer[offset + 1])) {
|
||||||
styler.ColourTo(startLine + offset + 1, SCE_BAT_IDENTIFIER);
|
styler.ColourTo(startLine + offset + 1, SCE_BAT_IDENTIFIER);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
} else if (lineBuffer[offset + 1] == '%' &&
|
} else if (lineBuffer[offset + 1] == '%' &&
|
||||||
@@ -343,12 +351,17 @@ static void ColouriseMakeDoc(unsigned int startPos, int length, int, WordList *[
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool strstart(char *haystack, char *needle) {
|
||||||
|
return strncmp(haystack, needle, strlen(needle)) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void ColouriseErrorListLine(
|
static void ColouriseErrorListLine(
|
||||||
char *lineBuffer,
|
char *lineBuffer,
|
||||||
unsigned int lengthLine,
|
unsigned int lengthLine,
|
||||||
// unsigned int startLine,
|
// unsigned int startLine,
|
||||||
unsigned int endPos,
|
unsigned int endPos,
|
||||||
Accessor &styler) {
|
Accessor &styler) {
|
||||||
|
const int unRecognized = 99;
|
||||||
if (lineBuffer[0] == '>') {
|
if (lineBuffer[0] == '>') {
|
||||||
// Command or return status
|
// Command or return status
|
||||||
styler.ColourTo(endPos, SCE_ERR_CMD);
|
styler.ColourTo(endPos, SCE_ERR_CMD);
|
||||||
@@ -367,10 +380,17 @@ static void ColouriseErrorListLine(
|
|||||||
styler.ColourTo(endPos, SCE_ERR_PYTHON);
|
styler.ColourTo(endPos, SCE_ERR_PYTHON);
|
||||||
} else if (strstr(lineBuffer, " in ") && strstr(lineBuffer, " on line ")) {
|
} else if (strstr(lineBuffer, " in ") && strstr(lineBuffer, " on line ")) {
|
||||||
styler.ColourTo(endPos, SCE_ERR_PHP);
|
styler.ColourTo(endPos, SCE_ERR_PHP);
|
||||||
} else if (0 == strncmp(lineBuffer, "Error ", strlen("Error "))) {
|
} else if ((strstart(lineBuffer, "Error ") ||
|
||||||
|
strstart(lineBuffer, "Warning ")) &&
|
||||||
|
strstr(lineBuffer, " at (") &&
|
||||||
|
strstr(lineBuffer, ") : ") &&
|
||||||
|
(strstr(lineBuffer, " at (") < strstr(lineBuffer, ") : "))) {
|
||||||
|
// Intel Fortran Compiler error/warning message
|
||||||
|
styler.ColourTo(endPos, SCE_ERR_IFC);
|
||||||
|
} else if (strstart(lineBuffer, "Error ")) {
|
||||||
// Borland error message
|
// Borland error message
|
||||||
styler.ColourTo(endPos, SCE_ERR_BORLAND);
|
styler.ColourTo(endPos, SCE_ERR_BORLAND);
|
||||||
} else if (0 == strncmp(lineBuffer, "Warning ", strlen("Warning "))) {
|
} else if (strstart(lineBuffer, "Warning ")) {
|
||||||
// Borland warning message
|
// Borland warning message
|
||||||
styler.ColourTo(endPos, SCE_ERR_BORLAND);
|
styler.ColourTo(endPos, SCE_ERR_BORLAND);
|
||||||
} else if (strstr(lineBuffer, "at line " ) &&
|
} else if (strstr(lineBuffer, "at line " ) &&
|
||||||
@@ -382,51 +402,84 @@ static void ColouriseErrorListLine(
|
|||||||
} else if (strstr(lineBuffer, " at " ) &&
|
} else if (strstr(lineBuffer, " at " ) &&
|
||||||
(strstr(lineBuffer, " at " ) < (lineBuffer + lengthLine)) &&
|
(strstr(lineBuffer, " at " ) < (lineBuffer + lengthLine)) &&
|
||||||
strstr(lineBuffer, " line ") &&
|
strstr(lineBuffer, " line ") &&
|
||||||
(strstr(lineBuffer, " line ") < (lineBuffer + lengthLine))) {
|
(strstr(lineBuffer, " line ") < (lineBuffer + lengthLine)) &&
|
||||||
|
(strstr(lineBuffer, " at " ) < (strstr(lineBuffer, " line ")))) {
|
||||||
// perl error message
|
// perl error message
|
||||||
styler.ColourTo(endPos, SCE_ERR_PERL);
|
styler.ColourTo(endPos, SCE_ERR_PERL);
|
||||||
} else if ((memcmp(lineBuffer, " at ", 6) == 0) &&
|
} else if ((memcmp(lineBuffer, " at ", 6) == 0) &&
|
||||||
strstr(lineBuffer, ":line ")) {
|
strstr(lineBuffer, ":line ")) {
|
||||||
// A .NET traceback
|
// A .NET traceback
|
||||||
styler.ColourTo(endPos, SCE_ERR_NET);
|
styler.ColourTo(endPos, SCE_ERR_NET);
|
||||||
|
} else if (strstart(lineBuffer, "Line ") &&
|
||||||
|
strstr(lineBuffer, ", file ")) {
|
||||||
|
// Essential Lahey Fortran error message
|
||||||
|
styler.ColourTo(endPos, SCE_ERR_ELF);
|
||||||
} else {
|
} else {
|
||||||
// Look for <filename>:<line>:message
|
// Look for GCC <filename>:<line>:message
|
||||||
// Look for <filename>(line)message
|
// Look for Microsoft <filename>(line) :message
|
||||||
// Look for <filename>(line,pos)message
|
// Look for Microsoft <filename>(line,pos)message
|
||||||
|
// Look for CTags \tmessage
|
||||||
int state = 0;
|
int state = 0;
|
||||||
for (unsigned int i = 0; i < lengthLine; i++) {
|
for (unsigned int i = 0; i < lengthLine; i++) {
|
||||||
if ((state == 0) && (lineBuffer[i] == ':') && isdigit(lineBuffer[i + 1])) {
|
char ch = lineBuffer[i];
|
||||||
|
char chNext = ' ';
|
||||||
|
if ((i+1) < lengthLine)
|
||||||
|
chNext = lineBuffer[i+1];
|
||||||
|
if (state == 0) {
|
||||||
|
if (ch == ':') {
|
||||||
|
// May be GCC
|
||||||
|
if ((chNext != '\\') && (chNext != '/')) {
|
||||||
|
// This check is not completely accurate as may be on
|
||||||
|
// GTK+ with a file name that includes ':'.
|
||||||
state = 1;
|
state = 1;
|
||||||
} else if ((state == 0) && (lineBuffer[i] == '(')) {
|
}
|
||||||
|
} else if ((ch == '(') && Is1To9(chNext)) {
|
||||||
|
// May be Microsoft
|
||||||
|
// Check againt '0' often removes phone numbers
|
||||||
state = 10;
|
state = 10;
|
||||||
} else if ((state == 0) && (lineBuffer[i] == '\t')) {
|
} else if (ch == '\t') {
|
||||||
|
// May be CTags
|
||||||
state = 20;
|
state = 20;
|
||||||
} else if ((state == 1) && isdigit(lineBuffer[i])) {
|
}
|
||||||
state = 2;
|
} else if (state == 1) {
|
||||||
} else if ((state == 2) && (lineBuffer[i] == ':')) {
|
state = Is1To9(ch) ? 2 : unRecognized;
|
||||||
state = 3;
|
} else if (state == 2) {
|
||||||
|
if (ch == ':') {
|
||||||
|
state = 3; // :9.*: is GCC
|
||||||
break;
|
break;
|
||||||
} else if ((state == 2) && !isdigit(lineBuffer[i])) {
|
} else if (!Is0To9(ch)) {
|
||||||
state = 99;
|
state = unRecognized;
|
||||||
} else if ((state == 10) && isdigit(lineBuffer[i])) {
|
}
|
||||||
state = 11;
|
} else if (state == 10) {
|
||||||
} else if ((state == 11) && (lineBuffer[i] == ',')) {
|
state = Is0To9(ch) ? 11 : unRecognized;
|
||||||
|
} else if (state == 11) {
|
||||||
|
if (ch == ',') {
|
||||||
state = 14;
|
state = 14;
|
||||||
} else if ((state == 11) && (lineBuffer[i] == ')')) {
|
} else if (ch == ')') {
|
||||||
state = 12;
|
state = 12;
|
||||||
} else if ((state == 12) && (lineBuffer[i] == ':')) {
|
} else if ((ch != ' ') && !Is0To9(ch)) {
|
||||||
|
state = unRecognized;
|
||||||
|
}
|
||||||
|
} else if (state == 12) {
|
||||||
|
if ((ch == ' ') && (chNext == ':'))
|
||||||
state = 13;
|
state = 13;
|
||||||
} else if ((state == 14) && (lineBuffer[i] == ')')) {
|
else
|
||||||
|
state = unRecognized;
|
||||||
|
} else if (state == 14) {
|
||||||
|
if (ch == ')') {
|
||||||
state = 15;
|
state = 15;
|
||||||
break;
|
break;
|
||||||
} else if (((state == 11) || (state == 14)) && !((lineBuffer[i] == ' ') || isdigit(lineBuffer[i]))) {
|
} else if ((ch != ' ') && !Is0To9(ch)) {
|
||||||
state = 99;
|
state = unRecognized;
|
||||||
} else if ((state == 20) && (lineBuffer[i-1] == '\t') &&
|
}
|
||||||
((lineBuffer[i] == '/' && lineBuffer[i+1] == '^') || isdigit(lineBuffer[i]))) {
|
} else if (state == 20) {
|
||||||
|
if ((lineBuffer[i-1] == '\t') &&
|
||||||
|
((ch == '/' && lineBuffer[i+1] == '^') || Is0To9(ch))) {
|
||||||
state = 24;
|
state = 24;
|
||||||
break;
|
break;
|
||||||
} else if ((state == 20) && ((lineBuffer[i] == '/') && (lineBuffer[i+1] == '^'))) {
|
} else if ((ch == '/') && (lineBuffer[i+1] == '^')) {
|
||||||
state = 21;
|
state = 21;
|
||||||
|
}
|
||||||
} else if ((state == 21) && ((lineBuffer[i] == '$') && (lineBuffer[i+1] == '/'))) {
|
} else if ((state == 21) && ((lineBuffer[i] == '$') && (lineBuffer[i+1] == '/'))) {
|
||||||
state = 22;
|
state = 22;
|
||||||
break;
|
break;
|
||||||
@@ -561,12 +614,21 @@ static void ColouriseLatexDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
styler.ColourTo(lengthDoc, state);
|
styler.ColourTo(lengthDoc-1, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch");
|
static const char * const batchWordListDesc[] = {
|
||||||
LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff");
|
"Keywords",
|
||||||
LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props");
|
0
|
||||||
LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile");
|
};
|
||||||
LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist");
|
|
||||||
LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex");
|
static const char * const emptyWordListDesc[] = {
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmBatch(SCLEX_BATCH, ColouriseBatchDoc, "batch", 0, batchWordListDesc);
|
||||||
|
LexerModule lmDiff(SCLEX_DIFF, ColouriseDiffDoc, "diff", 0, emptyWordListDesc);
|
||||||
|
LexerModule lmProps(SCLEX_PROPERTIES, ColourisePropsDoc, "props", 0, emptyWordListDesc);
|
||||||
|
LexerModule lmMake(SCLEX_MAKEFILE, ColouriseMakeDoc, "makefile", 0, emptyWordListDesc);
|
||||||
|
LexerModule lmErrorList(SCLEX_ERRORLIST, ColouriseErrorListDoc, "errorlist", 0, emptyWordListDesc);
|
||||||
|
LexerModule lmLatex(SCLEX_LATEX, ColouriseLatexDoc, "latex", 0, emptyWordListDesc);
|
||||||
|
222
contrib/src/stc/scintilla/src/LexPOV.cxx
Normal file
222
contrib/src/stc/scintilla/src/LexPOV.cxx
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
// Scintilla source code edit control
|
||||||
|
/** @file LexPOV.cxx
|
||||||
|
** Lexer for POV-Ray, based on lexer for C++.
|
||||||
|
**/
|
||||||
|
// Copyright 2003 by Steven te Brinke <steven.t.b@zonnet.nl>
|
||||||
|
// The License.txt file describes the conditions under which this software may be distributed.
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
|
#include "Platform.h"
|
||||||
|
|
||||||
|
#include "PropSet.h"
|
||||||
|
#include "Accessor.h"
|
||||||
|
#include "StyleContext.h"
|
||||||
|
#include "KeyWords.h"
|
||||||
|
#include "Scintilla.h"
|
||||||
|
#include "SciLexer.h"
|
||||||
|
|
||||||
|
#define KEYWORD_BOXHEADER 1
|
||||||
|
#define KEYWORD_FOLDCONTRACTED 2
|
||||||
|
|
||||||
|
static inline bool IsAWordChar(const int ch) {
|
||||||
|
return (ch < 0x80) && (isalnum(ch) || ch == '.' || ch == '_');
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool IsAWordStart(const int ch) {
|
||||||
|
return (ch < 0x80) && (isalnum(ch) || ch == '_');
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool IsStateComment(const int state) {
|
||||||
|
return ((state == SCE_POV_COMMENT) ||
|
||||||
|
(state == SCE_POV_COMMENTLINE) ||
|
||||||
|
(state == SCE_POV_COMMENTDOC));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool IsStateString(const int state) {
|
||||||
|
return ((state == SCE_POV_STRING));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ColourisePOVDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||||
|
Accessor &styler) {
|
||||||
|
|
||||||
|
WordList &keywords = *keywordlists[0];
|
||||||
|
WordList &keywords2 = *keywordlists[1];
|
||||||
|
|
||||||
|
// Do not leak onto next line
|
||||||
|
/*if (initStyle == SCE_POV_STRINGEOL)
|
||||||
|
initStyle = SCE_POV_DEFAULT;*/
|
||||||
|
|
||||||
|
StyleContext sc(startPos, length, initStyle, styler);
|
||||||
|
|
||||||
|
bool caseSensitive = styler.GetPropertyInt("pov.case.sensitive", 1) != 0;
|
||||||
|
|
||||||
|
for (; sc.More(); sc.Forward()) {
|
||||||
|
|
||||||
|
/*if (sc.atLineStart && (sc.state == SCE_POV_STRING)) {
|
||||||
|
// Prevent SCE_POV_STRINGEOL from leaking back to previous line
|
||||||
|
sc.SetState(SCE_POV_STRING);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
// Handle line continuation generically.
|
||||||
|
if (sc.ch == '\\') {
|
||||||
|
if (sc.chNext == '\n' || sc.chNext == '\r') {
|
||||||
|
sc.Forward();
|
||||||
|
if (sc.ch == '\r' && sc.chNext == '\n') {
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if the current state should terminate.
|
||||||
|
if (sc.state == SCE_POV_OPERATOR || sc.state == SCE_POV_BRACE) {
|
||||||
|
sc.SetState(SCE_POV_DEFAULT);
|
||||||
|
} else if (sc.state == SCE_POV_NUMBER) {
|
||||||
|
if (!IsADigit(sc.ch) || sc.ch != '.') {
|
||||||
|
sc.SetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
} else if (sc.state == SCE_POV_IDENTIFIER) {
|
||||||
|
if (!IsAWordChar(sc.ch) || (sc.ch == '.')) {
|
||||||
|
char s[100];
|
||||||
|
if (caseSensitive) {
|
||||||
|
sc.GetCurrent(s, sizeof(s));
|
||||||
|
} else {
|
||||||
|
sc.GetCurrentLowered(s, sizeof(s));
|
||||||
|
}
|
||||||
|
if (keywords.InList(s)) {
|
||||||
|
sc.ChangeState(SCE_POV_WORD);
|
||||||
|
} else if (keywords2.InList(s)) {
|
||||||
|
sc.ChangeState(SCE_POV_WORD2);
|
||||||
|
}
|
||||||
|
sc.SetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
} else if (sc.state == SCE_POV_COMMENT) {
|
||||||
|
if (sc.Match('*', '/')) {
|
||||||
|
sc.Forward();
|
||||||
|
sc.ForwardSetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
} else if (sc.state == SCE_POV_COMMENTDOC) {
|
||||||
|
if (sc.Match('*', '/')) {
|
||||||
|
sc.Forward();
|
||||||
|
sc.ForwardSetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
} else if (sc.state == SCE_POV_COMMENTLINE) {
|
||||||
|
if (sc.atLineEnd) {
|
||||||
|
sc.SetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
} else if (sc.state == SCE_POV_STRING) {
|
||||||
|
if (sc.ch == '\\') {
|
||||||
|
if (sc.chNext == '\"' || sc.chNext == '\\') {
|
||||||
|
sc.Forward();
|
||||||
|
}
|
||||||
|
} else if (sc.ch == '\"') {
|
||||||
|
sc.ForwardSetState(SCE_POV_DEFAULT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determine if a new state should be entered.
|
||||||
|
if (sc.state == SCE_POV_DEFAULT) {
|
||||||
|
if (IsADigit(sc.ch) || (sc.ch == '.' && IsADigit(sc.chNext))) {
|
||||||
|
sc.SetState(SCE_POV_NUMBER);
|
||||||
|
} else if (IsAWordStart(sc.ch) || (sc.ch == '#')) {
|
||||||
|
sc.SetState(SCE_POV_IDENTIFIER);
|
||||||
|
} else if (sc.Match('/', '*')) {
|
||||||
|
sc.SetState(SCE_POV_COMMENT);
|
||||||
|
sc.Forward(); // Eat the * so it isn't used for the end of the comment
|
||||||
|
} else if (sc.Match('/', '/')) {
|
||||||
|
sc.SetState(SCE_POV_COMMENTLINE);
|
||||||
|
} else if (sc.ch == '\"') {
|
||||||
|
sc.SetState(SCE_POV_STRING);
|
||||||
|
//} else if (isoperator(static_cast<char>(sc.ch))) {
|
||||||
|
} else if (sc.ch == '+' || sc.ch == '-' || sc.ch == '*' || sc.ch == '/' || sc.ch == '=' || sc.ch == '<' || sc.ch == '>' || sc.ch == '&' || sc.ch == '|' || sc.ch == '!' || sc.ch == '?' || sc.ch == ':') {
|
||||||
|
sc.SetState(SCE_POV_OPERATOR);
|
||||||
|
} else if (sc.ch == '{' || sc.ch == '}') {
|
||||||
|
sc.SetState(SCE_POV_BRACE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
sc.Complete();
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool IsStreamCommentStyle(int style) {
|
||||||
|
return style == SCE_POV_COMMENT ||
|
||||||
|
style == SCE_POV_COMMENTDOC;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void FoldNoBoxPOVDoc(unsigned int startPos, int length, int initStyle,
|
||||||
|
Accessor &styler) {
|
||||||
|
bool foldComment = styler.GetPropertyInt("fold.comment", 1) != 0;
|
||||||
|
bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0;
|
||||||
|
unsigned int endPos = startPos + length;
|
||||||
|
int visibleChars = 0;
|
||||||
|
int lineCurrent = styler.GetLine(startPos);
|
||||||
|
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
|
||||||
|
int levelCurrent = levelPrev;
|
||||||
|
char chNext = styler[startPos];
|
||||||
|
int styleNext = styler.StyleAt(startPos);
|
||||||
|
int style = initStyle;
|
||||||
|
for (unsigned int i = startPos; i < endPos; i++) {
|
||||||
|
char ch = chNext;
|
||||||
|
chNext = styler.SafeGetCharAt(i + 1);
|
||||||
|
int stylePrev = style;
|
||||||
|
style = styleNext;
|
||||||
|
styleNext = styler.StyleAt(i + 1);
|
||||||
|
bool atEOL = (ch == '\r' && chNext != '\n') || (ch == '\n');
|
||||||
|
if (foldComment && IsStreamCommentStyle(style)) {
|
||||||
|
if (!IsStreamCommentStyle(stylePrev)) {
|
||||||
|
levelCurrent++;
|
||||||
|
} else if (!IsStreamCommentStyle(styleNext) && !atEOL) {
|
||||||
|
// Comments don't end at end of line and the next character may be unstyled.
|
||||||
|
levelCurrent--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (style == SCE_POV_BRACE) {
|
||||||
|
if (ch == '{') {
|
||||||
|
levelCurrent++;
|
||||||
|
} else if (ch == '}') {
|
||||||
|
levelCurrent--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (atEOL) {
|
||||||
|
int lev = levelPrev;
|
||||||
|
if (visibleChars == 0 && foldCompact)
|
||||||
|
lev |= SC_FOLDLEVELWHITEFLAG;
|
||||||
|
if ((levelCurrent > levelPrev) && (visibleChars > 0))
|
||||||
|
lev |= SC_FOLDLEVELHEADERFLAG;
|
||||||
|
if (lev != styler.LevelAt(lineCurrent)) {
|
||||||
|
styler.SetLevel(lineCurrent, lev);
|
||||||
|
}
|
||||||
|
lineCurrent++;
|
||||||
|
levelPrev = levelCurrent;
|
||||||
|
visibleChars = 0;
|
||||||
|
}
|
||||||
|
if (!isspacechar(ch))
|
||||||
|
visibleChars++;
|
||||||
|
}
|
||||||
|
// Fill in the real level of the next line, keeping the current flags as they will be filled in later
|
||||||
|
int flagsNext = styler.LevelAt(lineCurrent) & ~SC_FOLDLEVELNUMBERMASK;
|
||||||
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void FoldPOVDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) {
|
||||||
|
FoldNoBoxPOVDoc(startPos, length, initStyle, styler);
|
||||||
|
}
|
||||||
|
|
||||||
|
static const char * const POVWordLists[] = {
|
||||||
|
"Primary keywords and identifiers",
|
||||||
|
"Secondary keywords and identifiers",
|
||||||
|
0,
|
||||||
|
};
|
||||||
|
|
||||||
|
static void ColourisePOVDocSensitive(unsigned int startPos, int length, int initStyle, WordList *keywordlists[],
|
||||||
|
Accessor &styler) {
|
||||||
|
ColourisePOVDoc(startPos, length, initStyle, keywordlists, styler);
|
||||||
|
}
|
||||||
|
|
||||||
|
LexerModule lmPOV(SCLEX_POV, ColourisePOVDocSensitive, "pov", FoldPOVDoc, POVWordLists);
|
@@ -339,4 +339,10 @@ static void FoldPascalDoc(unsigned int startPos, int length, int initStyle, Word
|
|||||||
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
styler.SetLevel(lineCurrent, levelPrev | flagsNext);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc);
|
static const char * const pascalWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
"Classwords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmPascal(SCLEX_PASCAL, ColourisePascalDoc, "pascal", FoldPascalDoc, pascalWordListDesc);
|
||||||
|
@@ -715,7 +715,7 @@ static void FoldPerlDoc(unsigned int startPos, int length, int, WordList *[],
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char * const perlWordListDesc[] = {
|
static const char * const perlWordListDesc[] = {
|
||||||
"Perl keywords",
|
"Keywords",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -431,7 +431,7 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char * const pythonWordListDesc[] = {
|
static const char * const pythonWordListDesc[] = {
|
||||||
"Python keywords",
|
"Keywords",
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -352,4 +352,9 @@ static void FoldRbDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc);
|
static const char * const rubyWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmRuby(SCLEX_RUBY, ColouriseRbDoc, "ruby", FoldRbDoc, rubyWordListDesc);
|
||||||
|
@@ -155,4 +155,9 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
|
|||||||
styler.ColourTo(lengthDoc - 1, state);
|
styler.ColourTo(lengthDoc - 1, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc, "sql");
|
static const char * const sqlWordListDesc[] = {
|
||||||
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmSQL(SCLEX_SQL, ColouriseSQLDoc, "sql", 0, sqlWordListDesc);
|
||||||
|
@@ -116,7 +116,7 @@ static void ColouriseVBDoc(unsigned int startPos, int length, int initStyle,
|
|||||||
} else if (sc.ch == '#') {
|
} else if (sc.ch == '#') {
|
||||||
int n = 1;
|
int n = 1;
|
||||||
int chSeek = ' ';
|
int chSeek = ' ';
|
||||||
while (chSeek == ' ' || chSeek == '\t') {
|
while ((n < 100) && (chSeek == ' ' || chSeek == '\t')) {
|
||||||
chSeek = sc.GetRelative(n);
|
chSeek = sc.GetRelative(n);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
@@ -200,6 +200,11 @@ static void ColouriseVBScriptDoc(unsigned int startPos, int length, int initStyl
|
|||||||
ColouriseVBDoc(startPos, length, initStyle, keywordlists, styler, true);
|
ColouriseVBDoc(startPos, length, initStyle, keywordlists, styler, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc);
|
static const char * const vbWordListDesc[] = {
|
||||||
LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc);
|
"Keywords",
|
||||||
|
0
|
||||||
|
};
|
||||||
|
|
||||||
|
LexerModule lmVB(SCLEX_VB, ColouriseVBNetDoc, "vb", FoldVBDoc, vbWordListDesc);
|
||||||
|
LexerModule lmVBScript(SCLEX_VBSCRIPT, ColouriseVBScriptDoc, "vbscript", FoldVBDoc, vbWordListDesc);
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@ public:
|
|||||||
markType = SC_MARK_CIRCLE;
|
markType = SC_MARK_CIRCLE;
|
||||||
fore = ColourDesired(0,0,0);
|
fore = ColourDesired(0,0,0);
|
||||||
back = ColourDesired(0xff,0xff,0xff);
|
back = ColourDesired(0xff,0xff,0xff);
|
||||||
|
delete pxpm;
|
||||||
pxpm = NULL;
|
pxpm = NULL;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
@@ -185,7 +185,8 @@ SString PropSet::GetExpanded(const char *key) {
|
|||||||
SString PropSet::Expand(const char *withVars) {
|
SString PropSet::Expand(const char *withVars) {
|
||||||
char *base = StringDup(withVars);
|
char *base = StringDup(withVars);
|
||||||
char *cpvar = strstr(base, "$(");
|
char *cpvar = strstr(base, "$(");
|
||||||
while (cpvar) {
|
int maxExpands = 1000; // Avoid infinite expansion of recursive definitions
|
||||||
|
while (cpvar && (maxExpands > 0)) {
|
||||||
char *cpendvar = strchr(cpvar, ')');
|
char *cpendvar = strchr(cpvar, ')');
|
||||||
if (cpendvar) {
|
if (cpendvar) {
|
||||||
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
|
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
|
||||||
@@ -201,6 +202,7 @@ SString PropSet::Expand(const char *withVars) {
|
|||||||
base = newbase;
|
base = newbase;
|
||||||
}
|
}
|
||||||
cpvar = strstr(base, "$(");
|
cpvar = strstr(base, "$(");
|
||||||
|
maxExpands--;
|
||||||
}
|
}
|
||||||
SString sret = base;
|
SString sret = base;
|
||||||
delete []base;
|
delete []base;
|
||||||
@@ -304,7 +306,8 @@ SString PropSet::GetWild(const char *keybase, const char *filename) {
|
|||||||
SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
|
SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
|
||||||
char *base = StringDup(GetWild(keybase, filename).c_str());
|
char *base = StringDup(GetWild(keybase, filename).c_str());
|
||||||
char *cpvar = strstr(base, "$(");
|
char *cpvar = strstr(base, "$(");
|
||||||
while (cpvar) {
|
int maxExpands = 1000; // Avoid infinite expansion of recursive definitions
|
||||||
|
while (cpvar && (maxExpands > 0)) {
|
||||||
char *cpendvar = strchr(cpvar, ')');
|
char *cpendvar = strchr(cpvar, ')');
|
||||||
if (cpendvar) {
|
if (cpendvar) {
|
||||||
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
|
int lenvar = cpendvar - cpvar - 2; // Subtract the $()
|
||||||
@@ -320,6 +323,7 @@ SString PropSet::GetNewExpand(const char *keybase, const char *filename) {
|
|||||||
base = newbase;
|
base = newbase;
|
||||||
}
|
}
|
||||||
cpvar = strstr(base, "$(");
|
cpvar = strstr(base, "$(");
|
||||||
|
maxExpands--;
|
||||||
}
|
}
|
||||||
SString sret = base;
|
SString sret = base;
|
||||||
delete []base;
|
delete []base;
|
||||||
|
@@ -30,8 +30,20 @@
|
|||||||
* Modification history:
|
* Modification history:
|
||||||
*
|
*
|
||||||
* $Log$
|
* $Log$
|
||||||
* Revision 1.5.2.1 2003/04/08 22:40:19 RD
|
* Revision 1.5.2.2 2003/04/19 19:56:40 RD
|
||||||
* Updated wxSTC to Scintilla 1.51
|
* Updated Scintilla to 1.52
|
||||||
|
*
|
||||||
|
* Revision 1.9 2003/03/21 10:36:08 nyamatongwe
|
||||||
|
* Detect patterns too long in regular expression search.
|
||||||
|
*
|
||||||
|
* Revision 1.8 2003/03/04 10:53:59 nyamatongwe
|
||||||
|
* Patch from Jakub to optionally implement more POSIX compatible regular
|
||||||
|
* expressions. \(..\) changes to (..)
|
||||||
|
* Fixes problem where find previous would not find earlier matches on same
|
||||||
|
* line.
|
||||||
|
*
|
||||||
|
* Revision 1.8 2003/03/03 20:12:56 vrana
|
||||||
|
* Added posix syntax.
|
||||||
*
|
*
|
||||||
* Revision 1.7 2002/09/28 00:33:28 nyamatongwe
|
* Revision 1.7 2002/09/28 00:33:28 nyamatongwe
|
||||||
* Fixed problem with character ranges caused by expansion to 8 bits.
|
* Fixed problem with character ranges caused by expansion to 8 bits.
|
||||||
@@ -335,10 +347,11 @@ const char escapeValue(char ch) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *RESearch::Compile(const char *pat, int length, bool caseSensitive) {
|
const char *RESearch::Compile(const char *pat, int length, bool caseSensitive, bool posix) {
|
||||||
char *mp=nfa; /* nfa pointer */
|
char *mp=nfa; /* nfa pointer */
|
||||||
char *lp; /* saved pointer.. */
|
char *lp; /* saved pointer.. */
|
||||||
char *sp=nfa; /* another one.. */
|
char *sp=nfa; /* another one.. */
|
||||||
|
char *mpMax = mp + MAXNFA - BITBLK - 10;
|
||||||
|
|
||||||
int tagi = 0; /* tag stack index */
|
int tagi = 0; /* tag stack index */
|
||||||
int tagc = 1; /* actual tag count */
|
int tagc = 1; /* actual tag count */
|
||||||
@@ -356,6 +369,8 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive) {
|
|||||||
|
|
||||||
const char *p=pat; /* pattern pointer */
|
const char *p=pat; /* pattern pointer */
|
||||||
for (int i=0; i<length; i++, p++) {
|
for (int i=0; i<length; i++, p++) {
|
||||||
|
if (mp > mpMax)
|
||||||
|
return badpat("Pattern too long");
|
||||||
lp = mp;
|
lp = mp;
|
||||||
switch(*p) {
|
switch(*p) {
|
||||||
|
|
||||||
@@ -470,25 +485,6 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive) {
|
|||||||
i++;
|
i++;
|
||||||
switch(*++p) {
|
switch(*++p) {
|
||||||
|
|
||||||
case '(':
|
|
||||||
if (tagc < MAXTAG) {
|
|
||||||
tagstk[++tagi] = tagc;
|
|
||||||
*mp++ = BOT;
|
|
||||||
*mp++ = static_cast<char>(tagc++);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return badpat("Too many \\(\\) pairs");
|
|
||||||
break;
|
|
||||||
case ')':
|
|
||||||
if (*sp == BOT)
|
|
||||||
return badpat("Null pattern inside \\(\\)");
|
|
||||||
if (tagi > 0) {
|
|
||||||
*mp++ = static_cast<char>(EOT);
|
|
||||||
*mp++ = static_cast<char>(tagstk[tagi--]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return badpat("Unmatched \\)");
|
|
||||||
break;
|
|
||||||
case '<':
|
case '<':
|
||||||
*mp++ = BOW;
|
*mp++ = BOW;
|
||||||
break;
|
break;
|
||||||
@@ -527,13 +523,49 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive) {
|
|||||||
*mp++ = escapeValue(*p);
|
*mp++ = escapeValue(*p);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
if (!posix && *p == '(') {
|
||||||
|
if (tagc < MAXTAG) {
|
||||||
|
tagstk[++tagi] = tagc;
|
||||||
|
*mp++ = BOT;
|
||||||
|
*mp++ = static_cast<char>(tagc++);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return badpat("Too many \\(\\) pairs");
|
||||||
|
} else if (!posix && *p == ')') {
|
||||||
|
if (*sp == BOT)
|
||||||
|
return badpat("Null pattern inside \\(\\)");
|
||||||
|
if (tagi > 0) {
|
||||||
|
*mp++ = static_cast<char>(EOT);
|
||||||
|
*mp++ = static_cast<char>(tagstk[tagi--]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return badpat("Unmatched \\)");
|
||||||
|
} else {
|
||||||
*mp++ = CHR;
|
*mp++ = CHR;
|
||||||
*mp++ = *p;
|
*mp++ = *p;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default : /* an ordinary char */
|
default : /* an ordinary char */
|
||||||
if (caseSensitive) {
|
if (posix && *p == '(') {
|
||||||
|
if (tagc < MAXTAG) {
|
||||||
|
tagstk[++tagi] = tagc;
|
||||||
|
*mp++ = BOT;
|
||||||
|
*mp++ = static_cast<char>(tagc++);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return badpat("Too many () pairs");
|
||||||
|
} else if (posix && *p == ')') {
|
||||||
|
if (*sp == BOT)
|
||||||
|
return badpat("Null pattern inside ()");
|
||||||
|
if (tagi > 0) {
|
||||||
|
*mp++ = static_cast<char>(EOT);
|
||||||
|
*mp++ = static_cast<char>(tagstk[tagi--]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return badpat("Unmatched )");
|
||||||
|
} else if (caseSensitive) {
|
||||||
*mp++ = CHR;
|
*mp++ = CHR;
|
||||||
*mp++ = *p;
|
*mp++ = *p;
|
||||||
} else {
|
} else {
|
||||||
@@ -548,7 +580,7 @@ const char *RESearch::Compile(const char *pat, int length, bool caseSensitive) {
|
|||||||
sp = lp;
|
sp = lp;
|
||||||
}
|
}
|
||||||
if (tagi > 0)
|
if (tagi > 0)
|
||||||
return badpat("Unmatched \\(");
|
return badpat((posix ? "Unmatched (" : "Unmatched \\("));
|
||||||
*mp = END;
|
*mp = END;
|
||||||
sta = OKP;
|
sta = OKP;
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -32,7 +32,7 @@ public:
|
|||||||
bool GrabMatches(CharacterIndexer &ci);
|
bool GrabMatches(CharacterIndexer &ci);
|
||||||
void ChSet(char c);
|
void ChSet(char c);
|
||||||
void ChSetWithCase(char c, bool caseSensitive);
|
void ChSetWithCase(char c, bool caseSensitive);
|
||||||
const char *Compile(const char *pat, int length, bool caseSensitive);
|
const char *Compile(const char *pat, int length, bool caseSensitive, bool posix);
|
||||||
int Execute(CharacterIndexer &ci, int lp, int endp);
|
int Execute(CharacterIndexer &ci, int lp, int endp);
|
||||||
void ModifyWord(char *s);
|
void ModifyWord(char *s);
|
||||||
int Substitute(CharacterIndexer &ci, char *src, char *dst);
|
int Substitute(CharacterIndexer &ci, char *src, char *dst);
|
||||||
|
@@ -307,6 +307,7 @@ void ScintillaBase::AutoCompleteCharacterDeleted() {
|
|||||||
void ScintillaBase::AutoCompleteCompleted() {
|
void ScintillaBase::AutoCompleteCompleted() {
|
||||||
int item = ac.lb->GetSelection();
|
int item = ac.lb->GetSelection();
|
||||||
char selected[1000];
|
char selected[1000];
|
||||||
|
selected[0] = '\0';
|
||||||
if (item != -1) {
|
if (item != -1) {
|
||||||
ac.lb->GetValue(item, selected, sizeof(selected));
|
ac.lb->GetValue(item, selected, sizeof(selected));
|
||||||
}
|
}
|
||||||
@@ -344,6 +345,36 @@ void ScintillaBase::AutoCompleteCompleted() {
|
|||||||
pdoc->EndUndoAction();
|
pdoc->EndUndoAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScintillaBase::CallTipShow(Point pt, const char *defn) {
|
||||||
|
AutoCompleteCancel();
|
||||||
|
pt.y += vs.lineHeight;
|
||||||
|
PRectangle rc = ct.CallTipStart(currentPos, pt,
|
||||||
|
defn,
|
||||||
|
vs.styles[STYLE_DEFAULT].fontName,
|
||||||
|
vs.styles[STYLE_DEFAULT].sizeZoomed,
|
||||||
|
IsUnicodeMode(),
|
||||||
|
wMain);
|
||||||
|
// If the call-tip window would be out of the client
|
||||||
|
// space, adjust so it displays above the text.
|
||||||
|
PRectangle rcClient = GetClientRectangle();
|
||||||
|
if (rc.bottom > rcClient.bottom) {
|
||||||
|
int offset = vs.lineHeight + rc.Height();
|
||||||
|
rc.top -= offset;
|
||||||
|
rc.bottom -= offset;
|
||||||
|
}
|
||||||
|
// Now display the window.
|
||||||
|
CreateCallTipWindow(rc);
|
||||||
|
ct.wCallTip.SetPositionRelative(rc, wMain);
|
||||||
|
ct.wCallTip.Show();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ScintillaBase::CallTipClick() {
|
||||||
|
SCNotification scn;
|
||||||
|
scn.nmhdr.code = SCN_CALLTIPCLICK;
|
||||||
|
scn.position = ct.clickPlace;
|
||||||
|
NotifyParent(scn);
|
||||||
|
}
|
||||||
|
|
||||||
void ScintillaBase::ContextMenu(Point pt) {
|
void ScintillaBase::ContextMenu(Point pt) {
|
||||||
if (displayPopupMenu) {
|
if (displayPopupMenu) {
|
||||||
bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
|
bool writable = !WndProc(SCI_GETREADONLY, 0, 0);
|
||||||
@@ -525,30 +556,9 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
|
|||||||
case SCI_AUTOCGETTYPESEPARATOR:
|
case SCI_AUTOCGETTYPESEPARATOR:
|
||||||
return ac.GetTypesep();
|
return ac.GetTypesep();
|
||||||
|
|
||||||
case SCI_CALLTIPSHOW: {
|
case SCI_CALLTIPSHOW:
|
||||||
AutoCompleteCancel();
|
CallTipShow(LocationFromPosition(wParam),
|
||||||
if (!ct.wCallTip.Created()) {
|
reinterpret_cast<const char *>(lParam));
|
||||||
Point pt = LocationFromPosition(wParam);
|
|
||||||
pt.y += vs.lineHeight;
|
|
||||||
PRectangle rc = ct.CallTipStart(currentPos, pt,
|
|
||||||
reinterpret_cast<char *>(lParam),
|
|
||||||
vs.styles[STYLE_DEFAULT].fontName,
|
|
||||||
vs.styles[STYLE_DEFAULT].sizeZoomed,
|
|
||||||
IsUnicodeMode());
|
|
||||||
// If the call-tip window would be out of the client
|
|
||||||
// space, adjust so it displays above the text.
|
|
||||||
PRectangle rcClient = GetClientRectangle();
|
|
||||||
if (rc.bottom > rcClient.bottom) {
|
|
||||||
int offset = vs.lineHeight + rc.Height();
|
|
||||||
rc.top -= offset;
|
|
||||||
rc.bottom -= offset;
|
|
||||||
}
|
|
||||||
// Now display the window.
|
|
||||||
CreateCallTipWindow(rc);
|
|
||||||
ct.wCallTip.SetPositionRelative(rc, wMain);
|
|
||||||
ct.wCallTip.Show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SCI_CALLTIPCANCEL:
|
case SCI_CALLTIPCANCEL:
|
||||||
@@ -570,6 +580,16 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara
|
|||||||
InvalidateStyleRedraw();
|
InvalidateStyleRedraw();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SCI_CALLTIPSETFORE:
|
||||||
|
ct.colourUnSel = ColourDesired(wParam);
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCI_CALLTIPSETFOREHLT:
|
||||||
|
ct.colourSel = ColourDesired(wParam);
|
||||||
|
InvalidateStyleRedraw();
|
||||||
|
break;
|
||||||
|
|
||||||
case SCI_USEPOPUP:
|
case SCI_USEPOPUP:
|
||||||
displayPopupMenu = wParam != 0;
|
displayPopupMenu = wParam != 0;
|
||||||
break;
|
break;
|
||||||
|
@@ -71,6 +71,8 @@ protected:
|
|||||||
void AutoCompleteMoveToCurrentWord();
|
void AutoCompleteMoveToCurrentWord();
|
||||||
static void AutoCompleteDoubleClick(void* p);
|
static void AutoCompleteDoubleClick(void* p);
|
||||||
|
|
||||||
|
void CallTipClick();
|
||||||
|
void CallTipShow(Point pt, const char *defn);
|
||||||
virtual void CreateCallTipWindow(PRectangle rc) = 0;
|
virtual void CreateCallTipWindow(PRectangle rc) = 0;
|
||||||
|
|
||||||
virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
|
virtual void AddToPopUp(const char *label, int cmd=0, bool enabled=true) = 0;
|
||||||
|
@@ -16,13 +16,13 @@ Style::Style() {
|
|||||||
aliasOfDefaultFont = true;
|
aliasOfDefaultFont = true;
|
||||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||||
Platform::DefaultFontSize(), 0, SC_CHARSET_DEFAULT,
|
Platform::DefaultFontSize(), 0, SC_CHARSET_DEFAULT,
|
||||||
false, false, false, false, caseMixed, true, true);
|
false, false, false, false, caseMixed, true, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
Style::Style(const Style &source) {
|
Style::Style(const Style &source) {
|
||||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
false, false, false, false, caseMixed, true, true);
|
false, false, false, false, caseMixed, true, true, false);
|
||||||
fore.desired = source.fore.desired;
|
fore.desired = source.fore.desired;
|
||||||
back.desired = source.back.desired;
|
back.desired = source.back.desired;
|
||||||
characterSet = source.characterSet;
|
characterSet = source.characterSet;
|
||||||
@@ -34,6 +34,7 @@ Style::Style(const Style &source) {
|
|||||||
caseForce = source.caseForce;
|
caseForce = source.caseForce;
|
||||||
visible = source.visible;
|
visible = source.visible;
|
||||||
changeable = source.changeable;
|
changeable = source.changeable;
|
||||||
|
hotspot = source.hotspot;
|
||||||
}
|
}
|
||||||
|
|
||||||
Style::~Style() {
|
Style::~Style() {
|
||||||
@@ -49,7 +50,7 @@ Style &Style::operator=(const Style &source) {
|
|||||||
return * this;
|
return * this;
|
||||||
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff),
|
||||||
0, 0, SC_CHARSET_DEFAULT,
|
0, 0, SC_CHARSET_DEFAULT,
|
||||||
false, false, false, false, caseMixed, true, true);
|
false, false, false, false, caseMixed, true, true, false);
|
||||||
fore.desired = source.fore.desired;
|
fore.desired = source.fore.desired;
|
||||||
back.desired = source.back.desired;
|
back.desired = source.back.desired;
|
||||||
characterSet = source.characterSet;
|
characterSet = source.characterSet;
|
||||||
@@ -68,7 +69,7 @@ void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_,
|
|||||||
const char *fontName_, int characterSet_,
|
const char *fontName_, int characterSet_,
|
||||||
bool bold_, bool italic_, bool eolFilled_,
|
bool bold_, bool italic_, bool eolFilled_,
|
||||||
bool underline_, ecaseForced caseForce_,
|
bool underline_, ecaseForced caseForce_,
|
||||||
bool visible_, bool changeable_) {
|
bool visible_, bool changeable_, bool hotspot_) {
|
||||||
fore.desired = fore_;
|
fore.desired = fore_;
|
||||||
back.desired = back_;
|
back.desired = back_;
|
||||||
characterSet = characterSet_;
|
characterSet = characterSet_;
|
||||||
@@ -81,6 +82,7 @@ void Style::Clear(ColourDesired fore_, ColourDesired back_, int size_,
|
|||||||
caseForce = caseForce_;
|
caseForce = caseForce_;
|
||||||
visible = visible_;
|
visible = visible_;
|
||||||
changeable = changeable_;
|
changeable = changeable_;
|
||||||
|
hotspot = hotspot_;
|
||||||
if (aliasOfDefaultFont)
|
if (aliasOfDefaultFont)
|
||||||
font.SetID(0);
|
font.SetID(0);
|
||||||
else
|
else
|
||||||
@@ -101,7 +103,8 @@ void Style::ClearTo(const Style &source) {
|
|||||||
source.underline,
|
source.underline,
|
||||||
source.caseForce,
|
source.caseForce,
|
||||||
source.visible,
|
source.visible,
|
||||||
source.changeable);
|
source.changeable,
|
||||||
|
source.hotspot);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Style::EquivalentFontTo(const Style *other) const {
|
bool Style::EquivalentFontTo(const Style *other) const {
|
||||||
|
@@ -26,6 +26,7 @@ public:
|
|||||||
ecaseForced caseForce;
|
ecaseForced caseForce;
|
||||||
bool visible;
|
bool visible;
|
||||||
bool changeable;
|
bool changeable;
|
||||||
|
bool hotspot;
|
||||||
|
|
||||||
Font font;
|
Font font;
|
||||||
int sizeZoomed;
|
int sizeZoomed;
|
||||||
@@ -45,7 +46,7 @@ public:
|
|||||||
const char *fontName_, int characterSet_,
|
const char *fontName_, int characterSet_,
|
||||||
bool bold_, bool italic_, bool eolFilled_,
|
bool bold_, bool italic_, bool eolFilled_,
|
||||||
bool underline_, ecaseForced caseForce_,
|
bool underline_, ecaseForced caseForce_,
|
||||||
bool visible_, bool changeable_);
|
bool visible_, bool changeable_, bool hotspot_);
|
||||||
void ClearTo(const Style &source);
|
void ClearTo(const Style &source);
|
||||||
bool EquivalentFontTo(const Style *other) const;
|
bool EquivalentFontTo(const Style *other) const;
|
||||||
void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0);
|
void Realise(Surface &surface, int zoomLevel, Style *defaultStyle = 0);
|
||||||
|
@@ -74,7 +74,7 @@ public:
|
|||||||
if (ch >= 0x100)
|
if (ch >= 0x100)
|
||||||
currentPos++;
|
currentPos++;
|
||||||
ch = chNext;
|
ch = chNext;
|
||||||
GetNextChar(currentPos);
|
GetNextChar(currentPos + ((ch >= 0x100) ? 1 : 0));
|
||||||
} else {
|
} else {
|
||||||
atLineStart = false;
|
atLineStart = false;
|
||||||
chPrev = ' ';
|
chPrev = ' ';
|
||||||
|
@@ -79,6 +79,12 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
|
|||||||
foldmarginHighlightColourSet = source.foldmarginHighlightColourSet;
|
foldmarginHighlightColourSet = source.foldmarginHighlightColourSet;
|
||||||
foldmarginHighlightColour.desired = source.foldmarginHighlightColour.desired;
|
foldmarginHighlightColour.desired = source.foldmarginHighlightColour.desired;
|
||||||
|
|
||||||
|
hotspotForegroundSet = source.hotspotForegroundSet;
|
||||||
|
hotspotForeground.desired = source.hotspotForeground.desired;
|
||||||
|
hotspotBackgroundSet = source.hotspotBackgroundSet;
|
||||||
|
hotspotBackground.desired = source.hotspotBackground.desired;
|
||||||
|
hotspotUnderline = source.hotspotUnderline;
|
||||||
|
|
||||||
whitespaceForegroundSet = source.whitespaceForegroundSet;
|
whitespaceForegroundSet = source.whitespaceForegroundSet;
|
||||||
whitespaceForeground.desired = source.whitespaceForeground.desired;
|
whitespaceForeground.desired = source.whitespaceForeground.desired;
|
||||||
whitespaceBackgroundSet = source.whitespaceBackgroundSet;
|
whitespaceBackgroundSet = source.whitespaceBackgroundSet;
|
||||||
@@ -153,6 +159,12 @@ void ViewStyle::Init() {
|
|||||||
caretWidth = 1;
|
caretWidth = 1;
|
||||||
someStylesProtected = false;
|
someStylesProtected = false;
|
||||||
|
|
||||||
|
hotspotForegroundSet = false;
|
||||||
|
hotspotForeground.desired = ColourDesired(0, 0, 0xff);
|
||||||
|
hotspotBackgroundSet = false;
|
||||||
|
hotspotBackground.desired = ColourDesired(0xff, 0xff, 0xff);
|
||||||
|
hotspotUnderline = true;
|
||||||
|
|
||||||
leftMarginWidth = 1;
|
leftMarginWidth = 1;
|
||||||
rightMarginWidth = 1;
|
rightMarginWidth = 1;
|
||||||
ms[0].symbol = false;
|
ms[0].symbol = false;
|
||||||
@@ -206,6 +218,8 @@ void ViewStyle::RefreshColourPalette(Palette &pal, bool want) {
|
|||||||
pal.WantFind(caretcolour, want);
|
pal.WantFind(caretcolour, want);
|
||||||
pal.WantFind(caretLineBackground, want);
|
pal.WantFind(caretLineBackground, want);
|
||||||
pal.WantFind(edgecolour, want);
|
pal.WantFind(edgecolour, want);
|
||||||
|
pal.WantFind(hotspotForeground, want);
|
||||||
|
pal.WantFind(hotspotBackground, want);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewStyle::Refresh(Surface &surface) {
|
void ViewStyle::Refresh(Surface &surface) {
|
||||||
@@ -248,7 +262,7 @@ void ViewStyle::ResetDefaultStyle() {
|
|||||||
ColourDesired(0xff,0xff,0xff),
|
ColourDesired(0xff,0xff,0xff),
|
||||||
Platform::DefaultFontSize(), fontNames.Save(Platform::DefaultFont()),
|
Platform::DefaultFontSize(), fontNames.Save(Platform::DefaultFont()),
|
||||||
SC_CHARSET_DEFAULT,
|
SC_CHARSET_DEFAULT,
|
||||||
false, false, false, false, Style::caseMixed, true, true);
|
false, false, false, false, Style::caseMixed, true, true, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewStyle::ClearStyles() {
|
void ViewStyle::ClearStyles() {
|
||||||
|
@@ -63,6 +63,11 @@ public:
|
|||||||
ColourPair foldmarginColour;
|
ColourPair foldmarginColour;
|
||||||
bool foldmarginHighlightColourSet;
|
bool foldmarginHighlightColourSet;
|
||||||
ColourPair foldmarginHighlightColour;
|
ColourPair foldmarginHighlightColour;
|
||||||
|
bool hotspotForegroundSet;
|
||||||
|
ColourPair hotspotForeground;
|
||||||
|
bool hotspotBackgroundSet;
|
||||||
|
ColourPair hotspotBackground;
|
||||||
|
bool hotspotUnderline;
|
||||||
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
|
/// Margins are ordered: Line Numbers, Selection Margin, Spacing Margin
|
||||||
enum { margins=3 };
|
enum { margins=3 };
|
||||||
int leftMarginWidth; ///< Spacing margin on left of text
|
int leftMarginWidth; ///< Spacing margin on left of text
|
||||||
|
@@ -85,6 +85,10 @@ DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
|
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@@ -573,6 +577,11 @@ void wxStyledTextCtrl::StyleSetCharacterSet(int style, int characterSet) {
|
|||||||
SendMsg(2066, style, characterSet);
|
SendMsg(2066, style, characterSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set a style to be a hotspot or not.
|
||||||
|
void wxStyledTextCtrl::StyleSetHotSpot(int style, bool hotspot) {
|
||||||
|
SendMsg(2409, style, hotspot);
|
||||||
|
}
|
||||||
|
|
||||||
// Set the foreground colour of the selection and whether to use this setting.
|
// Set the foreground colour of the selection and whether to use this setting.
|
||||||
void wxStyledTextCtrl::SetSelForeground(bool useSetting, const wxColour& fore) {
|
void wxStyledTextCtrl::SetSelForeground(bool useSetting, const wxColour& fore) {
|
||||||
SendMsg(2067, useSetting, wxColourAsLong(fore));
|
SendMsg(2067, useSetting, wxColourAsLong(fore));
|
||||||
@@ -1348,6 +1357,16 @@ void wxStyledTextCtrl::CallTipSetBackground(const wxColour& back) {
|
|||||||
SendMsg(2205, wxColourAsLong(back), 0);
|
SendMsg(2205, wxColourAsLong(back), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the foreground colour for the call tip.
|
||||||
|
void wxStyledTextCtrl::CallTipSetForeground(const wxColour& fore) {
|
||||||
|
SendMsg(2206, wxColourAsLong(fore), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the foreground colour for the highlighted part of the call tip.
|
||||||
|
void wxStyledTextCtrl::CallTipSetForegroundHighlight(const wxColour& fore) {
|
||||||
|
SendMsg(2207, wxColourAsLong(fore), 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Find the display line of a document line taking hidden lines into account.
|
// Find the display line of a document line taking hidden lines into account.
|
||||||
int wxStyledTextCtrl::VisibleFromDocLine(int line) {
|
int wxStyledTextCtrl::VisibleFromDocLine(int line) {
|
||||||
return SendMsg(2220, line, 0);
|
return SendMsg(2220, line, 0);
|
||||||
@@ -1553,7 +1572,6 @@ void wxStyledTextCtrl::TargetFromSelection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Join the lines in the target.
|
// Join the lines in the target.
|
||||||
// This is an experimental feature and may be changed or removed.
|
|
||||||
void wxStyledTextCtrl::LinesJoin() {
|
void wxStyledTextCtrl::LinesJoin() {
|
||||||
SendMsg(2288, 0, 0);
|
SendMsg(2288, 0, 0);
|
||||||
}
|
}
|
||||||
@@ -1871,6 +1889,21 @@ int wxStyledTextCtrl::GetPrintWrapMode() {
|
|||||||
return SendMsg(2407, 0, 0);
|
return SendMsg(2407, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set a fore colour for active hotspots.
|
||||||
|
void wxStyledTextCtrl::SetHotspotActiveForeground(bool useSetting, const wxColour& fore) {
|
||||||
|
SendMsg(2410, useSetting, wxColourAsLong(fore));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set a back colour for active hotspots.
|
||||||
|
void wxStyledTextCtrl::SetHotspotActiveBackground(bool useSetting, const wxColour& back) {
|
||||||
|
SendMsg(2411, useSetting, wxColourAsLong(back));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Enable / Disable underlining active hotspots.
|
||||||
|
void wxStyledTextCtrl::SetHotspotActiveUnderline(bool underline) {
|
||||||
|
SendMsg(2412, underline, 0);
|
||||||
|
}
|
||||||
|
|
||||||
// Start notifying the container of all key presses and commands.
|
// Start notifying the container of all key presses and commands.
|
||||||
void wxStyledTextCtrl::StartRecord() {
|
void wxStyledTextCtrl::StartRecord() {
|
||||||
SendMsg(3001, 0, 0);
|
SendMsg(3001, 0, 0);
|
||||||
@@ -2314,6 +2347,18 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
|||||||
evt.SetEventType(wxEVT_STC_ZOOM);
|
evt.SetEventType(wxEVT_STC_ZOOM);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SCN_HOTSPOTCLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_HOTSPOT_CLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCN_HOTSPOTDOUBLECLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_HOTSPOT_DCLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCN_CALLTIPCLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_CALLTIP_CLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -85,6 +85,10 @@ DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG )
|
|||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP )
|
||||||
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
|
DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK )
|
||||||
|
DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
BEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl)
|
||||||
@@ -575,6 +579,18 @@ void wxStyledTextCtrl::NotifyParent(SCNotification* _scn) {
|
|||||||
evt.SetEventType(wxEVT_STC_ZOOM);
|
evt.SetEventType(wxEVT_STC_ZOOM);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SCN_HOTSPOTCLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_HOTSPOT_CLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCN_HOTSPOTDOUBLECLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_HOTSPOT_DCLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SCN_CALLTIPCLICK:
|
||||||
|
evt.SetEventType(wxEVT_STC_CALLTIP_CLICK);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -225,11 +225,11 @@ private:
|
|||||||
void NotifyChange();
|
void NotifyChange();
|
||||||
void NotifyParent(SCNotification* scn);
|
void NotifyParent(SCNotification* scn);
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
DECLARE_CLASS(wxStyledTextCtrl)
|
DECLARE_CLASS(wxStyledTextCtrl)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
ScintillaWX* m_swx;
|
ScintillaWX* m_swx;
|
||||||
wxStopWatch m_stopWatch;
|
wxStopWatch m_stopWatch;
|
||||||
wxScrollBar* m_vScrollBar;
|
wxScrollBar* m_vScrollBar;
|
||||||
@@ -348,6 +348,8 @@ private:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef SWIG
|
#ifndef SWIG
|
||||||
BEGIN_DECLARE_EVENT_TYPES()
|
BEGIN_DECLARE_EVENT_TYPES()
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CHANGE, 1650)
|
||||||
@@ -373,6 +375,9 @@ BEGIN_DECLARE_EVENT_TYPES()
|
|||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DRAG_OVER, 1670)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_DO_DROP, 1671)
|
||||||
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_ZOOM, 1672)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_HOTSPOT_CLICK, 1673)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_HOTSPOT_DCLICK, 1674)
|
||||||
|
DECLARE_LOCAL_EVENT_TYPE(wxEVT_STC_CALLTIP_CLICK, 1675)
|
||||||
END_DECLARE_EVENT_TYPES()
|
END_DECLARE_EVENT_TYPES()
|
||||||
#else
|
#else
|
||||||
enum {
|
enum {
|
||||||
@@ -399,6 +404,9 @@ END_DECLARE_EVENT_TYPES()
|
|||||||
wxEVT_STC_DRAG_OVER,
|
wxEVT_STC_DRAG_OVER,
|
||||||
wxEVT_STC_DO_DROP,
|
wxEVT_STC_DO_DROP,
|
||||||
wxEVT_STC_ZOOM,
|
wxEVT_STC_ZOOM,
|
||||||
|
wxEVT_STC_HOTSPOT_CLICK,
|
||||||
|
wxEVT_STC_HOTSPOT_DCLICK,
|
||||||
|
wxEVT_STC_CALLTIP_CLICK
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -430,6 +438,10 @@ typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&);
|
|||||||
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
#define EVT_STC_CALLTIP_CLICK(id, fn)) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, -1, (wxObjectEventFunction) (wxEventFunction) (wxStyledTextEventFunction) & fn, (wxObject *) NULL ),
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
@@ -342,6 +342,10 @@ SOURCE=.\scintilla\src\LexOthers.cxx
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\scintilla\src\LexPOV.cxx
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\scintilla\src\LexPascal.cxx
|
SOURCE=.\scintilla\src\LexPascal.cxx
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -48,6 +48,7 @@ OBJECTS = \
|
|||||||
LexLisp.obj \
|
LexLisp.obj \
|
||||||
LexLua.obj \
|
LexLua.obj \
|
||||||
LexOthers.obj \
|
LexOthers.obj \
|
||||||
|
LexPOV.obj \
|
||||||
LexPascal.obj \
|
LexPascal.obj \
|
||||||
LexPerl.obj \
|
LexPerl.obj \
|
||||||
LexPython.obj \
|
LexPython.obj \
|
||||||
|
@@ -36,6 +36,7 @@ OBJECTS = \
|
|||||||
$(S)/LexLisp.$(OBJSUFF) \
|
$(S)/LexLisp.$(OBJSUFF) \
|
||||||
$(S)/LexLua.$(OBJSUFF) \
|
$(S)/LexLua.$(OBJSUFF) \
|
||||||
$(S)/LexOthers.$(OBJSUFF) \
|
$(S)/LexOthers.$(OBJSUFF) \
|
||||||
|
$(S)/LexPOV.$(OBJSUFF) \
|
||||||
$(S)/LexPascal.$(OBJSUFF) \
|
$(S)/LexPascal.$(OBJSUFF) \
|
||||||
$(S)/LexPerl.$(OBJSUFF) \
|
$(S)/LexPerl.$(OBJSUFF) \
|
||||||
$(S)/LexPython.$(OBJSUFF) \
|
$(S)/LexPython.$(OBJSUFF) \
|
||||||
|
@@ -41,6 +41,7 @@ OBJECTS = \
|
|||||||
$(D)\LexLisp.obj \
|
$(D)\LexLisp.obj \
|
||||||
$(D)\LexLua.obj \
|
$(D)\LexLua.obj \
|
||||||
$(D)\LexOthers.obj \
|
$(D)\LexOthers.obj \
|
||||||
|
$(D)\LexPOV.obj \
|
||||||
$(D)\LexPascal.obj \
|
$(D)\LexPascal.obj \
|
||||||
$(D)\LexPerl.obj \
|
$(D)\LexPerl.obj \
|
||||||
$(D)\LexPython.obj \
|
$(D)\LexPython.obj \
|
||||||
|
@@ -45,6 +45,7 @@ OBJECTS = &
|
|||||||
LexLisp.obj &
|
LexLisp.obj &
|
||||||
LexLua.obj &
|
LexLua.obj &
|
||||||
LexOthers.obj &
|
LexOthers.obj &
|
||||||
|
LexPOV.obj &
|
||||||
LexPascal.obj &
|
LexPascal.obj &
|
||||||
LexPerl.obj &
|
LexPerl.obj &
|
||||||
LexPython.obj &
|
LexPython.obj &
|
||||||
|
Reference in New Issue
Block a user