Solution was pretty easy, I've replaced builder openModal: dialog with: World openModal: dialog On Sat, Feb 2, 2013 at 4:26 PM, J. P. L. MartÃn <arguser@gmail.com> wrote:
Prestamo = Loan Ejemplar = a Copy (of a Material) Socio = Library member. Listado = List Selecciono = Selected Alerta = Alert
Anyway you could ignore most of the spanish stuff since the problem is how should I call openModal so it blocks the main window. So, add loan creates a Loan new, then does an openModal on UILoans where you load the Loan data: CopyID, MemberID, etc. if you hit OK some conditions should apply for it to be added on the Loan database (anOrderedCollection). openModal on UILoans just popups a newPluggableDialogWindow with textEntries to fill the Loan fields before adding it to the database.
On Sat, Feb 2, 2013 at 4:09 PM, Benjamin < benjamin.vanryseghem.pharo@gmail.com> wrote:
Sorry, but it's too late now for me to read spanish :s Can you provide an "english" version of this please ?
Ben
On Feb 2, 2013, at 7:54 PM, J. P. L. MartÃn <arguser@gmail.com> wrote:
I'm not sure how should I, for making the GUI we mainly based on the ContactList example on PharoCasts: http://www.pharocasts.com/2011/02/pharo-gui-with-polymorph.html This is my child window:
UIPrestamos>>openModal
openModal | builder content dialog | prestamo id: (Prestamo database size = 0 ifTrue: 1 ifFalse: [Prestamo database last id + 1]) asString. builder := UITheme builder. content := builder newLabelGroup: {('Prestamo: ' -> (builder newLabelFor: self prestamo getLabel: #id getEnabled: nil )). ('Socio ' -> (builder newTextEntryFor: self prestamo getText: #idSocio setText: #idSocio: help: 'Codigo de Socio')). ('Ejemplar: ' -> (builder newTextEntryFor: self prestamo getText: #idEjemplar setText: #idEjemplar: help: 'Codigo de Ejemplar'))}. dialog := builder newPluggableDialogWindow: 'Nuevo Prestamo' for: content. builder openModal: dialog. dialog cancelled ifFalse: [self doOnOK].
---- Which is called this way:
UIBabel>>addPrestamo
addPrestamo | prestamo alerta | prestamo := Prestamo new. alerta := AlertDialogWindow new. UIPrestamos new prestamo: prestamo; onOK: [ ((Ejemplar database anySatisfy: [:x | x idEjemplar = prestamo idEjemplar and: (x fechaBaja = '') ]) and: (Socio database anySatisfy: [:y| y numeroDeSocio = prestamo idSocio])) ifTrue: [Prestamo database add: prestamo] ifFalse: [alerta alert: 'El socio o el ejemplar no se encuentra disponible']. seleccionado := Prestamo database size. self changed: #listado; changed: #selecciono ]; openModal.
---- I've also found another way to show lists, using GridMorph instead of the current PluggableMultiColumnList, sadly it look really hard and lot of refactor should be done :(
* Block a father window when a child is made, so the father window can't
be closed if a child window exist.
childerWindow openModal: fatherWindow