Xojo Conferences
XDCMay2019MiamiUSA

Putting 16x16 icons from other apps into a bevel button (Real Studio network user group Mailinglist archive)

Back to the thread list
Previous thread: {bug] CheckBoxes in listboxes are not clipped at bottom of listbox on OSX
Next thread: XML Help


Win32 API Declares   -   Berg, Heath
  Putting 16x16 icons from other apps into a bevel button   -   Paul Rehill
   Re: Putting 16x16 icons from other apps into a bevel button   -   Brian Rathbone
   Re: Putting 16x16 icons from other apps into a bevel button   -   Paul Rehill
   Re: Putting 16x16 icons from other apps into a bevel button   -   Paul Rehill
   Re: Putting 16x16 icons from other apps into a bevel button   -   Charles Yeomans
   Re: Putting 16x16 icons from other apps into a bevel button   -   Paul Rehill
   Re: Putting 16x16 icons from other apps into a bevel button   -   William Squires
   Re: Putting 16x16 icons from other apps into a bevel button   -   Paul Rehill

Putting 16x16 icons from other apps into a bevel button
Date: 19.08.05 02:04 (Fri, 19 Aug 2005 11:04:51 +1000)
From: Paul Rehill
I am thinking about including a few bevel buttons in my app that will
allow users to launch other applications that can help them with the
task at hand such as a native OS calculator, Excel, graphing
calculator program etc. Users choose whichever apps they wish to
assign to the bevel buttons. I can use folderitem.launch to start the
apps and store the folderitems' GetSaveInfo in the app's preferences.

I am wondering if it is possible to obtain an app's 16x16 icon (given
its folderitem) to store as the icon picture in the bevel button
instead of using text or an unfamiliar icon. Is this possible for
both Mac and Windows?

Thanks in advance

Paul Rehill
mathsteacher.com.au
RB 5.5.5 Mac Pro, Mac OS 10.3.6
RB 5.5.5 Win Standard, Win XP SP2
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 19.08.05 02:33 (Thu, 18 Aug 2005 21:33:40 -0400)
From: Brian Rathbone
>From: "Paul Rehill" <<email address removed>>
>Subject: Putting 16x16 icons from other apps into a bevel button

>I am wondering if it is possible to obtain an app's 16x16 icon (given
>its folderitem) to store as the icon picture in the bevel button
>instead of using text or an unfamiliar icon. Is this possible for
>both Mac and Windows?

This can be done for both platforms using the MBS plugin. There is a way to
do it with declares (on Windows for certain), but that requires either MBS
or a hack to get the handle of a graphics object, for right now at least.

Check out Folderitem.DrawWideIconMBS

hth,

Brian


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 19.08.05 09:01 (Fri, 19 Aug 2005 18:01:30 +1000)
From: Paul Rehill
Thanks Brian

I have been playing around with this for a couple of hours now (on
Windows) trying to work out how to best assign an icon to a bevel
button.

I think a bevel button with width and height=18 and no bevel is the best size.

I create a new bevel class with a picture property, say AppIconPic.

In a bevel button's open event I use:
Bevel1.AppIconPic=NewPicture(16,16,32)

I then use
Folderitem.DrawWideIconMBS(Bevel1.AppIconPic.graphics, x, y, 16,
WindowsIconIndex)

before assign Bevel1.AppIconPic to Bevel1.Icon.

Now two issues arise.

One what is WindowsIconIndex for the 16x16 icon seen in Windows Explorer?

The other issue is what is the x and y offset. For an Excel 2000
icon, x=0, y=-3 works well (when WindowsIconIndex=16).

As I don't know of a way to obtain the right WindowsIconIndex yet, I
have created a window with 32 bevel buttons which show the icon images
with WindowsIconIndex equal 1 to 32 just to see what icons are
displayed (as an afterthought, I might try 0 next to see if it has an
icon). Different apps will require a different WindowsIconIndex and
probably different x and y offsets for the icon to fit right into the
bevel button.

Is there a standard range for WindowsIconIndex like 0-127 as for some
apps, WindowsIconIndex drew a blank in the bevel buttons when 1-32
were used?

