~drgeo-developers/drgeo/trunk

« back to all changes in this revision

Viewing changes to srcCuis/DrGeo.pck.st

  • Committer: Hilaire Fernandes
  • Date: 2022-08-07 08:27:42 UTC
  • Revision ID: hilaire.fernandes@gmail.com-20220807082742-g4se0ex29lw63nvo
Archives

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'From Cuis 6.0 [latest update: #5352] on 6 July 2022 at 11:06:25 am'!
 
1
'From Cuis 6.0 [latest update: #5435] on 5 August 2022 at 9:58:24 am'!
2
2
'Description '!
3
 
!provides: 'DrGeo' 1 419!
 
3
!provides: 'DrGeo' 1 424!
4
4
!requires: 'Gettext' 1 17 nil!
5
5
!requires: 'SVG' 1 16 nil!
6
6
!requires: 'YAXO' 1 19 nil!
6957
6957
        super buildMorphicWindow.
6958
6958
        titleMorph showButtonsNamed: #(close expand).! !
6959
6959
 
6960
 
!DrGSmalltalkSketchBrowser methodsFor: 'GUI building' stamp: 'hlsf 4/11/2022 21:46:47'!
 
6960
!DrGSmalltalkSketchBrowser methodsFor: 'GUI building' stamp: 'hlsf 7/9/2022 12:04:06'!
6961
6961
newButtonArea
6962
6962
        | rowLeft rowRight |    
6963
6963
        buttonArea _ LayoutMorph newRow :: 
6979
6979
        rowRight _ LayoutMorph newRow.
6980
6980
        rowRight 
6981
6981
                axisEdgeWeight: #rowRight;              
