Created
March 10, 2010 12:33
-
-
Save ranguard/327817 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Not correct (last label in bad location) - but useful for reference | |
var prices = [ | |
'175', | |
'250', | |
'350', | |
'500', | |
'700', | |
'1000', | |
'2000' | |
]; | |
var price_units = prices.length; | |
var bar_width = 300; | |
for(var i=0; i < price_units; i++) { | |
var text = prices[i] + 'k'; | |
if(i == prices.length) { | |
text += '+'; | |
} | |
var left = factory.default_left() + (i * (bar_width / (price_units - 1))); | |
Ti.API.info(text + " -> " + left); | |
var thing = factory.addLabel({ | |
top: local_top, | |
win: view_search_options, | |
label_height: 30, | |
left: left, | |
text: text | |
}); | |
} | |
local_top += 40; | |
var basicSlider = Titanium.UI.createSlider({ | |
min:0, | |
max: price_units, | |
value:1, | |
width:bar_width, | |
height:'auto', | |
top:local_top, | |
}); | |
basicSlider.addEventListener('change',function(e) | |
{ | |
var foo = prices[Math.floor(e.value)]; | |
Ti.API.info("NP:" + foo); | |
price.text = 'v = ' + factory.priceOut(foo) + ' act val ' + basicSlider.value; | |
}); | |
view_search_options.add(basicSlider); | |
local_top += 40; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment