|
I heartily dislike drag and drop form designers. They seem so easy to use but as soon as you need any fine control they let you down. I always liked the simple containers that the Java user interface libraries have that automatically size their contents and arrange them in columns or rows.
So I have decide to create something like it in C#. I originally thought of creating new classes derived from Panel but I think that is is simpler to simply create some functions that take panels and other controls as argument.
Example code will be found in layout.
Both functions return the panel as their value. This lets us write code that shows the hierrchical structure of the layout. You can then build up the layout piece by piece replacing simple elements with Rows or Columns as you go:
Column(panelTop, splitterH, panelText);
You can compile it and check that it works. Now expand it by adding controls to the top panel:
Column(Row(panelTop, picDotPlot, panelTopRight),
splitterH,
panelText);
<example>
The example is intended as preparation for the use of this idea in
DotPlot.
<example>
Column(Row(panelTop, picDotPlot,
Column(panelTopRight,
buttonGo,
frameDotScaling,
frameParsing),
splitterH,
Row(panelText,
Column(panelText1, comboFile1, textFile1),
Column(panelText2, comboFile2, textFile2));
All the examples assume that the various controls already exist and that all the relevant properties have been set.