Solved

How to assign Glyph Icon for new component

Posted on 1998-12-03
6
367 Views
Last Modified: 2013-12-03
Hi folks,

I am trying to create a new (simple) Component.  It consists of a small pannel with 3 buttons I often use on my form.  They do some simple filtering on my Datasources, nothing complicated.

But now I'm having a little problem.  It seems that crating the pannel and the buttons is no problem, but when I place my new component on a form, the buttons have no glyphs or bitmaps attached to them.

Now I would like to ask how I can attach an image to the three buttons, which will appear on my form when I place my new control on my form.

Anyone has any hints concerning this ?

Thanks a lot in advance
0
Comment
Question by:Stefaan
  • 3
  • 3
6 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 50 total points
ID: 1349237
Create a .RES file for the component which contains three bitmaps for the buttons. Include the res file in the component source like this:

{$R TheBitmaps.RES}

In the constructor for the component do this;

BitBtn1.glyph.LoadFromResourceName(Application.Handle, 'BitBtn1Glyph');
BitBtn2.glyph.LoadFromResourceName(Application.Handle, 'BitBtn2Glyph');
BitBtn3.glyph.LoadFromResourceName(Application.Handle, 'BitBtn3Glyph');

Cheers,

Raymond.

0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349238
Hi rwilson,

You were absolutely Right.  It works perfectly.  One little question I still want to ask is : What is the default (most used) size of a speedbutton and the icon which is on it.

I have made my button 26 x 26 and the icon on it is 21 x 21.  Is this good, or should I take something else.

Oh, by the way, if you have any more usefull tips or links concerning Component Creation, feel free to send them to me.

Greetings and best regards,


Stefaan Lesage

E-Mail : Stefaan.Lesage@eca.be

0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349239
Sorry RWilson, forgot to award you with the points.

0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 12

Expert Comment

by:rwilson032697
ID: 1349240
Hi Stefan,

I think most speedbuttons (like the ones you see in toolbars) are 16x16 - not that it really matters since they will be scales but the scaling can sometimes reduce the quality.... Otherwise you can pretty much use whatever size suits your app.

Cheers,

Raymond.
0
 
LVL 3

Author Comment

by:Stefaan
ID: 1349241
Raymond,

I have one more question, which you could probably help me with.  The pannel contains 3 buttons (one for entering a filter, one for applying a filter and one for canceling a filter), but it Should also contain a RadioGroup with 2 radiobuttons one for AND one for OR.

I already found out how I could create the RadioGroup, but apparently I can't seem to figure out how I should create the 2 radiobuttons, and furthermore I would also like to get the currently selected radiobutton as a property (which probable means I'll have to code something into the OnClick event of the radiogroup).

If you have any hints on how I could achieve this.  I would be very greatfull if you could help me.

Thanks a lot in advance.

Greetings and best regards,

Stefaan

0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1349242
Right click on the radio group component - theres an option to add a radiobutton.

The radiogroup component has a property indicating the selected radio button in the group.

Cheers,

Raymond.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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