tz@739: " tz@739: COPYRIGHT (c) 1997 by eXept Software AG tz@739: All Rights Reserved tz@739: tz@739: This software is furnished under a license and may be used tz@739: only in accordance with the terms of that license and with the tz@739: inclusion of the above copyright notice. This software may not tz@739: be provided or otherwise made available to, or used by, any tz@739: other person. No title to or ownership of the software is tz@739: hereby transferred. tz@739: " ca@1431: "{ Package: 'stx:libtool2' }" ca@1373: sv@3330: "{ NameSpace: Smalltalk }" sv@3330: tz@739: ResourceSpecEditor subclass:#TabListEditor ca@1373: instanceVariableNames:'listOfTabs' tz@739: classVariableNames:'' tz@739: poolDictionaries:'' tz@739: category:'Interface-UIPainter' tz@739: ! tz@739: tz@739: !TabListEditor class methodsFor:'documentation'! tz@739: tz@739: copyright tz@739: " tz@739: COPYRIGHT (c) 1997 by eXept Software AG tz@739: All Rights Reserved tz@739: tz@739: This software is furnished under a license and may be used tz@739: only in accordance with the terms of that license and with the tz@739: inclusion of the above copyright notice. This software may not tz@739: be provided or otherwise made available to, or used by, any tz@739: other person. No title to or ownership of the software is tz@739: hereby transferred. tz@739: " tz@739: tz@739: tz@739: ! tz@739: tz@739: documentation tz@739: " tz@739: The TabListEditor allows you to create, modify or just inspect tz@739: tab lists for tab headers or note books. tz@739: tz@739: [start with:] tz@739: TabItemEditor open tz@739: tz@739: [see also:] tz@739: TabItem tz@739: TabView tz@739: NoteBookView tz@739: UIPainter tz@739: tz@739: [author:] tz@739: Claus Atzkern, eXept Software AG tz@749: Thomas Zwick, eXept Software AG tz@739: " tz@739: tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'instance creation'! tz@739: tz@739: openModalOnTabList: aTabList tz@739: "Open a TabListEditor modal on aTabList" tz@739: "self openModalOnTabList: (Array with: (TabItem label: 'Tab Item 1'))" tz@739: tz@739: ^self new openModalOnTabList: aTabList tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'accessing'! tz@739: tz@739: resourceType tz@739: "get the type of resource of the method generated by the TabListEditor" tz@739: tz@739: ^#tabList tz@739: tz@739: tz@739: tz@739: tz@739: tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'aspects'! tz@739: tz@739: aspects tz@739: "get the aspects for the attributes of the tab list components" tz@739: tz@739: ^#( tz@739: label tz@739: translateLabel tz@739: labelForegroundColor tz@739: enabled tz@739: editAgument ca@1325: accessCharacterPosition ca@1325: shortcutKey ca@1373: activeHelpKey ca@1373: ca@1373: majorKey ca@1373: minorKey ca@1373: createNewBuilder ca@1373: ca@1373: hasHorizontalScrollBar ca@1373: hasVerticalScrollBar ca@1373: miniScrollerHorizontal ca@1373: miniScrollerVertical tz@739: ) tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'help specs'! tz@739: tz@739: helpSpec tz@739: "This resource specification was automatically generated tz@739: by the UIHelpTool of ST/X." tz@739: tz@739: "Do not manually edit this!! If it is corrupted, tz@739: the UIHelpTool may not be able to read the specification." tz@739: tz@739: " tz@739: UIHelpTool openOnClass:TabListEditor tz@739: " tz@739: tz@739: tz@739: ca@1845: ^ super helpSpec addPairsFrom:#( tz@739: tz@739: #addTabItem tz@739: 'Adds a new tab item.' tz@739: cg@2346: #applicationProvidesLabel cg@2346: 'If on, the label''s string is a selector returning a string or bitmap image, which is used as logo in the tab item.' cg@2346: ca@1373: #autoHideScrollBars ca@1373: 'ScrollBars should be made invisible dynamically, if there is nothing to scroll.' tz@739: ca@1845: #basicTab ca@1845: 'Define the basic attributes.' ca@1845: tz@739: #canSelect tz@739: 'Turns on/off whether the tab item is selectable.' tz@739: ca@1845: #canvasTab ca@1845: 'Define an application, which is started if the tab is pressed the first time.' ca@1845: ca@1845: #color ca@1845: 'Defines the foreground color of the label. The default color derives from the style sheet.' ca@1845: ca@1373: #createNewBuilder ca@1373: 'Create a new builder for the application; the application use its own aspects.' ca@1373: ca@1845: #detailTab ca@1845: 'Define the optional/specific attributes.' ca@1845: ca@1845: #detailsAccelerator ca@1845: 'Key to be pressed to select the tab item from the keyboard (accelerator key).' ca@1845: ca@1845: #detailsAccessCharaterPosition ca@1845: 'Index of the access character position of the textual label (optional).' ca@1845: ca@1845: #detailsArgument ca@1845: 'An optional argument stored with the tab item.' tz@739: tz@739: #fileCreateAspectMethod tz@739: 'Creates the aspect method for the tab list.' tz@739: tz@739: #fileLoad tz@739: 'Opens a dialog for selecting and loading a tab list spec from a class.' tz@739: tz@739: #fileNew tz@739: 'Creates a new tab list.' tz@739: tz@739: #fileSave tz@739: 'Saves current tab list.' tz@739: ca@1373: #horizontalMiniScroller ca@1373: 'Use a mini-scroller as horizontal scrollbar.' ca@1373: ca@1845: #horizontalScroller ca@1845: 'Enable horizontal scrollability.' ca@1373: tz@739: #label tz@739: 'Label of the tab item.' tz@739: ca@1845: #majorKey ca@1845: 'Name of the class to be started (application if empty); or app-selector returning application instance.' ca@1373: ca@1845: #minorKey ca@1845: 'Message sent to the class which returns the window specification (default: #windowSpec).' ca@1373: tz@739: #testPreview tz@739: 'Turns on/off preview of the tab list.' tz@739: cg@2346: #translateLabel cg@2346: 'If on, the label is translated using the applications language resources.' cg@2346: ca@1845: #verticalMiniScroller ca@1845: 'Use a mini-scroller as vertical scrollbar.' ca@1845: ca@1845: #verticalScroller ca@1845: 'Enable vertical scrollability.' ca@1845: tz@739: ) tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'image specs'! tz@739: tz@739: newTabItemIcon sv@3118: tz@739: "This resource specification was automatically generated tz@739: by the ImageEditor of ST/X." tz@739: "Do not manually edit this!!!! If it is corrupted, tz@739: the ImageEditor may not be able to read the specification." tz@739: " sv@3118: ImageEditor openOnClass:self andSelector:#newTabItemIcon" sv@3118: sv@3118: ^ Icon constantNamed:#'TabListEditor newTabItemIcon' sv@3118: ifAbsentPut:[ sv@3118: (Depth2Image new) sv@3118: width:22; sv@3118: height:22; sv@3118: photometric:(#palette); sv@3118: bitsPerSample:(#( 2 )); sv@3118: samplesPerPixel:(1); sv@3118: bits:(ByteArray sv@3118: fromPackedString:'U@@@@EUPUEUUVEUPUF**+EUPUF**+EUPUF**+EUP@F**+@@@EV***UV@F*****+@F KNC*+NF(("H*+@F((BC +EF(("H*+@F(("C*+MF*****+@F"@ H*K@F"""(LK@F"" ("K@F"""(*K@F"" H*K@F*****+HK??????@@@@@@@@@'); sv@3118: colorMapFromArray:#[ 0 0 0 255 255 255 170 170 170 127 127 127 ]; sv@3118: mask:((ImageMask new) sv@3118: width:22; sv@3118: height:22; sv@3118: bits:(ByteArray sv@3118: fromPackedString:'G?<@G?<@G?<@G?<@G?<@??? tz@739: cg@1183: ^ cg@1876: #(FullSpec cg@1876: name: basicSpec cg@1876: window: cg@1876: (WindowSpec cg@1876: label: 'Basic' cg@1876: name: 'Basic' cg@1876: min: (Point 10 10) cg@1876: max: (Point 1280 1024) cg@2346: bounds: (Rectangle 0 0 429 240) cg@1183: ) cg@1876: component: cg@1876: (SpecCollection cg@1876: collection: ( cg@1876: (LabelSpec cg@1876: label: 'Label:' cg@1876: name: 'labelLabel' cg@1876: layout: (AlignmentOrigin 98 0 26 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true cg@1183: ) cg@1876: (InputFieldSpec cg@1876: name: 'label' cg@1876: layout: (LayoutFrame 100 0 15 0 -5 1.0 37 0) cg@1876: activeHelpKey: label cg@1876: tabable: true cg@1876: model: label cg@1876: group: inputGroup cg@1876: immediateAccept: true cg@1876: acceptOnReturn: false cg@1876: acceptOnTab: false cg@1876: acceptOnLostFocus: false cg@1876: acceptChannel: acceptChannel cg@1876: modifiedChannel: modifiedChannel cg@1876: acceptOnPointerLeave: false ca@1325: ) cg@1876: (LabelSpec cg@1876: label: 'Accelerator:' cg@1876: name: 'shortcutKeyLabel' cg@1876: layout: (AlignmentOrigin 98 0 55 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true ca@1325: ) cg@1876: (InputFieldSpec cg@1876: name: 'shortcutKey' cg@1876: layout: (LayoutFrame 100 0 44 0 -5 1.0 66 0) cg@1876: activeHelpKey: detailsAccelerator cg@1876: tabable: true cg@1876: model: shortcutKey cg@1876: group: inputGroup cg@1876: type: symbolOrNil cg@1876: immediateAccept: true cg@1876: acceptOnReturn: false cg@1876: acceptOnTab: false cg@1876: acceptOnLostFocus: false cg@1876: acceptChannel: acceptChannel cg@1876: modifiedChannel: modifiedChannel cg@1876: acceptOnPointerLeave: false ca@1325: ) cg@1876: (LabelSpec cg@1876: label: 'Argument:' cg@1876: name: 'editAgumentLabel' cg@1876: layout: (AlignmentOrigin 98 0 84 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true ca@1325: ) cg@1876: (InputFieldSpec cg@1876: name: 'editAgument' cg@1876: layout: (LayoutFrame 100 0 73 0 -5 1.0 95 0) cg@1876: activeHelpKey: detailsArgument cg@1876: tabable: true cg@1876: model: editAgument cg@1876: group: inputGroup cg@1876: immediateAccept: true cg@1876: acceptOnReturn: false cg@1876: acceptOnTab: false cg@1876: acceptOnLostFocus: false cg@1876: acceptChannel: acceptChannel cg@1876: modifiedChannel: modifiedChannel cg@1876: acceptOnPointerLeave: false ca@1325: ) cg@1876: (LabelSpec cg@1876: label: 'Access Character Position:' cg@1876: name: 'accessCharacterPositionLabel' cg@1876: layout: (AlignmentOrigin 275 0 113 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true ca@1325: ) cg@1876: (InputFieldSpec cg@1876: name: 'accessCharacterPosition' cg@1876: layout: (LayoutFrame 278 0 103 0 -5 1.0 125 0) cg@1876: activeHelpKey: detailsAccessCharaterPosition cg@1876: tabable: true cg@1876: model: accessCharacterPosition cg@1876: group: inputGroup cg@1876: type: number cg@1876: immediateAccept: true cg@1876: acceptOnReturn: false cg@1876: acceptOnTab: false cg@1876: acceptOnLostFocus: false cg@1876: acceptChannel: acceptChannel cg@1876: modifiedChannel: modifiedChannel cg@1876: acceptOnPointerLeave: false cg@1183: ) cg@1876: (CheckBoxSpec cg@2346: label: 'Translate Label ' cg@1876: name: 'translateLabel' cg@2346: layout: (LayoutFrame 96 0 135 0 308 0 161 0) cg@2346: activeHelpKey: translateLabel cg@1876: tabable: true cg@1876: model: translateLabel cg@1876: translateLabel: true cg@1183: ) cg@2346: (CheckBoxSpec cg@2346: label: 'Application Provides Label ' cg@2346: name: 'CheckBox1' cg@2346: layout: (LayoutFrame 96 0 161 0 308 0 187 0) cg@2346: activeHelpKey: applicationProvidesLabel cg@2346: tabable: true cg@2346: model: applicationProvidesLabel cg@2346: translateLabel: true cg@2346: ) cg@1876: (LabelSpec cg@1876: label: 'Help Key:' cg@1876: name: 'activeHelp' cg@2346: layout: (AlignmentOrigin 98 0 203 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true ca@1373: ) cg@1876: (InputFieldSpec cg@1876: name: 'activeHelpKey' cg@2346: layout: (LayoutFrame 100 0 192 0 -5 1.0 214 0) cg@1876: activeHelpKey: label cg@1876: tabable: true cg@1876: model: activeHelpKey cg@1876: group: inputGroup cg@1876: type: symbolOrNil cg@1876: immediateAccept: true cg@1876: acceptOnReturn: false cg@1876: acceptOnTab: false cg@1876: acceptOnLostFocus: false cg@1876: acceptChannel: acceptChannel cg@1876: modifiedChannel: modifiedChannel cg@1876: acceptOnPointerLeave: false ca@1373: ) ca@1373: ) ca@1373: ca@1373: ) ca@1373: ) ca@1373: ! ca@1373: ca@1373: canvasSpec ca@1373: "This resource specification was automatically generated ca@1373: by the UIPainter of ST/X." ca@1373: ca@1373: "Do not manually edit this!! If it is corrupted, ca@1373: the UIPainter may not be able to read the specification." ca@1373: ca@1373: " ca@1373: UIPainter new openOnClass:TabListEditor andSelector:#canvasSpec ca@1373: TabListEditor new openInterface:#canvasSpec ca@1373: " ca@1373: ca@1373: ca@1373: ca@1373: ^ cg@3663: #(FullSpec cg@3663: name: canvasSpec cg@3663: uuid: '8a7c55d6-761b-11e9-98ea-b8f6b1108e05' cg@3663: window: cg@3663: (WindowSpec cg@3663: label: 'Canvas' cg@3663: name: 'Canvas' cg@3663: uuid: '8a7c5964-761b-11e9-98ea-b8f6b1108e05' cg@3663: min: (Point 10 10) cg@3663: max: (Point 1280 1024) cg@3663: bounds: (Rectangle 0 0 383 220) cg@3663: ) cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (LabelSpec cg@3663: label: 'Class / Major Key:' cg@3663: name: 'majorKeyLabel' cg@3663: layout: (AlignmentOrigin 160 0 26 0 1 0.5) cg@3663: activeHelpKey: majorKey cg@3663: uuid: '8a7cc2f0-761b-11e9-98ea-b8f6b1108e05' cg@3663: translateLabel: true cg@3663: resizeForLabel: true cg@3663: ) cg@3663: (InputFieldSpec cg@3663: name: 'majorKeyField' cg@3663: layout: (LayoutFrame 161 0 15 0 -5 1.0 37 0) cg@3663: activeHelpKey: majorKey cg@3663: uuid: '8a7cc82c-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: majorKey cg@3663: group: inputGroup cg@3663: type: symbolOrNil cg@3663: immediateAccept: true cg@3663: acceptOnReturn: false cg@3663: acceptOnTab: false cg@3663: acceptOnLostFocus: false cg@3663: modifiedChannel: modifiedChannel cg@3663: acceptOnPointerLeave: false cg@3663: ) cg@3663: (LabelSpec cg@3663: label: 'Selector / Minor Key:' cg@3663: name: 'minorKeyLabel' cg@3663: layout: (AlignmentOrigin 160 0 55 0 1 0.5) cg@3663: uuid: '8a7ccda4-761b-11e9-98ea-b8f6b1108e05' cg@3663: translateLabel: true cg@3663: resizeForLabel: true cg@3663: ) cg@3663: (InputFieldSpec cg@3663: name: 'minorKeyField' cg@3663: layout: (LayoutFrame 161 0 44 0 -5 1.0 66 0) cg@3663: activeHelpKey: majorKey cg@3663: uuid: '8a7ccf7a-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: minorKey cg@3663: group: inputGroup cg@3663: type: symbolOrNil cg@3663: immediateAccept: true cg@3663: acceptOnReturn: false cg@3663: acceptOnTab: false cg@3663: acceptOnLostFocus: false cg@3663: modifiedChannel: modifiedChannel cg@3663: acceptOnPointerLeave: false cg@3663: ) cg@3663: (FramedBoxSpec cg@3663: label: 'Scroll Bars' cg@3663: name: 'FramedBox' cg@3663: layout: (LayoutFrame 0 0.0 119 0.0 0 1.0 218 0) cg@3663: uuid: '8a7cd1be-761b-11e9-98ea-b8f6b1108e05' cg@3663: labelPosition: topLeft cg@3663: translateLabel: true cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (HorizontalPanelViewSpec cg@3663: name: 'HorizontalPanel1' cg@3663: layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) cg@3663: uuid: '8a7cd42a-761b-11e9-98ea-b8f6b1108e05' cg@3663: horizontalLayout: fitSpace cg@3663: verticalLayout: fitSpace cg@3663: horizontalSpace: 3 cg@3663: verticalSpace: 3 cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (ViewSpec cg@3663: name: 'Box1' cg@3663: uuid: '8a7cd768-761b-11e9-98ea-b8f6b1108e05' cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (CheckBoxSpec cg@3663: label: 'Vertical' cg@3663: name: 'verticalScrollBarCheckBox' cg@3663: layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0) cg@3663: activeHelpKey: verticalScroller cg@3663: uuid: '8a7cd8ee-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: hasVerticalScrollBar cg@3663: translateLabel: true ca@1373: ) cg@3663: (CheckBoxSpec cg@3663: label: 'Mini' cg@3663: name: 'miniScrollerVerticalCheckBox' cg@3663: layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0) cg@3663: activeHelpKey: verticalMiniScroller cg@3663: uuid: '8a7cdb82-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: miniScrollerVertical cg@3663: translateLabel: true cg@3663: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: useDefaultExtent: true cg@3663: ) cg@3663: (ViewSpec cg@3663: name: 'Box2' cg@3663: uuid: '8a7cdda8-761b-11e9-98ea-b8f6b1108e05' cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (CheckBoxSpec cg@3663: label: 'Horizontal' cg@3663: name: 'horizontalScrollBarCheckBox' cg@3663: layout: (LayoutFrame 0 0.0 3 0 0 1.0 27 0) cg@3663: activeHelpKey: horizontalScroller cg@3663: uuid: '8a7cdede-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: hasHorizontalScrollBar cg@3663: translateLabel: true cg@3663: ) cg@3663: (CheckBoxSpec cg@3663: label: 'Mini' cg@3663: name: 'miniScrollerHorizontalCheckBox' cg@3663: layout: (LayoutFrame 0 0.0 32 0 0 1.0 56 0) cg@3663: activeHelpKey: horizontalMiniScroller cg@3663: uuid: '8a7ce064-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: miniScrollerHorizontal cg@3663: translateLabel: true ca@1373: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: extent: (Point 111 53) cg@3663: ) cg@3663: (ViewSpec cg@3663: name: 'Box3' cg@3663: uuid: '8a7ce1fe-761b-11e9-98ea-b8f6b1108e05' cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (LabelSpec cg@3663: label: 'Auto Hide:' cg@3663: name: 'Label1' cg@3663: layout: (LayoutFrame 0 0.0 6 0 0 1.0 23 0) cg@3663: uuid: '8a7ce334-761b-11e9-98ea-b8f6b1108e05' cg@3663: translateLabel: true cg@3663: resizeForLabel: true cg@3663: adjust: left ca@1373: ) cg@3663: (PopUpListSpec cg@3663: label: 'Default' cg@3663: name: 'PopUpList1' cg@3663: layout: (LayoutFrame 0 0.0 32 0 0 1.0 54 0) cg@3663: activeHelpKey: autoHideScrollBars cg@3663: uuid: '8a7ce4e2-761b-11e9-98ea-b8f6b1108e05' cg@3663: translateLabel: true cg@3663: tabable: true cg@3663: model: autoHideScrollBars cg@3663: menu: cg@3663: (ImmutableArray cg@3663: Default On cg@3663: Off cg@3663: ) cg@3663: useIndex: true cg@3663: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: extent: (Point 112 53) ca@1373: ) cg@3663: ) cg@3663: cg@3663: ) ca@1373: ) cg@3663: ) cg@3663: cg@3663: ) ca@1373: ) cg@3663: (CheckBoxSpec cg@3663: label: 'Create New Builder' cg@3663: name: 'createNewBuilder' cg@3663: layout: (Point 161 75) cg@3663: activeHelpKey: createNewBuilder cg@3663: uuid: '8a7ce8de-761b-11e9-98ea-b8f6b1108e05' cg@3663: model: createNewBuilder cg@3663: translateLabel: true cg@3663: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: ) ca@1373: ! ca@1373: ca@1373: detailSpec ca@1373: "This resource specification was automatically generated ca@1373: by the UIPainter of ST/X." ca@1373: ca@1373: "Do not manually edit this!! If it is corrupted, ca@1373: the UIPainter may not be able to read the specification." ca@1373: ca@1373: " ca@1373: UIPainter new openOnClass:TabListEditor andSelector:#detailSpec ca@1373: TabListEditor new openInterface:#detailSpec ca@1373: " ca@1373: ca@1373: ca@1373: ca@1373: ^ cg@1876: #(FullSpec cg@1876: name: detailSpec cg@1876: window: cg@1876: (WindowSpec cg@1876: label: 'Details' cg@1876: name: 'Details' cg@1876: min: (Point 10 10) cg@1876: max: (Point 1280 1024) cg@1876: bounds: (Rectangle 0 0 358 107) ca@1373: ) cg@1876: component: cg@1876: (SpecCollection cg@1876: collection: ( cg@1876: (CheckBoxSpec cg@1876: label: 'Can Select' cg@1876: name: 'enabled' cg@1876: layout: (Point 46 14) cg@1876: activeHelpKey: canSelect cg@1876: tabable: true cg@1876: model: enabled cg@1876: translateLabel: true cg@1183: ) cg@1876: (LabelSpec cg@1876: label: 'Color:' cg@1876: name: 'ForegroundLabel' cg@1876: layout: (AlignmentOrigin 46 0 62 0 1 0.5) cg@1876: translateLabel: true cg@1876: resizeForLabel: true cg@1876: adjust: right cg@1183: ) cg@1876: (ColorMenuSpec cg@1876: name: 'ForegroundColorMenu' cg@1876: layout: (LayoutFrame 48 0 50 0 -10 1.0 72 0) cg@1876: activeHelpKey: color cg@1876: model: labelForegroundColor cg@1876: labelsAreColored: false cg@1183: ) cg@1183: ) cg@1183: cg@1183: ) tz@739: ) tz@739: ! tz@739: tz@739: windowSpec tz@739: "This resource specification was automatically generated tz@739: by the UIPainter of ST/X." tz@739: tz@739: "Do not manually edit this!! If it is corrupted, tz@739: the UIPainter may not be able to read the specification." tz@739: tz@739: " tz@739: UIPainter new openOnClass:TabListEditor andSelector:#windowSpec tz@739: TabListEditor new openInterface:#windowSpec tz@739: TabListEditor open tz@739: " tz@739: tz@739: tz@739: cg@1183: ^ cg@3663: #(FullSpec cg@3663: name: windowSpec cg@3663: uuid: 'b2e02714-761b-11e9-98ea-b8f6b1108e05' cg@3663: window: cg@3663: (WindowSpec cg@3663: label: 'Tab List Editor' cg@3663: name: 'Tab List Editor' cg@3663: uuid: 'b2e02a02-761b-11e9-98ea-b8f6b1108e05' cg@3663: min: (Point 440 280) cg@3663: bounds: (Rectangle 0 0 536 369) cg@3663: menu: menu cg@3663: ) cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (MenuPanelSpec cg@3663: name: 'menuToolbarView' cg@3663: layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 34 0) cg@3663: uuid: 'b2e02c78-761b-11e9-98ea-b8f6b1108e05' cg@3663: menu: menuToolbar cg@3663: showSeparatingLines: true cg@3663: ) cg@3663: (VariableHorizontalPanelSpec cg@3663: name: 'VariablePanel' cg@3663: layout: (LayoutFrame 0 0.0 36 0.0 0 1.0 -26 1.0) cg@3663: uuid: 'b2e02f48-761b-11e9-98ea-b8f6b1108e05' cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (SelectionInListModelViewSpec cg@3663: name: 'ListOfLabels' cg@3663: uuid: 'b2e031fa-761b-11e9-98ea-b8f6b1108e05' cg@3663: tabable: true cg@3663: model: selectionHolder cg@3663: menu: menuEdit cg@3663: hasHorizontalScrollBar: true cg@3663: hasVerticalScrollBar: true cg@3663: miniScrollerHorizontal: true cg@3663: listModel: listOfTabs cg@3663: highlightMode: line cg@3663: selectConditionSelector: askForItemModification cg@3663: ) cg@3663: (ViewSpec cg@3663: name: 'SpecView' cg@3663: uuid: 'b2e034d4-761b-11e9-98ea-b8f6b1108e05' cg@3663: level: -1 cg@3663: component: cg@3663: (SpecCollection cg@3663: collection: ( cg@3663: (NoteBookViewSpec cg@3663: name: 'NoteBook' cg@3663: layout: (LayoutFrame 1 0.0 0 0.0 0 1.0 -32 1.0) cg@3663: uuid: 'b2e03600-761b-11e9-98ea-b8f6b1108e05' cg@3663: enableChannel: hasSelectionHolder cg@3663: tabable: true cg@3663: model: noteBookModel cg@3663: menu: noteBookTabList cg@3663: useIndex: true cg@3663: translateLabel: true cg@3663: keepCanvasAlive: true cg@3663: ) cg@3663: (UISubSpecification cg@3663: name: 'subSpec' cg@3663: layout: (LayoutFrame 2 0.0 -32 1 -2 1.0 0 1) cg@3663: uuid: 'b2e039ac-761b-11e9-98ea-b8f6b1108e05' cg@3663: majorKey: ToolApplicationModel cg@3663: minorKey: windowSpecForCommit cg@3663: ) cg@3663: (NoteBookViewSpec cg@3663: name: 'TestNoteBook' cg@3663: layout: (LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) cg@3663: uuid: 'b2e03b32-761b-11e9-98ea-b8f6b1108e05' cg@3663: visibilityChannel: testMode cg@3663: tabable: true cg@3663: menu: testItemList cg@3663: useIndex: true cg@3663: translateLabel: true cg@3663: ) ca@1373: ) cg@3663: cg@3663: ) cg@1183: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: handles: (Any 0.23999999999999999 1.0) cg@1183: ) cg@3663: (UISubSpecification cg@3663: name: 'infoBarSubSpec' cg@3663: layout: (LayoutFrame 0 0.0 -24 1 0 1.0 0 1.0) cg@3663: uuid: 'b2e03d44-761b-11e9-98ea-b8f6b1108e05' cg@3663: majorKey: ToolApplicationModel cg@3663: minorKey: windowSpecForInfoBar cg@3663: ) cg@3663: ) cg@3663: cg@3663: ) cg@3663: ) tz@739: ! ! tz@739: ca@1373: !TabListEditor class methodsFor:'list specs'! ca@1373: ca@1373: noteBookTabList ca@1373: "This resource specification was automatically generated ca@1373: by the TabListEditor of ST/X." ca@1373: ca@1373: "Do not manually edit this!! If it is corrupted, ca@1373: the TabListEditor may not be able to read the specification." ca@1373: ca@1373: " ca@1373: TabListEditor new openOnClass:TabListEditor andSelector:#noteBookTabList ca@1373: " ca@1373: ca@1373: ca@1373: ca@1373: ^ #( ca@1373: #(#TabItem ca@1373: #label: 'Basic' ca@1373: #activeHelpKey: #basicTab ca@1373: #minorKey: #basicSpec ca@1373: ) ca@1373: #(#TabItem ca@1373: #label: 'Details' ca@1373: #activeHelpKey: #detailTab ca@1373: #minorKey: #detailSpec ca@1373: ) ca@1373: #(#TabItem ca@1373: #label: 'Canvas' ca@1373: #activeHelpKey: #canvasTab ca@1373: #minorKey: #canvasSpec ca@1373: ) ca@1373: ) ca@1373: ca@1373: collect:[:aTab| TabItem new fromLiteralArrayEncoding:aTab ] ca@1373: ! ! ca@1373: tz@739: !TabListEditor class methodsFor:'menu specs'! tz@739: tz@739: menu tz@739: "This resource specification was automatically generated tz@739: by the MenuEditor of ST/X." tz@739: tz@739: "Do not manually edit this!! If it is corrupted, tz@739: the MenuEditor may not be able to read the specification." tz@739: cg@3663: tz@739: " tz@739: MenuEditor new openOnClass:TabListEditor andSelector:#menu tz@739: (Menu new fromLiteralArrayEncoding:(TabListEditor menu)) startUp tz@739: " tz@739: tz@739: tz@739: cg@3663: ^ cg@3663: #(Menu cg@3663: ( cg@3663: (MenuItem cg@3663: activeHelpKey: file cg@3663: label: 'File' cg@3663: submenu: cg@3663: (Menu cg@3663: ( cg@3663: (MenuItem cg@3663: activeHelpKey: fileNew cg@3663: label: 'New' cg@3663: itemValue: doNew cg@3663: ) cg@3663: (MenuItem cg@3663: label: '-' cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: fileLoad cg@3663: label: 'Load...' cg@3663: itemValue: doLoad cg@3663: ) cg@3663: (MenuItem cg@3663: label: '-' tz@739: ) cg@3663: (MenuItem cg@3663: activeHelpKey: fileSave cg@3663: label: 'Save' cg@3663: itemValue: doSave cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: fileSave cg@3663: label: 'Save As...' cg@3663: itemValue: doSaveAs cg@3663: ) cg@3663: (MenuItem cg@3663: label: '-' cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: fileBrowseClass cg@3663: label: 'Browse Class' cg@3663: itemValue: doBrowseClass cg@3663: ) cg@3663: (MenuItem cg@3663: label: '-' cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: fileExit cg@3663: label: 'Exit' cg@3663: itemValue: closeRequest cg@3663: ) cg@3663: ) cg@3663: nil cg@3663: nil tz@739: ) cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: edit cg@3663: label: 'Edit' cg@3663: submenuChannel: menuEdit cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: add cg@3663: label: 'Add' cg@3663: submenu: cg@3663: (Menu cg@3663: ( cg@3663: (MenuItem cg@3663: activeHelpKey: addTabItem cg@3663: label: 'Tab Item' cg@3663: itemValue: doCreate cg@3663: labelImage: (ResourceRetriever nil newTabItemIcon 'Tab Item') tz@739: ) cg@3663: ) cg@3663: nil cg@3663: nil tz@739: ) cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: add cg@3663: label: 'Generate' cg@3663: submenu: cg@3663: (Menu cg@3663: ( cg@3663: (MenuItem cg@3663: activeHelpKey: fileCreateAspectMethod cg@3663: enabled: hasClassAndSelector cg@3663: label: 'Aspect Method' cg@3663: itemValue: doGenerateAspectMethod tz@739: ) cg@3663: ) cg@3663: nil cg@3663: nil tz@739: ) cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: test cg@3663: label: 'Test' cg@3663: submenu: cg@3663: (Menu cg@3663: ( cg@3663: (MenuItem cg@3663: activeHelpKey: testPreview cg@3663: enabled: canToggleTestMode cg@3663: label: 'Preview' cg@3663: indication: testMode tz@739: ) cg@3663: ) cg@3663: nil cg@3663: nil tz@749: ) cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: history cg@3663: label: 'History' cg@3663: submenuChannel: menuHistory cg@3663: ) cg@3663: (MenuItem cg@3663: activeHelpKey: help cg@3663: label: 'MENU_Help' cg@3663: startGroup: conditionalRight cg@3663: submenuChannel: menuHelp cg@3663: ) cg@3663: ) cg@3663: nil cg@3663: nil tz@739: ) tz@739: ! tz@739: tz@739: menuEdit tz@739: "This resource specification was automatically generated tz@739: by the MenuEditor of ST/X." tz@739: tz@739: "Do not manually edit this!! If it is corrupted, tz@739: the MenuEditor may not be able to read the specification." tz@739: tz@739: " tz@739: MenuEditor new openOnClass:TabListEditor andSelector:#menuEdit tz@739: (Menu new fromLiteralArrayEncoding:(TabListEditor menuEdit)) startUp tz@739: " tz@739: tz@739: tz@739: ca@1374: ^ ca@1374: #(#Menu ca@1374: #( ca@1374: #(#MenuItem ca@1374: #label: 'Cut' ca@1374: #value: #doCut ca@1374: #activeHelpKey: #editCut ca@1374: #enabled: #hasSelectionHolder ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Copy' ca@1374: #value: #doCopy ca@1374: #activeHelpKey: #editCopy ca@1374: #enabled: #hasSelectionHolder ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Paste' ca@1374: #value: #doPaste ca@1374: #activeHelpKey: #editPaste sv@2383: #enabled: #canPasteHolder ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Delete' ca@1374: #value: #doDelete ca@1374: #activeHelpKey: #editPaste ca@1374: #enabled: #hasSelectionHolder ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: '-' ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Move Up' ca@1374: #value: #doMoveTabUpOrDown: ca@1374: #activeHelpKey: #editMoveUp ca@1374: #enabled: #canMoveTabItemUpOrDown ca@1374: #argument: #up ca@1374: #labelImage: #(#ResourceRetriever #Icon #upIcon 'Move Up') ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Move Down' ca@1374: #value: #doMoveTabUpOrDown: ca@1374: #activeHelpKey: #editMoveDown ca@1374: #enabled: #canMoveTabItemUpOrDown ca@1374: #argument: #down ca@1374: #labelImage: #(#ResourceRetriever #Icon #downIcon 'Move Down') ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: '-' ca@1374: #isVisible: #hiddenAccelerator ca@1374: ) ca@1374: #(#MenuItem ca@1374: #label: 'Accept' ca@1374: #translateLabel: true ca@1374: #isVisible: #hiddenAccelerator ca@1374: #value: #accept sv@2432: #enabled: #enablingCommitButtonsHolder ca@1374: ) ca@1374: ) ca@1374: nil ca@1374: nil tz@739: ) tz@739: ! tz@739: tz@739: menuToolbar tz@739: "This resource specification was automatically generated tz@739: by the MenuEditor of ST/X." tz@739: tz@739: "Do not manually edit this!! If it is corrupted, tz@739: the MenuEditor may not be able to read the specification." tz@739: tz@739: " tz@739: MenuEditor new openOnClass:TabListEditor andSelector:#menuToolbar tz@739: (Menu new fromLiteralArrayEncoding:(TabListEditor menuToolbar)) startUp tz@739: " tz@739: tz@739: tz@739: ca@1373: ^ cg@1909: #(Menu cg@1909: ( cg@1909: (MenuItem cg@1909: activeHelpKey: fileNew cg@1909: label: 'New' cg@1909: itemValue: doNew cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary new22x22Icon) ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: fileLoad cg@1909: label: 'Load' cg@1909: itemValue: doLoad cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary loadFromMethodIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: fileSave cg@1909: label: 'Save' cg@1909: itemValue: doSave cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary saveAsMethodIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: label: '-' ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editCut cg@1909: enabled: hasSelectionHolder cg@1909: label: 'Cut' cg@1909: itemValue: doCut cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary cutWidgetIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editCopy cg@1909: enabled: hasSelectionHolder cg@1909: label: 'Copy' cg@1909: itemValue: doCopy cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary copyWidgetIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editPaste sv@2383: enabled: canPasteHolder cg@1909: label: 'Paste' cg@1909: itemValue: doPaste cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary pasteWidgetIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editDelete cg@1909: enabled: hasSelectionHolder cg@1909: label: 'Delete' cg@1909: itemValue: doDelete cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: isVisible: false cg@1909: labelImage: (ResourceRetriever ToolbarIconLibrary delete22x22Icon) ca@1373: ) cg@1909: (MenuItem cg@1909: label: '-' ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: addTabItem cg@1909: label: 'Add Tab Item' cg@1909: itemValue: doCreate cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: labelImage: (ResourceRetriever nil newTabItemIcon) ca@1373: ) cg@1909: (MenuItem cg@1909: label: '' ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editMoveUp cg@1909: enabled: canMoveTabItemUpOrDown cg@1909: label: 'Move Tab Up' cg@1909: itemValue: doMoveTabUpOrDown: cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: startGroup: right cg@1909: labelImage: (ResourceRetriever XPToolbarIconLibrary up22x22Icon) cg@1909: argument: up ca@1373: ) cg@1909: (MenuItem cg@1909: activeHelpKey: editMoveDown cg@1909: enabled: canMoveTabItemUpOrDown cg@1909: label: 'Move Tab Down' cg@1909: itemValue: doMoveTabUpOrDown: cg@1909: translateLabel: true cg@1909: isButton: true cg@1909: startGroup: right cg@1909: labelImage: (ResourceRetriever XPToolbarIconLibrary down22x22Icon) cg@1909: argument: down ca@1373: ) ca@1373: ) ca@1373: nil ca@1373: nil tz@739: ) tz@739: ! ! tz@739: tz@739: !TabListEditor methodsFor:'aspects'! tz@739: ca@1373: autoHideScrollBars ca@1373: |holder| ca@1373: ca@1373: (holder := builder bindingAt:#autoHideScrollBars) isNil ifTrue:[ ca@1373: builder aspectAt:#autoHideScrollBars put:(holder := 1 asValue). ca@1373: holder addDependent: self ca@1373: ]. ca@1373: ^ holder. ca@1373: ! ca@1373: tz@739: canMoveTabItemUpOrDown ca@1373: ^ builder booleanValueAspectFor:#canMoveTabItemUpOrDown ca@1373: ! ca@1373: ca@1374: hasSelectionHolder ca@1374: ^ builder booleanValueAspectFor:#hasSelectionHolder ca@1374: ! ca@1374: ca@1374: hiddenAccelerator ca@1374: "used to set menu entries with an accelerator not visible to the operator ca@1374: " ca@1374: ^ false ca@1374: ! ca@1374: ca@1326: inputGroup ca@1326: ca@1326: |holder| ca@1326: ca@1326: (holder := builder bindingAt:#inputGroup) isNil ifTrue:[ ca@1326: builder aspectAt:#inputGroup put:(holder := EnterFieldGroup new) ca@1326: ]. ca@1326: ^ holder. ca@1326: ca@1326: ca@1326: ! ca@1326: ca@1373: listOfTabs ca@1373: ^ listOfTabs ca@1373: ! ca@1373: ca@1373: noteBookModel ca@1373: |holder| ca@1373: ca@1373: (holder := builder bindingAt:#noteBookModel) isNil ifTrue:[ ca@1373: holder := 0 asValue. ca@1373: builder aspectAt:#noteBookModel put:holder. ca@1373: ]. ca@1373: ^ holder. ca@1373: ! ca@1373: ca@1373: noteBookTabList ca@1373: "Generated by the TabListEditor" ca@1373: ca@1373: |list| ca@1373: ca@1373: (list := builder bindingAt:#noteBookTabList) isNil ifTrue:[ ca@1373: builder aspectAt:#noteBookTabList put:(list := self class noteBookTabList). ca@1373: ]. ca@1373: ^ list tz@739: ! tz@739: tz@739: selectionHolder tz@739: "holder which keeps the current selection tz@739: " tz@739: |holder| tz@739: tz@739: (holder := builder bindingAt:#selectionHolder) isNil ifTrue:[ ca@1373: holder := 0 asValue. tz@739: builder aspectAt:#selectionHolder put:holder. ca@1373: holder addDependent:self. tz@739: ]. tz@739: ^ holder tz@739: ! tz@739: ca@1373: testItemList tz@739: |holder| tz@739: ca@1373: (holder := builder bindingAt:#testItemList) isNil ifTrue:[ ca@1373: holder := ValueHolder new. ca@1373: builder aspectAt:#testItemList put:holder. tz@739: ]. ca@1373: ^ holder. tz@739: ! tz@739: tz@739: testMode tz@739: tz@739: |holder| tz@739: tz@739: (holder := builder bindingAt:#testMode) isNil ifTrue:[ tz@739: builder aspectAt:#testMode put:(holder := false asValue). tz@739: holder addDependent: self tz@739: ]. tz@739: ^ holder tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor methodsFor:'building'! tz@739: ca@1373: buildFromResourceSpec:aListSpec ca@1373: self buildFromTabList:aListSpec tz@739: ! tz@739: tz@739: buildFromTabList: aTabList tz@739: "build from a aTabList" tz@739: ca@1373: self selection:0. tz@739: listOfTabs removeAll. tz@739: cg@2819: aTabList do:[:aTabItem| cg@2819: self assert:(aTabItem isKindOf:TabItem). cg@2819: listOfTabs add: aTabItem cg@2819: ]. cg@1972: self clearModified. ca@1374: listOfTabs notEmpty ifTrue:[ self selection:1 ]. cg@2819: cg@2819: "Modified: / 08-11-2010 / 13:57:27 / cg" cg@1972: ! tz@739: cg@1972: loadFromClass:aClass andSelector:aSelector cg@1972: "build from class and selector" cg@1972: cg@1972: |cls spec| cg@1972: cg@1972: self assert:(aClass isNil or:[aClass isClass]). cg@1972: cg@1972: self testMode value: false. cg@1972: self selection:0. cg@1972: cg@1972: "if opened on a tab list" cg@1972: (aClass isNil and: [aSelector isNil and: [listOfTabs size > 0]]) ifFalse:[ cg@1972: listOfTabs removeAll. cg@1972: cg@1972: cls := aClass isBehavior ifTrue:[ aClass ] ifFalse:[ self resolveName:aClass]. cg@1972: specSelector := aSelector. cg@1972: cg@1972: cls notNil ifTrue:[ cg@1972: specSelector notNil ifTrue:[ cg@1972: cg@1972: (cls respondsTo: aSelector) ifTrue:[ cg@1972: spec := cls perform: aSelector. cg@1972: ]. cg@1972: spec size ~~ 0 ifTrue:[ cg@2819: spec do:[:aTabOrArray| cg@2819: |tab| cg@2819: cg@2819: aTabOrArray isArray ifTrue:[ cg@2819: tab := aTabOrArray decodeAsLiteralArray cg@2819: ] ifFalse:[ cg@2819: tab := aTabOrArray. cg@2819: ]. cg@2819: self assert:(tab isKindOf:TabItem). cg@2819: listOfTabs add:tab. cg@1972: ]. cg@1972: self addHistoryEntryForClass:cls selector:specSelector. cg@1972: ] cg@1972: ] cg@1972: ]. cg@1972: cg@1972: self clearModified. cg@1972: ]. cg@1972: listOfTabs notEmpty ifTrue:[ self selection:1 ]. cg@2819: cg@2819: "Modified: / 08-11-2010 / 13:59:09 / cg" tz@739: ! ! tz@739: tz@739: !TabListEditor methodsFor:'change & update'! tz@739: tz@739: update:something with:aParameter from:someObject tz@739: "one of my aspects has changed; update modified channel tz@739: " ca@1374: |list| ca@1373: ca@1373: someObject = self selectionHolder ifTrue:[ ca@1373: ^ self selectionChanged ca@1373: ]. ca@1373: ca@1373: someObject = self testMode ifFalse:[ ca@1373: ^ super update:something with:aParameter from:someObject. ca@1373: ]. ca@1373: ca@1373: someObject value ifTrue:[ ca@1375: self noteBookModel value:0. ca@1375: ca@1374: listOfTabs notEmpty ifTrue:[ ca@1373: list := listOfTabs collect:[:aTab| |tab| ca@1373: tab := aTab copy. ca@1373: tab setAttributesFromClass:specClass. ca@1373: tab ca@1374: ] ca@1374: ]. ca@1374: self selection:0. ca@1373: ]. ca@1373: self testItemList value:list. ca@1373: self updateInfoLabel. tz@739: tz@739: ! ! tz@739: ca@1373: !TabListEditor methodsFor:'queries'! tz@739: ca@1373: canToggleTestMode sv@2281: "checks whether testMode button is enabled" sv@2281: ca@1373: self testMode value ifTrue:[ ca@1373: ^ true ca@1373: ]. ca@1373: sv@2281: self enablingCommitButtonsHolder value ifFalse:[ ca@1373: ^ listOfTabs notEmpty ca@1373: ]. ca@1373: ^ false tz@739: ! ! tz@739: tz@739: !TabListEditor methodsFor:'selection'! tz@739: ca@1373: selectedElement ca@1373: |idx tab| ca@1373: ca@1373: idx := self selection. ca@1373: ca@1373: idx ~~ 0 ifTrue:[ ca@1373: (tab := listOfTabs at:idx ifAbsent:nil) notNil ifTrue:[ ca@1373: ^ tab ca@1373: ]. ca@1373: self selection:0 ca@1373: ]. ca@1373: ^ nil ca@1373: ! ca@1373: ca@1373: selection ca@1373: ^ self selectionHolder value ? 0 tz@739: ! tz@739: ca@1373: selection:anIndex ca@1373: self selectionHolder value:(anIndex ? 0). ca@1373: ! tz@739: ca@1373: selectionChanged ca@1373: |noteBookModel hasSelection| tz@739: ca@1373: hasSelection := self selection ~~ 0. ca@1373: noteBookModel := self noteBookModel. cg@1145: ca@1373: hasSelection ifTrue:[ ca@1373: self testMode value:false. ca@1373: noteBookModel value == 0 ifTrue:[noteBookModel value:1] tz@739: ] ifFalse:[ ca@1373: noteBookModel value:0 tz@739: ]. tz@739: self cancel. ca@1374: self hasSelectionHolder value:hasSelection. sv@2281: self canPasteHolder. ca@1373: ! tz@739: ca@1373: setSelection:anIndex ca@1374: |index| ca@1374: ca@1374: index := anIndex ? 0. ca@1374: self selectionHolder value:index withoutNotifying:self tz@739: ! ! tz@739: cg@3036: !TabListEditor methodsFor:'startup & release'! tz@739: tz@739: initialize tz@739: "setup aspects used by column description specifications tz@739: " tz@739: super initialize. ca@1373: listOfTabs := List new. tz@739: ! tz@739: tz@739: openModalOnTabList: aTabList tz@739: "build a tab list from aTabList and open it modal" tz@739: tz@739: super openModalOnResourceSpec: aTabList tz@739: tz@739: ! ! tz@739: tz@739: !TabListEditor methodsFor:'user actions'! tz@739: tz@739: accept tz@739: "accept changes tz@739: " cg@3093: |tab asb| cg@1066: ca@1373: (tab := self selectedElement) notNil ifTrue:[ ca@1373: super accept. cg@3093: aspects keysAndValuesDo:[:k :m| tab perform:k asMutator with:(m value) ]. tz@739: ca@1373: asb := self autoHideScrollBars value. ca@1373: asb := asb ~~ 1 ifTrue:[asb == 2] ifFalse:[nil]. ca@1373: tab autoHideScrollBars:asb. tz@739: ]. tz@739: self cancel. ca@1373: ! ca@1373: ca@1373: addTab:aTab ca@1373: |idx| ca@1373: ca@1373: aTab notNil ifTrue:[ cg@2819: self assert:(aTab isKindOf:TabItem). ca@1373: self testMode value: false. ca@1373: ca@1373: (idx := self selection) == 0 ifTrue:[ ca@1373: listOfTabs add:aTab. ca@1373: self selection:(listOfTabs size). ca@1373: ] ifFalse:[ ca@1373: listOfTabs add:aTab afterIndex:idx ca@1373: ]. cg@1972: self setModified. ca@1373: ]. cg@2819: cg@2819: "Modified: / 08-11-2010 / 13:55:27 / cg" tz@739: ! tz@739: tz@739: cancel sv@2281: "cancel all changes" sv@2281: ca@1373: |tab idx asb| tz@739: ca@1373: ( (idx := self selection) ~~ 0 ca@1373: and:[(tab := self selectedElement) notNil] ca@1373: ) ifTrue:[ ca@1373: aspects keysAndValuesDo:[:k :m| m value:(tab perform:k) ]. ca@1373: listOfTabs at:idx put:tab. tz@739: ca@1373: asb := tab autoHideScrollBars. ca@1373: asb notNil ifTrue:[asb := asb == true ifTrue:[2] ifFalse:[3]] ca@1373: ifFalse:[asb := 1]. tz@739: ca@1373: self autoHideScrollBars value:asb. tz@739: ]. ca@1373: self canMoveTabItemUpOrDown value:(listOfTabs size > 1 and:[idx ~~ 0]). sv@2281: self enablingCommitButtonsHolder value: false tz@739: ! tz@739: tz@739: doCopy tz@739: "copy selected tab tz@739: " ca@1373: |tab| ca@1373: ca@1373: (tab := self selectedElement) notNil ifTrue:[ ca@1373: self clipboard:tab. tz@749: self updateAllToolInstances. tz@739: ] tz@739: ! tz@739: ca@1373: doCreate ca@1373: self addTab:(TabItem label:'TAB'). tz@739: ! tz@739: tz@739: doCut ca@1373: "cut the selected tab; put to pasteBuffer tz@739: " ca@1373: |tab| tz@739: ca@1373: (tab := self selectedElement) notNil ifTrue:[ ca@1373: self clipboard:tab. ca@1373: self doDelete. tz@739: ]. tz@739: tz@739: ! tz@739: tz@739: doDelete tz@739: "delete selected tab tz@739: " ca@1374: |index size| tz@739: ca@1373: (index := self selection) ~~ 0 ifTrue:[ tz@739: self testMode value: false. ca@1374: ca@1374: (size := listOfTabs size) == 1 ifTrue:[ ca@1374: self selection:0 ca@1374: ] ifFalse:[ ca@1374: self setSelection:0 ca@1374: ]. tz@739: listOfTabs removeIndex:index. ca@1374: index < size ifFalse:[ ca@1374: index := index - 1 ca@1374: ]. ca@1373: self selection:index. ca@1373: self updateAllToolInstances. cg@1972: self setModified. tz@739: ]. tz@739: ! tz@739: tz@739: doGenerateAspectMethod tz@739: "generate aspect method tz@739: " tz@739: |cls code| tz@739: cg@3381: (specClass notNil and:[specSelector notNil]) ifFalse:[ cg@3381: ^ self information:'No class and selector defined!!' tz@739: ]. tz@739: tz@739: cls := self resolveName: specClass. tz@739: tz@739: (cls canUnderstand:specSelector) ifTrue:[ tz@739: "/ method already exists, do not overwrite the method automaticaly tz@739: tz@739: ( YesNoBox title:'method ' tz@739: , (Text string:('#', specSelector) emphasis:#bold) tz@739: , ' already exists!!' tz@739: yesText:'overwrite' tz@739: noText:'cancel' tz@739: ) confirm ifFalse:[ tz@739: ^ self tz@739: ] tz@739: ]. tz@739: tz@739: code := '!!' , cls name , ' methodsFor:''aspects''!!\\' , tz@739: specSelector , '\' , tz@739: ' "Generated by the TabListEditor"\' , tz@739: '\' , tz@739: ' |list|\' , tz@739: '\' , tz@739: ' (list := builder bindingAt:#' , specSelector , ') isNil ifTrue:[\' , tz@739: ' builder aspectAt:#' , specSelector, ' put:(list := self class ', specSelector, ').\' , tz@739: ' ].\' , tz@739: ' ^ list\' , tz@739: '!! !!\\'. tz@739: cg@3074: Class packageQuerySignal answer:cls package do:[ cg@3074: (ReadStream on:(code withCRs)) fileIn cg@3074: ] tz@739: cg@3074: "Modified: / 28-01-2014 / 21:57:09 / cg" tz@739: ! tz@739: tz@739: doMoveTabUpOrDown:what tz@739: "step up or down tz@739: " ca@1373: |tab idx sz| tz@739: ca@1373: (listOfTabs size > 1 and:[(idx := self selection) ~~ 0]) ifFalse:[ tz@739: ^ self tz@739: ]. tz@739: ca@1373: (tab := listOfTabs at:idx ifAbsent:nil) isNil ifTrue:[ ca@1373: ^ self selection:0 ca@1373: ]. tz@739: ca@1373: self setSelection:0. ca@1373: listOfTabs removeIndex:idx. tz@739: ca@1373: sz := listOfTabs size. cg@1145: tz@739: what == #down ifTrue:[ ca@1373: idx := idx > sz ifTrue:[1] ifFalse:[idx + 1] tz@739: ] ifFalse:[ ca@1373: idx := idx == 1 ifTrue:[sz + 1] ifFalse:[idx - 1] tz@739: ]. tz@739: ca@1373: listOfTabs add:tab beforeIndex:idx. ca@1373: self setSelection:idx. cg@1972: self setModified. tz@739: ! tz@739: tz@739: doPaste tz@739: "paste a tab tz@739: " ca@1373: |tab| cg@1145: ca@1373: ((tab := self class clipboard) notNil and:[tab isKindOf:TabItem]) ifTrue:[ ca@1373: self addTab:(tab deepCopy). ca@1373: ] tz@739: ! tz@739: tz@739: doSave cg@1972: "generate code for class and instance" cg@1972: cg@3056: |cls code spec category package mthd list| tz@739: sv@3330: (specClass notNil and:[specSelector notNil]) ifFalse:[ sv@3330: ^ self doSaveAs tz@739: ]. tz@739: tz@739: cls := self resolveName: specClass. tz@739: tz@739: listOfTabs isEmpty ifTrue:[^self information:'No tab list defined!!']. tz@739: sv@3330: spec := WriteStream on:''. ca@1245: list := Array new:(listOfTabs size). ca@1245: listOfTabs keysAndValuesDo:[:i :el|list at:i put:(el literalArrayEncoding)]. ca@1245: ca@1245: UISpecification prettyPrintSpecArray:list on:spec indent:5. tz@739: spec := spec contents. tz@739: tz@739: "/ if that method already exists, do not overwrite the category tz@739: tz@739: category := 'list specs'. tz@739: tz@739: (mthd := cls class compiledMethodAt:specSelector) notNil ifTrue:[ tz@739: category := mthd category. cg@3056: package := mthd package. tz@739: ]. tz@739: tz@739: code := Character excla asString tz@739: , cls name , ' class methodsFor:' , category storeString tz@739: , Character excla asString , '\\' tz@739: tz@739: , specSelector , '\' tz@739: , (self class codeGenerationComment replChar:$!! withString:'!!!!') tz@739: , '\\ "\' cg@1855: , ' TabListEditor new openOnClass: self andSelector:#' , specSelector , '\' tz@739: , ' "\'. tz@739: tz@739: code := code tz@739: , '\' tz@739: , ' \\' tz@739: , ' ^' tz@739: , ' ', spec, '\' cg@3590: , ' collect:#decodeAsLiteralArray "[:aTab| TabItem new fromLiteralArrayEncoding:aTab ]"' tz@739: , '\' tz@739: , Character excla asString tz@739: , ' ' tz@739: , Character excla asString tz@739: , '\'. tz@739: tz@739: code := code withCRs. cg@3056: Class packageQuerySignal cg@3056: answer:package cg@3056: do:[ cg@3074: Class packageQuerySignal answer:cls package do:[ cg@3074: (ReadStream on:code) fileIn. cg@3074: ]. cg@3056: (cls canUnderstand:specSelector) ifFalse:[ cg@3584: (YesNoBox confirm:(resources string:'Generate aspect method (on instance side) to hold the tabList (#%1)?' with:specSelector)) ifTrue:[ cg@3056: self doGenerateAspectMethod cg@3056: ] cg@3056: ]. cg@3056: ]. tz@739: cg@1972: self addHistoryEntryForClass:cls selector:specSelector. cg@1972: self clearModified. tz@739: hasSaved := true. cg@3074: cg@3074: "Modified: / 28-01-2014 / 21:56:54 / cg" cg@3590: "Modified: / 11-08-2018 / 18:52:00 / Claus Gittinger" cg@1856: ! cg@1856: cg@1856: openDocumentation cg@1856: self openHTMLDocument:'tools/uipainter/TabListEditor.html'. tz@739: ! ! tz@739: tz@739: !TabListEditor class methodsFor:'documentation'! tz@739: tz@739: version cg@1066: ^ '$Header$' cg@2667: ! cg@2667: cg@2667: version_CVS cg@2667: ^ '$Header$' tz@739: ! ! cg@3036: