mwcompletionproposal.hpp

来自「本人买的<<VC++项目开发实例>>源代码配套光盘.」· HPP 代码 · 共 256 行

HPP
256
字号
// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved

// (DO NOT EDIT: machine generated header) 'mwCompletionProposal.pas' rev: 5.00

#ifndef mwCompletionProposalHPP
#define mwCompletionProposalHPP

#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Menus.hpp>	// Pascal unit
#include <Graphics.hpp>	// Pascal unit
#include <Windows.hpp>	// Pascal unit
#include <mwKeyCmds.hpp>	// Pascal unit
#include <mwCustomEdit.hpp>	// Pascal unit
#include <SysUtils.hpp>	// Pascal unit
#include <Controls.hpp>	// Pascal unit
#include <StdCtrls.hpp>	// Pascal unit
#include <Classes.hpp>	// Pascal unit
#include <Forms.hpp>	// Pascal unit
#include <SysInit.hpp>	// Pascal unit
#include <System.hpp>	// Pascal unit

//-- user supplied -----------------------------------------------------------

namespace Mwcompletionproposal
{
//-- type declarations -------------------------------------------------------
typedef bool __fastcall (__closure *TCompletionProposalPaintItem)(AnsiString Key, Graphics::TCanvas* 
	Canvas, int x, int y);

class DELPHICLASS TCompletionProposalForm;
class PASCALIMPLEMENTATION TCompletionProposalForm : public Forms::TForm 
{
	typedef Forms::TForm inherited;
	
protected:
	AnsiString FCurrentString;
	Controls::TKeyPressEvent FOnKeyPress;
	Classes::TNotifyEvent FOnKeyDelete;
	TCompletionProposalPaintItem FOnPaintItem;
	Classes::TStrings* FItemList;
	int FPosition;
	int FNbLinesInWindow;
	int FFontHeight;
	Stdctrls::TScrollBar* Scroll;
	Classes::TNotifyEvent FOnValidate;
	Classes::TNotifyEvent FOnCancel;
	Graphics::TColor FClSelect;
	bool FAnsi;
	void __fastcall SetCurrentString(const AnsiString Value);
	DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
	DYNAMIC void __fastcall KeyPress(char &Key);
	DYNAMIC void __fastcall Paint(void);
	void __fastcall ScrollGetFocus(System::TObject* Sender);
	DYNAMIC void __fastcall Deactivate(void);
	void __fastcall SelectPrec(void);
	HIDESBASE void __fastcall SelectNext(void);
	void __fastcall ScrollChange(System::TObject* Sender);
	void __fastcall SetItemList(const Classes::TStrings* Value);
	HIDESBASE void __fastcall SetPosition(const int Value);
	void __fastcall SetNbLinesInWindow(const int Value);
	DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
		int Y);
	void __fastcall StringListChange(System::TObject* Sender);
	
private:
	Graphics::TBitmap* Bitmap;
	Classes::TComponent* fCurrentEditor;
	
public:
	__fastcall virtual TCompletionProposalForm(Classes::TComponent* AOwner);
	__fastcall virtual ~TCompletionProposalForm(void);
	
__published:
	__property AnsiString CurrentString = {read=FCurrentString, write=SetCurrentString};
	__property Controls::TKeyPressEvent OnKeyPress = {read=FOnKeyPress, write=FOnKeyPress};
	__property Classes::TNotifyEvent OnKeyDelete = {read=FOnKeyDelete, write=FOnKeyDelete};
	__property TCompletionProposalPaintItem OnPaintItem = {read=FOnPaintItem, write=FOnPaintItem};
	__property Classes::TNotifyEvent OnValidate = {read=FOnValidate, write=FOnValidate};
	__property Classes::TNotifyEvent OnCancel = {read=FOnCancel, write=FOnCancel};
	__property Classes::TStrings* ItemList = {read=FItemList, write=SetItemList};
	__property int Position = {read=FPosition, write=SetPosition, nodefault};
	__property int NbLinesInWindow = {read=FNbLinesInWindow, write=SetNbLinesInWindow, nodefault};
	__property Graphics::TColor ClSelect = {read=FClSelect, write=FClSelect, nodefault};
	__property bool ffAnsi = {read=FAnsi, write=FAnsi, nodefault};
	__property Classes::TComponent* CurrentEditor = {read=fCurrentEditor, write=fCurrentEditor};
public:
		
