1. Win32Lib: TabItem icons (to Ad and Matt)

On Wed, 4 Oct 2000 07:53:50 +0200, Ad Rienks wrote:

>----- Oorspronkelijk bericht -----
>Van: Brian Broker <bkb at CNW.COM>
>Aan: <EUPHORIA at LISTSERV.MUOHIO.EDU>
>Verzonden: woensdag 4 oktober 2000 3:22
>Onderwerp: Re: Setting the windows icon (and maybe TabItem icons too?)
>
>> >Do you know if there is a way
>> >to replace the text on a TabItem with an icon too?
>> >
>> >Well, thanks a lot,    Ad
>>
>> Well, theoretically you should be able to create an ImageList with your
>> icons then send a TCM_SETIMAGELIST message to your TabControl where
wParam
>> is Null and lParam is the handle to your image list.
>>
>> There is a 'setImageList' routine but it looks like it would need a minor
>> tweak to handle Tab Controls.  (Maybe I should start submitting some code
>> to the dev team  8^)
>>
>> I've not done much with tab controls so I don't have a working example
for
>> you but I could write a demo for you if you'd like.
>>
>> -- Brian
>
>I sure would like that, and I'm sure others would like it too
>
>Ad

You know... I think I'm going to defer this demo to Matt Lewis, since he
implemented ImageLists in Win32Lib.  I'd rather not reinvent the wheel on
this one; and Matt could probably tell us both the best way to do this.  It
seems to me that the image list routines are geared for specific controls
(not including Tab controls), but I'm sure that some routines could be
utilized to accomplish Tab icons.

I guess I was hoping for more generalized routines (and/or more comments in
the Win32Lib source to guide me) when I made my reply...

If Matt can't help, then I'll take a stab at it when I have more time to
study the latest Win32Lib source.

-- Brian

new topic     » topic index » view message » categorize

2. Re: Win32Lib: TabItem icons (to Ad and Matt)

> From: Brian Broker

<snip>

> You know... I think I'm going to defer this demo to Matt
> Lewis, since he
> implemented ImageLists in Win32Lib.  I'd rather not reinvent
> the wheel on
> this one; and Matt could probably tell us both the best way
> to do this.  It
> seems to me that the image list routines are geared for
> specific controls
> (not including Tab controls), but I'm sure that some routines could be
> utilized to accomplish Tab icons.

> I guess I was hoping for more generalized routines (and/or
> more comments in
> the Win32Lib source to guide me) when I made my reply...
>
> If Matt can't help, then I'll take a stab at it when I have
> more time to
> study the latest Win32Lib source.

I don't really have time right now to get that all up, but let me explain
image lists in win32lib.  There are 5 different lists that are created by
win32lib automatically for different controls:

ILlarge
ILsmall
himlFTBDefault
himlFTBHot
himlFTBDisabled

The IL... lists and the himl... lists are for different purposes, but are an
attempt to 'standardize' the use of images in win32lib.  They can be used
for multiple controls.  For instance, ILlarge and small are used for
ListView, TreeView and ComboBoxEx.  The himl... lists are currently only
used for FlatToolBar buttons.

Basically, each control that uses images has different specifications.  For
the FlatToolBar, you provide handles to the control to three different
imagelists, and you assign a button the index of the images you're looking
for.  So the images need to have the same index in each list.  That's why
you have to supply 3 images to add to the image list when supplying these.

I'd suggest simply using either ILlarge or ILsmall (probably ILsmall for
default, but add an option to change to ILlarge if desired).  It *should* be
as simple as sending the TCM_SETIMAGELIST and sending the TCM_SETITEM
message with an appropriate TC_ITEM structure to change the images.

My goal was to be able to reuse the imagelists for other controls (and I
think it works :), but since some use different types of imagelists...

Let me know if you have any other questions.

Matt Lewis

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu