unit LabelEditImpl1;
{$WARN SYMBOL_PLATFORM OFF}
interface
uses
Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
ComServ, StdVCL, AXCtrls, LabelEditXControl1_TLB, LabelEdit;
type
TLabelEditX = class(TActiveXControl, ILabelEditX)
private
{ Private declarations }
FDelphiControl: TLabelEdit;
FEvents: ILabelEditXEvents;
protected
{ Protected declarations }
procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage)
override;
procedure EventSinkChanged(const EventSink: IUnknown)
override;
procedure InitializeControl
override;
function DrawTextBiDiModeFlagsReadingOnly: Integer
safecall;
function Get_AlignDisabled: WordBool
safecall;
function Get_Cursor: Smallint
safecall;
function Get_DoubleBuffered: WordBool
safecall;
function Get_EditText: WideString
safecall;
function Get_Enabled: WordBool
safecall;
function Get_Font: IFontDisp
safecall;
function Get_HelpKeyword: WideString
safecall;
function Get_HelpType: TxHelpType
safecall;
function Get_LabelText: WideString
safecall;
function Get_Visible: WordBool
safecall;
function Get_VisibleDockClientCount: Integer
safecall;
function IsRightToLeft: WordBool
safecall;
function UseRightToLeftReading: WordBool
safecall;
function UseRightToLeftScrollBar: WordBool
safecall;
procedure _Set_Font(var Value: IFontDisp)
safecall;
procedure InitiateAction
safecall;
procedure Set_Cursor(Value: Smallint)
safecall;
procedure Set_DoubleBuffered(Value: WordBool)
safecall;
procedure Set_EditText(const Value: WideString)
safecall;
procedure Set_Enabled(Value: WordBool)
safecall;
procedure Set_Font(const Value: IFontDisp)
safecall;
procedure Set_HelpKeyword(const Value: WideString)
safecall;
procedure Set_HelpType(Value: TxHelpType)
safecall;
procedure Set_LabelText(const Value: WideString)
safecall;
procedure Set_Visible(Value: WordBool)
safecall;
procedure SetSubComponent(IsSubComponent: WordBool)
safecall;
end;
implementation
uses ComObj;
{ TLabelEditX }
procedure TLabelEditX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
begin
{TODO: Define property pages here. Property pages are defined by calling
DefinePropertyPage with the class id of the page. For example,
DefinePropertyPage(Class_LabelEditXPage)
}
end;
procedure TLabelEditX.EventSinkChanged(const EventSink: IUnknown);
begin
FEvents := EventSink as ILabelEditXEvents;
end;
procedure TLabelEditX.InitializeControl;
begin
FDelphiControl := Control as TLabelEdit;
end;
function TLabelEditX.DrawTextBiDiModeFlagsReadingOnly: Integer;
begin
Result := FDelphiControl.DrawTextBiDiModeFlagsReadingOnly;
end;
function TLabelEditX.Get_AlignDisabled: WordBool;
begin
Result := FDelphiControl.AlignDisabled;
end;
function TLabelEditX.Get_Cursor: Smallint;
begin
Result := Smallint(FDelphiControl.Cursor);
end;
function TLabelEditX.Get_DoubleBuffered: WordBool;
begin
Result := FDelphiControl.DoubleBuffered;
end;
function TLabelEditX.Get_EditText: WideString;
begin
Result := WideString(FDelphiControl.EditText);
end;
function TLabelEditX.Get_Enabled: WordBool;
begin
Result := FDelphiControl.Enabled;
end;
function TLabelEditX.Get_Font: IFontDisp;
begin
GetOleFont(FDelphiControl.Font, Result);
end;
function TLabelEditX.Get_HelpKeyword: WideString;
begin
Result := WideString(FDelphiControl.HelpKeyword);
end;
function TLabelEditX.Get_HelpType: TxHelpType;
begin
Result := Ord(FDelphiControl.HelpType);
end;
function TLabelEditX.Get_LabelText: WideString;
begin
Result := WideString(FDelphiControl.LabelText);
end;
function TLabelEditX.Get_Visible: WordBool;
begin
Result := FDelphiControl.Visible;
end;
function TLabelEditX.Get_VisibleDockClientCount: Integer;
begin
Result := FDelphiControl.VisibleDockClientCount;
end;
function TLabelEditX.IsRightToLeft: WordBool;
begin
Result := FDelphiControl.IsRightToLeft;
end;
function TLabelEditX.UseRightToLeftReading: WordBool;
begin
Result := FDelphiControl.UseRightToLeftReading;
end;
function TLabelEditX.UseRightToLeftScrollBar: WordBool;
begin
Result := FDelphiControl.UseRightToLeftScrollBar;
end;
procedure TLabelEditX._Set_Font(var Value: IFontDisp);
begin
SetOleFont(FDelphiControl.Font, Value);
end;
procedure TLabelEditX.InitiateAction;
begin
FDelphiControl.InitiateAction;
end;
procedure TLabelEditX.Set_Cursor(Value: Smallint);
begin
FDelphiControl.Cursor := TCursor(Value);
end;
procedure TLabelEditX.Set_DoubleBuffered(Value: WordBool);
begin
FDelphiControl.DoubleBuffered := Value;
end;
procedure TLabelEditX.Set_EditText(const Value: WideString);
begin
FDelphiControl.EditText := String(Value);
end;
procedure TLabelEditX.Set_Enabled(Value: WordBool);
begin
FDelphiControl.Enabled := Value;
end;
procedure TLabelEditX.Set_Font(const Value: IFontDisp);
begin
SetOleFont(FDelphiControl.Font, Value);
end;
procedure TLabelEditX.Set_HelpKeyword(const Value: WideString);
begin
FDelphiControl.HelpKeyword := String(Value);
end;
procedure TLabelEditX.Set_HelpType(Value: TxHelpType);
begin
FDelphiControl.HelpType := THelpType(Value);
end;
procedure TLabelEditX.Set_LabelText(const Value: WideString);
begin
FDelphiControl.LabelText := String(Value);
end;
procedure TLabelEditX.Set_Visible(Value: WordBool);
begin
FDelphiControl.Visible := Value;
end;
procedure TLabelEditX.SetSubComponent(IsSubComponent: WordBool);
begin
FDelphiControl.SetSubComponent(IsSubComponent);
end;
initialization
TActiveXControlFactory.Create(
ComServer,
TLabelEditX,
TLabelEdit,
Class_LabelEditX,
1,
'',
0,
tmApartment);
end.