As the x and y offsets are likely to differ from app to app, I will
probably include controls (up and down, left and right) allowing the
icon position to be centered within the bevel button. I know icons
can be positioned but using that won't work well in some instances
because of the pixel information the icon image contains (eg. that
Excel icon I was looking at had some strange extra graphics above the
16x16 image normally shown).

Thanks

Paul

On 8/19/05, Brian Rathbone <<email address removed>> wrote:
> >From: "Paul Rehill" <<email address removed>>
> >Subject: Putting 16x16 icons from other apps into a bevel button
>
>
> >I am wondering if it is possible to obtain an app's 16x16 icon (given
> >its folderitem) to store as the icon picture in the bevel button
> >instead of using text or an unfamiliar icon. Is this possible for
> >both Mac and Windows?
>
> This can be done for both platforms using the MBS plugin. There is a way to
> do it with declares (on Windows for certain), but that requires either MBS
> or a hack to get the handle of a graphics object, for right now at least.
>
> Check out Folderitem.DrawWideIconMBS
>
> hth,
>
> Brian
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 19.08.05 09:18 (Fri, 19 Aug 2005 18:18:44 +1000)
From: Paul Rehill
> The other issue is what is the x and y offset. For an Excel 2000
> icon, x=0, y=-3 works well (when WindowsIconIndex=16).
>
>Different apps will require a different WindowsIconIndex and
> probably different x and y offsets for the icon to fit right into the
> bevel button.
>
> As the x and y offsets are likely to differ from app to app, I will
> probably include controls (up and down, left and right) allowing the
> icon position to be centered within the bevel button. I know icons
> can be positioned but using that won't work well in some instances
> because of the pixel information the icon image contains (eg. that
> Excel icon I was looking at had some strange extra graphics above the
> 16x16 image normally shown).

On the offsets, I think it is likely this isn't needed and 0, 0 can be
used once the right WindowsIconIndex has been identified (eg. for
Excel 2000, the right WindowsIconIndex just wasn't 16 as I initially
used and another index appears to fit the icon nicely into a
bevelbutton).

Regards Paul
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 19.08.05 16:13 (Fri, 19 Aug 2005 11:13:16 -0400)
From: Charles Yeomans

On Aug 18, 2005, at 9:33 PM, Brian Rathbone wrote:

>> From: "Paul Rehill" <<email address removed>>
>> Subject: Putting 16x16 icons from other apps into a bevel button
>
>> I am wondering if it is possible to obtain an app's 16x16 icon (given
>> its folderitem) to store as the icon picture in the bevel button
>> instead of using text or an unfamiliar icon. Is this possible for
>> both Mac and Windows?
>
> This can be done for both platforms using the MBS plugin. There is a
> way to
> do it with declares (on Windows for certain), but that requires either
> MBS
> or a hack to get the handle of a graphics object, for right now at
> least.
>

For MacOS, it's also easy to do it using Icon Services -- for which see
the Icons chapter of my declares book <http://www.declareSub.com/>.

