⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syncompletionproposal.hpp

📁 嵌入式IDE
💻 HPP
📖 第 1 页 / 共 2 页
字号:
	Controls::TKeyPressEvent __fastcall GetOnKeyPress();
	TSynBaseCompletionProposalPaintItem __fastcall GetOnPaintItem();
	TSynBaseCompletionProposalMeasureItem __fastcall GetOnMeasureItem();
	TValidateEvent __fastcall GetOnValidate();
	int __fastcall GetPosition(void);
	void __fastcall SetCurrentString(const AnsiString Value);
	void __fastcall SetItemList(const Classes::TStrings* Value);
	void __fastcall SetInsertList(const Classes::TStrings* Value);
	void __fastcall SetNbLinesInWindow(const int Value);
	void __fastcall SetOnCancel(const Classes::TNotifyEvent Value);
	void __fastcall SetOnKeyPress(const Controls::TKeyPressEvent Value);
	void __fastcall SetOnPaintItem(const TSynBaseCompletionProposalPaintItem Value);
	void __fastcall SetOnMeasureItem(const TSynBaseCompletionProposalMeasureItem Value);
	void __fastcall SetPosition(const int Value);
	void __fastcall SetOnValidate(const TValidateEvent Value);
	void __fastcall SetWidth(int Value);
	void __fastcall SetImages(const Controls::TImageList* Value);
	SynCompletionType __fastcall GetDisplayKind(void);
	void __fastcall SetDisplayKind(const SynCompletionType Value);
	TCompletionParameter __fastcall GetParameterToken();
	void __fastcall SetParameterToken(const TCompletionParameter Value);
	SynCompletionType __fastcall GetDefaultKind(void);
	void __fastcall SetDefaultKind(const SynCompletionType Value);
	Graphics::TColor __fastcall GetClBack(void);
	void __fastcall SetClBack(const Graphics::TColor Value);
	Graphics::TColor __fastcall GetClSelectedText(void);
	void __fastcall SetClSelectedText(const Graphics::TColor Value);
	AnsiString __fastcall GetEndOfTokenChar();
	void __fastcall SetEndOfTokenChar(const AnsiString Value);
	Graphics::TColor __fastcall GetClTitleBackground(void);
	void __fastcall SetClTitleBackground(const Graphics::TColor Value);
	void __fastcall SetTitle(const AnsiString Value);
	AnsiString __fastcall GetTitle();
	Graphics::TFont* __fastcall GetFont(void);
	Graphics::TFont* __fastcall GetTitleFont(void);
	void __fastcall SetFont(const Graphics::TFont* Value);
	void __fastcall SetTitleFont(const Graphics::TFont* Value);
	TSynCompletionOptions __fastcall GetOptions(void);
	AnsiString __fastcall GetTriggerChars();
	void __fastcall SetTriggerChars(const AnsiString Value);
	TCompletionChange __fastcall GetOnChange();
	void __fastcall SetOnChange(const TCompletionChange Value);
	void __fastcall SetColumns(const TProposalColumns* Value);
	TProposalColumns* __fastcall GetColumns(void);
	bool __fastcall GetResizeable(void);
	void __fastcall SetResizeable(const bool Value);
	int __fastcall GetItemHeight(void);
	void __fastcall SetItemHeight(const int Value);
	int __fastcall GetMargin(void);
	void __fastcall SetMargin(const int Value);
	Controls::TImageList* __fastcall GetImages(void);
	
protected:
	virtual void __fastcall SetOptions(const TSynCompletionOptions Value);
	virtual void __fastcall EditorCancelMode(System::TObject* Sender);
	virtual void __fastcall HookedEditorCommand(System::TObject* Sender, bool AfterProcessing, bool &Handled, Syneditkeycmds::TSynEditorCommand &Command, char &AChar, void * Data, void * HandlerData);
	
