📄 qstescintillabase.h
字号:
#ifndef _qstescintillabase_h_#define _qstescintillabase_h_#include <QAbstractScrollArea>#include <qpoint.h>#include <qtimer.h>#include <qclipboard.h>#include <ctype.h>#include <stdlib.h>#include "Platform.h"#include "Scintilla.h"#include "SVector.h"#include "SplitVector.h"#include "Partitioning.h"#include "CellBuffer.h"#include "CharClassify.h"#include "Document.h"#include "Style.h"#include "XPM.h"#include "LineMarker.h"#include "Indicator.h"#include "ViewStyle.h"#include "KeyMap.h"#include "ContractionState.h"#include "Editor.h"#include "AutoComplete.h"#include "CallTip.h"#include "SString.h"#include "PropSet.h"#include "Accessor.h"#include "KeyWords.h"#include "SciLexer.h"#include "ScintillaBase.h"class _QSTE_DLL_ QSteScintillaBase : public QAbstractScrollArea ,public ScintillaBase{ Q_OBJECT friend class QSteCallTip; friend class QStePopup;public: explicit QSteScintillaBase(QWidget *parent = 0); virtual ~QSteScintillaBase(); virtual sptr_t WndProc(unsigned int msg,uptr_t wparam,sptr_t lparam); //send message interface long sendMsgToSci(unsigned int msg,unsigned long wparam = 0,long lparam = 0); long sendMsgToSci(unsigned int msg,unsigned long wparam,const char *lparam = 0); long sendMsgToSci(unsigned int msg,const char *lparam); long sendMsgToSci(unsigned int msg,const char *wparam,const char *lparam); long sendMsgToSci(unsigned int msg,long wparam); long sendMsgToSci(unsigned int msg,int wparam); long sendMsgToSci(unsigned int msg,long cpMin, long cpMax,char *lpstrText); long sendMsgToSci(unsigned int msg,unsigned long wparam,const QColor &col); long sendMsgToSci(unsigned int msg,const QColor &col); long sendMsgToSci(unsigned int msg,unsigned long wparam,QPainter *hdc,const QRect &rc,long cpmin,long cpmax); long sendMsgToSci(unsigned int msg,unsigned long wparam,const QPixmap &lparam);private: void Initialise(); void Finalise(); void StartDrag(); sptr_t DefWndProc(unsigned int msg,uptr_t wparam,sptr_t lparam); void SetTicking(bool); void SetMouseCapture(bool on); bool HaveMouseCapture(); void SetVerticalScrollPos(); void SetHorizontalScrollPos(); bool ModifyScrollBars(int nmax,int npage); void reconfigureScrollBars(); void NotifyChange(); void NotifyParent(SCNotification scn); void CopyToClipboard(const SelectionText &seltext); void Copy(); void Paste(); void CreateCallTipWindow(PRectangle rc); void AddToPopUp(const char *label,int cmd = 0,bool enable = true); void ClaimSelection(); void unclaimSelection(); QString textRange(const SelectionText *seltext); void pasteFromClipboard(QClipboard::Mode mode); bool capturedMouse; QTimer qtimer;signals: //this signal is emitted when text is selected or de-selected //==true selected //==false deselcted void qsteSelectChanged(bool ch); //this signal is emitted when the user selects an item in an auto-completion list,it is emitted before the selection is inserted //selected == the text being selected //postion is the start postion of the word being completed void qsteAutoCompleteSelect(const char *selected,int position); //this signal is emitted when the document has changed void qsteDocChanged(); //this signal is emitted when user clicks on a calltip //== true clicked on the up arrow //== false clicked on the down arrow void qsteCallTipClick(int dir); //this signal is emitted when user enters an normal character into the text void qsteAddCharacter(char character); //this signal is emitted when user double clicks //position= is the position in text where the click occured //line= the line in the text where the click occured //modifiers= the logical or of the modifier keys thar were pressed void qsteDoubleClick(int position,int line,int modifiers); //this signal is emitted block selection start void qsteDwellStart(int x,int y,int z); //this signal is emitted block selection end void qsteDwellEnd(int x,int y,int z); //this signal is emitted when user clicks on text in a style with the hotspot attribute set //position = is the position in the text where the click occured //modifiers = is the logical or of the modifier keys that were pressed when the user clicked void qsteHotspotClick(int position,int modifiers); //this signal is emitted when user double clicks on text in a style with the hotspot attribute set //position = is the position in the text where the double click occured //modifiers = is the logical or of the modifier keys that were pressed when the user clicked void qsteHotspotDoubleClick(int position,int modifiers); //this signal is emitted when a recordable editor command has been executed void qsteMarcoRecordExecute(unsigned int msg,unsigned long param,long lparam); //this signal is emitted when the user clicks on a margin //position = the start of the line against which the user clicked //modifiers = is the logical or of the modifier keys that were pressed when the user clicked //margin = is the number os the margin the user clicked in void qsteMarginClick(int position,int modifiers,int margin); //this signal is emitted when something has been modified void qsteModified(int,int,const char*,int,int,int,int,int); //this signal is emitted when user attemps to modify read-only text void qsteModifiedReadOnly(); //this signal is emitted when something need repaint void qsteNeedShown(int,int); //this signal is emitted when the current state of the text no longer corresponds to the state of the text at the save point void qsteSavePointLeft(); //this signal is emitted when the current state of the text corresponds //to the state of the text at the save point,this allows feedback to be //given to the user as to whether the text has been modified since it was last saved void qsteSavePointReached(); //this signal is emitted when a range of text needs to be syntal styled //the range is from the value returned by the SCI_GETENDSTYLED message and void qsteStyleNeeded(int position); void qsteUpdated(); void qsteUserListSelection(const char *,int); void qsteZoom(int scale = 0);protected: //reimplemented to handle the context menu virtual void contextMenuEvent(QContextMenuEvent *event); //reimplemented to handle drag enters. virtual void dragEnterEvent(QDragEnterEvent *event); //reimplemented to handle drag move virtual void dragMoveEvent(QDragMoveEvent *event); //reimplemented to handle drag leaves virtual void dragLeaveEvent(QDragLeaveEvent *event); //reimplemented to handle drop event virtual void dropEvent(QDropEvent *event); //reimplemented to handle get focus virtual void focusInEvent(QFocusEvent *event); //reimplemented to handle lost focus virtual void focusOutEvent(QFocusEvent *event); //reimplemented to allow tabs to be entered as text virtual bool focusNextPrevChild(bool next); //reimplemented to handle key presses virtual void keyPressEvent(QKeyEvent *event); //reimplemented to handle input method characters virtual void inputMethodEvent(QInputMethodEvent *event); //reimplemented to handle mouse double clicks virtual void mouseDoubleClickEvent(QMouseEvent *event); //reimplemented to handle mouse moves virtual void mouseMoveEvent(QMouseEvent *event); //reimplemented to handle mouse presses virtual void mousePressEvent(QMouseEvent *event); //reimplemented to handle mouse releases virtual void mouseReleaseEvent(QMouseEvent *event); //reimplemented to handle viewport paint virtual void paintEvent(QPaintEvent *event); //reimplemented to handle resizes virtual void resizeEvent(QResizeEvent *event); //reimplemented to handle scrolling virtual void scrollContentsBy(int dx,int dy);private slots: void handleTimer(); void handleVSb(int value); void handleHSb(int value); void handleSelection(); virtual void startAutoComplete(); virtual bool gotoBraceMatch(); virtual void selectBraceMatch(); virtual void insertAbbreviation(); virtual void expandAbbreviation();private: static sptr_t DirectFunction(QSteScintillaBase *qste, unsigned int msg,uptr_t wparam,sptr_t lparam); QPoint triple_click_at; QTimer triple_click;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -