Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TSpinEdit looks like "compressed" on WinXP

Posted on 2003-12-11
14
Medium Priority
?
293 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 600 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

610 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