mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
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:
parent
9b8ffbeb1f
commit
e155bfca39
@ -1899,7 +1899,6 @@ type
|
||||
FDoubleBuffered: Boolean;
|
||||
FDockSite: Boolean;
|
||||
FUseDockManager: Boolean;
|
||||
FIsCDIntfControl: Boolean;
|
||||
procedure AlignControl(AControl: TControl);
|
||||
function GetBrush: TBrush;
|
||||
function GetControl(const Index: Integer): TControl;
|
||||
@ -2108,7 +2107,6 @@ type
|
||||
property DoubleBuffered: Boolean read FDoubleBuffered write FDoubleBuffered default False;
|
||||
property Handle: HWND read GetHandle write SetHandle;
|
||||
property IsResizing: Boolean read GetIsResizing;
|
||||
property IsCDIntfControl: Boolean read FIsCDIntfControl write FIsCDIntfControl default False;
|
||||
property TabOrder: TTabOrder read GetTabOrder write SetTaborder default -1;
|
||||
property TabStop: Boolean read FTabStop write SetTabStop default false;
|
||||
property OnAlignInsertBefore: TAlignInsertBeforeEvent read FOnAlignInsertBefore write FOnAlignInsertBefore;
|
||||
|
@ -524,6 +524,11 @@ begin
|
||||
// But Forms is not in the uses clause
|
||||
end;
|
||||
|
||||
function TWidgetSet.IsCDIntfControl(AWinControl: TObject): Boolean;
|
||||
begin
|
||||
Result := False;
|
||||
end;
|
||||
|
||||
function TWidgetSet.MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean;
|
||||
var
|
||||
P: TPoint;
|
||||
|
@ -356,6 +356,11 @@ begin
|
||||
Result := WidgetSet.IsMobilePlatform();
|
||||
end;
|
||||
|
||||
function IsCDIntfControl(AWinControl: TObject): Boolean;
|
||||
begin
|
||||
Result := WidgetSet.IsCDIntfControl(AWinControl);
|
||||
end;
|
||||
|
||||
function MoveWindowOrgEx(dc: hdc; dX,dY: Integer): boolean;
|
||||
begin
|
||||
Result := WidgetSet.MoveWindowOrgEx(DC, dX, dY);
|
||||
|
@ -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 IsDesignerDC(WindowHandle: HWND; DC: HDC): 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}
|
||||
|
||||
|
@ -4601,7 +4601,7 @@ begin
|
||||
begin
|
||||
lWinControl := TWinControl(FTabList[I]);
|
||||
// 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);
|
||||
lWinControl.GetTabOrderList(List);
|
||||
end;
|
||||
|
@ -317,6 +317,11 @@ begin
|
||||
Result := (ADC = HDC(Self.ScreenDC));
|
||||
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;
|
||||
begin
|
||||
Result := IsValidDC(DC);
|
||||
|
@ -57,6 +57,7 @@ procedure HideVirtualKeyboard();
|
||||
function IsDesignerDC(WindowHandle: HWND; DC: HDC): Boolean; override;*)
|
||||
function IsMobilePlatform: Boolean; override;
|
||||
function IsScreenDC(ADC: HDC): Boolean;
|
||||
function IsCDIntfControl(AWinControl: TObject): Boolean; override;
|
||||
|
||||
function PromptUser(const DialogCaption : string;
|
||||
const DialogMessage : string;
|
||||
|
@ -312,15 +312,19 @@ end;
|
||||
|
||||
function IsIntfControl(AControl: TWinControl): Boolean;
|
||||
begin
|
||||
Result := (AControl <> nil) and (AControl.Parent <> nil) and AControl.IsCDIntfControl;
|
||||
{if Result then Result :=
|
||||
Result := (AControl <> nil) and (AControl.Parent <> nil);
|
||||
if Result then Result :=
|
||||
// Standard Tab
|
||||
(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
|
||||
(AControl is TCDIntfStaticText) or
|
||||
// Common Controls Tab
|
||||
(AControl is TCDIntfProgressBar) or (AControl is TCDIntfTrackBar) or
|
||||
(AControl is TCDIntfPageControl);}
|
||||
(AControl is TCDIntfPageControl) or
|
||||
// Common Controls Tab
|
||||
(AControl is TCDIntfSpinEdit)
|
||||
;
|
||||
end;
|
||||
|
||||
{ TCDIntfEdit }
|
||||
|
@ -290,7 +290,6 @@ begin
|
||||
TCDIntfPageControl(ACDControlField).LCLControl := TCustomTabControl(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -428,7 +427,6 @@ begin
|
||||
TCDIntfTrackBar(ACDControlField).LCLControl := TCustomTrackBar(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -569,7 +567,6 @@ begin
|
||||
TCDIntfProgressBar(ACDControlField).LCLControl := TCustomProgressBar(AWinControl);
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
|
@ -355,7 +355,6 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -422,7 +421,6 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -824,7 +822,6 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -1308,7 +1305,6 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
TCDIntfEdit(ACDControlField).ReadOnly := TCustomEdit(AWinControl).ReadOnly;
|
||||
end;
|
||||
@ -1566,7 +1562,6 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -1637,7 +1632,6 @@ begin
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -1728,7 +1722,6 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
@ -1800,7 +1793,6 @@ begin
|
||||
ACDControlField.Parent := AWinControl;
|
||||
ACDControlField.Caption := AWinControl.Caption;
|
||||
ACDControlField.Align := alClient;
|
||||
ACDControlField.IsCDIntfControl := True;
|
||||
{$ifdef VerboseCDInjectedControlNames}ACDControlField.Name := 'CustomDrawnInternal_' + AWinControl.Name;{$endif}
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user