Re: Example of nested layout panels and dynamic form creation with .NET

  • From: "Ricks Place" <OFBGMail@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Sat, 11 Oct 2008 09:14:32 -0400

I am sure you do not like their products. They work for me and they are more consistent than trying to work with perhaps 5 diferent third party vendors who have their own termonologies, controls, Resource usage, syntax and accessibility issues. I prefer just trying to use the IDE for Winforms or VWD projects. They work pretty much the same and even Java Script is pretty consistent in the various editors. They allow setting options from a single window for designers, editors and other thingys. I would have to do all that and allot more to use 5 diferent products. Also, if I wanted to use them in a single project I would have to allow for all their diferences and how they implement their software as there might be conflicts with resource management. I am not trying to become the smartest programmer on the block, just get the job done the easiest way. I use programs I write, I do not work for a company that wants me to develop code for them so I can pick and choose my technologies to fit my applications and the Visual Studio environment is consistent for development compared to working with several individual products and tracking all the complexities of such actions. It is just my choice, you can do it however you like too.

Over and out:
Rick USA
----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 9:02 AM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


Consistency on Microsoft's products? You are kidding, no?

Was there Visual Studio 6 similar to Visual Studio 5, or Visual Studio 7 or 8 similar to Visual Studio 6?

Not even Windows is consistent. I have installed Win XP Service pack 3, and strangely, I can't access some audio Captchas, even though those who have only SP2 can access the same Captchas without problems.

I really don't know what session problems you met, but I can tell you that I use the Catalyst framework, and I never had any kind of problems with the sessions. And for using sessions I just need to add 2 or 3 lines of configuration in a single program or configuration file, wherever I like, and all the modules of the web project can use sessions, so I don't think this is something complicated.

But those 2 or 3 lines allow me to choose the way I want to save the data for sessions on the server, how to send the ID of the session to the client (in cookies or URL), and a few other options if I don't like the defaults.

And yes, exactly those menus and tree views which are created by VS.net are very bad made, and they are hard accessible comparing with other solutions that were discussed on the list some time ago.

I know that the blind programmers tend to prefer the things made by Microsoft, because Windows is the most accessible OS, and some programmers might find harder to also learn a little Linux, and learn other things, but my opinion is that it is better to need to learn more and to be able to do more and easier than to be satisfied only with what Microsoft's programs offer.

Until I found the best combination of framework, ORM, templating system, web forms manager, RSS/Atom/RDF generator, email sender, and many other things, I needed to test very many modules, but now I can do much easier and with very little code more than I can do with Microsoft's products.

I don't want to know what's VS.net good for, but I want to know which are its advantages aside of intelisense... I mean what's it better than other methods of programming, even if using C# or other DotNet languages. For programming for the web it isn't the best for sure, but the problem is that I still don't know... hmm, right now I think you just made me understand why it is prefered.
It * doesn't require learning too much*.

I realise that not only the intelisense is a big advantage, but that the programmers don't require to learn using the command line, don't need to manually specify the names of all the needed dlls when compiling, and other things regarding project management. We just need to press a hotkey, and we got an executable, and this is an advantage indeed.

I think I was attracted too much by the name "Visual" so I was thinking that its main advantage should be on creating the visual design, but unfortunately it is not the case for the blind.
(When creating pretty complex GUIS, of course.)

Octavian

----- Original Message ----- From: "Ricks Place" <OFBGMail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 3:02 PM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


Not really. You can modify the html and code to run how you like. I never used widgits or whatever, just native VS Controls and some Java Script. If I have a bunch of links, complex Menu or TreeView controls to be maintained dynamically I found VS a decent tool to use. Some of their controls are not as accessible as I would like but they might address that, who knows? It would be easier I think to work in PHP and all that jazz but I wanted to learn to do things the Microsoft way to stay somewhat consistent without having to use allot of diverse third party controls and applications which may, or not, be accessible or even work with each other. OI have enough trouble remembering how to use CSS, VWD, Java Script, HTML - all the versions, VB, handle Session Problems, Sql Server DataBase complexities and other things I can't even think of just now. I want consistency as much as possible so I tend to stick with Microsoft which maintains some consistency among it's product lines.
Anyway, I guess it is just a matter of preference for me.
Rick USA
----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 7:45 AM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


Well, if I need to do programs with a simple interface, I don't even need to use wxWidgets, because I can use Win32::GUI which is really very simple to use.

But if I need to create complex GUIS, then I think that VS.net should be good for doing that. I know that a simple interface is prefered by the blind, but unfortunately sometimes we need to do what the sighted folks like.

If we can create old-style menus and use layout managers by code in VS.net, then why not doing with TextPad? It would be running much faster than VS.net. :-)

Octavian

----- Original Message ----- From: "Ricks Place" <OFBGMail@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 1:55 PM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


I have used Visual Studio since 2005 and never used Intellisense, wish I know how. As for layout, it all depends on what you are doing. Everyone has their own work-arounds. I use windoweyes and have found work-arounds for menu items and it is much easier in jaws if I remember. You can code by hand if you like and I do that sometimes but use the designers for most things. I do not do nested table layouts for the most part just because I follow the KISS approach to design since I use a screen reader and simpler is usually better.
Rick USA
----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 6:18 AM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


Ok, but this is exactly what I don't know how to do.

I don't know if it is possible for the blind to use the forms designer easier than creating the design manually. Jamal says that it is easier manually than using the forms designer, and until now I found it pretty hard to create the menus, and I don't even know if it is possible to create old-style menus using the forms designer.

I have found that it is pretty hard to use layout managers when using the forms designer. Can you use layout managers when using the forms designer? Can you tell us how to place a layout manager into another one and generally tips about using layout managers?

I also said that the intelisense is helpful, but I already said that I found that this is an exception, and without it, VS.net is pretty useless for the blind. I would be glad if this isn't true.

Octavian

----- Original Message ----- From: "James Panes" <jimpanes@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Saturday, October 11, 2008 11:54 AM
Subject: Re: Example of nested layout panels and dynamic form creation with .NET


Hi Teddy,

I had been out of the loop for several years when I started programming with Bill Dennis's Blind Geeks. The VS interface was like very easy to use. It helped me a lot especially when it came to intellesense and form layout.

How would you like to go back to "Edlin" and a paper manual?

Sorry if you don't like exactly what it does, but I will not agree that it
is useless.

.
Regards,
James
jimpanes@xxxxxxxxx
jimpanes@xxxxxxxxxxxx
"Everything is easy when you know how."

----- Original Message ----- From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, October 10, 2008 4:55 PM
Subject: Re: Example of nested layout panels and dynamic form creation with
.NET


Aha, so I am not wrong when I say that actually, VS.net is pretty useless
for the blind?

Again, if we don't consider Intelisense, of course.

Octavian

----- Original Message ----- From: "Jamal Mazrui" <empower@xxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx>
Sent: Friday, October 10, 2008 11:26 PM
Subject: Example of nested layout panels and dynamic form creation with .NET


/*
Example of nested layout panels and dynamic form creation
Public domain by Jamal Mazrui
October 10, 2008

Here is an example of using nested layout panels of the .NET Framework.
Note that no pixel coordinates are used for positioning and sizing
controls. The form, TableLayoutPanel, FlowLayoutPanels, and Buttons are
all laid out  automatically according to defaults and need.

I wrote and compiled this C# code with EdSharp and the command-line
compiler. Although Visual Studio certainly has its benefits, I think significantly more time, effort, and code would probably be involved to do the same thing with the form designer, code generator, and multiple files
of a Visual Studio project.

Below is the source code of LayoutPanels.cs, which is also included with
the compiled version, LayoutPanels.exe in the archive available at
http://EmpowermentZone.com/LayoutPanels.zip

When the executable is run, it calls a function called MultiInput that I have found useful in various contexts. It presents a dialog with a number of edit boxes determined at runtime. Parameters to the function provide the dialog title as a string, and the labels and default values of each field in arrays. The function returns an array with values as edited by the user, or an empty array if the dialog is canceled. The program shows
those return values in a message box.
*/

using System;
using System.Collections.Generic;
using System.Windows.Forms;

