I was browsing some websites this afternoon, and read somewhere (I think on the DailyWTF forums) that Java and C# syntax are almost the same. So this evening I thought: why not give it a try and create a simple C# web-application. So here I go…
1) Start Delphi2005
2) File->New->C# web application
3) Give it a name etc.
4) Look at the canvas: it says “Form is in gridbaglayout. If you want to …. blablabla”.
5) Now drop a button on the form
6) Move the button
7) Try to move it again
8) Don’t get annoyed: it’s not possible.
9) Close all and exit Delphi2005
Now do the same, except change the first into:
1) Start VS.NET
.
.
.
7) Hey, the button has moved
8) Be surprised, but…
9) Continue coding
If that’s not a WTF, than what is? Perhaps this is: running the (not so good looking) page/application (just some inputfields and buttons doing nothing) for the second time gave me the annoying “can’t connect to the asp workerprocess” error. VS.NET has no trouble running the pages time after time.
View what I did here. Please comment if this is a known bug that I did not know about (quite possible) or if you know that I did something utterly stupid (extremely possible).
I can’t judge Delphi very well, but I do know I like C# very much from what I have seen, clearly this a profitable route and .NET surely has more than enough potential, especially now it’s also being (or is the work on that done already ? IE Mono for Linux etc?) ‘ported’ to other OSes. I also am pleased with how the Visual Studio environment looks and feels. Ever since I started scribbling in C++ and later C# in VS I have never looked back at Pascal/Delphi and the likes. Of course I am not even a ‘blue monday’ programmer, so I may be considered an ignorant twat by some…. I’ll take my chances ! The internet has many good ebooks available, some free, some semifree ;-), at least you can take a peek at a copy before you spend a fortune on books.
Errm, I meant: ebooks on C sharp (among others!). I already got quite a collection!
Online .NET resources are mostly in C#, so I guess that eases the learning process a bit.
My rant was not so much about Java or C#, since the above was done in Delphi2005 and VS.NET both in C#.
What I don’t like, is that I am a happy Borland customer (I have Delphi 6 Enterprise) and I am wondering if I should upgrade and if yes, to what. The “if” is turning into a “when”. But the “upgrade” is more and more turning into a “don’t upgrade, but buy VS.NET” instead. Bigger price from Borland is fine, just as long as they deliver more (necessary) features or a higher quality or a higher level of developer-productivity. Ever since I tried both Delphi2005 and VS.NET, the only thing I noticed is that I get things done quicker and easier in VS.NET, even without knowing C# as good as ObjectPascal, and even without the ability to view data (in DB-aware components) at design-time.
That sucks, especially since it’s a well known fact that I am not the biggest Microsoft fan in the world.
You can choose between Grid or Flow layout in Delphi 2005 for web forms. There is a property you can change to switch between the two. I am told that the default setting, Grid, is better because the way you design the form is how it exactly will appear in a browser. When you choose Flow some browsers will change the positioning sometimes when it thinks that is better. (Don’t ask me why this is but it has to do with how browsers seems to work).
Borland again doesn’t stick to one option but gives the developer the posibility to choose what you want! That is an advantage!
Although there are a lot of valid complaints about issues in Delphi 2005 please consider that Delphi 2005 is NOT VS.NET. By delivering choices this can make things awkward in teh beginning but gives you as developer the freedom you need. I rather have that freedom then be forced to do it only in one way!
Perry, sorry to be so blunt, but have a f*cking look at the viewlet. The canvas says it’s in GridLayout mode (I even stuck a post-it near the text on the canvas to make it even clearer to the viewer), and the Form-property confirms that (although I did not include that in the viewlet). Still, the form behaves like it’s in Flow Layout. That is NOT good.
FYI: Flow Layout is how we read text: from left to right. The first object is placed in the top-left corner. The next object is placed on the first object’s righthand-side. And so on, until the “line” is full. Than a new line/row is created. You can exhibit this behaviour very easily. Just resize the canvas in Flow Layout: most of your objects will rearrange.
Sorry, In my haste I didn’t looked at the viewlet.
I will look into it after I am home. I don’t have D2005 here. It’s always easier when you have the tool in front of you.
All I know from my own experience is that I ALWAYS have to change a property before I can move the components.
I’ll be happy to hear you comments. I can’t see ANY reason why one would have to change a property to enable moving it around in the designer.
Apart from that, it’s obvious that the form is in Flow Layout (despite the Form-property and the message on the canvas), because dropping a component somewhere in the middle of the form will result in a component being in the top-left corner of the canvas.
Basically what you’re suggesting is: change the form-property from “Grid Layout” to “Flow layout” and then change it back?! Haven’t thought of that (because it’s contra-productive), but I’ll test it.
I have tried the same in Delphi 8 and figured out what is happening.
If you are in Grid layout, as it says and you double click to add a control, it will be placed as ‘flow layout’. If you drop/drag it it will placed as ‘grid layout’.
Looks like a hidden feature
Hidden feature. Where have I heard that term before. Grid Layout is supposed to be a form-property, not an item-property. And if this would be a hidden feature, than how come I can still add items by dragging remaining movable (so part of the form is in Flow layout and part is in Grid layout?). Gimme a break.
Thanks for testing, though, I don’t have a D8.NET trial lying around.
If things stay this way with Delphi, I think I’ll say goodbye to Borland.
Gridlayout is imo not a form property although it says in the body tag. It is the default placing policy for your controls. So in the tag of the control is determined if it absolute or relative placed. (If you remove the x y z it will be relative placed)
I agree that this hidden feature (or bug) is confusing.
Guys,
GridLayout is a value of the pageLayout control. So the IDE should switch to Flow Layout when you put controls on the page by double-clicking on them in the Toolbar (and warn about possible control-rearrangement), or it should properly put the control on the page, respecting the GridLayout. Period.
Look it up, GridLayout is not an item property.
In Delphi 2005 Enterprise update 2, I have the same behaviour as Roland describes.
When I follow the steps like in the viewlet I can move them around like they suppose to do.
I looked in Borland’s Quality Central and couldn’t find an issue on this. I assume it isn’t a problem for people, like for me, otherwise it would be in QC within minutes.
Hi Reginald,
Hmm, this is very odd. I can’t reproduce the problem here on my build. The first problem that struck me was the fact that the absolute position button wasn’t checked when you dropped the control. Look on the toolbar next to the Grid button you’ll see a button with a square with a cross on the top lefthand corner. That button should be checked when you drop the control. Since it’s not checked you can probably workaround the issue by simply checking this button. As for why it’s not checked by default I can’t say for sure because it works correctly here. Additionally, if you double click a control from the palette it will be placed on the form in flowlayout which we feel provides greater flexibility. Btw, I’d never recommend using gridlayout myself. In fact, I’m working to get the default layout changed to flow since that makes the most sense for web applications.
-Steve Delphi R&D
Steve,
I can agree with you with the Flow Layout being the better choice for web-applications, but…Grid is there, and should work as expected.
You are right about the “Absolute Position” button (as I suspected 😉 ). Double-click-adding a component leaves the item unmovable, but when clicking on the Absolute Position button it can be moved from then on.
So, that’s a workaround. The default this “state” has should be based on the pagelayout choosen: “on” for GridLayout and “off” for FlowLayout.
What’s the most recent (publicly available) build-number? Perhaps it’s already solved.
BTW Thanks for stopping by. Always nice to have some authority around…