📄 advdblookupcombobox.hpp
字号:
bool FLabelAlwaysEnabled;
bool FLabelTransparent;
int FLabelMargin;
Graphics::TFont* FLabelFont;
TLabelPosition FLabelPosition;
TLabelEx* FLabel;
TDropDownType FDropDownType;
TLookupErrorEvent FOnLookupError;
TLookupSuccessEvent FOnLookupSuccess;
AnsiString FLabelField;
AnsiString FSortColumn;
int FLabelWidth;
int FGridRowHeight;
TLookupLoad FLookupLoad;
bool FDisableChange;
bool FInLookup;
bool FDropSizeable;
Classes::TNotifyEvent FOnDropDown;
Classes::TNotifyEvent FOnCloseUp;
bool FReturnIsTab;
Graphics::TColor FFocusColor;
Graphics::TColor FNormalColor;
Controls::TImageList* FImages;
bool FShowGridTitleRow;
int FLookupColumn;
bool FInternalCall;
TDrawGridCellProp FOnDrawProp;
int FDropStretchColumn;
Graphics::TColor FDisabledColor;
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
MESSAGE void __fastcall WMPaste(Messages::TWMNoParams &Message);
MESSAGE void __fastcall WMCut(Messages::TWMNoParams &Message);
HIDESBASE MESSAGE void __fastcall WMKeyDown(Messages::TWMKey &Msg);
HIDESBASE MESSAGE void __fastcall WMChar(Messages::TWMKey &Msg);
HIDESBASE MESSAGE void __fastcall WMSysKeyDown(Messages::TWMKey &Msg);
HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Msg);
HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Msg);
int __fastcall GetMinHeight(void);
void __fastcall SetEditRect(void);
void __fastcall OnGridResize(System::TObject* Sender);
void __fastcall OnDropDownResize(System::TObject* Sender);
AnsiString __fastcall GridToString();
void __fastcall ShowGridList(bool Focus);
void __fastcall HideGridList(void);
void __fastcall UpdateLookup(void);
void __fastcall FormDeactivate(System::TObject* Sender);
void __fastcall MouseClick(System::TObject* Sender);
void __fastcall DownClick(System::TObject* Sender);
void __fastcall SetDropFont(const Graphics::TFont* Value);
HIDESBASE AnsiString __fastcall GetText();
HIDESBASE void __fastcall SetText(const AnsiString Value);
bool __fastcall CheckDataSet(void);
bool __fastcall CheckEditDataSet(void);
Db::TDataSource* __fastcall GetListsource(void);
void __fastcall SetListsource(const Db::TDataSource* Value);
int __fastcall GetItemIndex(void);
void __fastcall SetItemIndex(int Value);
Db::TDataSource* __fastcall GetDatasource(void);
void __fastcall SetDatasource(const Db::TDataSource* Value);
void __fastcall SetSortColumns(const int Value);
int __fastcall GetRealItemIndex(int Index);
void __fastcall SetFilterField(const AnsiString Value);
void __fastcall SetFilterValue(const AnsiString Value);
AnsiString __fastcall GetLabelCaption();
void __fastcall SetLabelAlwaysEnabled(const bool Value);
void __fastcall SetLabelCaption(const AnsiString Value);
void __fastcall SetLabelFont(const Graphics::TFont* Value);
void __fastcall SetLabelMargin(const int Value);
void __fastcall SetLabelPosition(const TLabelPosition Value);
void __fastcall SetLabelTransparent(const bool Value);
void __fastcall UpdateLabel(void);
void __fastcall LabelFontChange(System::TObject* Sender);
void __fastcall SetLabelField(const AnsiString Value);
void __fastcall SetSortColumn(const AnsiString Value);
void __fastcall SetLabelWidth(const int Value);
void __fastcall SetSortDownGlyph(const Graphics::TBitmap* Value);
void __fastcall SetSortUpGlyph(const Graphics::TBitmap* Value);
void __fastcall SetLookupLoad(const TLookupLoad Value);
AnsiString __fastcall GetVersion();
void __fastcall SetVersion(const AnsiString Value);
bool __fastcall GetEnabledEx(void);
void __fastcall SetEnabledEx(const bool Value);
void __fastcall SetDisabledColor(const Graphics::TColor Value);
void __fastcall SetLookupColumn(const int Value);
Variant __fastcall SecureLookup(const Db::TDataSet* Data, const Db::TField* Field, const AnsiString KeyFields, const Variant &KeyValues, const Variant &KeyValuesDefault, const AnsiString ResultFields);
protected:
virtual int __fastcall GetVersionNr(void);
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall DestroyWnd(void);
virtual Forms::TCustomForm* __fastcall GetParentForm(Controls::TControl* Control);
void __fastcall LoadGridOptions(void);
void __fastcall StringGridDrawCell(System::TObject* Sender, int ACol, int ARow, const Types::TRect &Rect, Grids::TGridDrawState State);
void __fastcall GridMouseDown(System::TObject* Sender, Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
void __fastcall StringGridKeyPress(System::TObject* Sender, char &Key);
void __fastcall StringGridSelectCell(System::TObject* Sender, int ACol, int ARow, bool &CanSelect);
int __fastcall LoadFromListSource(void);
void __fastcall SetActive(bool Active);
DYNAMIC void __fastcall Change(void);
DYNAMIC void __fastcall DoEnter(void);
DYNAMIC void __fastcall KeyPress(char &Key);
DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
bool __fastcall FindField(AnsiString Value);
TLabelEx* __fastcall CreateLabel(void);
void __fastcall UpdateText(AnsiString s);
__property int SortColumns = {read=FSortColumns, write=SetSortColumns, default=0};
void __fastcall SetSortMethod(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation AOperation);
int __fastcall GetGridColumnsWidth(void);
void __fastcall UpdateDropStretchColumnWidth(void);
Db::TField* __fastcall GetColumnField(int ACol);
void __fastcall CancelChanges(void);
public:
__fastcall virtual TAdvDBLookupComboBox(Classes::TComponent* AOwner);
__fastcall virtual ~TAdvDBLookupComboBox(void);
virtual void __fastcall Loaded(void);
virtual void __fastcall Init(void);
__property TDropGridListButton* Button = {read=FButton};
__property AnsiString Text = {read=GetText, write=SetText};
__property int ItemIndex = {read=GetItemIndex, write=SetItemIndex, nodefault};
virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
void __fastcall DropDown(void);
__published:
__property Anchors = {default=3};
__property Constraints ;
__property DragKind = {default=0};
__property AutoSelect = {default=1};
__property AutoSize = {default=1};
__property BorderStyle = {default=1};
__property Color = {default=-16777211};
__property Ctl3D ;
__property Graphics::TColor DisabledColor = {read=FDisabledColor, write=SetDisabledColor, default=12632256};
__property DragCursor = {default=-12};
__property DragMode = {default=0};
__property TDropDownType DropDownType = {read=FDropDownType, write=FDropDownType, default=0};
__property bool EditorEnabled = {read=FEditorEnabled, write=FEditorEnabled, default=1};
__property bool Enabled = {read=GetEnabledEx, write=SetEnabledEx, nodefault};
__property AnsiString FilterField = {read=FFilterField, write=SetFilterField};
__property AnsiString FilterValue = {read=FFilterValue, write=SetFilterValue};
__property Font ;
__property AnsiString LabelCaption = {read=GetLabelCaption, write=SetLabelCaption};
__property TLabelPosition LabelPosition = {read=FLabelPosition, write=SetLabelPosition, nodefault};
__property int LabelMargin = {read=FLabelMargin, write=SetLabelMargin, nodefault};
__property bool LabelTransparent = {read=FLabelTransparent, write=SetLabelTransparent, nodefault};
__property bool LabelAlwaysEnabled = {read=FLabelAlwaysEnabled, write=SetLabelAlwaysEnabled, nodefault};
__property AnsiString LabelField = {read=FLabelField, write=SetLabelField};
__property Graphics::TFont* LabelFont = {read=FLabelFont, write=SetLabelFont};
__property int LabelWidth = {read=FLabelWidth, write=SetLabelWidth, nodefault};
__property int LookupColumn = {read=FLookupColumn, write=SetLookupColumn, nodefault};
__property TLookupMethod LookupMethod = {read=FLookupMethod, write=FLookupMethod, nodefault};
__property TLookupLoad LookupLoad = {read=FLookupLoad, write=SetLookupLoad, nodefault};
__property MaxLength = {default=0};
__property ParentColor = {default=0};
__property ParentCtl3D = {default=1};
__property ParentFont = {default=1};
__property ParentShowHint = {default=1};
__property PopupMenu ;
__property ShowHint ;
__property TabOrder = {default=-1};
__property TabStop = {default=1};
__property Visible = {default=1};
__property Height ;
__property Width ;
__property OnChange ;
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDrag ;
__property OnEndDock ;
__property OnStartDock ;
__property TDBColumnCollection* Columns = {read=FColumns, write=FColumns};
__property AnsiString DataField = {read=FDataField, write=FDataField};
__property Db::TDataSource* DataSource = {read=GetDatasource, write=SetDatasource};
__property int DropWidth = {read=FDropWidth, write=FDropWidth, nodefault};
__property int DropStretchColumn = {read=FDropStretchColumn, write=FDropStretchColumn, nodefault};
__property int DropHeight = {read=FDropHeight, write=FDropHeight, default=100};
__property Graphics::TColor DropColor = {read=FDropColor, write=FDropColor, default=-16777211};
__property Graphics::TFont* DropFont = {read=FDropFont, write=SetDropFont};
__property TDropDirection DropDirection = {read=fDropDirection, write=fDropDirection, default=0};
__property bool DropSorted = {read=FDropSorted, write=FDropSorted, default=0};
__property bool DropSizeable = {read=FDropSizeable, write=FDropSizeable, default=0};
__property Graphics::TColor FocusColor = {read=FFocusColor, write=FFocusColor, default=536870911};
__property bool GridLines = {read=FGridLines, write=FGridLines, default=1};
__property bool GridColumnSize = {read=FGridColumnSize, write=FGridColumnSize, default=1};
__property int GridRowHeight = {read=FGridRowHeight, write=FGridRowHeight, default=21};
__property Graphics::TColor HeaderColor = {read=FHeaderColor, write=FHeaderColor, default=-16777201};
__property Controls::TImageList* Images = {read=FImages, write=FImages};
__property AnsiString KeyField = {read=FKeyField, write=FKeyField};
__property Db::TDataSource* ListSource = {read=GetListsource, write=SetListsource};
__property bool ReturnIsTab = {read=FReturnIsTab, write=FReturnIsTab, default=0};
__property Graphics::TColor SelectionColor = {read=FSelectionColor, write=FSelectionColor, default=-16777203};
__property Graphics::TColor SelectionTextColor = {read=FSelectionTextColor, write=FSelectionTextColor, default=-16777202};
__property AnsiString SortColumn = {read=FSortColumn, write=SetSortColumn};
__property Graphics::TBitmap* SortUpGlyph = {read=FBitmapdown, write=SetSortUpGlyph};
__property Graphics::TBitmap* SortDownGlyph = {read=FBitmapUp, write=SetSortDownGlyph};
__property bool ShowGridTitleRow = {read=FShowGridTitleRow, write=FShowGridTitleRow, nodefault};
__property Classes::TNotifyEvent OnClickBtn = {read=FOnClickBtn, write=FOnClickBtn};
__property Classes::TNotifyEvent OnCloseUp = {read=FOnCloseUp, write=FOnCloseUp};
__property Classes::TNotifyEvent OnDropDown = {read=FOnDropDown, write=FOnDropDown};
__property TTextToGridListItem OnTextToGridListItem = {read=FOnTextToGridListItem, write=FOnTextToGridListItem};
__property TGridListItemToText OnGridListItemToText = {read=FOnGridListItemToText, write=FOnGridListItemToText};
__property TLookupErrorEvent OnLookupError = {read=FOnLookupError, write=FOnLookupError};
__property TLookupSuccessEvent OnLookupSuccess = {read=FOnLookupSuccess, write=FOnLookupSuccess};
__property AnsiString Version = {read=GetVersion, write=SetVersion};
__property TDrawGridCellProp OnDrawProp = {read=FOnDrawProp, write=FOnDrawProp};
public:
#pragma option push -w-inl
/* TWinControl.CreateParented */ inline __fastcall TAdvDBLookupComboBox(HWND ParentWindow) : Stdctrls::TCustomEdit(ParentWindow) { }
#pragma option pop
};
class PASCALIMPLEMENTATION TFindList : public Classes::TStringList
{
typedef Classes::TStringList inherited;
private:
int BaseIndex;
AnsiString KeyField;
TAdvDBLookupComboBox* FGrid;
public:
__fastcall TFindList(TAdvDBLookupComboBox* Agrid);
__fastcall virtual ~TFindList(void);
};
#pragma option push -b-
enum TGradientDirection { gdHorizontal, gdVertical };
#pragma option pop
#pragma option push -b-
enum TDBColumnType { ctText, ctImage };
#pragma option pop
class PASCALIMPLEMENTATION TDBColumnItem : public Classes::TCollectionItem
{
typedef Classes::TCollectionItem inherited;
private:
int FWidth;
Classes::TAlignment FAlignment;
Graphics::TFont* FFont;
Graphics::TColor FColor;
TDBColumnType FColumnType;
AnsiString FListField;
AnsiString FTitle;
AnsiString FName;
Graphics::TFont* FTitleFont;
bool FAutoSize;
Graphics::TColor FFixedColor;
Graphics::TColor FFixedColorTo;
TGradientDirection FGradientDir;
void __fastcall SetWidth(const int value);
void __fastcall SetAlignment(const Classes::TAlignment value);
void __fastcall SetFont(const Graphics::TFont* value);
void __fastcall SetColor(const Graphics::TColor value);
AnsiString __fastcall GetListField();
void __fastcall SetListField(const AnsiString Value);
void __fastcall SetColumnType(const TDBColumnType Value);
TAdvDBLookupComboBox* __fastcall GetCombo(void);
AnsiString __fastcall GetName();
void __fastcall SetName(const AnsiString Value);
void __fastcall SetTitleFont(const Graphics::TFont* Value);
protected:
virtual AnsiString __fastcall GetDisplayName();
public:
__fastcall virtual TDBColumnItem(Classes::TCollection* Collection);
__fastcall virtual ~TDBColumnItem(void);
virtual void __fastcall Assign(Classes::TPersistent* Source);
__property TAdvDBLookupComboBox* Combo = {read=GetCombo};
__published:
__property bool AutoSize = {read=FAutoSize, write=FAutoSize, default=0};
__property Graphics::TColor Color = {read=FColor, write=SetColor, default=-16777211};
__property TDBColumnType ColumnType = {read=FColumnType, write=SetColumnType, default=0};
__property Graphics::TColor FixedColor = {read=FFixedColor, write=FFixedColor, nodefault};
__property Graphics::TColor FixedColorTo = {read=FFixedColorTo, write=FFixedColorTo, nodefault};
__property TGradientDirection GradientDir = {read=FGradientDir, write=FGradientDir, nodefault};
__property int Width = {read=FWidth, write=SetWidth, default=100};
__property Classes::TAlignment Alignment = {read=FAlignment, write=SetAlignment, default=0};
__property Graphics::TFont* Font = {read=FFont, write=SetFont};
__property AnsiString ListField = {read=GetListField, write=SetListField};
__property AnsiString Name = {read=GetName, write=SetName};
__property AnsiString Title = {read=FTitle, write=FTitle};
__property Graphics::TFont* TitleFont = {read=FTitleFont, write=SetTitleFont};
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint MAJ_VER = 0x1;
static const Shortint MIN_VER = 0x5;
static const Shortint REL_VER = 0x1;
static const Shortint BLD_VER = 0x0;
} /* namespace Advdblookupcombobox */
using namespace Advdblookupcombobox;
#pragma pack(pop)
#pragma option pop
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // Advdblookupcombobox
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -