refactoring_custom/SmallSense__CustomUserDialog.st
author convert-repo
Wed, 11 Dec 2019 04:28:36 +0000
changeset 1116 b51ace366efc
parent 1072 a44c741ee5ef
permissions -rw-r--r--
update tags
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     1
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     2
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     3
Copyright (C) 2013-2015 Jakub Nesveda
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 833
diff changeset
     4
Copyright (C) 2015 Jan Vrany
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     5
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     6
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     8
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
     9
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    10
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    11
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    14
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    15
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    17
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    19
"
833
297eb38e4eee Package jn:refactoring_custom renamed to stx:goodies/smallsense/refactoring_custom
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 830
diff changeset
    20
"{ Package: 'stx:goodies/smallsense/refactoring_custom' }"
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    21
830
1a88f5e65fe2 Classes moved to namespace SmallSense
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 828
diff changeset
    22
"{ NameSpace: SmallSense }"
803
95cdac772759 Fixed failing tests caused by new STX release
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 762
diff changeset
    23
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    24
CustomDialog subclass:#CustomUserDialog
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    25
	instanceVariableNames:'dialog'
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    26
	classVariableNames:''
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    27
	poolDictionaries:''
740
dcc444183c8c move CustomDialog and its implementations to UI category
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 669
diff changeset
    28
	category:'Interface-Refactoring-Custom-UI'
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    29
!
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    30
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    31
!CustomUserDialog class methodsFor:'documentation'!
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    32
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    33
copyright
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    34
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    35
A custom code generation and refactoring support for Smalltalk/X
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    36
Copyright (C) 2013-2015 Jakub Nesveda
1072
a44c741ee5ef Copyright updates
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 833
diff changeset
    37
Copyright (C) 2015 Jan Vrany
828
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    38
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    39
This library is free software; you can redistribute it and/or
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    41
License as published by the Free Software Foundation; either
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    42
version 2.1 of the License.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    43
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    44
This library is distributed in the hope that it will be useful,
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    47
Lesser General Public License for more details.
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    48
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    50
License along with this library; if not, write to the Free Software
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    52
"
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    53
!
4c5acc592dc7 Added copyright notice
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 803
diff changeset
    54
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    55
documentation
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    56
"
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    57
    CustomDialog implementation with real dialogs to provide human interaction.
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    58
    Currently it is a simple wrapper around DialogBox. 
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    59
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    60
    [author:]
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    61
        Jakub Nesveda <nesvejak@fit.cvut.cz>
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    62
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    63
"
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    64
! !
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    65
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    66
!CustomUserDialog class methodsFor:'instance creation'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    67
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    68
new
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    69
    "return an initialized instance"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    70
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    71
    ^ self basicNew initialize.
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    72
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    73
741
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    74
!CustomUserDialog methodsFor:'accessing'!
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    75
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    76
dialog
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    77
    ^ dialog
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    78
!
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    79
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    80
dialog:something
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    81
    dialog := something.
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    82
! !
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    83
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    84
!CustomUserDialog methodsFor:'construction-adding'!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    85
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    86
addAbortAndOkButtons
741
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    87
    "Adds buttons Ok and Cancel"
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    88
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    89
    dialog addAbortAndOkButtons
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    90
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    91
    "Created: / 15-09-2014 / 16:21:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
741
c23d35088a49 fix generator not aborted when user clicks to the cancel button
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 740
diff changeset
    92
    "Modified: / 09-11-2014 / 22:52:43 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    93
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    94
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    95
addComponent:aView
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    96
    "Add given component. Component is automatically stretched to occupy windows' width"
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
    97
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    98
    ^ dialog addComponent: aView
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
    99
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   100
    "Created: / 15-09-2014 / 18:50:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   101
!
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   102
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   103
addComponent:aView labeled:aString
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   104
    "Add a label and some component side-by-side. Returns the component"
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   105
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   106
"/    aString notEmptyOrNil ifTrue:[
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   107
        ^ dialog
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   108
            addLabelledField:aView 
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   109
            label:aString ? ''
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   110
            adjust:#left 
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   111
            tabable:true 
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   112
            separateAtX:0.3
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   113
"/    ] ifFalse:[ 
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   114
"/        ^ dialog
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   115
"/            addComponent:aView indent: 0.3
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   116
"/    ].
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   117
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   118
    "Created: / 15-09-2014 / 15:45:40 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   119
    "Modified: / 15-09-2014 / 19:44:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   120
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   121
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   122
!CustomUserDialog methodsFor:'initialization'!
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   123
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   124
initialize
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   125
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   126
    dialog := DialogBox new
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   127
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   128
    "Modified: / 15-09-2014 / 16:23:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   129
    "Modified: / 25-11-2014 / 21:09:09 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   130
! !
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   131
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   132
!CustomUserDialog methodsFor:'opening'!
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   133
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   134
open
745
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   135
    "Actually opens the dialog. Return true, if dialog has been accepted
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   136
     of raises abort request if it has been cancelled."
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   137
745
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   138
    dialog open.
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   139
    dialog accepted ifFalse: [
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   140
        AbortOperationRequest raiseRequest
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   141
    ].
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   142
745
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   143
    ^ dialog accepted
669
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   144
13f049ec3b22 CustomDialog refactored to support creation of a more complex dialogs.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 617
diff changeset
   145
    "Created: / 15-09-2014 / 16:23:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
745
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   146
    "Modified: / 14-11-2014 / 17:52:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
762
85d4aa4c2424 removed method CustomDialog >> isAborted and simplified the code
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 745
diff changeset
   147
    "Modified: / 25-11-2014 / 21:08:39 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   148
! !
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   149
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   150
!CustomUserDialog methodsFor:'user interaction & notifications'!
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   151
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   152
information: aString
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   153
617
184b586387b5 fix endless recursion in CustomUserDialog >> information:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 557
diff changeset
   154
    ^ Dialog information: aString
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   155
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   156
    "Created: / 02-06-2014 / 22:36:58 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
617
184b586387b5 fix endless recursion in CustomUserDialog >> information:
Jakub Nesveda <jakubnesveda@seznam.cz>
parents: 557
diff changeset
   157
    "Modified: / 22-07-2014 / 21:25:18 / Jakub Nesveda <nesvejak@fit.cvut.cz>"
557
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   158
! !
d0e228558858 make CustomDialog as abstract with CustomSilentDialog (system/test interaction) and CustomUserDialog (human interaction) implementations
Jakub Nesveda <jakubnesveda@seznam.cz>
parents:
diff changeset
   159
745
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   160
!CustomUserDialog class methodsFor:'documentation'!
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   161
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   162
version_HG
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   163
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   164
    ^ '$Changeset: <not expanded> $'
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   165
! !
2dd476349eba Little fix in CustomDialog - properly detect if dialog has been accepted or not.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 741
diff changeset
   166