Re: WG: How to display a working actionButtonView intoaGraphicsContext?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: WG: How to display a working actionButtonView intoaGraphicsContext?

Steven Kelly

From the buttonView example code below, it looks like you’re just displaying the button onto the GraphicsContext. That will certainly make it appear, but it won’t make it “really there”: no fly-by help, no action when you click, no redisplay when that part of the window is obscured and revealed. You want to add it to some CompositePart that’s part of the window’s component hierarchy. A CompositePart knows how to ask its components to display themselves when needed (so you don’t need to send #displayOn: explicitly to the buttonView), and how to forward events to the components.

 

There’s quite a lot of work to do to hook up a new button into an existing window – see #actionButton:into:.  The Panel class is a new way of doing this: in 7.7.1, see SUnitStatusBar>>addButtons in RBSUnitExtensions.

 

An alternative may be to have the button in the window from the start, but marked as invisible in the windowSpec. When the selection changes, you can then move it to the correct position and make it visible.

 

Finally, the Dataset widget allows a row to contain input fields, checkboxes and combo boxes, but also an “Arbitrary View” – maybe you can use that to host a button? A quick look at ArbitraryView hints that it might not be set up to respond to input, but I may be wrong.

 

Of course, the simplest way is just to have a button as a permanent part of the UI, outside the list. Enable and disable it according to whether there is a selection in the list. Or then forget the button and just make the list double-clickable. But these are changes to your design, rather than implementations of it.

 

All the best,

Steve

 

Gruenewald, Tom" <[hidden email]> wrote:
I have to upgrade an already existing custom list view (subclass: View).
Until now each list item included only simple visual components, like text labels and images. But no interactive components, like action buttons, etc.
Now my task is to display a working action button in a list item, if it is selected.


I don't like to reinvent the list component, so I've tried to display a ActionButtonView into the GraphicsContext. But all my approach failed.


Until now, my best and also simplest try was:


buttonView := myBuilder policy actionButtonClass new.
buttonView label: anImage.
buttonView displayOn: aGraphicsContext at: aPoint.


The button is displayed in the list. But I am not able to make it working. I cannot assign the desired action. Also the fly-by-help does not work.
Assigning the proper controller seem not to help.


buttonView controller: buttonView defaultController.


Can someone give me an advice please? And in general: Is this a good or a bad approach?
And how to get the default "actionButtonClass" without using the builder? I've tried to get the information by the DefaultLookPolicy. Without success.
Thank you for your answers.

Best regards,
Tom Grünewald

________

Carl Zeiss Industrielle Messtechnik GmbH
Softwareentwicklung/Software Development

T o m G r ü n e w a l d

73446 Oberkochen, Germany
tel: +49.7364.20-8541
fax: +49.7364.20-4800
email: [hidden email]
http://www.zeiss.de/imt

Carl Zeiss Industrielle Messtechnik GmbH
Carl–Zeiss–Straße 22, 73447 Oberkochen
Aufsichtsratsvorsitzender: Dr. Dieter Kurz
Geschäftsführer: Dr. Rainer Ohnheiser, Felix Hoben, Axel Jaeger
Sitz der Gesellschaft: 73446 Oberkochen, Deutschland
Handelsregister: Amtsgericht Ulm, HRB 501561
USt–IdNr.: DE 811 515 346


----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: WG: How to display a working actionButtonView intoaGraphicsContext?

Annick
<base href="x-msg://65/">You can also create aBuilder with a source on your model.
Then create a ButtonSpec as described in the specs.
Builder add: spec.
and look at the code "reinstallInterface".

It will give you a workable widget, linked with the Sensor

Le 1 déc. 2010 à 10:25, Steven Kelly a écrit :

From the buttonView example code below, it looks like you’re just displaying the button onto the GraphicsContext. That will certainly make it appear, but it won’t make it “really there”: no fly-by help, no action when you click, no redisplay when that part of the window is obscured and revealed. You want to add it to some CompositePart that’s part of the window’s component hierarchy. A CompositePart knows how to ask its components to display themselves when needed (so you don’t need to send #displayOn: explicitly to the buttonView), and how to forward events to the components.
 
There’s quite a lot of work to do to hook up a new button into an existing window – see #actionButton:into:.  The Panel class is a new way of doing this: in 7.7.1, see SUnitStatusBar>>addButtons in RBSUnitExtensions.
 
An alternative may be to have the button in the window from the start, but marked as invisible in the windowSpec. When the selection changes, you can then move it to the correct position and make it visible.
 
Finally, the Dataset widget allows a row to contain input fields, checkboxes and combo boxes, but also an “Arbitrary View” – maybe you can use that to host a button? A quick look at ArbitraryView hints that it might not be set up to respond to input, but I may be wrong.
 
Of course, the simplest way is just to have a button as a permanent part of the UI, outside the list. Enable and disable it according to whether there is a selection in the list. Or then forget the button and just make the list double-clickable. But these are changes to your design, rather than implementations of it.
 
All the best,
Steve
 

Gruenewald, Tom" <[hidden email]> wrote: 
I have to upgrade an already existing custom list view (subclass: View).
Until now each list item included only simple visual components, like text labels and images. But no interactive components, like action buttons, etc.
Now my task is to display a working action button in a list item, if it is selected.


I don't like to reinvent the list component, so I've tried to display a ActionButtonView into the GraphicsContext. But all my approach failed.


Until now, my best and also simplest try was:


buttonView := myBuilder policy actionButtonClass new.
buttonView label: anImage.
buttonView displayOn: aGraphicsContext at: aPoint.


The button is displayed in the list. But I am not able to make it working. I cannot assign the desired action. Also the fly-by-help does not work.
Assigning the proper controller seem not to help.


buttonView controller: buttonView defaultController.


Can someone give me an advice please? And in general: Is this a good or a bad approach?
And how to get the default "actionButtonClass" without using the builder? I've tried to get the information by the DefaultLookPolicy. Without success.
Thank you for your answers.

Best regards,
Tom Grünewald

________

Carl Zeiss Industrielle Messtechnik GmbH
Softwareentwicklung/Software Development

T o m G r ü n e w a l d

73446 Oberkochen, Germany
tel: +49.7364.20-8541
fax: +49.7364.20-4800
email: [hidden email]
http://www.zeiss.de/imt

Carl Zeiss Industrielle Messtechnik GmbH
Carl–Zeiss–Straße 22, 73447 Oberkochen
Aufsichtsratsvorsitzender: Dr. Dieter Kurz
Geschäftsführer: Dr. Rainer Ohnheiser, Felix Hoben, Axel Jaeger
Sitz der Gesellschaft: 73446 Oberkochen, Deutschland
Handelsregister: Amtsgericht Ulm, HRB 501561
USt–IdNr.: DE 811 515 346
 

----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted. 
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


----------------------------------------
This message is intended for a particular addressee only and may contain business or company secrets. If you have received this email in error, please contact the sender and delete the message immediately. Any use of this email, including saving, publishing, copying, replication or forwarding of the message or the contents is not permitted.

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: WG: How to display a working actionButtonView intoaGraphicsContext?

Travis Griggs-4
In reply to this post by Steven Kelly

On Dec 1, 2010, at 1:25 AM, Steven Kelly wrote:

From the buttonView example code below, it looks like you’re just displaying the button onto the GraphicsContext. That will certainly make it appear, but it won’t make it “really there”: no fly-by help, no action when you click, no redisplay when that part of the window is obscured and revealed. You want to add it to some CompositePart that’s part of the window’s component hierarchy. A CompositePart knows how to ask its components to display themselves when needed (so you don’t need to send #displayOn: explicitly to the buttonView), and how to forward events to the components.
 
There’s quite a lot of work to do to hook up a new button into an existing window – see #actionButton:into:.  The Panel class is a new way of doing this: in 7.7.1, see SUnitStatusBar>>addButtons in RBSUnitExtensions.
 
An alternative may be to have the button in the window from the start, but marked as invisible in the windowSpec. When the selection changes, you can then move it to the correct position and make it visible.
 
Finally, the Dataset widget allows a row to contain input fields, checkboxes and combo boxes, but also an “Arbitrary View” – maybe you can use that to host a button? A quick look at ArbitraryView hints that it might not be set up to respond to input, but I may be wrong.
 
Of course, the simplest way is just to have a button as a permanent part of the UI, outside the list. Enable and disable it according to whether there is a selection in the list. Or then forget the button and just make the list double-clickable. But these are changes to your design, rather than implementations of it.

Good explanations and ideas there.

Another way of putting this, is that SequenceView (list views) don't support "children". So while you can create one, and dispatch is displayOn: method, you haven't really inserted the button into the view tree in that parent-child way that allows the widget to know where it is, how big it is, process events, be invalidated, etc.

In VisualWorks, you have three basic classifications of widgets w.r.t. "childability":
1) Sterile widgets (the default implemented at the VisualPart level), 0 children
2) Widgets with exactly one child (the Wrapper class hierarchy)
3) Widgets with 0 or more children, as implemented by the CompositePart hierarchy

I think this is wrong, but that's another chat.

Panel is an attempt to develop an API that could some day be hoisted up to VisualPart, thus allowing the *potential* for any widget to easily support children. It is not ready yet. :)

--
Travis Griggs
Objologist
For every adage, there is an equal and contrary un-adage


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc