Jump to content
Sign in to follow this  
dummzeuch

When computers try to be clever

Recommended Posts

Don’t you just hate it when computers try to be clever but get it wrong? OK, it’s not really the computer itself but the programmer who tried to be clever. The problem usually is that he overlooked a corner case that you then hit where his sophisticated strategy fails and leaves you with something – lets say less desirable.

Today I wasted several hours trying to find out what was wrong with my hack to create a TSpeedButton which can take the input focus (which standard TSpeedButtons can’t), by using a TBitBtn instead. I blogged about this before.

There was a certain button width which caused the button to display only a square part of the caption. At closer inspection it turned out to not be a fixed width but kind of a width to height ratio that caused the problem. Here are several buttons with different widths and heights that show this behaviour:

broken-dzspeedBitBn.png.23802bdf7a7f4a88eb386e5c94c7442d.png

 

read on in my blog post.

  • Like 1

Share this post


Link to post

IIRC, that functionality exists since Delphi 1. After 25 years someone finally managed to hit it. Congratulations. :classic_smile:

  • Like 2
  • Haha 1

Share this post


Link to post

I actually know of this feature, and am not ashamed to admit that I have used it. But it was a long time ago.

 

The pains you have to go through to debug GExperts would have gotten me to quit frustratedly, I am not very patient with "hobby projects". How hard would it be to embed GEXperts into a mockup to debug? Basically all plugin developers could unite and profit from this.

 

Sherlock

Share this post


Link to post
1 hour ago, Sherlock said:

How hard would it be to embed GEXperts into a mockup to debug?

Gerrit Beuze, the original inventor of MMX Code Explorer, managed to provide sort of a Micro IDE to test things.

  • Like 1

Share this post


Link to post
1 hour ago, Sherlock said:

How hard would it be to embed GEXperts into a mockup to debug?

Quite hard, all least if I tried to do that for the whole GExperts. It not only uses many calls of the OTAPI but also hacks into the known native forms and components structure. It might be possible for some of the experts, if they can be separated from the rest. Given the size, long history and large number of developers who left their mark in the code, there are too many interdependencies to make that an easy task. I tried to clean up a bit, but on the other hand I'm probably also the one who introduced new dependencies over the - wow, more than 10 - years I have been involved in the project.

Share this post


Link to post
1 hour ago, Sherlock said:

I actually know of this feature, and am not ashamed to admit that I have used it. But it was a long time ago.

I probably knew that too, many years ago, but have since forgotten, or at least didn't think of it when I saw this bug.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×