@@ -8,6 +8,7 @@ public class ThemedDocumentControlHandler : ThemedContainerHandler<TableLayout,
8
8
List < DocumentPage > pages = new List < DocumentPage > ( ) ;
9
9
ThemedDocumentPageHandler tabPrev , tabNext ;
10
10
11
+ bool allowNavigating ;
11
12
PointF mousePos ;
12
13
int selectedIndex ;
13
14
float nextPrevWidth ;
@@ -42,6 +43,20 @@ public Padding TabPadding
42
43
set => Widget . Properties . Set ( TabPadding_Key , value , DefaultTabPadding ) ;
43
44
}
44
45
46
+ /// <summary>
47
+ /// Gets or sets a value indicating indicating the tabs can be navigated by next and previous buttons.
48
+ /// </summary>
49
+ /// <value><c>true</c> if navigatable; otherwise, <c>false</c>.</value>
50
+ public bool AllowNavigating
51
+ {
52
+ get { return allowNavigating ; }
53
+ set
54
+ {
55
+ allowNavigating = value ;
56
+ Calculate ( ) ;
57
+ }
58
+ }
59
+
45
60
/// <summary>
46
61
/// Gets or sets the font for the tab text.
47
62
/// </summary>
@@ -189,6 +204,7 @@ public ThemedDocumentControlHandler()
189
204
{
190
205
mousePos = new PointF ( - 1 , - 1 ) ;
191
206
selectedIndex = - 1 ;
207
+ allowNavigating = true ;
192
208
nextPrevWidth = 0 ;
193
209
startx = 0 ;
194
210
font = SystemFonts . Default ( ) ;
@@ -531,7 +547,7 @@ void CalculateTabs(bool force = false)
531
547
if ( ! force && ! Widget . Loaded )
532
548
return ;
533
549
var posx = 0f ;
534
- if ( nextPrevWidth == 0f )
550
+ if ( allowNavigating && nextPrevWidth == 0f )
535
551
{
536
552
CalculateTab ( tabPrev , - 1 , ref posx ) ;
537
553
CalculateTab ( tabNext , - 1 , ref posx ) ;
@@ -568,8 +584,11 @@ void Drawable_Paint(object sender, PaintEventArgs e)
568
584
569
585
posx = 0 ;
570
586
571
- DrawTab ( g , tabPrev , - 1 ) ;
572
- DrawTab ( g , tabNext , - 1 ) ;
587
+ if ( allowNavigating )
588
+ {
589
+ DrawTab ( g , tabPrev , - 1 ) ;
590
+ DrawTab ( g , tabNext , - 1 ) ;
591
+ }
573
592
}
574
593
575
594
void CalculateTab ( ThemedDocumentPageHandler tab , int i , ref float posx )
0 commit comments