6982
 
                addMorph: (PluggableButtonMorph
 
6982
                addMorph: ((PluggableButtonMorph
6983
6983
                        model: self
6984
6984
                        action: #edit
6985
 
                        label: 'Edit' translated).
 
6985
                        label: 'Edit' translated) enableSelector: #canEdit; yourself).
6986
6986
        rowRight 
6987
6987
                addMorph: (PluggableButtonMorph
6988
6988
                        model: self
6991
6991
        rowRight 
6992
6992
                addMorph: ((PluggableButtonMorph 
6993
6993
                        model: self
6994
 
                        action: #deleteSketch) icon: Theme current deleteIcon).         
 
6994
                        action: #deleteSketch
 
6995
                        label: 'Delete' translated) 
 
6996
                                setBalloonText: 'Delete permanently this Smalltalk Sketch from disk.' translated;
 
6997
                                enableSelector: #canDelete; 
 
6998
                                yourself).              
6995
6999
        buttonArea 
6996
7000
                addMorph: rowLeft;
6997
7001
                addMorph: rowRight.
7052
7056
minimumExtent
7053
7057
        ^ 1200@800! !
7054
7058
 
7055
 
!DrGSmalltalkSketchBrowser methodsFor: 'update' stamp: 'hlsf 4/12/2022 21:04:08'!
 
7059
!DrGSmalltalkSketchBrowser methodsFor: 'update' stamp: 'hlsf 7/9/2022 12:07:45'!
7056
7060
updateButtonsAndPreviews
7057
7061
        sketches _ nil.
7058
7062
        self changed: #isExamples.
7059
7063
        self changed: #isMySketches.
7060
7064
        self changed: #sketches.
7061
7065
        self changed: #sourceCode.
 
7066
        self changed: #canDelete.
7062
7067
        self sketch: 0! !
7063
7068
 
7064
7069
!DrGSmalltalkSketchBrowser methodsFor: 'states' stamp: 'hlsf 4/11/2022 21:56:14'!
7065
7070
canDelete
7066
7071
        ^ self isMySketches and: [selectedFile notNil ]! !
7067
7072
 
 
7073
!DrGSmalltalkSketchBrowser methodsFor: 'states' stamp: 'hlsf 7/9/2022 11:55:01'!
 
7074
canEdit
 
7075
" Is there any editor listening to edit a selected Smalltalk Sketch? "
 
7076
        ^ self actionMap includesKey: #editSmalltalkSketch! !
 
7077
 
7068
7078
!DrGSmalltalkSketchBrowser methodsFor: 'states' stamp: 'hlsf 4/11/2022 21:57:32'!
7069
7079
isExamples
7070
7080
        ^ self isMySketches not! !
9534
9544
                        ifNotNil: [:d | d containsPoint: globalPoint ]]
9535
9545
                ! !
9536
9546
 
9537
 
!DrGValueMorph methodsFor: 'accessing' stamp: 'hlsf 7/6/2022 11:05:02'!
 
9547
!DrGValueMorph methodsFor: 'accessing' stamp: 'hlsf 7/9/2022 11:41:51'!
9538
9548
roundedValueString
9539
9549
        ^ (mathItem valueItem isPoint or: [mathItem valueItem isNumber])
9540
9550
                ifTrue: [
9541
9551
                        mathItem valueItem isFraction 
9542
9552
                                ifTrue: [mathItem valueItem printString] 
9543
 
                                ifFalse: [mathItem valueItem printShowingDecimalPlaces: (DrGeoSystem at: #valueDecimal)]]
 
9553
                                ifFalse: [mathItem valueItem printShowingDecimalPlaces: (DrGeoSystem preferences at: #valueDecimal)]]
9544
9554
                ifFalse: [mathItem valueItem asString]! !
9545
9555
 
9546
9556
!DrGValueMorph methodsFor: 'accessing' stamp: 'hlsf 4/7/2021 19:56:32'!
11695
11705
        ^ 'Installed version: ' translated, (String streamContents: [:str | 
11696
11706
                (CodePackage installedPackages at: 'DrGeo') featureSpec provides printVersionRevisionOn: str])! !
11697
11707
 
 
11708
!DrGeo class methodsFor: 'user interface' stamp: 'hlsf 8/4/2022 23:04:44'!
 
11709
getMenuIn: aWorld at: aHand
 
11710
        | menu |
 
11711
        menu _  (CommandBuilder on: #drgeoWorldMenu) getMenu.
 
11712
        menu addStayUpIcons ;
 
11713
                addTitle: 'System menu' translated.
 
11714
        ^ menu! !
 
11715
 
11698
11716
!DrGeo class methodsFor: 'user interface' stamp: 'hlsf 4/9/2022 23:13:13'!
11699
11717
quit
11700
11718
        self unsavedData isEmpty ifFalse: [ 
11702
11720
Are you sure to quit Dr. Geo environment?' translated) ifFalse: [ ^ self]].
11703
11721
        Smalltalk quitPrimitive! !
11704
11722
 
 
11723
!DrGeo class methodsFor: 'user interface' stamp: 'hlsf 8/5/2022 09:55:17'!
 
11724
toolsMenu: builder
 
11725
        <drgeoWorldMenu>
 
11726
        builder newEntry: 'System Browser' translated in: 'Tools' translated ::
 
11727
                icon: #developmentIcon;
 
11728
                action: [HierarchyBrowserWindow onClass: DrGeoSketch selector: nil];
 
11729
                help:'A source code browser to view, edit and save Dr. Geo code. I open the browser on the DrGeoSketch class you can study to design your own Smalltalk sketch.'        translated;
 
11730
                order: 0.
 
11731
        builder newEntry: 'Smalltalk Sketch Editor' translated in: 'Tools' translated ::
 
11732
                icon: #textEditorIcon;
 
11733
                help: 'An editor to write and test your own Smallltalk sketch.'         translated;
 
11734
                action: [DrGSmalltalkSketchEditor open: 'DrGeoSketch new' label: 'Edit Smalltalk Sketch' translated.];
 
11735
                order: 1.
 
11736
        builder newEntry: 'Workspace' translated in: 'Tools' translated ::
 
11737
                icon: #terminalIcon;
 
11738
                action: [Workspace openWorkspace ];
 
11739
                help: 'A window used as a scratchpad area where fragments of Cuis-Smalltalk code can be entered, stored, edited, and evaluated.'        translated;
 
11740
                order: 2.
 
11741
        builder newEntry: 'Open a file' translated in: 'Tools' translated ::
 
11742
                icon: #systemFileManagerIcon;
 
11743
                action: [FileListWindow openFileList];
 
11744
                help: 'Open the filer on your personal sketches collection.' translated;
 
11745
                order: 3.
 
11746
        builder newEntry: 'Save session' translated in: 'Tools' translated ::
 
11747
                order: 4;
 
11748
                action: [Smalltalk saveImage];
 
11749
                icon:    #saveIcon;
 
11750
                help: 'Save this Dr. Geo session.' translated! !
 
11751
 
 
11752
!DrGeo class methodsFor: 'user interface' stamp: 'hlsf 8/5/2022 09:25:50'!
 
11753
worldMenu: builder
 
11754
        <drgeoWorldMenu>
 
11755
        builder newEntry: 'New' translated ::
 
11756
                icon: #blankIcon;
 
11757
                action: [DrGeo new];
 
11758
                order: 0.
 
11759
        builder newEntry: 'Open a sketch' translated ::
 
11760
                icon: #openIcon;
 
11761
                action: [DrGSmalltalkSketchBrowser open: DrGeoSystem smalltalkSketchesPath label: 'Browse' translated.];
 
11762
                order: 1.
 
11763
        builder newEntry: 'Toggle full screen mode' translated ::
 
11764
                icon: #viewFullscreenIcon;
 
11765
                action: [DrGeoSystem toggleFullscreen];
 
11766
                help: 'Turn full screen mode on when it is off, off when it is on.'     translated;
 
11767
                order: 2.
 
11768
        builder newEntry: 'Settings' translated ::
 
11769
                icon: #preferencesIcon;
 
11770
                action: [PreferenceBrowser open: DrGeoSystem preferences label: 'Dr. Geo Preferences' translated.];
 
11771
                order: 3.
 
11772
        builder newEntry: 'Tools' translated ::
 
11773
                icon:    #systemIcon.
 
11774
        builder newEntry: 'About' translated ::
 
11775
                action: [ DrGeo aboutDrgeo ];
 
11776
                order: 7.
 
11777
        builder newEntry:  'Quit' translated ::
 
11778
                action: [ DrGeo quit ];
 
11779
                icon: #quitIcon;
 
11780
                order: 999! !
 
11781
 
11705
11782
!DrGeoCommandLineHandler methodsFor: 'as yet unclassified'!
11706
11783
activate
11707
11784
        self activateHelp ifTrue: [ ^ self].
21933
22010
showVirtualKeyboard: boolean
21934
22011
! !
21935
22012
 
 
22013
!DrGPlatform methodsFor: 'user interface' stamp: 'hlsf 8/4/2022 23:06:44'!
 
22014
toggleFullscreen
 
22015
        | isFullscreen |
 
22016
        isFullscreen _ [ Preferences at: #fullscreen ] 
 
22017
                on: Error 
 
22018
                do: [Preferences name: #fullscreen category: #gui value: true.
 
22019
                        true].
 
22020
        Preferences at: #fullscreen put: isFullscreen not.
 
22021
        Display fullScreenMode: isFullscreen not! !
 
22022
 
21936
22023
!DrGPlatform methodsFor: 'user interface' stamp: 'hlsf 2/24/2022 22:57:12'!
21937
22024
toolbarIconSize
21938
22025
        ^ 45! !
21994
22081
smallFontSize
21995
22082
        ^ 13! !
21996
22083
 
21997
 
!DrGDevelopment methodsFor: 'initialization' stamp: 'hlsf 7/3/2022 12:52:05'!
 
22084
!DrGDevelopment methodsFor: 'initialization' stamp: 'hlsf 8/4/2022 16:47:49'!
21998
22085
initialize
21999
22086
        canWeDisplaySpinner _ false.
22000
22087
        self flag: #drgeoTodo.
22001
 
        "We need a dedicated world menu for DrGeo"
22002
 
        "WorldState desktopMenuPragmaKeyword:  'worldMenu'.
22003
 
        WorldState desktopMenuTitle: 'World'."
22004
22088
        Display newDepth: 32.
22005
22089
        Preferences at: #fullScreenLeavesDeskMargins put: true.
22006
22090
        Preferences at: #guiElementsSize put: #smallFonts.
 
22091
        Preferences at: #worldMenu put: TheWorldMenu.
22007
22092
        "Preferences restoreDefaultFonts"! !
22008
22093
 
22009
22094
!DrGDevelopment methodsFor: 'testing'!
22215
22300
        super checkForPaths.
22216
22301
        self myExportsPath ensureCreateDirectory! !
22217
22302
 
22218
 
!DrGWorkstation methodsFor: 'initialize-release' stamp: 'hlsf 3/12/2022 16:18:25'!
 
22303
!DrGWorkstation methodsFor: 'initialize-release' stamp: 'hlsf 8/4/2022 18:06:27'!
22219
22304
initialize
22220
22305
        canWeDisplaySpinner _ true.
22221
22306
        self flag: #drgeoTodo.
22222
 
"       WorldState desktopMenuTitle: 'System menu' translated.
22223
 
        WorldState desktopMenuPragmaKeyword:  'drgeoMenu'.
22224
 
        Display newDepth: 32.
22225
 
        PolymorphSystemSettings uiThemeClass: PharoDarkTheme.
22226
 
        TaskbarMorph showTaskbar: true.
22227
 
        MenubarMorph showMenubar: false.
 
22307
        Preferences at: #worldMenu put: DrGeo.
 
22308
 
 
22309
"       TaskbarMorph showTaskbar: true.
22228
22310
        SystemWindow fullscreenMargin: 0."! !
22229
22311
 
22230
22312
!DrGWorkstation methodsFor: 'initialize-release' stamp: 'hlsf 3/12/2022 16:28:46'!
22324
22406
stopSpinner
22325
22407
        WaitSpinner stop! !
22326
22408
 
 
22409
!DrGeoSystem class methodsFor: 'user interface' stamp: 'hlsf 8/4/2022 22:55:40'!
 
22410
toggleFullscreen
 
22411
        platform toggleFullscreen ! !
 
22412
 
22327
22413
!DrGeoSystem class methodsFor: 'user interface'!
22328
22414
toolbarIconSize
22329
22415
        ^ platform toolbarIconSize ! !