--------------
Charles Yeomans

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 20.08.05 02:53 (Sat, 20 Aug 2005 11:53:27 +1000)
From: Paul Rehill
> I have been playing around with this for a couple of hours now (on
> Windows) trying to work out how to best assign an icon to a bevel
> button.
>
> I think a bevel button with width and height=18 and no bevel is the best size.
>
> I create a new bevel class with a picture property, say AppIconPic.
>
> In a bevel button's open event I use:
> Bevel1.AppIconPic=NewPicture(16,16,32)
>
> I then use
> Folderitem.DrawWideIconMBS(Bevel1.AppIconPic.graphics, x, y, 16,
> WindowsIconIndex)
>
> before assign Bevel1.AppIconPic to Bevel1.Icon.
>
> Now two issues arise.
>
> One what is WindowsIconIndex for the 16x16 icon seen in Windows Explorer?
>
> The other issue is what is the x and y offset. For an Excel 2000
> icon, x=0, y=-3 works well (when WindowsIconIndex=16).
>
> As I don't know of a way to obtain the right WindowsIconIndex yet, I
> have created a window with 32 bevel buttons which show the icon images
> with WindowsIconIndex equal 1 to 32 just to see what icons are
> displayed (as an afterthought, I might try 0 next to see if it has an
> icon). Different apps will require a different WindowsIconIndex and
> probably different x and y offsets for the icon to fit right into the
> bevel button.
>
> Is there a standard range for WindowsIconIndex like 0-127 as for some
> apps, WindowsIconIndex drew a blank in the bevel buttons when 1-32
> were used?
>
> As the x and y offsets are likely to differ from app to app, I will
> probably include controls (up and down, left and right) allowing the
> icon position to be centered within the bevel button. I know icons
> can be positioned but using that won't work well in some instances
> because of the pixel information the icon image contains (eg. that
> Excel icon I was looking at had some strange extra graphics above the
> 16x16 image normally shown).
>
> Thanks
>
> Paul
>
> On 8/19/05, Brian Rathbone <<email address removed>> wrote:
> > >From: "Paul Rehill" <<email address removed>>
> > >Subject: Putting 16x16 icons from other apps into a bevel button
> >
> >
> > >I am wondering if it is possible to obtain an app's 16x16 icon (given
> > >its folderitem) to store as the icon picture in the bevel button
> > >instead of using text or an unfamiliar icon. Is this possible for
> > >both Mac and Windows?
> >
> > This can be done for both platforms using the MBS plugin. There is a way to
> > do it with declares (on Windows for certain), but that requires either MBS
> > or a hack to get the handle of a graphics object, for right now at least.
> >
> > Check out Folderitem.DrawWideIconMBS
> >
> > hth,
> >
> > Brian

Further to my other post, I found that for some applications, non-zero
offsets are required with the MBS declare to make a 16x16 icon fit
nicely into a 18x18 bevel button.

I have another problem. I think some applications on Windows have
only a single 32x32 icon such as the system calculator on Windows XP.
I think there must be some interpolation to produce the 16x16 icon
that appears in Windows Explorer. If so, is there a good way to mimic
this interpolation to achieve the 16x16 icon? Perhaps with a MBS
function.

Thanks in advance

Paul
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 20.08.05 15:22 (Sat, 20 Aug 2005 09:22:03 -0500)
From: William Squires
On Aug 18, 2005, at 8:04 PM, Paul Rehill wrote:

> I am thinking about including a few bevel buttons in my app that will
> allow users to launch other applications that can help them with the
> task at hand such as a native OS calculator, Excel, graphing
> calculator program etc. Users choose whichever apps they wish to
> assign to the bevel buttons. I can use folderitem.launch to start the
> apps and store the folderitems' GetSaveInfo in the app's preferences.
>
> I am wondering if it is possible to obtain an app's 16x16 icon (given
> its folderitem) to store as the icon picture in the bevel button
> instead of using text or an unfamiliar icon. Is this possible for
> both Mac and Windows?
>
There's two issues here; can you, and should you?

"Can you?" - probably yes, though the method is probably
platform-dependent.
"Should you?" - that's a legal (copyright) issue, so probably not.
* If your app grabs the icon(s) from the applications every time upon
launch, and doesn't store them
anywhere (except in the toolbar or bevelbutton), then you're probably
okay.
* If your app grabs the icon(s) once, and stores them locally, then you
have a problem.
* If you grab the icon(s), and package them with your app, then you've
definitely committed a violation of
someone's copyright.

> Thanks in advance
>
> Paul Rehill
> mathsteacher.com.au
> RB 5.5.5 Mac Pro, Mac OS 10.3.6
> RB 5.5.5 Win Standard, Win XP SP2
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>
A compiler is a tool for turning source code into error messages;
generating machine language bytes is just a fortuitous by-product!

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Putting 16x16 icons from other apps into a bevel button
Date: 21.08.05 01:01 (Sun, 21 Aug 2005 10:01:46 +1000)
From: Paul Rehill
> * If you grab the icon(s), and package them with your app, then you've definitely committed a violation of someone's copyright.
> * If your app grabs the icon(s) once, and stores them locally, then you have a problem.

No, I wouldn't do either of the above for the reasons outlined.

> * If your app grabs the icon(s) from the applications every time upon
> launch, and doesn't store them
> anywhere (except in the toolbar or bevelbutton), then you're probably
> okay.

This is what happens if the end-user wants to use a familiar
application icon for a program they already have on their computer.
On windows though, the icon number and x and y offsets to be used with
the MBS function needs to be stored.

Regards

Paul
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>