Solved

How to assign Glyph Icon for new component

Posted on 1998-12-03
6
361 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

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

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…
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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

707 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