Hola Gallego Definitivamente NO. No es una opcion subclasificar para eso. Por que no haces un Presenter y le pasas al Aspect que use ese presenter. En ese mismo presenter, cuando cambia un valor (o cuando pirde foco), implementas que confirme el usuario. Si tengo tiempo despues te paso un ejemplo.
Disculpa la molestia. Implemente esto y funciona, pero tiene un problema. El tema es que cuando se captura el #valueChanged, el valor ya se seteo en el objeto que estaba esperando esto. Si bien uno puede, através de la confirmación deshacer los cambios, el echo es que ya se seteo . El problema principal con esto, es que una vez seteado el valor de la variable, mi objeto es forzado a reinicializar y es algo que no quiero. Pues perdería todos los cambios que hay sobre el terreno. Que es en este caso el objeto en cuestión. Es posible que no este implementando bien, esto es lo que hay: ConfirmPresenter>>addPresenter: aClassPresenter on: aModel "Add a new presenter on aModel " currentPresenter := aClassPresenter createIn: card on: aModel. currentPresenter when: #valueChanged send: #onValueChanged to: self. oldValue := aModel value ConfirmPresenter>>onValueChanged "The model held by the receiver has changed so refresh the parentView. The default is to invalidate the receiver and cause it to repaint." oldValue = currentPresenter value ifTrue: [^self]. (MessageBox confirm: self confirm caption: self caption) ifFalse: [currentPresenter value: oldValue]. oldValue := currentPresenter value. ConfirmPresenter>>addChoicePresenterOn: aModel choiceFrom: aArray "Add a Choice presenter on aModel " self addPresenter: ChoicePresenter on: aModel. currentPresenter choices: aArray Test>>basicSetting | wrapper aspects | aspects := OrderedDictionary new. aspects add: (Aspect name: #position presenterBlock: [:p :m | | confirm | confirm := ConfirmPresenter createIn: p. confirm addChoicePresenterOn: m choiceFrom: #(#TV_PRECISION_BEST #TV_PRECISION_HIGH #TV_PRECISION_ULTRA #TV_PRECISION_AVERAGE). ]); add: (Aspect name: #size presenterBlock: [:p :m | | confirm | confirm := ConfirmPresenter createIn: p. confirm addPresenter: NumberPresenter on: m. ]); add: (Aspect string: #name). wrapper := WrapperPublishedAspect title: ' Basic Settings ' publishedAspects: aspects subject: self. ^wrapper saludos kiko --- El dom 28-feb-10, GallegO <[email protected]> escribió: De: GallegO <[email protected]> Asunto: Re: [clubSmalltalk] Dolphin publishedAspectsOfInstances y PropertyInspector? Para: [email protected] Fecha: domingo, 28 de febrero de 2010, 13:34 El 26 de febrero de 2010 16:43, Jose Gregoris <[email protected]> escribió: Hola Gallego Lo de poner en negrita ya esta. Pero tengo un problema mas, fijate la captura. El texto en negrita no se ve completo. Alguna idea ? Lo unico que se me ocurre con respecto a tu problema es que hayas hecho algo mal. Igual el TreeView es uno de los controles famosos por la cantidad de bugs que tiene. No me extrañaria que exista algun truco. Tenelo en cuenta. Para la confirmación se me ocurrio esto. Que el Aspect se encargue de pedir la confirmación Para eso subclasifique Aspect por ConfirmedAspect, el nombre no me suena muy bien pero bue(se escuchan ofertas). Luego reimplmente : >>writeInto: subjectObject value: valueObject "Private - Set the attribute of subjectObject described by the receiver to valueObject." (subjectObject perform: self getSelector) == valueObject ifTrue: [^self]. (MessageBox confirm: self confirm caption: self caption) ifTrue: [^super writeInto: subjectObject value: valueObject] Definitivamente NO. No es una opcion subclasificar para eso. Por que no haces un Presenter y le pasas al Aspect que use ese presenter. En ese mismo presenter, cuando cambia un valor (o cuando pirde foco), implementas que confirme el usuario. Si tengo tiempo despues te paso un ejemplo. Saludos GallegO -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] http://www.clubSmalltalk.org Yahoo! Cocina Encontra las mejores recetas con Yahoo! Cocina. http://ar.mujer.yahoo.com/cocina/ -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] http://www.clubSmalltalk.org
