VDBAbstractApplication.st
changeset 94 e76206d071fc
parent 84 74080a37751a
child 112 d293d117e978
equal deleted inserted replaced
93:bd0a7febf26d 94:e76206d071fc
    10 
    10 
    11 "{ NameSpace: Smalltalk }"
    11 "{ NameSpace: Smalltalk }"
    12 
    12 
    13 ApplicationModel subclass:#VDBAbstractApplication
    13 ApplicationModel subclass:#VDBAbstractApplication
    14 	instanceVariableNames:'debuggerHolder debugger titleHolder'
    14 	instanceVariableNames:'debuggerHolder debugger titleHolder'
    15 	classVariableNames:''
    15 	classVariableNames:'DefaultTextFont DefaultMenuFont'
    16 	poolDictionaries:''
    16 	poolDictionaries:''
    17 	category:'VDB-UI-Abstract'
    17 	category:'VDB-UI-Abstract'
    18 !
    18 !
    19 
    19 
    20 !VDBAbstractApplication class methodsFor:'documentation'!
    20 !VDBAbstractApplication class methodsFor:'documentation'!
    49 
    49 
    50     "Created: / 16-12-2017 / 00:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    50     "Created: / 16-12-2017 / 00:45:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    51     "Modified: / 16-12-2017 / 22:32:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    51     "Modified: / 16-12-2017 / 22:32:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    52 ! !
    52 ! !
    53 
    53 
       
    54 !VDBAbstractApplication class methodsFor:'accessing - defaults'!
       
    55 
       
    56 defaultMenuFont
       
    57     "Return a default font to be used in list and text views. VDB UI is designed
       
    58      so that it expects thos font to be monospaced but does not enforce it."     
       
    59 
       
    60     DefaultMenuFont isNil ifTrue:[ ^ MenuPanel defaultFont asSize: self defaultTextFont size ].
       
    61     ^ DefaultMenuFont
       
    62 
       
    63     "Created: / 31-08-2018 / 08:41:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    64 !
       
    65 
       
    66 defaultTextFont
       
    67     "Return a default font to be used in list and text views. VDB UI is designed
       
    68      so that it expects thos font to be monospaced but does not enforce it."     
       
    69 
       
    70     DefaultTextFont isNil ifTrue:[ ^ CodeView defaultFont ].
       
    71     ^ DefaultTextFont
       
    72 
       
    73     "Created: / 20-08-2018 / 10:49:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    74 !
       
    75 
       
    76 defaultTextFont: aFont
       
    77     "Set a default font to be used in list and text views. VDB UI is designed
       
    78      so that it expects thos font to be monospaced but does not enforce it."     
       
    79 
       
    80     DefaultTextFont := aFont
       
    81 
       
    82     "Created: / 20-08-2018 / 10:54:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
    83 ! !
       
    84 
    54 !VDBAbstractApplication class methodsFor:'interface opening'!
    85 !VDBAbstractApplication class methodsFor:'interface opening'!
    55 
    86 
    56 openFor: debugger
    87 openFor: debugger
    57     self new 
    88     self new 
    58         debugger: debugger;
    89         debugger: debugger;
   104     (anApplicationModel isKindOf: VDBAbstractApplication) ifTrue:[ 
   135     (anApplicationModel isKindOf: VDBAbstractApplication) ifTrue:[ 
   105         self debuggerHolder: anApplicationModel debuggerHolder.
   136         self debuggerHolder: anApplicationModel debuggerHolder.
   106     ].
   137     ].
   107 
   138 
   108     "Created: / 17-09-2014 / 22:45:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   139     "Created: / 17-09-2014 / 22:45:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   140 !
       
   141 
       
   142 menuFont
       
   143     "Return a Font to be used in pinned menu panels. Default value
       
   144      is to use menu's default font at the same size at #textFont"
       
   145 
       
   146     ^ self class defaultMenuFont
       
   147 
       
   148     "Created: / 31-08-2018 / 08:38:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   149 !
       
   150 
       
   151 textFont
       
   152     "Return a Font to be used in list and text views. VDB UI is designed
       
   153      so that it expects thos font to be monospaced but does not enforce it."
       
   154 
       
   155     ^ self class defaultTextFont
       
   156 
       
   157     "Created: / 20-08-2018 / 10:14:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   109 !
   158 !
   110 
   159 
   111 title
   160 title
   112     ^ self titleHolder value
   161     ^ self titleHolder value
   113 
   162 
   379         ].
   428         ].
   380     ].
   429     ].
   381     window := StandardSystemView new.
   430     window := StandardSystemView new.
   382     window label: (resources string: label).
   431     window label: (resources string: label).
   383     panel := MenuPanel in:window.
   432     panel := MenuPanel in:window.
   384     panel 
   433     panel
       
   434         font: self menuFont;
   385         originator: self;    
   435         originator: self;    
   386         layout: (0.0 @ 0.0 corner:1.0 @ 1.0) asLayout;
   436         layout: (0.0 @ 0.0 corner:1.0 @ 1.0) asLayout;
   387         verticalLayout:true.
   437         verticalLayout:true.
   388     panel
   438     panel
   389         menu:menu;
   439         menu:menu;
   390         receiver:self.
   440         receiver:self.
   391     window extent:panel preferredExtent.
   441     window extent:panel preferredExtent.
   392     self doOpenToolWindow:window
   442     self doOpenToolWindow:window
   393 
   443 
   394     "Created: / 16-03-2018 / 10:20:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   444     "Created: / 16-03-2018 / 10:20:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   445     "Modified: / 31-08-2018 / 08:38:12 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   395 ! !
   446 ! !
   396 
   447 
   397 !VDBAbstractApplication methodsFor:'startup & release'!
   448 !VDBAbstractApplication methodsFor:'startup & release'!
   398 
   449 
   399 releaseAsSubCanvas
   450 releaseAsSubCanvas