public:
	__fastcall virtual TSynBaseCompletionProposal(Classes::TComponent* Aowner);
	void __fastcall Execute(AnsiString s, int x, int y);
	virtual void __fastcall ExecuteEx(AnsiString s, int x, int y, SynCompletionType Kind = (SynCompletionType)(0x0));
	void __fastcall Activate(void);
	void __fastcall Deactivate(void);
	void __fastcall ClearList(void);
	AnsiString __fastcall DisplayItem(int AIndex);
	AnsiString __fastcall InsertItem(int AIndex);
	void __fastcall AddItemAt(int Where, AnsiString ADisplayText, AnsiString AInsertText);
	void __fastcall AddItem(AnsiString ADisplayText, AnsiString AInsertText);
	void __fastcall ResetAssignedList(void);
	__property Controls::TKeyPressEvent OnKeyPress = {read=GetOnKeyPress, write=SetOnKeyPress};
	__property TValidateEvent OnValidate = {read=GetOnValidate, write=SetOnValidate};
	__property Classes::TNotifyEvent OnCancel = {read=GetOnCancel, write=SetOnCancel};
	__property AnsiString CurrentString = {read=GetCurrentString, write=SetCurrentString};
	__property int DotOffset = {read=FDotOffset, write=FDotOffset, nodefault};
	__property SynCompletionType DisplayType = {read=GetDisplayKind, write=SetDisplayKind, nodefault};
	__property TSynBaseCompletionProposalForm* Form = {read=FForm};
	__property AnsiString PreviousToken = {read=FPreviousToken};
	__property int Position = {read=GetPosition, write=SetPosition, nodefault};
	
__published:
	__property SynCompletionType DefaultType = {read=GetDefaultKind, write=SetDefaultKind, default=0};
	__property TSynCompletionOptions Options = {read=GetOptions, write=SetOptions, default=1668};
	__property Classes::TStrings* ItemList = {read=GetItemList, write=SetItemList};
	__property Classes::TStrings* InsertList = {read=GetInsertList, write=SetInsertList};
	__property int NbLinesInWindow = {read=FNbLinesInWindow, write=SetNbLinesInWindow, default=8};
	__property Graphics::TColor ClSelect = {read=GetClSelect, write=SetClSelect, default=-2147483635};
	__property Graphics::TColor ClSelectedText = {read=GetClSelectedText, write=SetClSelectedText, default=-2147483634};
	__property Graphics::TColor ClBackground = {read=GetClBack, write=SetClBack, default=-2147483643};
	__property Graphics::TColor ClTitleBackground = {read=GetClTitleBackground, write=SetClTitleBackground, default=-2147483633};
	__property int Width = {read=FWidth, write=SetWidth, default=260};
	__property AnsiString EndOfTokenChr = {read=GetEndOfTokenChar, write=SetEndOfTokenChar};
	__property AnsiString TriggerChars = {read=GetTriggerChars, write=SetTriggerChars};
	__property AnsiString Title = {read=GetTitle, write=SetTitle};
	__property Graphics::TFont* Font = {read=GetFont, write=SetFont};
	__property Graphics::TFont* TitleFont = {read=GetTitleFont, write=SetTitleFont};
	__property TProposalColumns* Columns = {read=GetColumns, write=SetColumns};
	__property bool Resizeable = {read=GetResizeable, write=SetResizeable, default=1};
	__property int ItemHeight = {read=GetItemHeight, write=SetItemHeight, default=0};
	__property Controls::TImageList* Images = {read=GetImages, write=SetImages, default=0};
	__property int Margin = {read=GetMargin, write=SetMargin, default=2};
	__property TCompletionChange OnChange = {read=GetOnChange, write=SetOnChange};
	__property Classes::TNotifyEvent OnClose = {read=FOnClose, write=FOnClose};
	__property TCompletionExecute OnExecute = {read=FOnExecute, write=FOnExecute};
	__property TSynBaseCompletionProposalMeasureItem OnMeasureItem = {read=GetOnMeasureItem, write=SetOnMeasureItem};
	__property TSynBaseCompletionProposalPaintItem OnPaintItem = {read=GetOnPaintItem, write=SetOnPaintItem};
	__property TCompletionParameter OnParameterToken = {read=GetParameterToken, write=SetParameterToken};
	__property Classes::TNotifyEvent OnShow = {read=FOnShow, write=FOnShow};
public:
	#pragma option push -w-inl
	/* TComponent.Destroy */ inline __fastcall virtual ~TSynBaseCompletionProposal(void) { }
	#pragma option pop
	
};


