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:
jesus 2009-06-07 19:13:17 +00:00
parent 8d3b74321e
commit 5a971c0e06
3 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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;
{------------------------------------------------------------------------------

View File

@ -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