	#pragma option push -w-inl
	/* TCustomForm.CreateNew */ inline __fastcall virtual TCompletionProposalForm(Classes::TComponent* 
		AOwner, int Dummy) : Forms::TForm(AOwner, Dummy) { }
	#pragma option pop
	
public:
	#pragma option push -w-inl
	/* TWinControl.CreateParented */ inline __fastcall TCompletionProposalForm(HWND ParentWindow) : Forms::TForm(
		ParentWindow) { }
	#pragma option pop
	
};


class DELPHICLASS TCompletionProposal;
class PASCALIMPLEMENTATION TCompletionProposal : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	TCompletionProposalForm* Form;
	Classes::TNotifyEvent FOnExecute;
	Graphics::TColor __fastcall GetClSelect(void);
	void __fastcall SetClSelect(const Graphics::TColor Value);
	AnsiString __fastcall GetCurrentString();
	Classes::TStrings* __fastcall GetItemList(void);
	int __fastcall GetNbLinesInWindow(void);
	Classes::TNotifyEvent __fastcall GetOnCancel();
	Controls::TKeyPressEvent __fastcall GetOnKeyPress();
	TCompletionProposalPaintItem __fastcall GetOnPaintItem();
	Classes::TNotifyEvent __fastcall GetOnValidate();
	int __fastcall GetPosition(void);
	void __fastcall SetCurrentString(const AnsiString Value);
	void __fastcall SetItemList(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 TCompletionProposalPaintItem Value);
	void __fastcall SetPosition(const int Value);
	void __fastcall SetOnValidate(const Classes::TNotifyEvent Value);
	Classes::TNotifyEvent __fastcall GetOnKeyDelete();
	void __fastcall SetOnKeyDelete(const Classes::TNotifyEvent Value);
	void __fastcall RFAnsi(const bool Value);
	bool __fastcall SFAnsi(void);
	
public:
	__fastcall virtual TCompletionProposal(Classes::TComponent* Aowner);
	__fastcall virtual ~TCompletionProposal(void);
	void __fastcall Execute(AnsiString s, int x, int y);
	__property Controls::TKeyPressEvent OnKeyPress = {read=GetOnKeyPress, write=SetOnKeyPress};
	__property Classes::TNotifyEvent OnKeyDelete = {read=GetOnKeyDelete, write=SetOnKeyDelete};
	__property Classes::TNotifyEvent OnValidate = {read=GetOnValidate, write=SetOnValidate};
	__property Classes::TNotifyEvent OnCancel = {read=GetOnCancel, write=SetOnCancel};
	__property AnsiString CurrentString = {read=GetCurrentString, write=SetCurrentString};
	
__published:
	__property Classes::TNotifyEvent OnExecute = {read=FOnExecute, write=FOnExecute};
	__property TCompletionProposalPaintItem OnPaintItem = {read=GetOnPaintItem, write=SetOnPaintItem};
	__property Classes::TStrings* ItemList = {read=GetItemList, write=SetItemList};
	__property int Position = {read=GetPosition, write=SetPosition, nodefault};
	__property int NbLinesInWindow = {read=GetNbLinesInWindow, write=SetNbLinesInWindow, nodefault};
	__property Graphics::TColor ClSelect = {read=GetClSelect, write=SetClSelect, nodefault};
	__property bool AnsiStrings = {read=SFAnsi, write=RFAnsi, nodefault};
};


