It is currently Mon Sep 28, 2020 8:48 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: HyperLinkGadget in ListIconGadget [Windows]
PostPosted: Sat Aug 03, 2013 9:22 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3670
The Title say it all

Code:
  LoadFont(0,"Tahoma",12)
 
  OpenWindow(0, 0, 0, 640, 300, "ListIconGadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)     
      ListIconGadget(0, 10,  25, 620, 250, "", 0,#PB_ListIcon_FullRowSelect| #WS_CLIPSIBLINGS)
      SendMessage_(GadgetID(0),#LVM_SETEXTENDEDLISTVIEWSTYLE,#LVS_EX_GRIDLINES,#LVS_EX_GRIDLINES)
      SetGadgetColor(0,#PB_Gadget_BackColor,$DCFFFF)
      For b = 1 To 6
        AddGadgetColumn(a, b, "Column " + Str(b), 130)
      Next
      For b = 0 To 6
        AddGadgetItem(a, b, "Item 1"+Chr(10)+"Item 1"+Chr(10)+"Item 2"+Chr(10)+"Item 3"+Chr(10)+"Item 4"+Chr(10)+"Item 5"+Chr(10)+"Item 6")
      Next
     
      SetGadgetFont(0,FontID(0))
     
      SetGadgetItemText(0,0,"Link Test #1",1)
      SetGadgetItemText(0,2,"Link Test #2",3)
      SetGadgetItemText(0,4,"Link Test #3",2)
     
      HyperLinkGadget(1, 0,0,0,0,"",$FF0000, #PB_HyperLink_Underline | #WS_CLIPSIBLINGS)
      SetGadgetColor(1,#PB_Gadget_BackColor,GetGadgetColor(0,#PB_Gadget_BackColor))
      BringWindowToTop_(GadgetID(1))
      SetGadgetFont(1,FontID(0))
     
Repeat
  Select WaitWindowEvent()
     
      Case #PB_Event_CloseWindow
            Quit = 1
       

      Case #PB_Event_Gadget
          Select EventGadget()
           Case 1
                 If GetGadgetText(1) = "Link Test #1"
                     Debug "OK # 1"
                 ElseIf GetGadgetText(1) = "Link Test #2"
                     Debug "OK # 2"
                 ElseIf GetGadgetText(1) = "Link Test #3"
                     Debug "OK # 3"
                 EndIf           
          EndSelect         
         
      Case #WM_SIZE
         
      Case #WM_MOUSEMOVE
            GetCursorPos_(@p.POINT)
            ScreenToClient_(GadgetID(0),p)
            li.LVHITTESTINFO
            li\pt\x = p\x
            li\pt\y = p\y
            SendMessage_(GadgetID(0),#LVM_SUBITEMHITTEST ,0,li)
           
            If li\iItem <> Olditem Or li\iSubItem <> Oldsubitem
                If li\iItem = 0 And li\iSubItem = 1
                    SetGadgetText(1,"Link Test #1")
                ElseIf li\iItem = 2 And li\iSubItem = 3
                    SetGadgetText(1,"Link Test #2")
                ElseIf li\iItem = 4 And li\iSubItem = 2
                    SetGadgetText(1,"Link Test #3")
                EndIf               
                If (li\iItem = 0 And li\iSubItem = 1) Or (li\iItem = 2 And li\iSubItem = 3) Or (li\iItem = 4 And li\iSubItem = 2)
                    r.RECT
                    r\top = li\iSubItem
                    r\left = #LVIR_BOUNDS
                    SendMessage_(GadgetID(0), #LVM_GETSUBITEMRECT, li\iItem, r)
                    MoveWindow_(GadgetID(1),r\left+GadgetX(0)+8,r\top+GadgetY(0)+4,r\right-r\left-2,r\bottom-r\top,1)
                Else
                    MoveWindow_(GadgetID(1),0,0,0,0,1)
                EndIf           
            EndIf
                       
            Olditem = li\iItem
            Oldsubitem = li\iSubItem
             
  EndSelect

Until Quit = 1
End


_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: HyperLinkGadget in ListIconGadget [Windows]
PostPosted: Sun Aug 04, 2013 10:38 am 
Offline
Addict
Addict
User avatar

Joined: Mon May 14, 2007 2:13 am
Posts: 979
Location: Darling River
8)

_________________
PureBasic Rocks! Even More! And More!
PureBasic 5, Now We're Really Rockin!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye