Reimplements the cdintf control special case as a LCLIntf function, to be more conformant to the way of working for the LCL

git-svn-id: trunk@39475 -
This commit is contained in:
sekelsenmat 2012-12-07 15:55:54 +00:00
parent 9b8ffbeb1f
commit e155bfca39
10 changed files with 25 additions and 17 deletions

View File

@ -1899,7 +1899,6 @@ type
FDoubleBuffered: Boolean; FDoubleBuffered: Boolean;
FDockSite: Boolean; FDockSite: Boolean;
FUseDockManager: Boolean; FUseDockManager: Boolean;
FIsCDIntfControl: Boolean;
procedure AlignControl(AControl: TControl); procedure AlignControl(AControl: TControl);
function GetBrush: TBrush; function GetBrush: TBrush;
function GetControl(const Index: Integer): TControl; function GetControl(const Index: Integer): TControl;
@ -2108,7 +2107,6 @@ type
property DoubleBuffered: Boolean read FDoubleBuffered write FDoubleBuffered default False; property DoubleBuffered: Boolean read FDoubleBuffered write FDoubleBuffered default False;
property Handle: HWND read GetHandle write SetHandle; property Handle: HWND read GetHandle write SetHandle;
property IsResizing: Boolean read GetIsResizing; property IsResizing: Boolean read GetIsResizing;
property IsCDIntfControl: Boolean read FIsCDIntfControl write FIsCDIntfControl default False;
property TabOrder: TTabOrder read GetTabOrder write SetTaborder default -1; property TabOrder: TTabOrder read GetTabOrder write SetTaborder default -1;
property TabStop: Boolean read FTabStop write SetTabStop default false; property TabStop: Boolean read FTabStop write SetTabStop default false;
property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore; property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore;

View File

@ -524,6 +524,11 @@ begin
// But Forms is not in the uses clause // But Forms is not in the uses clause
end; end;
function TWidgetSet.IsCDIntfControl(AWinControl: TObject): Boolean;
begin
Result := False;
end;
function TWidgetSet.MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean; function TWidgetSet.MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean;
var var
P: TPoint; P: TPoint;

View File

@ -356,6 +356,11 @@ begin
Result := WidgetSet.IsMobilePlatform(); Result := WidgetSet.IsMobilePlatform();
end; end;
function IsCDIntfControl(AWinControl: TObject): Boolean;
begin
Result := WidgetSet.IsCDIntfControl(AWinControl);
end;
function MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean; function MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean;
begin begin
Result := WidgetSet.MoveWindowOrgEx(DC, dX, dY); Result := WidgetSet.MoveWindowOrgEx(DC, dX, dY);

View File

@ -93,6 +93,7 @@ function IntfSendsUTF8KeyPress: Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function InvalidateFrame(aHandle : HWND; ARect : pRect; bErase : Boolean; BorderWidth: integer) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function InvalidateFrame(aHandle : HWND; ARect : pRect; bErase : Boolean; BorderWidth: integer) : Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function IsMobilePlatform: Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function IsMobilePlatform: Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function IsCDIntfControl(AWinControl: TObject): Boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}
function MoveWindowOrgEx(dc : hdc; dX,dY : Integer): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF} function MoveWindowOrgEx(dc : hdc; dX,dY : Integer): boolean; {$IFDEF IF_BASE_MEMBER}virtual;{$ENDIF}

View File

@ -4601,7 +4601,7 @@ begin
begin begin
lWinControl := TWinControl(FTabList[I]); lWinControl := TWinControl(FTabList[I]);
// The tab order list should exclude injected LCL-CustomDrawn controls // The tab order list should exclude injected LCL-CustomDrawn controls
if lWinControl.CanFocus and (not lWinControl.IsCDIntfControl) then if lWinControl.CanFocus and (not LCLIntf.IsCDIntfControl(lWinControl)) then
List.Add(lWinControl); List.Add(lWinControl);
lWinControl.GetTabOrderList(List); lWinControl.GetTabOrderList(List);
end; end;

View File

