?
Solved

TSpinEdit looks like "compressed" on WinXP

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 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