class DELPHICLASS TSynCompletionProposal;
class PASCALIMPLEMENTATION TSynCompletionProposal : public TSynBaseCompletionProposal 
{
	typedef TSynBaseCompletionProposal inherited;
	
private:
	Classes::TList* fEditors;
	Classes::TShortCut FShortCut;
	bool FNoNextKey;
	int FCompletionStart;
	bool FAdjustCompletionStart;
	TCodeCompletionEvent FOnCodeCompletion;
	Extctrls::TTimer* FTimer;
	int FTimerInterval;
	Synedit::TCustomSynEdit* FEditor;
	TAfterCodeCompletionEvent FOnAfterCodeCompletion;
	Classes::TNotifyEvent FOnCancelled;
	void __fastcall SetEditor(const Synedit::TCustomSynEdit* Value);
	void __fastcall HandleOnCancel(System::TObject* Sender);
	void __fastcall HandleOnValidate(System::TObject* Sender, Classes::TShiftState Shift, char EndToken);
	void __fastcall HandleOnKeyPress(System::TObject* Sender, char &Key);
	void __fastcall HandleDblClick(System::TObject* Sender);
	void __fastcall EditorKeyDown(System::TObject* Sender, Word &Key, Classes::TShiftState Shift);
	void __fastcall EditorKeyPress(System::TObject* Sender, char &Key);
	void __fastcall TimerExecute(System::TObject* Sender);
	AnsiString __fastcall GetPreviousToken(Synedit::TCustomSynEdit* AEditor);
	AnsiString __fastcall GetCurrentInput(Synedit::TCustomSynEdit* AEditor);
	int __fastcall GetTimerInterval(void);
	void __fastcall SetTimerInterval(const int Value);
	Synedit::TCustomSynEdit* __fastcall GetEditor(int i);
	void __fastcall InternalCancelCompletion(void);
	
protected:
	virtual void __fastcall DoExecute(Synedit::TCustomSynEdit* AEditor);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	void __fastcall SetShortCut(Classes::TShortCut Value);
	virtual void __fastcall SetOptions(const TSynCompletionOptions Value);
	virtual void __fastcall EditorCancelMode(System::TObject* Sender);
	virtual void __fastcall HookedEditorCommand(System::TObject* Sender, bool AfterProcessing, bool &Handled, Syneditkeycmds::TSynEditorCommand &Command, char &AChar, void * Data, void * HandlerData);
	
public:
	__fastcall virtual TSynCompletionProposal(Classes::TComponent* AOwner);
	__fastcall virtual ~TSynCompletionProposal(void);
	void __fastcall AddEditor(Synedit::TCustomSynEdit* AEditor);
	bool __fastcall RemoveEditor(Synedit::TCustomSynEdit* AEditor);
	int __fastcall EditorsCount(void);
	virtual void __fastcall ExecuteEx(AnsiString s, int x, int y, SynCompletionType Kind = (SynCompletionType)(0x0));
	void __fastcall ActivateCompletion(void);
	void __fastcall CancelCompletion(void);
	void __fastcall ActivateTimer(Synedit::TCustomSynEdit* ACurrentEditor);
	void __fastcall DeactivateTimer(void);
	__property Synedit::TCustomSynEdit* Editors[int i] = {read=GetEditor};
	__property int CompletionStart = {read=FCompletionStart, write=FCompletionStart, nodefault};
	
__published:
	__property Classes::TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
	__property Synedit::TCustomSynEdit* Editor = {read=FEditor, write=SetEditor};
	__property int TimerInterval = {read=GetTimerInterval, write=SetTimerInterval, default=1000};
	__property TAfterCodeCompletionEvent OnAfterCodeCompletion = {read=FOnAfterCodeCompletion, write=FOnAfterCodeCompletion};
	__property Classes::TNotifyEvent OnCancelled = {read=FOnCancelled, write=FOnCancelled};
	__property TCodeCompletionEvent OnCodeCompletion = {read=FOnCodeCompletion, write=FOnCodeCompletion};
};


class DELPHICLASS TSynAutoComplete;
class PASCALIMPLEMENTATION TSynAutoComplete : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	Classes::TShortCut FShortCut;
	Synedit::TCustomSynEdit* fEditor;
	Classes::TStrings* fAutoCompleteList;
	bool fNoNextKey;
	AnsiString FEndOfTokenChr;
	Classes::TNotifyEvent FOnBeforeExecute;
	Classes::TNotifyEvent FOnAfterExecute;
	TSynCompletionProposal* FInternalCompletion;
	bool FDoLookup;
	TSynCompletionOptions FOptions;
	void __fastcall SetAutoCompleteList(Classes::TStrings* List);
	void __fastcall SetEditor(const Synedit::TCustomSynEdit* Value);
	void __fastcall SetDoLookup(const bool Value);
	void __fastcall CreateInternalCompletion(void);
	TSynCompletionOptions __fastcall GetOptions(void);
	void __fastcall SetOptions(const TSynCompletionOptions Value);
	void __fastcall DoInternalAutoCompletion(System::TObject* Sender, const AnsiString Value, Classes::TShiftState Shift, int Index, char EndToken);
	bool __fastcall GetExecuting(void);
	
