 |
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Sun Mar 30, 2008 6:21 pm
[2.21] bad labels in mud connector |
I don't think these particular ones were posted about before and the image was captured in Pro but I assume it will be the same for the normal copy too.
 |
|
_________________ Taz :) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 31, 2008 5:03 pm |
Thanks. I'll add that to the list. When I did the DevExpress update between v2.20 and 2.21 the Label component changed again, and that caused these issues. I tried to fix them all, but as someone has mentioned in the past, there are hundreds and hundreds of labels in CMUD to check, and I missed a few like this.
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 31, 2008 8:10 pm |
Man, I am *really* getting sick of these Label alignment bugs. Turns out to be another DevExpress problem when using a Label within a dynamically created Frame when the font of the parent form has been changed. I have no idea why it shows up on this frame and not in the frames created in the Settings Editor since they use the same architecture and code for creating dynamic frames within the parent form. But I can't understand why it is so hard to create a Label component that will remain properly aligned when the font changes.
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 31, 2008 8:58 pm |
Turns out it was because these labels were "database labels". In other words, their contents point to a particular field in a database (the MUD listing). The IP Address field is a Integer field in the database, and Integer fields are set by default to "right aligned". But the IP Address field has a "GetText" method that converts the numeric IP address into a string xxx.xxx.xxx.xxx formatted IP address, and the Label was set to "left aligned". DevExpress apparently can't handle this case. It was forcing the label to be right-aligned (the database setting overriding the specific form setting), and then it was aligning the field based upon the length of the numeric data and not the string value. Once I set the database field to also be Left aligned, then it worked fine.
The Date field was similar...it was also right-aligned and had a GetText method to display the DataTime field in the correct format. So I've had to make this label into a Left-aligned label also. Apparently they never tested their Right-aligned database labels when a GetText method was being used to override the display text.
The alignment of the Name/Kind/Addr/URL labels was different and very weird. I couldn't get these to align at all. I deleted them and recreated them, and then they worked. So I don't know what was wrong with them, but they were screwed up somehow in the form file. Another mystery. But I really hate wasting hours and hours of time just trying to get labels to align properly. That's the kind of stuff developer's shouldn't need to be messing with these days in my opinion. |
|
|
 |
Taz GURU
Joined: 28 Sep 2000 Posts: 1395 Location: United Kingdom
|
Posted: Mon Mar 31, 2008 11:52 pm |
It used to a total nightmare in VB but since VB.NET 2005 it's not been so bad as they now have indicator lines showing when things are lined up properly. I agree though placing labels should be simple and quick so you can forget about them and get on with coding the important stuff.
I'll not bother adding this to the bug list since you've fixed it already and I'll more than likely forget to remove it when the next version is released. |
|
_________________ Taz :) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Tue Apr 01, 2008 4:59 pm |
Yeah, Delphi 2007 has the indicator lines too. But that's not the problem. The problem is that when you have an embedded frame within a form, the frame needs to be resized to fit into the form. So various controls get moved around depending upon their "anchor" alignment (like if a control is supposed to move with the right edge of the form instead of the left). Then, after the frame is resized, the font from the parent form is applied.
The frames are all designed with a particular font (Tahoma 8pt in my case). But when you run on Vista, the system font (Segoe UI 9pt) is applied. Any label that is right-aligned has to adjust itself to maintain it's alignment. All of this works fine on a normal form...it's only when you start embedding inherited Frames.
Frames are a very powerful feature in Delphi because it allows you to share visual design and code in different parts of the application. But it's not something that the Delphi Developer's seem to test very thoroughly. It's one of those "advanced" features.
Anyway, don't worry about adding minor visual stuff like this to your web bug list. |
|
|
 |
|
|