User Tools

Site Tools


built_in:alert

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
built_in:alert [2018/05/21 13:35]
geez437 [HTML Alert]
built_in:alert [2018/05/22 02:16] (current)
Line 58: Line 58:
 { {
     //background-layout     //background-layout
-    geez437 = app.CreateLayout( "linear", "VCenter,FillXY" ); +    htmlAlertLayout = app.CreateLayout( "linear", "VCenter,FillXY" ); 
-    geez437.Animate( "FadeIn", "", 100 ); +    htmlAlertLayout.Animate( "FadeIn", "", 100 ); 
-    geez437.SetBackColor( [bclr.slice(0, 1), "33", bclr.slice(1)].join('') );+    htmlAlertLayout.SetBackColor( [bclr.slice(0, 1), "33", bclr.slice(1)].join('') );
          
     //alert-layout     //alert-layout
-    geez437Alert = app.CreateLayout( "linear", "Left" ); +    htmlAlert = app.CreateLayout( "linear", "Left" ); 
-    geez437Alert.SetBackColor( bclr ); +    htmlAlert.SetBackColor( bclr ); 
-    geez437Alert.SetSize( 0.8, 0.2 );+    htmlAlert.SetSize( 0.8, 0.2 );
          
 +    //title-text
 +    htmlAlertTitle = app.CreateText( title );
 +    htmlAlertTitle.SetTextSize( 30 );
 +    htmlAlertTitle.SetMargins( 0.02 );
 +    htmlAlertTitle.SetTextColor( clr2 );
          
-    geez437Title = app.CreateText( title ); +    //horizontal line below 
-    geez437Title.SetTextSize( 30 ); +    htmlAlertHr = app.CreateText( "", 1, 0.002 ); 
-    geez437Title.SetMargins( 0.02 ); +    htmlAlertHr.SetBackColor( clr2 );
-    geez437Title.SetTextColor( clr2 );+
          
-    geez437Hr = app.CreateText( "", 1, 0.002 ); +    //text in alert 
-    geez437Hr.SetBackColorclr2 );+    htmlAlertText = app.CreateText( "", 0.8100, "Multiline,Left"); 
 +    htmlAlertText.SetMargins( 0.02 ); 
 +    htmlAlertText.SetHtml( text ); 
 +    htmlAlertText.SetTextColorclr1 );
          
-    geez437Text = app.CreateText( "", 0.8, 100, "Multiline,Left"); +    //horizontal line below 
-    geez437Text.SetMargins( 0.02 ); +    htmlAlertHr2 = app.CreateText( "", 0.8, 0.002 ); 
-    geez437Text.SetHtml( text ); +    htmlAlertHr2.SetBackColor( clr2 );
-    geez437Text.SetTextColor( clr1 ); +
-     +
-    geez437Hr2 = app.CreateText( "", 0.8, 0.002 ); +
-    geez437Hr2.SetBackColor( clr2 ); +
-     +
-    geez437Button = app.CreateText( "Ok", 0.8, 0.055 ); +
-    geez437Button.SetPadding( 0, 0.01 ); +
-    geez437Button.SetBackColor( bclr ); +
-    geez437Button.SetTextColor( clr1 ); +
-    geez437Button.SetOnTouchUp( function() { geez437.Animate( "FadeOut", "", 100 ); app.RemoveLayout(geez437););+
          
 +    //"Ok" button
 +    htmlAlertButton = app.CreateText( "Ok", 0.8, 0.055 );
 +    htmlAlertButton.SetPadding( 0, 0.01 );
 +    htmlAlertButton.SetBackColor( bclr );
 +    htmlAlertButton.SetTextColor( clr1 );
 +    htmlAlertButton.SetOnTouchUp( function() { htmlAlertLayout.Animate( "FadeOut", "", 100 ); app.RemoveLayout( htmlAlertLayout ); } );
          
     //add objects to app     //add objects to app
-    geez437Alert.AddChild( geez437Title ); +    htmlAlert.AddChild( htmlAlertTitle ); 
-    geez437Alert.AddChild( geez437Hr ); +    htmlAlert.AddChild( htmlAlertHr ); 
-    geez437Alert.AddChild( geez437Text ); +    htmlAlert.AddChild( htmlAlertText ); 
-    geez437.AddChild( geez437Alert ); +    htmlAlertLayout.AddChild( htmlAlert ); 
-    geez437.AddChild( geez437Hr2 ); +    htmlAlertLayout.AddChild( htmlAlertHr2 ); 
-    geez437.AddChild( geez437Button ); +    htmlAlertLayout.AddChild( htmlAlertButton ); 
-    app.AddLayout( geez437 );+    app.AddLayout( htmlAlertLayout);
 } }
 </code> </code>
built_in/alert.1526909747.txt.gz · Last modified: 2018/05/21 21:35 (external edit)