<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -332,6 +332,11 @@ NSString * const ControllerString = @&quot;Controller&quot;;
 	[self needsUpdate:TitaniumViewControllerRefreshIsAnimated];
 }
 
+- (void) setToolbarProxies: (NSArray *) newProxies;
+{
+	[self setToolbarItems:[newProxies valueForKey:@&quot;nativeBarButton&quot;]];
+}
+
 - (void) setToolbarItems: (NSArray *) newItems;
 {
 	if (newItems == toolbarItems) return;</diff>
      <filename>iphone/Classes/TitaniumViewController.m</filename>
    </modified>
    <modified>
      <diff>@@ -107,10 +107,17 @@ TitaniumViewController * mostRecentController = nil;
 {
 	[super setView:newView];
 	if (newView == nil) {
+		[self setContentView:nil];
 		[self setWebView:nil];
 	}
 }
 
+//- (void) setContentView: (UIView *) newContentView;
+//{
+//	[super setContentView:newContentView];
+//}
+
+
 - (void) setWebView: (UIWebView *) newWebView;
 {
 	if (newWebView == webView) return;
@@ -121,7 +128,7 @@ TitaniumViewController * mostRecentController = nil;
 	}
 	
 	if (newWebView == nil) { //Possibly deallocation.
-		if (1) { //This should be a javascript check.
+		if (0) { //This should be a javascript check.
 			[webView removeFromSuperview];
 			[webView release];
 			webView = nil;
@@ -131,13 +138,13 @@ TitaniumViewController * mostRecentController = nil;
 	
 	//Now if we have an old view and new view, the old view has to kill the new one. There can be only one!
 	//But we're not fully set yet? Let's find out.
-	NSLog(@&quot;Two web views go in! NewWebView %@ has %@ as a superview&quot;,[newWebView superview]);
+	NSLog(@&quot;Two web views go in! NewWebView %@ has %@ as a superview&quot;,newWebView,[newWebView superview]);
 	
 	[[newWebView superview] insertSubview:webView belowSubview:newWebView];
 	[webView setFrame:[newWebView frame]];
 	[newWebView removeFromSuperview];
-
-	NSLog(@&quot;One comes out! webView %@ has %@ as a superview&quot;,[webView superview]);
+	[[webView superview] setAlpha:1.0];
+	NSLog(@&quot;One comes out! webView %@ has %@ as a superview&quot;,webView,[webView superview]);
 }
 
 </diff>
      <filename>iphone/Classes/TitaniumWebViewController.m</filename>
    </modified>
    <modified>
      <diff>@@ -93,6 +93,38 @@
 		c.send();
 
 	};
+	
+	
+Titanium.Media.openPhotoGallery({
+	success: function(image,details) {
+		var query = 'http://twitpic.com/api/uploadAndPost?password=rogue10&amp;username=kevinwhinnery';
+    var xhr = Titanium.Network.createHTTPClient();
+		xhr.onreadystatechange = function() {
+      if (this.readyState == 4) {
+				Titanium.API.debug(this.responseText);
+			}
+		};
+		xhr.open('POST',query);
+		xhr.send({media:image});
+		//Titanium.Platform.openURL($(this).attr(&quot;href&quot;));
+	},
+	error: function(error) {
+		Titanium.UI.createAlertDialog( {
+			title: &quot;Error from Gallery&quot;,
+			message: error.message,
+			buttonNames: OK
+			}).show();
+	},
+	cancel: function() {
+		//no op
+	},
+	allowImageEditing:true
+});
+
+	
+	
+	
+	
 &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;</diff>
      <filename>iphone/Resources/network.html</filename>
    </modified>
    <modified>
      <diff>@@ -27,7 +27,7 @@
 		var btn5 = Ti.UI.createButton({title:'Moo'});
 		btn5.addEventListener('click',function(){Ti.UI.currentWindow.setFullscreen(true);});
 
-		var btn6 = Ti.UI.createSwitch({value:true,div:'sliderPlace'});
+		var btn6 = Ti.UI.createTextField({value:'Texty!',div:'sliderPlace'});
 //		btn6.width=100;
 		btn6.addEventListener('change',function(foo){document.getElementById('sliderValue').innerHTML='Newvalue' + foo.value;});
 //		btn6.addEventListener('valuechange',function(foo){
@@ -130,7 +130,7 @@ try{
 		e.index // index of clicked button
 	});
 
-	var switchInstance = Titanium.UI.createSlider({value:0.5});
+	var switchInstance = Titanium.UI.createTextField({value:'More text',width:170});
 	switchInstance.addEventListener('change',function(foo){document.getElementById('sliderValue').innerHTML='NewText: ' + foo.value;});
 
 //	var switchInstance = Ti.UI.createButton('activity');
@@ -254,6 +254,77 @@ try{
 
 	};
 //	alert('Orientation:' + window.orientation);
+	function showOptionsDialog()
+	{
+		// create dialog
+		var dialog = Titanium.UI.createOptionDialog();
+
+		// set button titles
+		dialog.setOptions([&quot;Pick A&quot;,&quot;Pick B&quot;,&quot;cancel&quot;]);
+
+		// set index for destructive button (IPHONE ONLY)
+		dialog.setDestructive(1);
+
+		// set index for cancel (IPHONE ONLY)
+		dialog.setCancel(2);
+
+		// set title
+		dialog.setTitle('My Title');
+
+		// add event listener
+		dialog.addEventListener('click',function(event)
+		{
+			var a = Titanium.UI.createAlertDialog();
+			a.setMessage('you clicked ' + event.index);
+			a.show();
+		});
+
+		// show dialog
+		dialog.show();
+		
+	};
+
+
+	function openPhotoGallery()
+	{
+		Titanium.Media.openPhotoGallery({
+			success: function(image,details)
+			{
+				var win = Titanium.UI.createWindow();
+				win.setURL('image.html');
+				Titanium.App.Properties.setString('photo',image.url);
+				if (details) {
+					Titanium.App.Properties.setString('x',details.cropRect.x);
+					Titanium.App.Properties.setString('y',details.cropRect.y);
+					Titanium.App.Properties.setString('height',details.cropRect.height);
+					Titanium.App.Properties.setString('width',details.cropRect.width);
+				} else {
+					Titanium.App.Properties.setString('x',0);
+					Titanium.App.Properties.setString('y',0);
+					Titanium.App.Properties.setString('height',image.height);
+					Titanium.App.Properties.setString('width',image.width);
+				}
+				win.open({animated:true});
+			},
+			error: function(error)
+			{
+				Titanium.UI.createAlertDialog( {
+					title: &quot;Error from Gallery&quot;,
+					message: error.message,
+					buttonNames: OK
+				} ).show();
+			},
+			cancel: function()
+			{
+
+			},
+			allowImageEditing:true
+		});
+		
+	};
+
+
+
 &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
@@ -276,7 +347,7 @@ try{
 	&lt;div id='sliderValue'&gt;Unchanged slider value!&lt;/div&gt;
 
 	&lt;div id='sliderPlace' style=&quot;width:200px;height:70px;&quot;&gt;&lt;/div&gt;
-	
+	&lt;button onclick=&quot;showOptionsDialog()&quot;&gt;
 	
 &lt;/body&gt;
 &lt;/html&gt;
\ No newline at end of file</diff>
      <filename>iphone/Resources/ui.html</filename>
    </modified>
    <modified>
      <diff>@@ -312,11 +312,11 @@
 				B413A67E0F7998C500B1C47D /* TitaniumAppProtocol.h */,
 				B413A67F0F7998C500B1C47D /* TitaniumAppProtocol.m */,
 				B413A7510F79A58000B1C47D /* TitaniumCmdThread.h */,
-				B413A7520F79A58000B1C47D /* TitaniumCmdThread.m */,
 				B4864F5A0F7C48E700A851C5 /* TitaniumUIViewController.h */,
 				B4864F5B0F7C48E700A851C5 /* TitaniumUIViewController.m */,
 				B45CA77D0F81565D00B80900 /* TitaniumHost.h */,
 				B45CA77E0F81565D00B80900 /* TitaniumHost.m */,
+				B413A7520F79A58000B1C47D /* TitaniumCmdThread.m */,
 				B4E9BC070F85491F00DD709C /* TitaniumJSConstants.h */,
 				B4E9BC080F85491F00DD709C /* TitaniumJSConstants.m */,
 				B408AD460F97FA010051FD67 /* TitaniumActionSheetHelper.h */,</diff>
      <filename>iphone/Titanium.xcodeproj/project.pbxproj</filename>
    </modified>
    <modified>
      <diff>@@ -25,6 +25,10 @@
 	//For activity spinners
 	UIActivityIndicatorViewStyle spinnerStyle;
 	
+	//Tinting or BG controls
+	UIColor * elementColor;
+	UIColor * elementBackgroundColor;	
+
 	//Yes, even integer and bools are represented as floats.
 	float minValue;		//Default is 0
 	float maxValue;		//Default is 1</diff>
      <filename>iphone/modules/UiModule/UiModule.h</filename>
    </modified>
    <modified>
      <diff>@@ -166,11 +166,8 @@ int barButtonSystemItemForString(NSString * inputString){
 	CGRect viewFrame=frame;
 	if (forBar){
 		viewFrame.size.height = 40.0;
-	}
-	if (viewFrame.size.width &lt; 1.0){
-		viewFrame.size.width = 30.0;
-	}
-
+	} else if (viewFrame.size.height &lt; 2) viewFrame.size.height = 20;
+	if (viewFrame.size.width &lt; 2) viewFrame.size.width = 30;
 
 	if (templateValue == UITitaniumNativeItemSpinner){
 		if ([nativeView isKindOfClass:[UIActivityIndicatorView class]]){
@@ -207,6 +204,7 @@ int barButtonSystemItemForString(NSString * inputString){
 		[(UISwitch *)resultView setOn:(floatValue &gt; ((minValue + maxValue)/2))];
 
 	} else if (templateValue == UITitaniumNativeItemTextField){
+		if (viewFrame.size.height &lt; 20) viewFrame.size.height = 20;
 		if ([nativeView isKindOfClass:[UITextField class]]){
 			resultView = [nativeView retain];
 			[(UIView *)resultView setFrame:viewFrame];
@@ -217,6 +215,7 @@ int barButtonSystemItemForString(NSString * inputString){
 		[(UITextField *)resultView setText:stringValue];
 		
 	} else if (templateValue == UITitaniumNativeItemTextView){
+		if (viewFrame.size.height &lt; 20) viewFrame.size.height = 20;
 		if ([nativeView isKindOfClass:[UITextView class]]){
 			resultView = [nativeView retain];
 			[(UIView *)resultView setFrame:viewFrame];
@@ -747,12 +746,12 @@ int barButtonSystemItemForString(NSString * inputString){
 	if ([barObject isKindOfClass:[NSArray class]]){
 		NSMutableArray *result = [NSMutableArray arrayWithCapacity:[barObject count]];
 		for (NSDictionary * thisButtonDict in barObject){
-			UIBarButtonItem * thisButton = [[self proxyForObject:thisButtonDict] nativeBarButton];
-			if (thisButton == nil) return;
-			[result addObject:thisButton];
+			UIButtonProxy * thisProxy = [self proxyForObject:thisButtonDict];
+			if (thisProxy == nil) return;
+			[result addObject:thisProxy];
 		}
 		
-		[ourVC performSelectorOnMainThread:@selector(setToolbarItems:) withObject:result waitUntilDone:NO];
+		[ourVC performSelectorOnMainThread:@selector(setToolbarProxies:) withObject:result waitUntilDone:NO];
 	} else if ((barObject == nil) || (barObject == [NSNull null])) {
 		[ourVC performSelectorOnMainThread:@selector(setToolbarItems:) withObject:nil waitUntilDone:NO];
 	}
@@ -977,6 +976,7 @@ int barButtonSystemItemForString(NSString * inputString){
 			&quot;return res;}&quot;;
 	TitaniumJSCode * createAlertCode = [TitaniumJSCode codeWithString:
 			@&quot;function(args){var res={};for(prop in args){res[prop]=args[prop];};&quot;
+			&quot;if(args &amp;&amp; args.buttonNames){res.options=args.buttonNames;}&quot;
 			&quot;res._TOKEN='MDL'+(Ti.UI._NEXTMODAL++);Ti.UI._MODAL[res._TOKEN]=res;res.onClick=Ti._ONEVT;&quot;
 			&quot;res._EVT={click:[]};res.addEventListener=Ti._ADDEVT;res.removeEventListener=Ti._REMEVT;&quot;
 			&quot;res.setButtonNames=function(args){this.options=args;};&quot;</diff>
      <filename>iphone/modules/UiModule/UiModule.m</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>f6e514f8808fee88cf5b58e7a43518c3515b420f</id>
    </parent>
    <parent>
      <id>f081bcbdac4a27af1cdd1877546cc8525467db8a</id>
    </parent>
  </parents>
  <author>
    <name>Jeff Haynie</name>
    <email>jhaynie@jeff-haynies-macbook-pro.local</email>
  </author>
  <url>http://github.com/appcelerator/titanium_mobile/commit/92f2522c459b6467da68dcbd04d45a74b7ad8197</url>
  <id>92f2522c459b6467da68dcbd04d45a74b7ad8197</id>
  <committed-date>2009-06-29T19:18:40-07:00</committed-date>
  <authored-date>2009-06-29T19:18:40-07:00</authored-date>
  <message>Merge branch 'master' of git@github.com:appcelerator/titanium_mobile</message>
  <tree>1ac5716b03000615624b4e038388195d0deb9c11</tree>
  <committer>
    <name>Jeff Haynie</name>
    <email>jhaynie@jeff-haynies-macbook-pro.local</email>
  </committer>
</commit>
