| 9 skipped lines |
| 10 | | 10 | | // Author: Robin Dunn |
|
|
| 12 | | 12 | | // Created: 13-Jan-2000 |
|
| 13 | | // RCS-ID: $Id: stc.cpp,v 1.97 2005/05/26 18:07:43 RD Exp $ | | 13 | | // RCS-ID: $Id: stc.cpp,v 1.97.2.1 2006/03/12 06:03:51 RD Exp $ |
| 14 | | 14 | | // Copyright: (c) 2000 by Total Control Software |
|
| 15 | | 15 | | // Licence: wxWindows license |
|
| 16 | | 16 | | ///////////////////////////////////////////////////////////////////////////// |
|
|
|
|
| 20 | | #include <wx/wx.h> | | 20 | | #include "wx/wx.h" |
| 21 | | #include <wx/tokenzr.h> | | 21 | | #include "wx/tokenzr.h" |
| 22 | | #include <wx/mstream.h> | | 22 | | #include "wx/mstream.h" |
| 23 | | #include <wx/image.h> | | 23 | | #include "wx/image.h" |
| 24 | | #include <wx/file.h> | | 24 | | #include "wx/file.h" |
|
| 26 | | 26 | | #include "wx/stc/stc.h" |
|
| 27 | | 27 | | #include "ScintillaWX.h" |
|
| 68 skipped lines |
| 96 | | 96 | | DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK ) |
|
| 97 | | 97 | | DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK ) |
|
| 98 | | 98 | | DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK ) |
|
| | | 99 | | DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION ) |
|
|
|
| 427 skipped lines |
|
|
|
| | | 533 | | // Add a set of markers to a line. |
| | | 534 | | void wxStyledTextCtrl::MarkerAddSet(int line, int set) { |
| | | 535 | | SendMsg(2466, line, set); |
| | | 536 | | } |
| | | 537 | | |
| 532 | | 538 | | // Set a margin to be either numeric or symbolic. |
|
| 533 | | 539 | | void wxStyledTextCtrl::SetMarginType(int margin, int marginType) { |
|
| 534 | | 540 | | SendMsg(2240, margin, marginType); |
|
| 391 skipped lines |
| 926 | | 932 | | SendMsg(2286, separatorCharacter, 0); |
|
|
|
| | | 935 | | // Set the maximum width, in characters, of auto-completion and user lists. |
| | | 936 | | // Set to 0 to autosize to fit longest item, which is the default. |
| | | 937 | | void wxStyledTextCtrl::AutoCompSetMaxWidth(int characterCount) { |
| | | 938 | | SendMsg(2208, characterCount, 0); |
| | | 939 | | } |
| 12 skipped lines |
| | | 952 | | // Set the maximum height, in rows, of auto-completion and user lists. |
| | | 953 | | int wxStyledTextCtrl::AutoCompGetMaxHeight() { |
| | | 954 | | return SendMsg(2211, 0, 0); |
| | | 955 | | } |
| | | 956 | | |
| 929 | | 957 | | // Set the number of spaces used for one level of indentation. |
|
| 930 | | 958 | | void wxStyledTextCtrl::SetIndent(int indentSize) { |
|
| 931 | | 959 | | SendMsg(2122, indentSize, 0); |
|
| 495 skipped lines |
| 1427 | | 1455 | | return SendMsg(2221, lineDisplay, 0); |
|
|
|
| | | 1458 | | // The number of display lines needed to wrap a document line |
| | | 1459 | | int wxStyledTextCtrl::WrapCount(int line) { |
| | | 1460 | | return SendMsg(2235, line, 0); |
| | | 1461 | | } |
| | | 1462 | | |
| 1430 | | 1463 | | // Set the fold level of a line. |
|
| 1431 | | 1464 | | // This encodes an integer level along with flags indicating whether the |
|
| 1432 | | 1465 | | // line is a header and whether it is effectively white space. |
|
| 178 skipped lines |
|
| 1612 | | 1645 | | // Retrieve whether the maximum scroll position has the last |
|
| 1613 | | 1646 | | // line at the bottom of the view. |
|
| 1614 | | int wxStyledTextCtrl::GetEndAtLastLine() { | | 1647 | | bool wxStyledTextCtrl::GetEndAtLastLine() { |
| 1615 | | return SendMsg(2278, 0, 0); | | 1648 | | return SendMsg(2278, 0, 0) != 0; |
|
|
| 1618 | | 1651 | | // Retrieve the height of a particular line of text in pixels. |
|
| 793 skipped lines |
| 2412 | | 2445 | | SendMsg(2446, bytes, 0); |
|
|
|
| 2415 | | // Find the position of a column on a line taking into account tabs and | | 2448 | | // Find the position of a column on a line taking into account tabs and |
| 2416 | | 2449 | | // multi-byte characters. If beyond end of line, return line end position. |
|
| 2417 | | 2450 | | int wxStyledTextCtrl::FindColumn(int line, int column) { |
|
| 2418 | | 2451 | | return SendMsg(2456, line, column); |
|
|
|
| | | 2454 | | // Can the caret preferred x position only be changed by explicit movement commands? |
| | | 2455 | | bool wxStyledTextCtrl::GetCaretSticky() { |
| | | 2456 | | return SendMsg(2457, 0, 0) != 0; |
| | | 2457 | | } |
| | | 2458 | | |
| 20 skipped lines |
| | | 2479 | | // Duplicate the selection. If selection empty duplicate the line containing the caret. |
| | | 2480 | | void wxStyledTextCtrl::SelectionDuplicate() { |
| | | 2481 | | SendMsg(2469, 0, 0); |
| | | 2482 | | } |
| | | 2483 | | |
| 2421 | | 2484 | | // Start notifying the container of all key presses and commands. |
|
| 2422 | | 2485 | | void wxStyledTextCtrl::StartRecord() { |
|
| 2423 | | 2486 | | SendMsg(3001, 0, 0); |
|
| 34 skipped lines |
| 2458 | | 2521 | | SendMsg(4006, 0, (long)(const char*)wx2stc(language)); |
|
|
|
| | | 2524 | | // Retrieve a 'property' value previously set with SetProperty. |
| | | 2525 | | wxString wxStyledTextCtrl::GetProperty(const wxString& key) { |
| | | 2526 | | int len = SendMsg(SCI_GETPROPERTY, (long)(const char*)wx2stc(key), (long)NULL); |
| | | 2527 | | if (!len) return wxEmptyString; |
| | | 2528 | | |
| 28 skipped lines |
| | | 2557 | | // Retrieve the number of bits the current lexer needs for styling. |
| | | 2558 | | int wxStyledTextCtrl::GetStyleBitsNeeded() { |
| | | 2559 | | return SendMsg(4011, 0, 0); |
| | | 2560 | | } |
| | | 2561 | | |
| 2461 | | 2562 | | // END of generated section |
|
| 2462 | | 2563 | | //---------------------------------------------------------------------- |
|
|
| 170 skipped lines |
| 2634 | | 2735 | | case wxSTC_CHARSET_THAI: |
|
| 2635 | | 2736 | | encoding = wxFONTENCODING_ISO8859_11; |
|
|
| | | 2738 | | |
| | | 2739 | | case wxSTC_CHARSET_CYRILLIC: |
| | | 2740 | | encoding = wxFONTENCODING_ISO8859_5; |
| | | 2741 | | break; |
| | | 2742 | | |
| | | 2743 | | case wxSTC_CHARSET_8859_15: |
| | | 2744 | | encoding = wxFONTENCODING_ISO8859_15;; |
| | | 2745 | | break; |
|
|
| 2639 | | 2748 | | // We just have Scintilla track the wxFontEncoding for us. It gets used |
|
| 559 skipped lines |
| 3199 | | 3308 | | evt.SetEventType(wxEVT_STC_CALLTIP_CLICK); |
|
|
|
| | | 3311 | | case SCN_AUTOCSELECTION: |
| | | 3312 | | evt.SetEventType(wxEVT_STC_AUTOCOMP_SELECTION); |
| | | 3313 | | break; |
| | | 3314 | | |
|
|
|
| 82 skipped lines |