mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 19:16:45 +02:00
LCL: added TNotebookCapabilities from Benito van der Zander (part of issue #11563)
git-svn-id: trunk@16000 -
This commit is contained in:
parent
cedc3fdcad
commit
11038348f3
@ -131,6 +131,8 @@ type
|
|||||||
|
|
||||||
TNoteBookOption = (nboShowCloseButtons, nboMultiLine);
|
TNoteBookOption = (nboShowCloseButtons, nboMultiLine);
|
||||||
TNoteBookOptions = set of TNoteBookOption;
|
TNoteBookOptions = set of TNoteBookOption;
|
||||||
|
TNoteBookCapability = (nbcShowCloseButtons, nbcMultiLine, nbcPageListPopup);
|
||||||
|
TNoteBookCapabilities = set of TNoteBookCapability;
|
||||||
|
|
||||||
TCustomNotebook = class(TWinControl)
|
TCustomNotebook = class(TWinControl)
|
||||||
private
|
private
|
||||||
@ -204,6 +206,7 @@ type
|
|||||||
function CanChangePageIndex: boolean; virtual;
|
function CanChangePageIndex: boolean; virtual;
|
||||||
function GetMinimumTabWidth: integer; virtual;
|
function GetMinimumTabWidth: integer; virtual;
|
||||||
function GetMinimumTabHeight: integer; virtual;
|
function GetMinimumTabHeight: integer; virtual;
|
||||||
|
function GetCapabilities: TNoteBookCapabilities; virtual;
|
||||||
public
|
public
|
||||||
//property MultiLine: boolean read fMultiLine write SetMultiLine default false;
|
//property MultiLine: boolean read fMultiLine write SetMultiLine default false;
|
||||||
procedure DoCloseTabClicked(APage: TCustomPage); virtual;
|
procedure DoCloseTabClicked(APage: TCustomPage); virtual;
|
||||||
|
@ -341,6 +341,11 @@ begin
|
|||||||
//debugln('TCustomNotebook.GetMinimumTabHeight A ',dbgs(Result));
|
//debugln('TCustomNotebook.GetMinimumTabHeight A ',dbgs(Result));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TCustomNotebook.GetCapabilities: TNoteBookCapabilities;
|
||||||
|
begin
|
||||||
|
Result:=TWSCustomNotebookClass(WidgetSetClass).GetCapabilities;
|
||||||
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
method TCustomNotebook DoCloseTabClicked
|
method TCustomNotebook DoCloseTabClicked
|
||||||
Params: APage: TCustomPage
|
Params: APage: TCustomPage
|
||||||
@ -414,6 +419,8 @@ begin
|
|||||||
FOptions:=AValue;
|
FOptions:=AValue;
|
||||||
if nboShowCloseButtons in ChangedOptions then
|
if nboShowCloseButtons in ChangedOptions then
|
||||||
UpdateTabProperties;
|
UpdateTabProperties;
|
||||||
|
if nboMultiLine in ChangedOptions then
|
||||||
|
TWSCustomNotebookClass(WidgetSetClass).GetCapabilities;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
|
@ -69,6 +69,7 @@ type
|
|||||||
class procedure RemovePage(const ANotebook: TCustomNotebook;
|
class procedure RemovePage(const ANotebook: TCustomNotebook;
|
||||||
const AIndex: integer); override;
|
const AIndex: integer); override;
|
||||||
|
|
||||||
|
class function GetCapabilities: TNoteBookCapabilities; override;
|
||||||
class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; override;
|
class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; override;
|
||||||
class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; override;
|
class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; override;
|
||||||
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; override;
|
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; override;
|
||||||
@ -489,6 +490,11 @@ begin
|
|||||||
gtk_widget_hide(PageWidget);
|
gtk_widget_hide(PageWidget);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TGtkWSCustomNotebook.GetCapabilities: TNoteBookCapabilities;
|
||||||
|
begin
|
||||||
|
Result:=[nbcPageListPopup, nbcShowCloseButtons];
|
||||||
|
end;
|
||||||
|
|
||||||
class function TGtkWSCustomNotebook.GetNotebookMinTabHeight(
|
class function TGtkWSCustomNotebook.GetNotebookMinTabHeight(
|
||||||
const AWinControl: TWinControl): integer;
|
const AWinControl: TWinControl): integer;
|
||||||
var
|
var
|
||||||
|
@ -76,11 +76,13 @@ type
|
|||||||
|
|
||||||
class function GetPageRealIndex(const ANotebook: TCustomNotebook; AIndex: Integer): Integer; override;
|
class function GetPageRealIndex(const ANotebook: TCustomNotebook; AIndex: Integer): Integer; override;
|
||||||
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; override;
|
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; override;
|
||||||
|
class function GetCapabilities: TNoteBookCapabilities;override;
|
||||||
class function GetDesignInteractive(const AWinControl: TWinControl; AClientPos: TPoint): Boolean; override;
|
class function GetDesignInteractive(const AWinControl: TWinControl; AClientPos: TPoint): Boolean; override;
|
||||||
class procedure SetImageList(const ANotebook: TCustomNotebook; const AImageList: TCustomImageList); override;
|
class procedure SetImageList(const ANotebook: TCustomNotebook; const AImageList: TCustomImageList); override;
|
||||||
class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); override;
|
class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); override;
|
||||||
class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); override;
|
class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); override;
|
||||||
class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); override;
|
class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); override;
|
||||||
|
class procedure UpdateProperties(const ANotebook: TCustomNotebook); override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TWin32WSPage }
|
{ TWin32WSPage }
|
||||||
@ -437,6 +439,8 @@ begin
|
|||||||
tpRight:
|
tpRight:
|
||||||
Flags := Flags or (TCS_VERTICAL or TCS_RIGHT or TCS_MULTILINE);
|
Flags := Flags or (TCS_VERTICAL or TCS_RIGHT or TCS_MULTILINE);
|
||||||
end;
|
end;
|
||||||
|
if nboMultiLine in TCustomNotebook(AWinControl).Options then
|
||||||
|
Flags := Flags or TCS_MULTILINE;
|
||||||
pClassName := WC_TABCONTROL;
|
pClassName := WC_TABCONTROL;
|
||||||
end;
|
end;
|
||||||
// create window
|
// create window
|
||||||
@ -621,6 +625,11 @@ begin
|
|||||||
Result := Windows.SendMessage(ANotebook.Handle, TCM_HITTEST, 0, LPARAM(@hittestInfo));
|
Result := Windows.SendMessage(ANotebook.Handle, TCM_HITTEST, 0, LPARAM(@hittestInfo));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TWin32WSCustomNotebook.GetCapabilities: TNoteBookCapabilities;
|
||||||
|
begin
|
||||||
|
Result:=[nbcMultiLine];
|
||||||
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomNotebook.GetDesignInteractive(
|
class function TWin32WSCustomNotebook.GetDesignInteractive(
|
||||||
const AWinControl: TWinControl; AClientPos: TPoint): Boolean;
|
const AWinControl: TWinControl; AClientPos: TPoint): Boolean;
|
||||||
var
|
var
|
||||||
@ -687,6 +696,17 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TWin32WSCustomNotebook.UpdateProperties(
|
||||||
|
const ANotebook: TCustomNotebook);
|
||||||
|
var currentStyle: cardinal;
|
||||||
|
begin
|
||||||
|
currentStyle:=GetWindowLong(ANotebook.Handle,GWL_STYLE);
|
||||||
|
if nboMultiLine in ANotebook.Options then
|
||||||
|
SetWindowLong(ANotebook.Handle,GWL_STYLE,currentStyle or TCS_MULTILINE)
|
||||||
|
else
|
||||||
|
SetWindowLong(ANotebook.Handle,GWL_STYLE,currentStyle and not TCS_MULTILINE)
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWin32WSCustomPanel }
|
{ TWin32WSCustomPanel }
|
||||||
|
|
||||||
class function TWin32WSCustomPanel.CreateHandle(const AWinControl: TWinControl;
|
class function TWin32WSCustomPanel.CreateHandle(const AWinControl: TWinControl;
|
||||||
|
@ -67,11 +67,13 @@ type
|
|||||||
class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; virtual;
|
class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; virtual;
|
||||||
class function GetPageRealIndex(const ANotebook: TCustomNotebook; AIndex: Integer): Integer; virtual;
|
class function GetPageRealIndex(const ANotebook: TCustomNotebook; AIndex: Integer): Integer; virtual;
|
||||||
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; virtual;
|
class function GetTabIndexAtPos(const ANotebook: TCustomNotebook; const AClientPos: TPoint): integer; virtual;
|
||||||
|
class function GetCapabilities: TNoteBookCapabilities; virtual;
|
||||||
class procedure SetImageList(const ANotebook: TCustomNotebook; const AImageList: TCustomImageList); virtual;
|
class procedure SetImageList(const ANotebook: TCustomNotebook; const AImageList: TCustomImageList); virtual;
|
||||||
class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); virtual;
|
class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); virtual;
|
||||||
class procedure SetTabCaption(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AText: string); virtual;
|
class procedure SetTabCaption(const ANotebook: TCustomNotebook; const AChild: TCustomPage; const AText: string); virtual;
|
||||||
class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); virtual;
|
class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); virtual;
|
||||||
class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); virtual;
|
class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); virtual;
|
||||||
|
class procedure UpdateProperties(const ANotebook: TCustomNotebook); virtual;
|
||||||
end;
|
end;
|
||||||
TWSCustomNotebookClass = class of TWSCustomNotebook;
|
TWSCustomNotebookClass = class of TWSCustomNotebook;
|
||||||
|
|
||||||
@ -262,6 +264,11 @@ begin
|
|||||||
Result := -1;
|
Result := -1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class function TWSCustomNotebook.GetCapabilities: TNoteBookCapabilities;
|
||||||
|
begin
|
||||||
|
Result:=[];
|
||||||
|
end;
|
||||||
|
|
||||||
class procedure TWSCustomNotebook.SetImageList(
|
class procedure TWSCustomNotebook.SetImageList(
|
||||||
const ANotebook: TCustomNotebook; const AImageList: TCustomImageList);
|
const ANotebook: TCustomNotebook; const AImageList: TCustomImageList);
|
||||||
begin
|
begin
|
||||||
@ -287,6 +294,12 @@ class procedure TWSCustomNotebook.ShowTabs(const ANotebook: TCustomNotebook;
|
|||||||
begin
|
begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
class procedure TWSCustomNotebook.UpdateProperties(
|
||||||
|
const ANotebook: TCustomNotebook);
|
||||||
|
begin
|
||||||
|
|
||||||
|
end;
|
||||||
|
|
||||||
{ TWSCustomTrayIcon }
|
{ TWSCustomTrayIcon }
|
||||||
|
|
||||||
class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
|
class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user