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