New Candy Lib: Widget Candy for Corona

@x-pressive.com Is there a way to add a multi-line input text box?

I really need this in my message box?

If I cant add the widget candy can I somehow use the corona native input text?

Thanks

Larry [import]uid: 11860 topic_id: 25953 reply_id: 115509[/import]

@doubleslashdesign you can use disableInput = true to disable the default onPress function for the widget candy input box. What this will do is allow you to attach your own onPress listener to the text box. I did this to create a multiline text. You can still access the box’s props so you can change the Props.caption of the box and make it work exactly like the default widget candy listener but, with your multiline text input! I also used this function to fix the problem with the textbox on android devices so its very handy. Now if you want the actual widget candy widget box to be multiline also i believe you will have to make your own. Because widget candy does not have a graphic for a large input text box. [import]uid: 126161 topic_id: 25953 reply_id: 115511[/import]

Hey Folks,
I purchased the Widget Candy library and I really believe it has a lot of potential. Unfortunately, I’m kind of slow and I could use a few more examples. I would really like to have the ability to do more cascading type lists. I like the changing list example that comes with the library, but I’d like to be able to cascade several lists- and then at the end, I’d like to be able click on a list item and get a screen with checkbox widgets to set options for the list item I selected.

Maybe storyboard is what I’m looking for. Is it possible you folks could show a storbyboard example where you display a list in one scene, clicking on a list item in that list takes you to a list on another scene and then clicking a list item in that list takes you to another scene where there are a bunch of widgets?

I’m going to keep plodding ahead on my own and if I come up with anything I’ll share.
Thanks! [import]uid: 104085 topic_id: 25953 reply_id: 115538[/import]

Ok, I think I answered my own question. Widget Candy comes with two example projects. The one called Widget Candy is the one I used to get cascading lists. I just took the menu.lua file and copied it. Then, I pointed the list item in menu.lua to the new file (students.lua). In the students.lua file, I pointed the individual list items to the toggle button example file.

One thing that is a little tricky is that the _G. variables (the names of the lists and the buttons, etc.) must be different from file to file. If they are the same, nothing works.

Also, I had problems when I used a different theme from file to file. And, when I had errors in my .remove function, it caused problems with the Back button.

After a bit of troubleshooting, however, I got everything to work. If you folks at Widget Candy would like to see what I did and maybe incorporate it into your samples, I’d be happy to help. [import]uid: 104085 topic_id: 25953 reply_id: 115567[/import]

I have a question for @ x-pressive.com

I am wondering what the reason was behind coding the widget creation functions to write, delete data into/from the table we provide as a parameter?

I came across this when I was creating a collection of widgets from a table description.

For example:

--The Table Description for my label  
local t = {   
 textColor = {255,255,255},  
 fontSize = "64",  
 parentGroup = "WIN\_SAMPLE",   
 x = "center",  
 y = -5,  
 name = "MyWidget",  
 theme = "theme\_1",  
 width = "20%",  
 caption = "My Label",  
 textAlign = "left",  
 icon = nil,  
 }   
  
--print the table   
print("------------------\>Before Create")  
for i,v in pairs(t) do  
 print(i,v)  
end  
  
--create a label from my description  
local myLabel = \_G.GUI.NewLabel(t)  
--Lets see what was added  
print("-------------------\>After Create")  
for i,v in pairs(t) do  
 print(i,v)  
end  
--Delete the widget  
myLabel:destroy()  
--Where did my data go?  
print("----------------\>After Destroy")  
for i,v in pairs(t) do  
 print(i,v)  
end  

So I looked at the source code and found that it was indeed writing directly into the table that I had provided as a parameter.

[update]
It’s not an issue, just wondering about the style is all.

Since widget candy does not use meta tables, you still load from a table description by doing the following:

  
t = {}  
setmetatable(t, {\_\_index=tableDescription}  
  
local myLabel = \_G.GUI.NewLabel(t)  
  

With this code, the NewLabel method will write into"t" and not into “tableDescription”. Also it will prevent the Widget from deleting key/values from “tableDescription” when you call destroy. “t” gets its values deleted instead.

-Phil
.
[import]uid: 106158 topic_id: 25953 reply_id: 115722[/import]

I’m not able to get the drag button to work - the drag icon appears, but no bubble is created when I drag in the simulator. Have not tried on the device. Anyone else have this experience? I’m using daily build 883, and OS 10.8.

[import]uid: 96383 topic_id: 25953 reply_id: 120942[/import]

Does the included drag button sample work on your machine? If so, could you please send us a trimmed version of your code (support.at.x-pressive.com) ? If the included drag button sample doesn’t work either, you could try another build to narrow down this issue. [import]uid: 10504 topic_id: 25953 reply_id: 120980[/import]

We need to have custom icons for each list item for the list widget. A while back you posted that:

>>

However, we’re also planning to add a list widget that can hold any custom display object group, so you can add multiline texts, shapes, custom images, whatever, then.

<<

Have you done that yet?

Thanks. [import]uid: 8780 topic_id: 25953 reply_id: 121252[/import]

The latest Widget Candy version supports custom icons to be used with list items. It has not been released yet (we’re testing it right now) but you could give it a try -please send an email to [support at x-pressive.com].

We’re also working on a list widget that supports custom list items, but this has not been implemented yet.

[import]uid: 10504 topic_id: 25953 reply_id: 121316[/import]

I’m not able to get the drag button to work - the drag icon appears, but no bubble is created when I drag in the simulator. Have not tried on the device. Anyone else have this experience? I’m using daily build 883, and OS 10.8.

[import]uid: 96383 topic_id: 25953 reply_id: 120942[/import]

Does the included drag button sample work on your machine? If so, could you please send us a trimmed version of your code (support.at.x-pressive.com) ? If the included drag button sample doesn’t work either, you could try another build to narrow down this issue. [import]uid: 10504 topic_id: 25953 reply_id: 120980[/import]

We need to have custom icons for each list item for the list widget. A while back you posted that:

>>

However, we’re also planning to add a list widget that can hold any custom display object group, so you can add multiline texts, shapes, custom images, whatever, then.

<<

Have you done that yet?

Thanks. [import]uid: 8780 topic_id: 25953 reply_id: 121252[/import]

The latest Widget Candy version supports custom icons to be used with list items. It has not been released yet (we’re testing it right now) but you could give it a try -please send an email to [support at x-pressive.com].

We’re also working on a list widget that supports custom list items, but this has not been implemented yet.

[import]uid: 10504 topic_id: 25953 reply_id: 121316[/import]

Hi Friends

Is it possible to have scroll view on text field using candy widget?

regards
Varun [import]uid: 130269 topic_id: 25953 reply_id: 128619[/import]

Hi Friends

Is it possible to have scroll view on text field using candy widget?

regards
Varun [import]uid: 130269 topic_id: 25953 reply_id: 128619[/import]

  1. I have a standard Corona display object drawn on top of a Widget Candy button so you can’t see the button.

  2. the Display object has a listener function which returns true, which should catch all touch events and prevent them from reaching the Widget Candy button.

BUT: the Widget Candy button fires every time. I cannot keep the Widget Candy button from reading taps by returning true in this listener. The listener effectively prevents touch events from propagating down to other non Widget Candy objects though. Any thoughts? Here’s some code you could copy and paste.

[lua]_G.GUI = require(“widget_candy”)
_G.GUI.LoadTheme(“theme_5”, “themes/theme_5/”)

BG = display.newRect( 0, 0, 768, 1024 )
BG ( 255, 255, 255 )

_G.GUI.NewButton(
{
x = “center”,
y = “center”,
width = “50%”,
name = “MyButton”,
theme = “theme_5”,
icon = 2,
caption = “Touch me!”,
onPress = function( EventData ) print(“I WAS PRESSED!”) end,
} )

function tinter2Func (event)
print ( “tinter” )
return true
end

tinter2 = display.newRect( 0, 0, 768, 1024 )
tinter2:setFillColor ( 0, 0, 0 )
tinter2.alpha = .3
tinter2:addEventListener ( “tap”, tinter2Func )[/lua]

It’s a serious problem at the moment, I have a data intensive app which was designed from the beginning with an interactive help screen in mind, but now when I implement the help screen I am firing off all the underlying Widgets! [import]uid: 177244 topic_id: 25953 reply_id: 130545[/import]

  1. I have a standard Corona display object drawn on top of a Widget Candy button so you can’t see the button.

  2. the Display object has a listener function which returns true, which should catch all touch events and prevent them from reaching the Widget Candy button.

BUT: the Widget Candy button fires every time. I cannot keep the Widget Candy button from reading taps by returning true in this listener. The listener effectively prevents touch events from propagating down to other non Widget Candy objects though. Any thoughts? Here’s some code you could copy and paste.

[lua]_G.GUI = require(“widget_candy”)
_G.GUI.LoadTheme(“theme_5”, “themes/theme_5/”)

BG = display.newRect( 0, 0, 768, 1024 )
BG ( 255, 255, 255 )

_G.GUI.NewButton(
{
x = “center”,
y = “center”,
width = “50%”,
name = “MyButton”,
theme = “theme_5”,
icon = 2,
caption = “Touch me!”,
onPress = function( EventData ) print(“I WAS PRESSED!”) end,
} )

function tinter2Func (event)
print ( “tinter” )
return true
end

tinter2 = display.newRect( 0, 0, 768, 1024 )
tinter2:setFillColor ( 0, 0, 0 )
tinter2.alpha = .3
tinter2:addEventListener ( “tap”, tinter2Func )[/lua]

It’s a serious problem at the moment, I have a data intensive app which was designed from the beginning with an interactive help screen in mind, but now when I implement the help screen I am firing off all the underlying Widgets! [import]uid: 177244 topic_id: 25953 reply_id: 130545[/import]

Kayaych,
Corona seems to ignore the return true with tap events (at least when there is a touch listener object beneath a tappable object) -use the touch event instead to make this work:

[lua]tinter2Func = function (event)
if event.phase == “began” then
print ( “tinter” )
end
return true
end

tinter2 = display.newRect( 0, 0, 768, 1024 )
tinter2:setFillColor ( 0, 0, 0 )
tinter2.alpha = .3
tinter2:addEventListener ( “touch”, tinter2Func )[/lua]

When using a touch event with return true instead of a tap event, the event will not passed to the underlying button anymore. [import]uid: 10504 topic_id: 25953 reply_id: 130600[/import]

Kayaych,
Corona seems to ignore the return true with tap events (at least when there is a touch listener object beneath a tappable object) -use the touch event instead to make this work:

[lua]tinter2Func = function (event)
if event.phase == “began” then
print ( “tinter” )
end
return true
end

tinter2 = display.newRect( 0, 0, 768, 1024 )
tinter2:setFillColor ( 0, 0, 0 )
tinter2.alpha = .3
tinter2:addEventListener ( “touch”, tinter2Func )[/lua]

When using a touch event with return true instead of a tap event, the event will not passed to the underlying button anymore. [import]uid: 10504 topic_id: 25953 reply_id: 130600[/import]

Works like a charm! Much appreciated. And really good to know about the Corona touch / tap issue. [import]uid: 177244 topic_id: 25953 reply_id: 130614[/import]