mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 23:03:48 +02:00
LCL, added option nboHidePageListPopup to Notebook so default right click popup list can be disabled (gtk1&2), enable multiline tab control under windows
git-svn-id: trunk@20500 -
This commit is contained in:
parent
8d3b74321e
commit
5a971c0e06
lcl
@ -132,7 +132,7 @@ type
|
||||
TTabGetImageEvent = procedure(Sender: TObject; TabIndex: Integer;
|
||||
var ImageIndex: Integer) of object;
|
||||
|
||||
TNoteBookOption = (nboShowCloseButtons, nboMultiLine);
|
||||
TNoteBookOption = (nboShowCloseButtons, nboMultiLine, nboHidePageListPopup);
|
||||
TNoteBookOptions = set of TNoteBookOption;
|
||||
TNoteBookCapability = (nbcShowCloseButtons, nbcMultiLine, nbcPageListPopup);
|
||||
TNoteBookCapabilities = set of TNoteBookCapability;
|
||||
|
@ -420,8 +420,8 @@ begin
|
||||
FOptions:=AValue;
|
||||
if nboShowCloseButtons in ChangedOptions then
|
||||
UpdateTabProperties;
|
||||
if nboMultiLine in ChangedOptions then
|
||||
TWSCustomNotebookClass(WidgetSetClass).GetCapabilities;
|
||||
if HandleAllocated then
|
||||
TWSCustomNotebookClass(WidgetSetClass).UpdateProperties(Self);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
|
@ -75,6 +75,7 @@ type
|
||||
class procedure SetPageIndex(const ANotebook: TCustomNotebook; const AIndex: integer); override;
|
||||
class procedure SetTabPosition(const ANotebook: TCustomNotebook; const ATabPosition: TTabPosition); override;
|
||||
class procedure ShowTabs(const ANotebook: TCustomNotebook; AShowTabs: boolean); override;
|
||||
class procedure UpdateProperties(const ANotebook: TCustomNotebook); override;
|
||||
end;
|
||||
|
||||
{ TGtkWSPage }
|
||||
@ -345,7 +346,10 @@ begin
|
||||
DebugGtkWidgets.MarkCreated(Pointer(AWidget), dbgsName(AWinControl));
|
||||
{$ENDIF}
|
||||
gtk_notebook_set_scrollable(AWidget, True);
|
||||
gtk_notebook_popup_enable(AWidget);
|
||||
|
||||
if not (nboHidePageListPopup in TCustomNotebook(AWinControl).Options) then
|
||||
gtk_notebook_popup_enable(AWidget);
|
||||
|
||||
if TCustomNotebook(AWinControl).PageCount=0 then
|
||||
// a gtk notebook needs a page -> add dummy page
|
||||
GTKWidgetSet.AddDummyNoteBookPage(AWidget);
|
||||
@ -614,6 +618,14 @@ begin
|
||||
gtk_notebook_set_show_tabs(PGtkNotebook(ANotebook.Handle), AShowTabs);
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomNotebook.UpdateProperties(const ANotebook: TCustomNotebook);
|
||||
begin
|
||||
if (nboHidePageListPopup in ANoteBook.Options) then
|
||||
gtk_notebook_popup_disable(PGtkNotebook(ANoteBook.Handle))
|
||||
else
|
||||
gtk_notebook_popup_enable(PGtkNotebook(ANoteBook.Handle));
|
||||
end;
|
||||
|
||||
class procedure TGtkWSCustomPanel.SetCallbacks(const AGtkWidget: PGtkWidget;
|
||||
const AWidgetInfo: PWidgetInfo);
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user