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
Solved

How to assign Glyph Icon for new component

Posted on 1998-12-03
6
373 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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…

790 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