protected:
	void __fastcall SetShortCut(Classes::TShortCut Value);
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
	virtual void __fastcall EditorKeyDown(System::TObject* Sender, Word &Key, Classes::TShiftState Shift);
	virtual void __fastcall EditorKeyPress(System::TObject* Sender, char &Key);
	AnsiString __fastcall GetPreviousToken(Synedit::TCustomSynEdit* Editor);
	
public:
	__fastcall virtual TSynAutoComplete(Classes::TComponent* AOwner);
	__fastcall virtual ~TSynAutoComplete(void);
	void __fastcall Execute(AnsiString token, Synedit::TCustomSynEdit* Editor);
	void __fastcall ExecuteEx(AnsiString token, Synedit::TCustomSynEdit* Editor, bool LookupIfNotExact);
	AnsiString __fastcall GetTokenList();
	AnsiString __fastcall GetTokenValue(AnsiString Token);
	void __fastcall CancelCompletion(void);
	__property bool Executing = {read=GetExecuting, nodefault};
	
__published:
	__property Classes::TStrings* AutoCompleteList = {read=fAutoCompleteList, write=SetAutoCompleteList};
	__property AnsiString EndOfTokenChr = {read=FEndOfTokenChr, write=FEndOfTokenChr};
	__property Synedit::TCustomSynEdit* Editor = {read=fEditor, write=SetEditor};
	__property Classes::TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
	__property Classes::TNotifyEvent OnBeforeExecute = {read=FOnBeforeExecute, write=FOnBeforeExecute};
	__property Classes::TNotifyEvent OnAfterExecute = {read=FOnAfterExecute, write=FOnAfterExecute};
	__property bool DoLookupWhenNotExact = {read=FDoLookup, write=SetDoLookup, default=1};
	__property TSynCompletionOptions Options = {read=GetOptions, write=SetOptions, default=1668};
};


class PASCALIMPLEMENTATION TProposalColumn : public Classes::TCollectionItem 
{
	typedef Classes::TCollectionItem inherited;
	
private:
	AnsiString FBiggestWord;
	int FInternalWidth;
	Graphics::TFontStyles FFontStyle;
	
public:
	__fastcall virtual TProposalColumn(Classes::TCollection* Collection);
	__fastcall virtual ~TProposalColumn(void);
	virtual void __fastcall Assign(Classes::TPersistent* Source);
	
__published:
	__property AnsiString BiggestWord = {read=FBiggestWord, write=FBiggestWord};
	__property Graphics::TFontStyles DefaultFontStyle = {read=FFontStyle, write=FFontStyle, default=0};
};


//-- var, const, procedure ---------------------------------------------------
#define DefaultProposalOptions (System::Set<TSynCompletionOption, scoAnsiStrings, scoCompleteWithEnter> () << TSynCompletionOption(2) << TSynCompletionOption(7) << TSynCompletionOption(9) << TSynCompletionOption(10) )
#define DefaultEndOfTokenChr "()[]. "
extern PACKAGE void __fastcall FormattedTextOut(Graphics::TCanvas* TargetCanvas, const Types::TRect &Rect, const AnsiString Text, bool Selected, TProposalColumns* Columns, Controls::TImageList* Images);
extern PACKAGE int __fastcall FormattedTextWidth(Graphics::TCanvas* TargetCanvas, const AnsiString Text, TProposalColumns* Columns, Controls::TImageList* Images);
extern PACKAGE AnsiString __fastcall PrettyTextToFormattedString(const AnsiString APrettyText, bool AlternateBoldStyle = false);

}	/* namespace Syncompletionproposal */
using namespace Syncompletionproposal;
#pragma option pop	// -w-
#pragma option pop	// -Vx

#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif	// SynCompletionProposal

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -