Colouring a ListIconGadget header

Just starting out? Need help? Post your questions and find answers here.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Thanks Fangles, but you can send mine to srod. I can take 'em used but loose........hmmmm.....I don't think so :P
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Sparkie, hope you don't mind another question (especially since I haven't sent the loose women yet) but...Where in that callback could I detect which gadget was requesting the draw?

I have two different windows opening and two different gadgets that need two different colours.

Is it the *pnmh\hwndFrom parameter?

something like:

Code: Select all

IF *pnmh\hwndFrom = #Gadget_listform_names

  FillRect_(*pnmcd\hdc, *pnmcd\rc, form\maincolour) (My main gadget)

Else

  FillRect_(*pnmcd\hdc, *pnmcd\rc, form\alternatecolour) (MY second gadget on other window

EndIf
I tried this earlier and got a "Gadget object not initialised"

Code: Select all

IF *pnmh\hwndFrom = GadgetId(#Gadget_listform_names)

  FillRect_(*pnmcd\hdc, *pnmcd\rc, form\maincolour) (My main gadget)

ElseIf *pnmh\hwndFrom = GadgetId(#Gadget_postcodeform_postcodes)

  FillRect_(*pnmcd\hdc, *pnmcd\rc, form\alternatecolour) (MY second gadget on other window

EndIf
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

*pnmh\hwndFrom in this case refers the handle of the individual header control for each ListIconGadget. Using GetParent_(*pnmh\hwndFrom) should point you to the handle/GadgetID() of each ListIconGadget. :)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Sorry fangs, my original post left out the GetParent_() etc. My fault! :oops:
I may look like a mule, but I'm not a complete ass.
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Is there any downside to an apprentice asking too many questions of resident wizards? Do I get turned into a frog or a hamster's ear or something worse?

Seriously, you blokes are excellent, thanks for all that help.

/me runs out of the batcave to try some code.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Fangles wrote:Do I get turned into a frog or a hamster's ear or something worse?
How does "BatAss Fangles" sound. :lol: :P Image
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Sparkie wrote:
Fangles wrote:Do I get turned into a frog or a hamster's ear or something worse?
How does "BatAss Fangles" sound. :lol: :P Image
Oh my aching jaws, i'm laughing too hard to type straight almost and my eyes are wet..
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Good...then my day is complete and I can now go to BatSleep. 8)
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Looks like you got a free avatar there fangs, It's your lucky day!
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

netmaestro wrote:Looks like you got a free avatar there fangs, It's your lucky day!
That's so true netmaestro. Since I have the graphical skills of a legless hyena and I lost my normal avatar (a terminally smelly hopping rabbit) it was time to find a new one.

Now I have to fix my ^@!$%!%$ web page and put it somewhere.

I hate editing web pages!
Dare
Addict
Addict
Posts: 1965
Joined: Mon May 29, 2006 1:01 am
Location: Outback

Post by Dare »

:lol:

Awesome!
Dare2 cut down to size
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4789
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

Dare wrote::lol:

Awesome!
The resemblance to me is unbelievable. If I didn't know better, I'd think Sparkie was stalking me to design that picture.
Post Reply