Solved

TSpinEdit looks like "compressed" on WinXP

Posted on 2003-12-11
14
281 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:raymng
  • 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:raymng
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
 

Author Comment

by:raymng
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:raymng
ID: 9926852
Just copy the "Spin.pas" file to the project directory ?  Any other procedures?

Raymond
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:raymng
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:raymng
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:raymng
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:raymng
ID: 9947441
Cesario and chrml0606:

Are you still here ?

raymng
0
 

Author Comment

by:raymng
ID: 9972489
Cesario and chrml0606:

Hello, are you here ?

raymng
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now