Skip to content

Conversation

@GWydouw
Copy link

@GWydouw GWydouw commented Jan 26, 2014

Image button with images for default and active state (mouse down)

Methods:
ImageButton.file=
ImageButton.activestatefile=

Event:
ImageButton.on( :click ) {|control| ... }

example toggle image button:
@@active_toggle = false
img_active = SKUI::ImageButton.new(css_path + "icons/off_red.png",css_path + "/icons/off_red_pushed.png")
img_active.on( :click ) {
if @@active_toggle == false
img_active.file = (css_path + "/icons/on_green.png")
img_active.activestatefile = (css_path + "/icons/on_green_pushed.png")
@@active_toggle = true
else
img_active.file = (css_path + "/icons/off_red.png")
img_active.activestatefile = (css_path + "/icons/off_red_pushed.png")
@@active_toggle = false
end
}
@@skui.add_control(img_active)

@GWydouw GWydouw closed this Jan 26, 2014
@GWydouw GWydouw reopened this Jan 26, 2014
@thomthom
Copy link
Owner

I got an issue open #32 to review events for controls.

Having a click event for Image, or any control would be useful.

I am however wondering what the purpose for this control is? One can customize visual style via CSS, if you want buttons that look different.

Just trying to keep the number of controls simple and generic. Can you describe the use scenario for this?

@thomthom
Copy link
Owner

I'm just wondering if it's enough to add events to the Image class. And then you can for instance make a sub-class where you set the different images. (Though I need to #81 for that.)

@GWydouw
Copy link
Author

GWydouw commented Jan 27, 2014

Thomas,

I made a short movie to demonstrate the use of it. The dialog is made completely with SKUI, all the icons are ImageButtons.

Guy

architectuurburo wydouw bvba
architect Guy Wydouw

Hoevensebaan 238 | 2950 Kapellen
T 03/327.95.67 | F 03/327.95.68 | GSM 0496/26.25.87
E-mail guy@wydouw.be | www.wydouw.be

Op 26-jan.-2014, om 20:27 heeft Thomas Thomassen notifications@github.com het volgende geschreven:

I got an issue open #32 to review events for controls.

Having a click event for Image, or any control would be useful.

I am however wondering what the purpose for this control is? One can customize visual style via CSS, if you want buttons that look different.

Just trying to keep the number of controls simple and generic. Can you describe the use scenario for this?


Reply to this email directly or view it on GitHub.

@thomthom
Copy link
Owner

Right, I think I'd prefer to modify the existing controls to allow subclassing. As this is practically a button - or an image with events. I want to avoid hybrids. Give me a couple of days to tweak it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants