Widget 2.0 newPickerWheel issues

I’m pretty sure this is another flavor of open issue 31640, which you can read about in this forum entry:

http://forums.coronalabs.com/topic/45794-tableview-positions-itself-wrong-in-10-compatibility-mode/

Yeah, it’s a 1.0 compatibility issue. tableView just doesn’t work in 1.0 compatibility.

My custom sheet is not lining up right. I’m using latest build #2014.2368. And basically the same code from the documentation. The only thing I changed was the widget image to match the dimensions used in the documentation.

There has to be a bug going on here. It’s bad enough you do not offer a basic combo list feature and now trying to make my own and I run into this?! Please help!

Can you post your code you’re using?

local widget = require("widget") local columnData = { { align = "left", width = 420, startIndex = 1, labels = {"item 1", "item 2", "item 3", "item 4", "item 5", "item 6"} } } -- Image sheet options and declaration local poptions = { frames = { { x=0, y=0, width=420, height=300 }, { x=420, y=0, width=420, height=300 }, { x=840, y=0, width=8, height=300 } }, sheetContentWidth = 848, sheetContentHeight = 300 } local pickerWheelSheet = graphics.newImageSheet( "assets/pickerwheel.png", poptions ) -- Create the widget pickerWheel = widget.newPickerWheel { top = 220, left=10, columns = columnData, fontColor = {.9, .8, .17}, sheet = pickerWheelSheet, overlayFrame = 1, overlayFrameWidth = 420, overlayFrameHeight = 320, backgroundFrame = 2, backgroundFrameWidth = 420, backgroundFrameHeight = 320, seperatorFrame = 3, seperatorFrameWidth = 8, seperatorFrameHeight = 320, columnColor = { 0.8, 0, 0 ,0} }

And I attached the pickerwheel.png as well. Any ideas why this doesn’t work?

Your sheet is 300px high.  Your widget is wanting 320px.

Is that intended?

I did adjust the sheet to 320px (no change), and I then adjusted the widget to 300px and still got the same results either way. 

I will just use a tableview widget until maybe this can be resolved. I was trying to make a combo list / drop-down style menu and realized the pickerwheel is not the way to go … Thanks for looking into this, but I will not be using it anymore.

The picker wheel widget is seriously broken if you want to use anything other than the default 640x320 screen size. I have been hacking the open source code to get something working with the app I’m currently developing, which uses a screen size of 1200x800 as recommended in the universal config.lua tutorial. There are a few fixed values in the source code that should really relate to passed parameters instead but I managed to get something working with a custom image sheet at this resolution.

A lot more work is required to make it suitably generic but it looks to be possible given time so I hope to complete this at some point. I would have thought a Corona engineer who knows the code could do a better job than me in a few hours but it’s clearly not a priority.

Take a look at Rob Miracle’s tutorial on how to create a Share Panel. It is not exactly a Combo box but it might help get you started faster with your tableView based implementation. 

http://coronalabs.com/blog/2014/04/15/tutorial-creating-a-sharing-panel/

Thanks, I’ll give it a look!

Its quite neat with the slide in & out animation. You could in theory click your display field and trigger the sharePanel code with animation towards the bottom of the screen and make it almost look like a combo box. The more I think about it the more I feel its doable and would be a nice tweak & extension of Rob’s great tutorial code. 

My custom sheet is not lining up right. I’m using latest build #2014.2368. And basically the same code from the documentation. The only thing I changed was the widget image to match the dimensions used in the documentation.

There has to be a bug going on here. It’s bad enough you do not offer a basic combo list feature and now trying to make my own and I run into this?! Please help!

Can you post your code you’re using?

local widget = require("widget") local columnData = { { align = "left", width = 420, startIndex = 1, labels = {"item 1", "item 2", "item 3", "item 4", "item 5", "item 6"} } } -- Image sheet options and declaration local poptions = { frames = { { x=0, y=0, width=420, height=300 }, { x=420, y=0, width=420, height=300 }, { x=840, y=0, width=8, height=300 } }, sheetContentWidth = 848, sheetContentHeight = 300 } local pickerWheelSheet = graphics.newImageSheet( "assets/pickerwheel.png", poptions ) -- Create the widget pickerWheel = widget.newPickerWheel { top = 220, left=10, columns = columnData, fontColor = {.9, .8, .17}, sheet = pickerWheelSheet, overlayFrame = 1, overlayFrameWidth = 420, overlayFrameHeight = 320, backgroundFrame = 2, backgroundFrameWidth = 420, backgroundFrameHeight = 320, seperatorFrame = 3, seperatorFrameWidth = 8, seperatorFrameHeight = 320, columnColor = { 0.8, 0, 0 ,0} }

And I attached the pickerwheel.png as well. Any ideas why this doesn’t work?

Your sheet is 300px high.  Your widget is wanting 320px.

Is that intended?

I did adjust the sheet to 320px (no change), and I then adjusted the widget to 300px and still got the same results either way. 

I will just use a tableview widget until maybe this can be resolved. I was trying to make a combo list / drop-down style menu and realized the pickerwheel is not the way to go … Thanks for looking into this, but I will not be using it anymore.

The picker wheel widget is seriously broken if you want to use anything other than the default 640x320 screen size. I have been hacking the open source code to get something working with the app I’m currently developing, which uses a screen size of 1200x800 as recommended in the universal config.lua tutorial. There are a few fixed values in the source code that should really relate to passed parameters instead but I managed to get something working with a custom image sheet at this resolution.

A lot more work is required to make it suitably generic but it looks to be possible given time so I hope to complete this at some point. I would have thought a Corona engineer who knows the code could do a better job than me in a few hours but it’s clearly not a priority.

Take a look at Rob Miracle’s tutorial on how to create a Share Panel. It is not exactly a Combo box but it might help get you started faster with your tableView based implementation.