home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
DBLOOKUP.HPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
14KB
|
352 lines
//----------------------------------------------------------------------------
// DBLookup.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
// From: DBLookup.pas
//----------------------------------------------------------------------------
#ifndef DBLookupHPP
#define DBLookupHPP
//----------------------------------------------------------------------------
#include <Grids.hpp>
#include <DBTables.hpp>
#include <DBGrids.hpp>
#include <Buttons.hpp>
#include <Menus.hpp>
#include <Graphics.hpp>
#include <Forms.hpp>
#include <SysUtils.hpp>
#include <Messages.hpp>
#include <Controls.hpp>
#include <DB.hpp>
#include <StdCtrls.hpp>
#include <Classes.hpp>
#include <Windows.hpp>
#include <System.hpp>
#pragma warn -par
#pragma warn -hid
#pragma warn -inl
namespace Dblookup
{
//-- type declarations -------------------------------------------------------
enum TDBLookupComboStyle { csDropDown, csDropDownList };
enum TDBLookupListOption { loColLines, loRowLines, loTitles };
typedef Set<TDBLookupListOption, loColLines, loTitles> TDBLookupListOptions;
class __declspec(delphiclass) TDBLookupCombo;
class __declspec(delphiclass) TPopupGrid;
class __declspec(delphiclass) TDBLookupList;
class __declspec(pascalimplementation) TDBLookupList : public Dbgrids::TCustomDBGrid
{
typedef Dbgrids::TCustomDBGrid inherited;
private:
Dbtables::TFieldDataLink* FFieldLink;
System::AnsiString FLookupDisplay;
System::AnsiString FLookupField;
Db::TField* FDisplayFld;
Db::TField* FValueFld;
System::AnsiString FValue;
System::AnsiString FDisplayValue;
int FHiliteRow;
TDBLookupListOptions FOptions;
int FTitleOffset;
bool FFoundValue;
bool FInCellSelect;
Classes::TNotifyEvent FOnListClick;
System::AnsiString __fastcall GetDataField(void);
HIDESBASE Db::TDataSource* __fastcall GetDataSource(void);
Db::TDataSource* __fastcall GetLookupSource(void);
bool __fastcall GetReadOnly(void);
void __fastcall FieldLinkActive(System::TObject* Sender);
void __fastcall DataChange(System::TObject* Sender);
void __fastcall SetDataField(const System::AnsiString Value);
HIDESBASE void __fastcall SetDataSource(Db::TDataSource* Value);
void __fastcall SetLookupSource(Db::TDataSource* Value);
void __fastcall SetLookupDisplay(const System::AnsiString Value);
void __fastcall SetLookupField(const System::AnsiString Value);
void __fastcall SetValue(const System::AnsiString Value);
void __fastcall SetDisplayValue(const System::AnsiString Value);
void __fastcall SetReadOnly(bool Value);
HIDESBASE void __fastcall SetOptions(TDBLookupListOptions Value);
HIDESBASE void __fastcall UpdateData(System::TObject* Sender);
void __fastcall NewLayout(void);
void __fastcall DoLookup(void);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
protected:
virtual bool __fastcall HighlightCell(int DataCol, int DataRow, const System::AnsiString Value, Grids::TGridDrawState
AState);
virtual bool __fastcall CanGridAcceptKey(Word Key, Classes::TShiftState Shift);
virtual void __fastcall DefineFieldMap(void);
virtual void __fastcall SetColumnAttributes(void);
virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X,
int Y);
virtual void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
virtual void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int
Y);
virtual bool __fastcall CanEdit(void);
void __fastcall InitFields(bool ShowError);
virtual void __fastcall CreateWnd(void);
virtual void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
virtual void __fastcall KeyPress(char &Key);
virtual void __fastcall LinkActive(bool Value);
virtual void __fastcall Paint(void);
virtual void __fastcall Scroll(int Distance);
virtual void __fastcall ListClick(void);
virtual void __fastcall Loaded(void);
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
public:
__fastcall virtual TDBLookupList(Classes::TComponent* AOwner);
__fastcall virtual ~TDBLookupList(void);
__property System::AnsiString Value = {read=FValue, write=SetValue, nodefault};
__property System::AnsiString DisplayValue = {read=FDisplayValue, write=SetDisplayValue, nodefault}
;
__published:
__property System::AnsiString DataField = {read=GetDataField, write=SetDataField, nodefault};
__property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource, nodefault};
__property Db::TDataSource* LookupSource = {read=GetLookupSource, write=SetLookupSource, nodefault}
;
__property System::AnsiString LookupDisplay = {read=FLookupDisplay, write=SetLookupDisplay, nodefault
};
__property System::AnsiString LookupField = {read=FLookupField, write=SetLookupField, nodefault};
__property TDBLookupListOptions Options = {read=FOptions, write=SetOptions, default=0};
__property Classes::TNotifyEvent OnClick = {read=FOnListClick, write=FOnListClick};
__property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
__property Align ;
__property BorderStyle ;
__property Color ;
__property Ctl3D ;
__property DragCursor ;
__property DragMode ;
__property Enabled ;
__property Font ;
__property ImeMode ;
__property ImeName ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TDBLookupList(HWND ParentWindow) : Dbgrids::TCustomDBGrid(
ParentWindow) { }
};
class __declspec(pascalimplementation) TPopupGrid : public TDBLookupList
{
typedef TDBLookupList inherited;
private:
TDBLookupCombo* FCombo;
MESSAGE void __fastcall CMHintShow(Messages::TMessage &Message);
protected:
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
virtual void __fastcall CreateWnd(void);
HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X,
int Y);
virtual bool __fastcall CanEdit(void);
virtual void __fastcall LinkActive(bool Value);
public:
__property RowCount ;
__fastcall virtual TPopupGrid(Classes::TComponent* AOwner);
public:
/* TDBLookupList.Destroy */ __fastcall virtual ~TPopupGrid(void) { }
public:
/* TWinControl.CreateParented */ __fastcall TPopupGrid(HWND ParentWindow) : Dblookup::TDBLookupList(
ParentWindow) { }
};
class __declspec(pascalimplementation) TDBLookupCombo : public Stdctrls::TCustomEdit
{
typedef Stdctrls::TCustomEdit inherited;
private:
Controls::TControlCanvas* FCanvas;
int FDropDownCount;
int FDropDownWidth;
int FTextMargin;
Dbtables::TFieldDataLink* FFieldLink;
TPopupGrid* FGrid;
Buttons::TSpeedButton* FButton;
Controls::TWinControl* FBtnControl;
TDBLookupComboStyle FStyle;
Classes::TNotifyEvent FOnDropDown;
System::AnsiString __fastcall GetDataField(void);
Db::TDataSource* __fastcall GetDataSource(void);
Db::TDataSource* __fastcall GetLookupSource(void);
System::AnsiString __fastcall GetLookupDisplay(void);
System::AnsiString __fastcall GetLookupField(void);
bool __fastcall GetReadOnly(void);
System::AnsiString __fastcall GetValue(void);
System::AnsiString __fastcall GetDisplayValue(void);
int __fastcall GetMinHeight(void);
TDBLookupListOptions __fastcall GetOptions(void);
bool __fastcall CanEdit(void);
bool __fastcall Editable(void);
void __fastcall SetValue(const System::AnsiString NewValue);
void __fastcall SetDisplayValue(const System::AnsiString NewValue);
void __fastcall DataChange(System::TObject* Sender);
void __fastcall EditingChange(System::TObject* Sender);
void __fastcall SetDataField(const System::AnsiString Value);
void __fastcall SetDataSource(Db::TDataSource* Value);
void __fastcall SetLookupSource(Db::TDataSource* Value);
void __fastcall SetLookupDisplay(const System::AnsiString Value);
void __fastcall SetLookupField(const System::AnsiString Value);
HIDESBASE void __fastcall SetReadOnly(bool Value);
void __fastcall SetOptions(TDBLookupListOptions Value);
void __fastcall SetStyle(TDBLookupComboStyle Value);
void __fastcall UpdateData(System::TObject* Sender);
void __fastcall FieldLinkActive(System::TObject* Sender);
void __fastcall NonEditMouseDown(Messages::TWMMouse &Message);
void __fastcall DoSelectAll(void);
void __fastcall SetEditRect(void);
MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
MESSAGE void __fastcall CMCancelMode(Controls::TCMCancelMode &Message);
HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
MESSAGE void __fastcall CMHintShow(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
HIDESBASE MESSAGE void __fastcall CMEnabledChanged(Messages::TMessage &Message);
protected:
virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
);
virtual void __fastcall Change(void);
virtual void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
virtual void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
virtual void __fastcall KeyPress(char &Key);
virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
virtual void __fastcall CreateWnd(void);
void __fastcall GridClick(System::TObject* Sender);
virtual void __fastcall Loaded(void);
public:
__fastcall virtual TDBLookupCombo(Classes::TComponent* AOwner);
__fastcall virtual ~TDBLookupCombo(void);
virtual void __fastcall DropDown(void);
virtual void __fastcall CloseUp(void);
__property System::AnsiString Value = {read=GetValue, write=SetValue, nodefault};
__property System::AnsiString DisplayValue = {read=GetDisplayValue, write=SetDisplayValue, nodefault
};
__published:
__property System::AnsiString DataField = {read=GetDataField, write=SetDataField, nodefault};
__property Db::TDataSource* DataSource = {read=GetDataSource, write=SetDataSource, nodefault};
__property Db::TDataSource* LookupSource = {read=GetLookupSource, write=SetLookupSource, nodefault}
;
__property System::AnsiString LookupDisplay = {read=GetLookupDisplay, write=SetLookupDisplay, nodefault
};
__property System::AnsiString LookupField = {read=GetLookupField, write=SetLookupField, nodefault};
__property TDBLookupListOptions Options = {read=GetOptions, write=SetOptions, default=0};
__property TDBLookupComboStyle Style = {read=FStyle, write=SetStyle, default=0};
__property AutoSelect ;
__property Color ;
__property Ctl3D ;
__property DragCursor ;
__property DragMode ;
__property int DropDownCount = {read=FDropDownCount, write=FDropDownCount, default=8};
__property int DropDownWidth = {read=FDropDownWidth, write=FDropDownWidth, default=0};
__property Enabled ;
__property Font ;
__property ImeMode ;
__property ImeName ;
__property MaxLength ;
__property ParentColor ;
__property ParentCtl3D ;
__property ParentFont ;
__property ParentShowHint ;
__property PopupMenu ;
__property bool ReadOnly = {read=GetReadOnly, write=SetReadOnly, default=0};
__property ShowHint ;
__property TabOrder ;
__property TabStop ;
__property Visible ;
__property OnChange ;
__property OnClick ;
__property OnDblClick ;
__property OnDragDrop ;
__property OnDragOver ;
__property Classes::TNotifyEvent OnDropDown = {read=FOnDropDown, write=FOnDropDown};
__property OnEndDrag ;
__property OnEnter ;
__property OnExit ;
__property OnKeyDown ;
__property OnKeyPress ;
__property OnKeyUp ;
__property OnMouseDown ;
__property OnMouseMove ;
__property OnMouseUp ;
__property OnStartDrag ;
public:
/* TWinControl.CreateParented */ __fastcall TDBLookupCombo(HWND ParentWindow) : Stdctrls::TCustomEdit(
ParentWindow) { }
};
class __declspec(delphiclass) TComboButton;
class __declspec(pascalimplementation) TComboButton : public Buttons::TSpeedButton
{
typedef Buttons::TSpeedButton inherited;
protected:
virtual void __fastcall MouseMove(Classes::TShiftState Shift, int X, int Y);
virtual void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X,
int Y);
public:
/* TSpeedButton.Create */ __fastcall virtual TComboButton(Classes::TComponent* AOwner) : Buttons::TSpeedButton(
AOwner) { }
/* TSpeedButton.Destroy */ __fastcall virtual ~TComboButton(void) { }
};
//-- var, const, procedure ---------------------------------------------------
//-- template instantiations -------------------------------------------------
template class TDBLookupListOptions ;
} /* namespace Dblookup */
#pragma warn .par
#pragma warn .hid
#pragma warn .inl
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Dblookup;
#endif
//-- end unit ----------------------------------------------------------------
#endif // DBLookup