NoteBookView.st
changeset 5218 4999a9f57b7d
parent 5217 034b6149d8bc
child 5220 ea3c03715e5b
child 5222 12c1ffb5326f
equal deleted inserted replaced
5217:034b6149d8bc 5218:4999a9f57b7d
    12 "{ Package: 'stx:libwidg2' }"
    12 "{ Package: 'stx:libwidg2' }"
    13 
    13 
    14 "{ NameSpace: Smalltalk }"
    14 "{ NameSpace: Smalltalk }"
    15 
    15 
    16 View subclass:#NoteBookView
    16 View subclass:#NoteBookView
    17 	instanceVariableNames:'list listHolder foregroundColor backgroundColor selection enabled
    17         instanceVariableNames:'list listHolder foregroundColor backgroundColor selection enabled
    18 		action useIndex direction numberOfLines selectConditionBlock
    18                 action useIndex direction numberOfLines selectConditionBlock
    19 		accessTabMenuAction canvas canvasInset canvasHolder
    19                 accessTabMenuAction canvas canvasInset canvasHolder
    20 		halfLightColor halfShadowColor fitLastRow tabModus
    20                 halfLightColor halfShadowColor fitLastRow tabModus
    21 		lastComputedExtent keepCanvas activeForegroundColor
    21                 lastComputedExtent keepCanvas activeForegroundColor
    22 		activeBackgroundColor drawLightColor edgeStyle tabInset
    22                 activeBackgroundColor drawLightColor edgeStyle tabInset
    23 		tabLabelInset disabledForegroundColor tabLevel tabTopMargin
    23                 tabLabelInset disabledForegroundColor tabLevel tabTopMargin
    24 		tabBottomMargin selectionInsetX selectionInsetY translateLabel
    24                 tabBottomMargin selectionInsetX selectionInsetY translateLabel
    25 		buttonPrev buttonNext tabRightMargin tabLeftMargin
    25                 buttonPrev buttonNext tabRightMargin tabLeftMargin
    26 		showDestroyTabButton destroyTabAction activeTabMarkerColor
    26                 showDestroyTabButton destroyTabAction activeTabMarkerColor
    27 		activeTabMarkerFGColor tabWasActiveWhenPressed removeTabIcon
    27                 activeTabMarkerFGColor tabWasActiveWhenPressed removeTabIcon
    28 		removeTabEnteredIcon removeTabDisabledIcon
    28                 removeTabEnteredIcon removeTabDisabledIcon
    29 		showingEnteredRemoveTabButton lastUserSelection minimumTabWidth
    29                 showingEnteredRemoveTabButton lastUserSelection minimumTabWidth
    30 		addTabAction addTabIcon addTabEnteredIcon addTabDisabledIcon
    30                 addTabAction addTabIcon addTabEnteredIcon addTabDisabledIcon
    31 		showingEnteredAddTabButton canvasLevel
    31                 showingEnteredAddTabButton canvasLevel
    32 		showDestroyTabButtonOnSingleTab'
    32                 showDestroyTabButtonOnSingleTab'
    33 	classVariableNames:'DefaultForegroundColor DefaultBackgroundColor
    33         classVariableNames:'DefaultForegroundColor DefaultBackgroundColor
    34 		DefaultActiveForegroundColor DefaultActiveBackgroundColor
    34                 DefaultActiveForegroundColor DefaultActiveBackgroundColor
    35 		DefaultShadowColor DefaultHalfShadowColor DefaultLightColor
    35                 DefaultShadowColor DefaultHalfShadowColor DefaultLightColor
    36 		DefaultHalfLightColor DefaultEdgeStyle DisabledForegroundColor
    36                 DefaultHalfLightColor DefaultEdgeStyle DisabledForegroundColor
    37 		DefaultActiveTabMarkerColor DefaultActiveTabMarkerFgColor
    37                 DefaultActiveTabMarkerColor DefaultActiveTabMarkerFgColor
    38 		RemoveTabIcon RemoveTabEnteredIcon AddTabIcon AddTabEnteredIcon'
    38                 RemoveTabIcon RemoveTabEnteredIcon AddTabIcon AddTabEnteredIcon'
    39 	poolDictionaries:''
    39         poolDictionaries:''
    40 	category:'Views-Layout'
    40         category:'Views-Layout'
    41 !
    41 !
    42 
    42 
    43 Object subclass:#Tab
    43 Object subclass:#Tab
    44 	instanceVariableNames:'label tabItem printableLabel disabledLabel lineNr
    44         instanceVariableNames:'label tabItem printableLabel disabledLabel lineNr
    45 		unselectedLayout selectedLayout layout extent accessCharacter
    45                 unselectedLayout selectedLayout layout extent accessCharacter
    46 		lastFocusViewId'
    46                 lastFocusViewId'
    47 	classVariableNames:''
    47         classVariableNames:''
    48 	poolDictionaries:''
    48         poolDictionaries:''
    49 	privateIn:NoteBookView
    49         privateIn:NoteBookView
    50 !
    50 !
    51 
    51 
    52 !NoteBookView class methodsFor:'documentation'!
    52 !NoteBookView class methodsFor:'documentation'!
    53 
    53 
    54 copyright
    54 copyright
  3112 
  3112 
  3113 indexOfTab:aTab
  3113 indexOfTab:aTab
  3114     ^ list indexOf:aTab 
  3114     ^ list indexOf:aTab 
  3115 !
  3115 !
  3116 
  3116 
       
  3117 showingDestroyButton
       
  3118      ^ showDestroyTabButton 
       
  3119      and:[destroyTabAction notNil
       
  3120      and:[(showDestroyTabButtonOnSingleTab ~~ false) or:[list size > 1]]]
       
  3121 !
       
  3122 
  3117 tabContainingPointX:x y:y
  3123 tabContainingPointX:x y:y
  3118     ^ list detect:[:aTab| aTab containsPointX:x y:y ] ifNone:nil.
  3124     ^ list detect:[:aTab| aTab containsPointX:x y:y ] ifNone:nil.
  3119 !
  3125 !
  3120 
  3126 
  3121 verticalMarginForAddTabButton
  3127 verticalMarginForAddTabButton