It is currently Sat May 25, 2013 1:51 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Alternative to the missing #PB_ListIcon_GridLines
PostPosted: Thu Feb 03, 2011 8:42 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 814
Location: Germany
The PureBasic help for the ListIconGadget states that the flag #PB_ListIcon_GridLines
is not supported in MacOS. But the underlying DataBrowser API of MacOS has two
features which do something similar:
- one feature enables alternating row colors to optically separate the single rows
- another feature draws column dividers

This code example demonstrates their use to "simulate" grid lines:
Code:
ImportC ""
  DataBrowserChangeAttributes(ControlRef.L, AttributesToSet.L, AttributesToClear.L)
EndImport

#kDataBrowserAttributeListViewAlternatingRowColors = (1 << 1)
#kDataBrowserAttributeListViewDrawColumnDividers = (1 << 2)

OpenWindow(0, 0, 0, 430, 105, "ListIcon Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListIconGadget(0, 5, 5, 420, 95, "Name", 110)

DataBrowserChangeAttributes(GadgetID(0), #kDataBrowserAttributeListViewAlternatingRowColors | #kDataBrowserAttributeListViewDrawColumnDividers, 0)

AddGadgetColumn(0, 1, "Address", 289)
AddGadgetItem(0, -1, "Harry Rannit" + #LF$ + "12 Parliament Way, Battle Street, By the Bay")
AddGadgetItem(0, -1, "Ginger Brokeit" + #LF$ + "130 PureBasic Road, BigTown, CodeCity")
AddGadgetItem(0, -1, "Didi Foundit"+ #LF$ + "321 Logo Drive, Mouse House, Downtown")

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow


Top
 Profile  
 
 Post subject: Re: Alternative to the missing #PB_ListIcon_GridLines
PostPosted: Thu Feb 03, 2011 9:05 pm 
Offline
User
User

Joined: Thu Sep 23, 2010 4:22 am
Posts: 81
This is a VB6 version:
Code:
Public Const LVM_FIRST As Long = &H1000
Public Const LVS_EX_FULLROWSELECT As Long = &H20
Public Const LVS_EX_GRIDLINES As Long = &H1
Public Const LVM_GETEXTENDEDLISTVIEWSTYLE As Long = LVM_FIRST + &H37
Public Const LVM_SETEXTENDEDLISTVIEWSTYLE As Long = LVM_FIRST + &H36

Public Sub LVstyles(Lv As Object)
    Dim lstyle As Long
    lstyle = SendMessage(Lv.hWnd, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0)
    lstyle = lstyle Or LVS_EX_FULLROWSELECT Or LVS_EX_GRIDLINES
    Call SendMessage(Lv.hWnd, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, ByVal lstyle)
End Sub
Hope helpful.

_________________
Sorry by bad English.
HP Pavilion DV6-2155DX: Intel i3-330m 2.13 / 4GB DDR3 / 500GB Sata2 HD / Display 15.6" LED / Win7 Ultimate x64 / PB 4.50 x86 demo.


Top
 Profile  
 
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 2 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