ListIconGadget questions...

Everything else that doesn't fall into one of the other PB categories.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Holy slow coach, beaten by the deadly duo; batman + netmaestro yet again!

:)

Oh well, I'll post what I hacked up anyhow:

Code: Select all

#LVM_GETHEADER = #LVM_FIRST+31

Procedure.l callback(hWnd, uMsg, wParam, lParam)
  result = #PB_ProcessPureBasicEvents
  Select uMsg
    Case #WM_NOTIFY
      *nmh.NMHDR=lParam
        Select *nmh\code
          Case #NM_RCLICK
             If *nmh\hwndFrom = SendMessage_(GadgetID(0),#LVM_GETHEADER,0,0)
               ;Now identify which item was clicked.
                GetCursorPos_(hdhittest.HD_HITTESTINFO\pt) 
                ScreenToClient_(*nmh\hwndFrom, hdhittest\pt) 
                SendMessage_(*nmh\hwndFrom, #HDM_HITTEST, 0, @hdhittest)
                Debug "Clicked header item " + Str(hdhittest\iItem)
             EndIf
        EndSelect
  EndSelect
  ProcedureReturn result
EndProcedure

If OpenWindow(0, 100, 100, 300, 100, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  If CreateGadgetList(WindowID(0))
    ListIconGadget(0, 5, 5, 290, 90, "Name", 100, #PB_ListIcon_FullRowSelect|#PB_ListIcon_AlwaysShowSelection)
    AddGadgetColumn(0, 1, "Address", 250)
    AddGadgetItem(0, -1, "Harry Rannit"+Chr(10)+"12 Parliament Way, Battle Street, By the Bay")
    AddGadgetItem(0, -1, "Ginger Brokeit"+Chr(10)+"130 PureBasic Road, BigTown, CodeCity")
    SetWindowCallback(@callback())
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf
EndIf
@Joakim Christiansen: to alleviate your AddGadgetItem() woes, you could simply use AddGadgetItem() with an empty string and then set individual cells with SetGadgetItemText() etc. This might be slightly less problematic.
I may look like a mule, but I'm not a complete ass.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

srod wrote:Holy slow coach, beaten by batman yet again!
It's been a while since anyone has beaten the Great ListIconGadgetGuru named srod. 8)

I figure you must have been taking a little snooze...zzzzzzz :P
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 »

It's well posted anyway as srod and I chose different avenues to achieve the rightclick test.
BERESHEIT
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

No time for sleep... must work... must debug spahgetti code... must co... zzzzzz!

Actually, I realised after I posted that it was netmaestro who had already produced code to solve the problem I was working on. Must have got your avatars mixed up somehow!

I was getting to the set column order array, but was way too slow for that one! :)
I may look like a mule, but I'm not a complete ass.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Hey srod...I want to swap rankings with you...here's my PureBasic Expert which you have more than earned. Now if you will kindly hand over your Addict ranking I'll be on my way. :)
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 »

grrr... Mitts off mine, it hasn't had time to get dusty yet!
BERESHEIT
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Not to worry netmaestro. Yours suits you just fine. Mine just doesn't feel right. I don't know.... maybe it's the weight I gained since I quit smoking 8)
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 »

Sparkie wrote:Hey srod...I want to swap rankings with you...here's my PureBasic Expert which you have more than earned. Now if you will kindly hand over your Addict ranking I'll be on my way. :)
Are you kidding man? :) Your knowledge of api stuff far outweigh's mine and on a technical level, some of your posts are beyond reproach. Beside's one of my posts in the bug section this week warrants that I get busted back down to 'Novice' at best! :wink: No, in as much as the rankings are pretty meaningless, you two are the real experts here. I just don't have a great deal of time at the moment to help out in the forums as I once did.

No, I could list half a dozen users who should be elevated way before myself - and there are undoubtedly many more.

Now, how about we swap bank accounts instead? :D
I may look like a mule, but I'm not a complete ass.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

srod wrote:Now, how about we swap bank accounts instead?
Two weeks ago maybe I'd have said yes....but now that I have deposited my tax refund check...hmmmm....I don't think so my friend :P
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

srod wrote:Beside's one of my posts in the bug section this week warrants that I get busted back down to 'Novice' at best!
Done that once or twice myself. No need for :oops: as it just shows that we are human just like everyone else :wink:
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 »

Not even if I throw my 'Addict' ranking in for free?

Oh well, worth a try!

:)
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 »

Done that once or twice myself. No need for :oops: as it just shows that we are human just like everyone else
Human?? We have a frog, a bat, a homer simpsons character and a visiting fanged beast in the room!!
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Oy, cut that out!

It's not my fault I look like comic book guy - and that's on a good day! :)
I may look like a mule, but I'm not a complete ass.
Sparkie
PureBatMan Forever
PureBatMan Forever
Posts: 2307
Joined: Tue Feb 10, 2004 3:07 am
Location: Ohio, USA

Post by Sparkie »

Hey Fangles, isn't it about time you updated your avatar :?: Let's get a peek at those infamous fangs of yours :lol:
What goes around comes around.

PB 5.21 LTS (x86) - Windows 8.1
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Fangbeast wrote:
Done that once or twice myself. No need for :oops: as it just shows that we are human just like everyone else
Human?? We have a frog, a bat, a homer simpsons character and a visiting fanged beast in the room!!
And now a robot comes to the party.
Post Reply