class DELPHICLASS TMwCompletionProposal;
class PASCALIMPLEMENTATION TMwCompletionProposal : public TCompletionProposal 
{
	typedef TCompletionProposal inherited;
	
private:
	Classes::TShortCut FShortCut;
	Classes::TList* fEditors;
	Classes::TList* fEditstuffs;
	AnsiString FEndOfTokenChr;
	void __fastcall SetEditor(const Mwcustomedit::TmwCustomEdit* Value);
	void __fastcall backspace(System::TObject* Senter);
	void __fastcall Cancel(System::TObject* Senter);
	void __fastcall Validate(System::TObject* Senter);
	void __fastcall KeyPress(System::TObject* Sender, char &Key);
	void __fastcall EditorKeyDown(System::TObject* Sender, Word &Key, Classes::TShiftState Shift);
	void __fastcall EditorKeyPress(System::TObject* Sender, char &Key);
	AnsiString __fastcall GetPreviousToken(Mwcustomedit::TmwCustomEdit* FEditor);
	Mwcustomedit::TmwCustomEdit* __fastcall GetFEditor(void);
	Mwcustomedit::TmwCustomEdit* __fastcall GetEditor(int i);
	
protected:
	virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
		);
	void __fastcall SetShortCut(Classes::TShortCut Value);
	
public:
	__fastcall virtual TMwCompletionProposal(Classes::TComponent* AOwner);
	__fastcall virtual ~TMwCompletionProposal(void);
	__property Mwcustomedit::TmwCustomEdit* Editors[int i] = {read=GetEditor};
	void __fastcall AddEditor(Mwcustomedit::TmwCustomEdit* Editor);
	bool __fastcall RemoveEditor(Mwcustomedit::TmwCustomEdit* Editor);
	int __fastcall EditorsCount(void);
	
__published:
	__property Classes::TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
	__property Mwcustomedit::TmwCustomEdit* Editor = {read=GetFEditor, write=SetEditor};
	__property AnsiString EndOfTokenChr = {read=FEndOfTokenChr, write=FEndOfTokenChr};
};


class DELPHICLASS TmwAutoComplete;
class PASCALIMPLEMENTATION TmwAutoComplete : public Classes::TComponent 
{
	typedef Classes::TComponent inherited;
	
private:
	Classes::TShortCut FShortCut;
	Classes::TList* fEditors;
	Classes::TList* fEditstuffs;
	Classes::TStrings* fAutoCompleteList;
	AnsiString FEndOfTokenChr;
	void __fastcall SetAutoCompleteList(Classes::TStrings* List);
	Mwcustomedit::TmwCustomEdit* __fastcall GetEditor(int i);
	Mwcustomedit::TmwCustomEdit* __fastcall GetEdit(void);
	void __fastcall SetEdit(const Mwcustomedit::TmwCustomEdit* Value);
	
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(Mwcustomedit::TmwCustomEdit* Editor);
	
public:
	__fastcall virtual TmwAutoComplete(Classes::TComponent* AOwner);
	__fastcall virtual ~TmwAutoComplete(void);
	void __fastcall Execute(AnsiString token, Mwcustomedit::TmwCustomEdit* Editor);
	__property Mwcustomedit::TmwCustomEdit* Editors[int i] = {read=GetEditor};
	void __fastcall AddEditor(Mwcustomedit::TmwCustomEdit* Editor);
	bool __fastcall RemoveEditor(Mwcustomedit::TmwCustomEdit* Editor);
	int __fastcall EditorsCount(void);
	
__published:
	__property Classes::TStrings* AutoCompleteList = {read=fAutoCompleteList, write=SetAutoCompleteList
		};
	__property AnsiString EndOfTokenChr = {read=FEndOfTokenChr, write=FEndOfTokenChr};
	__property Mwcustomedit::TmwCustomEdit* Editor = {read=GetEdit, write=SetEdit};
	__property Classes::TShortCut ShortCut = {read=FShortCut, write=SetShortCut, nodefault};
};


//-- var, const, procedure ---------------------------------------------------
extern PACKAGE void __fastcall register(void);
extern PACKAGE void __fastcall PretyTextOut(Graphics::TCanvas* c, int x, int y, AnsiString s);

}	/* namespace Mwcompletionproposal */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Mwcompletionproposal;
#endif
#pragma option pop	// -w-
#pragma option pop	// -Vx

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

⌨️ 快捷键说明

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