@ -317,6 +317,11 @@ begin
Result := (ADC = HDC(Self.ScreenDC)); Result := (ADC = HDC(Self.ScreenDC));
end; end;
function TCDWidgetSet.IsCDIntfControl(AWinControl: TObject): Boolean;
begin
Result := IsIntfControl(TWinControl(AWinControl));
end;
function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean; function TCDWidgetSet.RadialPie(DC: HDC; x1, y1, x2, y2, Angle1, Angle2: Integer): Boolean;
begin begin
Result := IsValidDC(DC); Result := IsValidDC(DC);

View File

@ -57,6 +57,7 @@ procedure HideVirtualKeyboard();
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*) function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
function IsMobilePlatform: Boolean; override; function IsMobilePlatform: Boolean; override;
function IsScreenDC(ADC: HDC): Boolean; function IsScreenDC(ADC: HDC): Boolean;
function IsCDIntfControl(AWinControl: TObject): Boolean; override;
function PromptUser(const DialogCaption : string; function PromptUser(const DialogCaption : string;
const DialogMessage : string; const DialogMessage : string;

View File

@ -312,15 +312,19 @@ end;
function IsIntfControl(AControl: TWinControl): Boolean; function IsIntfControl(AControl: TWinControl): Boolean;
begin begin
Result := (AControl <> nil) and (AControl.Parent <> nil) and AControl.IsCDIntfControl; Result := (AControl <> nil) and (AControl.Parent <> nil);
{if Result then Result := if Result then Result :=
// Standard Tab // Standard Tab
(AControl is TCDIntfButton) or (AControl is TCDIntfEdit) or (AControl is TCDIntfCheckBox) or (AControl is TCDIntfButton) or (AControl is TCDIntfEdit) or (AControl is TCDIntfCheckBox) or
(AControl is TCDIntfRadioButton) or (AControl is TCDIntfComboBox) or (AControl is TCDIntfScrollBar) or
// Additional Tab // Additional Tab
(AControl is TCDIntfStaticText) or (AControl is TCDIntfStaticText) or
// Common Controls Tab // Common Controls Tab
(AControl is TCDIntfProgressBar) or (AControl is TCDIntfTrackBar) or (AControl is TCDIntfProgressBar) or (AControl is TCDIntfTrackBar) or
(AControl is TCDIntfPageControl);} (AControl is TCDIntfPageControl) or
// Common Controls Tab
(AControl is TCDIntfSpinEdit)
;
end; end;
{ TCDIntfEdit } { TCDIntfEdit }

View File

@ -290,7 +290,6 @@ begin
TCDIntfPageControl(ACDControlField).LCLControl := TCustomTabControl(AWinControl); TCDIntfPageControl(ACDControlField).LCLControl := TCustomTabControl(AWinControl);
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -428,7 +427,6 @@ begin
TCDIntfTrackBar(ACDControlField).LCLControl := TCustomTrackBar(AWinControl); TCDIntfTrackBar(ACDControlField).LCLControl := TCustomTrackBar(AWinControl);
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -569,7 +567,6 @@ begin
TCDIntfProgressBar(ACDControlField).LCLControl := TCustomProgressBar(AWinControl); TCDIntfProgressBar(ACDControlField).LCLControl := TCustomProgressBar(AWinControl);
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;

View File

@ -355,7 +355,6 @@ begin
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -422,7 +421,6 @@ begin
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -824,7 +822,6 @@ begin
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -1308,7 +1305,6 @@ begin
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
TCDIntfEdit(ACDControlField).ReadOnly := TCustomEdit(AWinControl).ReadOnly; TCDIntfEdit(ACDControlField).ReadOnly := TCustomEdit(AWinControl).ReadOnly;
end; end;
@ -1566,7 +1562,6 @@ begin
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -1637,7 +1632,6 @@ begin
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -1728,7 +1722,6 @@ begin
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;
@ -1800,7 +1793,6 @@ begin
ACDControlField.Parent := AWinControl; ACDControlField.Parent := AWinControl;
ACDControlField.Caption := AWinControl.Caption; ACDControlField.Caption := AWinControl.Caption;
ACDControlField.Align := alClient; ACDControlField.Align := alClient;
ACDControlField.IsCDIntfControl := True;
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif} {$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
end; end;