class Program {
static void Main() {
string sTitle = "Example of Layout Panels";
string[] aLabels = {"Label1", "Label2", "Label3"};
string[] aValues = {"Value1", "Value2", "Value3"};

string[] aResults = MultiInput(sTitle, aLabels, aValues);
if (aResults.Length == 0) return;

MessageBox.Show(String.Join("\n", aResults), "Results");
Console.Write(String.Join("\n", aResults));
} // Main method

public static string[] MultiInput(string sTitle, string[] aLabels,
string[] aValues) {

/*
Define a dialog form containing a vertical FlowLayoutPanel, which in turn, contains a TableLayoutPanel and a horizontal FlowLayoutPanel below it After initializing each control, suspend automatic layout until all its
properties, and those of its child controls, have been set
The OK button captures the values entered or modified, which the function
returns in an array
*/

// Define the dialog form
Form frm = new Form();
frm.SuspendLayout();
frm.AutoSize = true;
frm.AutoSizeMode = AutoSizeMode.GrowAndShrink;
frm.AutoScroll = true;

// Define the main , vertical FlowLayoutPanel
FlowLayoutPanel flpMain = new FlowLayoutPanel();
flpMain.SuspendLayout();
flpMain.AutoSize = true;
flpMain.AutoSizeMode = AutoSizeMode.GrowAndShrink;
flpMain.FlowDirection = FlowDirection.TopDown;

/*
Define a TableLayoutPanel with two colums, the left containing field
labels and the right containing field values
The number of rows is the number of items in the array of field labels
passed to the function.
There will be one row for each field.
determined by the size*/

TableLayoutPanel tlpFields = new TableLayoutPanel();
tlpFields.SuspendLayout();
tlpFields.Anchor = AnchorStyles.None;
tlpFields.AutoSize = true;
tlpFields.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tlpFields.ColumnCount = 2;

// Add a column style for each column
for (int i = 0; i < tlpFields.ColumnCount; i++) {
tlpFields.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
}

// Add a row and row style for each field
tlpFields.RowCount = aLabels.Length;
for (int i = 0; i < tlpFields.RowCount; i++) {
Label lbl = new Label();
lbl.AutoSize = true;
lbl.Text = aLabels[i] + ":";
TextBox txt = new TextBox();
txt.Text = aValues[i];
tlpFields.Controls.AddRange(new Control[] {lbl, txt});
tlpFields.RowStyles.Add(new RowStyle(SizeType.AutoSize));
}
tlpFields.ResumeLayout();

// Below the TableLayoutPanel of fields, add a horizontal FlowLayoutPanel
containing buttons
FlowLayoutPanel flpButtons = new FlowLayoutPanel();
flpButtons.SuspendLayout();
flpButtons.Anchor = AnchorStyles.None;
flpButtons.AutoSize = true;
flpButtons.AutoSizeMode = AutoSizeMode.GrowAndShrink;
flpButtons.FlowDirection = FlowDirection.LeftToRight;

// Define the OK button
Button btnOK = new Button();
btnOK.Text = "OK";

// Define its event handler
List<string> listResults = new List<string>();
btnOK.Click += delegate(object o, EventArgs e) {
foreach (Control ctl in tlpFields.Controls) {
if (ctl.GetType() == typeof(TextBox)) listResults.Add(ctl.Text);
}
frm.Close();
};

// Define the Cancel button
Button btnCancel = new Button();
btnCancel.Text = "Cancel";
btnCancel.Click += delegate(object o, EventArgs e) {frm.Close();};

flpButtons.Controls.AddRange(new Control[] {btnOK, btnCancel});
flpButtons.ResumeLayout();

flpMain.Controls.AddRange(new Control[] {tlpFields, flpButtons});
flpMain.ResumeLayout();

// Set remaining properties of the form
frm.AcceptButton = btnOK;
frm.CancelButton = btnCancel;
frm.StartPosition = FormStartPosition.CenterParent;
frm.Text = sTitle;
frm.Controls.Add(flpMain);
frm.ResumeLayout();
frm.ShowDialog();
frm.Dispose();

return listResults.ToArray();
} // MultiInput method

} // Program class

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: