underline.idbarsoft.com

Simple .NET/ASP.NET PDF document editor web control SDK

function OnLogin() { var usernameCtrl = $('username').control; var passwordCtrl = $('password').control; var loggingInMsgCtrl = $('loggingInMsg').control; var loginFailureMsgCtrl = $('loginFailureMsg').control; Web.TypeDescriptor.setProperty(loggingInMsgCtrl, 'style', 'inline', 'display'); Web.TypeDescriptor.setProperty(loginFailureMsgCtrl, 'style', 'none', 'display'); Web.Services.AuthenticationService.login( usernameCtrl.get_text(), passwordCtrl.get_text(), OnLoginComplete); return false; } This script first sets up four vars, each an instance of a control. The first two are the TextBox controls where the username and password are entered. The next two are simple Label controls that are used to mark the progress of the login. When you first click the button, it displays a Logging in message. Later upon a failure, it indicates that you failed (as in Figure 7-12). These labels get referenced using the controls loggingInMsgCtrl and loginFailureMsgCtrl. The script then sets up how they should appear using their style properties. Most interesting is the call to the web service that processes the login. This is performed in this line: Web.Services.AuthenticationService.login( usernameCtrl.get_text(), passwordCtrl.get_text(), OnLoginComplete); Web.Services.AuthenticationService is a static class contained in the AtlasRuntime.js file that allows you to authenticate using the ASP .NET 2.0 membership application service. You pass it the username and password and the name of the function to call once the logging in is complete. This allows your Atlas applications to use the standard ASP .NET 2.0 authentication system. As you can see in this call, the script defines OnLoginComplete to handle the callback once the login is complete. Here s the OnLoginComplete script: function OnLoginComplete() { var usernameCtrl = $('username').control; var passwordCtrl = $('password').control; Web.Services.AuthenticationService.validateUser( usernameCtrl.get_text(), passwordCtrl.get_text(), OnLoginValidationComplete); return false; }

barcode font in excel 2010, barcode software excel 2007, barcode add in for word and excel pour windows, barcode generator excel 2013 free, barcode data entry excel, barcode fonts for excel 2010, excel barcode add in, using barcode in excel 2010, barcode in excel 2013, microsoft excel barcode formula,

Then we could use the enum as shown in Example 6-9.

// Run the turtle for the specified duration // Returns one of the TurtleError values if a failure // occurs, or TurtleError.OK if it succeeds public TurtleError RunFor(double duration) { if (LeftMotorState == MotorState.Stopped && RightMotorState == MotorState.Stopped) { // If we are at a full stop, nothing will happen return TurtleError.OK; } // The motors are both running in the same direction // then we just drive if ((LeftMotorState == MotorState.Running && RightMotorState == MotorState.Running) || (LeftMotorState == MotorState.Reversed && RightMotorState == MotorState.Reversed)) { Drive(duration); return TurtleError.OK; } // // // if The motors are running in opposite directions, so we don't move, we just rotate about the center of the rig ((LeftMotorState == MotorState.Running && RightMotorState == MotorState.Reversed) || (LeftMotorState == MotorState.Reversed && RightMotorState == MotorState.Running)) if (!Rotate(duration)) {

{

<font size='nnn'> ... </font>: The enclosed text is shown in an alternate size. The nnn part can either be a relative size prefixed with + or , or a fixed size (an integer value). <ul> ... </ul>: Contains list items that are prefixed by bullets. <ol> ... </ol>: Contains list items that are prefixed by numbers. <li> ... </li>: The enclosed text is treated as a list item.

}

} return TurtleError.MotorStateError;

}

Another very useful tag is the img tag, which is used to insert images from files or resources into the text. Figure 9-3 shows an example tooltip. The tag s syntax looks like <img src='nnn'>, where nnn is the file name. If the file name starts with :, it refers to a resource embedded into the executable file. Listing 9-4 presents the source code for creating the example tooltip found in Figure 9-3.

So, once the login is complete, the next thing it will do is validate the user, establishing not just their identity but also their permissions. You achieve this using the validateUser web method on the authentication service. This method also defines a function to call upon the service completion, again implementing asynchrony. The function defined as the callback is OnValidationComplete. You can see it here: function OnLoginValidationComplete(result) { var loggingInMsgCtrl = $('loggingInMsg').control; Web.TypeDescriptor.setProperty(loggingInMsgCtrl, 'style', 'none', 'display'); var usernameCtrl = $('username').control; var passwordCtrl = $('password').control; passwordCtrl.set_text(''); if (result) { g_rolesRequest = RolesWebService.GetRoles(OnRolesObtained, OnRolesAcquisionTimeout); } else { loginFailure(); } } This creates a var that references the logging in the message control and sets its style. It then clears the username and password boxes. The function receives a Boolean value from the validation web service that will be true if the user is valid and false otherwise. Should it be false, as in the case I m demonstrating, the loginFailure() function will be called: function loginFailure() { var loginFailureMsgCtrl = $('loginFailureMsg').control; Web.TypeDescriptor.setProperty(loginFailureMsgCtrl, 'style', 'inline', 'display'); } This creates a control from the loginFailureMsg region of the page and sets its style to be visible: <span id="loginFailureMsg" style="color: Red; display: none;"> Login failed.<br /> Please try again. </span> So, from this flow you can see how Atlas client-side controls, using web services, are providing asynchrony in a simple-to-use, simple-to-follow, and simple-to-understand manner.

return TurtleError.RotateError;

OK so far, although it is starting to get a bit tortuous, and we re going up only one call in the stack. But let s build and run anyway:

Arthur Arthur Arthur Arthur Arthur Arthur is is is is is is at at at at at at (0,0) and is pointing at angle 0.00 radians. (0,10) and is pointing at angle 0.00 radians. (0,10) and is pointing at angle 0.00 radians. (0,-15) and is pointing at angle 0.00 radians. (0,-15) and is pointing at angle 0.00 radians. (0,-18.5355339059327) and is pointing at angle 0.00 radians.

Listing 9-4. A tooltip including an image pushButton->setToolTip( tr("<img src=':/images/qt.png'>" "You can also insert images into your tool tips.") ); It is easy to provide tooltips for all your widgets and thus give your users the support they need. A tooltip is often used to answer questions such as What does this button do and Where did that hide ruler button go When you design a tooltip, try to keep the text at a minimum because the tips are often used to quickly obtain an understanding of the various interface widgets.

   Copyright 2020.