Solved

TSpinEdit looks like "compressed" on WinXP

Posted on 2003-12-11
14
290 Views
Last Modified: 2010-07-27
Please see this image:
http://home.i-cable.com/raymng/xp.jpg

This is a TSpinEdit running on WinXP, do you think the up/down arrow buttons
look like "compressed" ?  The buttons look good in other Windows, just WinXP... :-(

How can I fix this problem?

raymng
0
Comment
Question by:Raymond
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
14 Comments
 
LVL 8

Expert Comment

by:Cesario
ID: 9926595
Dear raymng,

I think the problem is in the Methode TSpinButton.AdjustSize in the unit Spin.pas.

procedure TSpinButton.AdjustSize (var W, H: Integer);
begin
 .......  
 if W < 15 then W := 15;
 .....
end;

solution:
try to detect the running operating system and if xp is running try to
to set

   IF W<13 then w := 13;

sorry but i have no XP running now :-(


good luck

Cesario

0
 

Author Comment

by:Raymond
ID: 9926700
Thanks Cesario!

Edit this file ?
C:\Program Files\Borland\Delphi7\Source\Samples\Spin.pas

0
 
LVL 8

Expert Comment

by:Cesario
ID: 9926726
right ;-)

you can copy this file to your project directory. Now you can change the code of this unit.

Best Regards

Cesario
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Raymond
ID: 9926727
Also, it should not be the problem of W (Width), i think it is the problem of H (height).

raymng
0
 
LVL 8

Expert Comment

by:Cesario
ID: 9926753
sorry, i was to fast ;-)))

 FUpButton.SetBounds (0, 0, W, H div 2);
0
 
LVL 8

Expert Comment

by:Cesario
ID: 9926793
Ok the problem

procedure TSpinEdit.WMSize(var Message: TWMSize);
var
  MinHeight: Integer;
begin
   .........
   // Height -5  
    FButton.SetBounds(Width - FButton.Width - 5, 0, FButton.Width, Height - 5)
    else FButton.SetBounds (Width - FButton.Width, 1, FButton.Width, Height - 3);
    SetEditRect;
  end;
end;
0
 

Author Comment

by:Raymond
ID: 9926852
Just copy the "Spin.pas" file to the project directory ?  Any other procedures?

Raymond
0
 

Author Comment

by:Raymond
ID: 9927023
After I reduce the height by 2:
FButton.SetBounds(Width - FButton.Width - 5, 0, FButton.Width, Height - 5 - 2)

Check the result:
http://home.i-cable.com/raymng/xp2.jpg

The look seems even worst... ;-(
Any idea ?

raymng
0
 
LVL 8

Expert Comment

by:Cesario
ID: 9927046
try to increase the hight
0
 

Author Comment

by:Raymond
ID: 9933757
Thanks Cesario.
It looks better after I increased the height by 1.

One last question:  Do I need to add the "Spin.pas" file to my project by selecting "Project" > "Add to Project" from the main menu ?   Just copy the file is ok ?

raymng
0
 

Accepted Solution

by:
chrml0606 earned 150 total points
ID: 9935155
Edit the name of the pas file, and include it under Uses. For example, if you rename the Spin.pas file to MySpin.pas, then you add MySpin under Uses in the unit you use the spinbar in. It's smart to rename it, so Delphi doesn't use the original, instead of yours in the project dir.
0
 

Author Comment

by:Raymond
ID: 9936839
chrml0606:

Actually Delphi uses my Spin.pas file even I didn't do the procedures you mentioned.
But I don't know that under what situation I need to do the "Project" > "Add to Project" ? and under what situation I need to add "Uses" in the unit ?

raymng
0
 

Author Comment

by:Raymond
ID: 9947441
Cesario and chrml0606:

Are you still here ?

raymng
0
 

Author Comment

by:Raymond
ID: 9972489
Cesario and chrml0606:

Hello, are you here ?

raymng
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question