Thursday, August 8, 2013

Reason #9: C#.NET Manages Tab Order Poorly

20 Reasons to Migrate Magic eDeveloper, uniPaaS and Magic xpa to .NET by Upgrading Rather than Converting
Reason #9: C#.NET Manages Tab Order Poorly

C#’s idea of tab order is to set the tab order in the order that the controls were created. As we all know, from experience designing forms. Controls often get moved around and arranged. The desired tab order is not oldest to newest, its left to right, top to bottom in order of z-depth. Right?

So if you were to convert your application from Magic to C#.NET instead of from Magic to Magic xpa on .NET, you are going to have to deal with this illogical tab order going forward. This is just an example of the thousands of idiosyncratic weaknesses of procedural coding in C#.NET versus .NET platform-based development in Magic.

Here’s how it works in Visual Studio C#.NET:

In Visual Studio C#.NET, the tab order is the order in which a user moves focus from one control to another by pressing the TAB key. Each form has its own tab order. By default, the tab order is the same as the order in which you created the controls. Tab-order numbering begins with zero. Keep in mind that this is a gross oversimplification. What we can describe about C#.NET behavior in one paragraph takes more than 20,000 lines of code in C#. In fact, just control.cs alone is that size. Good luck Magic programmers if you have to debug that C# source code. And yes, there are bugs in it!

Here’s how it works in Magic xpa:
When working in Automatic Tabbing Order, Magic xpa creates tabbing identifiers for every control on the form of an Online or Rich Client task, maintaining a consecutive sequence from 1 to the last supported control, regardless of whether the control allows the user to park or not. For a Browser task, the Automatic Tab Order command is always automatic.
When you place a new control or move an existing control on a form, Magic xpa sets or changes the tab order by the control’s top, left location, and Z-Order. When the form is set aligned right to left, Magic xpa sets or changes the tab order by the top, right location, and Z-Order.

For example:
When you place the first control at 2,2, the tab identifier is set as 1. When you place the second control at 3,2, the tab identifier is set as 2. When you place the third control at 2,4, the tab identifier is set to 2 and the tab identifier for the second control is reset to 3. Removing a control shifts all consecutive Tab Order properties one value back.
When working in Manual Tabbing Order mode is not active, Magic xpa lets you enter a four-digit identifier or set an expression that returns a numeric value in the Tab Order property that lets Magic xpa determine the tabbing order for the control in relation to other controls on the form.
So out-of-the-box, Magic’s automatic tabbing order makes much more sense and you gain very straightforward programmatic control of tabbing order as well including being able to set the tab order with an expression! How cool is that? If you wanted to do that in C#.NET, you would have to write the underlying code that would do that and it would need to interact with that 20,000 line code base we mentioned. In Magic, the application platform provides that capability for the developer built-in.


For additional information on how an upgrade to Magic xpa is superior to Magic to .NET conversion please convert here

No comments:

Post a Comment