Code: Select all
rc.rect\left = #LVIR_BOUNDS
SendMessage_(GadgetID(0), #LVM_GETITEMRECT, 0, rc)
height = rc\bottom - rc\top + 1
Code: Select all
rc.rect\left = #LVIR_BOUNDS
SendMessage_(GadgetID(0), #LVM_GETITEMRECT, 0, rc)
height = rc\bottom - rc\top + 1
srod wrote:The following will return the height of the first row so it will only work if the listicon has at least one row :
Code: Select all
rc.rect\left = #LVIR_BOUNDS SendMessage_(GadgetID(0), #LVM_GETITEMRECT, 0, rc) height = rc\bottom - rc\top + 1
User can't scroll in the time when 'editing mode' is active, no need for that because all changes in textbox are immediately will be written to listbox cell and all other actions with listbox just cancel editing mode and hide textbox.srod wrote:Hang on a cotton picking minute... how can the user scroll the listicon if you have disabled it?
Code: Select all
Dim colp.l(4)
OpenWindow(0,0,0,200,300,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered |#PB_Window_MinimizeGadget)
ListIconGadget(0,0,0,198,300,"Column 0",60,#PB_ListIcon_GridLines| #PB_ListIcon_FullRowSelect | #PB_ListIcon_AlwaysShowSelection)
AddGadgetColumn(0, 1, "Column 1", 70)
AddGadgetColumn(0, 2, "Column 2", 80)
AddGadgetColumn(0, 2, "Column 3", 90)
For a = 0 To 3
colp(a) = GetGadgetItemAttribute(0, 0, #PB_ListIcon_ColumnWidth, a)
Next
;example column nr 2 position X to place textbox i can calculate
textboxXposition = WindowMouseX(0) - listboxiX + colp(0) + colp(1); + bordersize
Debug textboxXposition
For i=0 To 10
AddGadgetItem(0, -1, "line "+Str(i)+" col 0"+Chr(10)+"line "+Str(i)+" col 1"+Chr(10)+"line "+Str(i)+" col 2"+Chr(10)+"line "+Str(i)+" col 3")
Next
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
As right now i work 99% in cgi and php, the api is not my strongest side, can you give me example please, thankssrod wrote:Honestly, if you are wishing to position a string gadget over a cell then your approach is too simplistic. Sure you can get the required scroll amount by using the GetScrollInfo_() function etc. but what happens when/if the user resizes a column or, heaven forbid, drags a column and reorders them? You are going to give yourself a migraine followed by a hernia followed by a nightmare!![]()
Instead I advise you take a good look at the following messages. The first can be used to locate the cell which has just been clicked (if you use it in response to a #WM_LBUTTONDOWN message etc.) and the second can be used to get the exact bounds/dimensions of a cell. This second message takes all of the the scrolling into account.
If you are attempting to create a grid control then, take it from me, it would be far easier to start one from scratch and use a custom window's class rather than base it upon a ListIcon gadget. The ListIcon (or more precisely a Windows ListView control) comes with too much baggage and too many subtle problems which need solving, particularly scrolling and painting problems. It was, in my own words, a bloody nightmare!
- #LVM_SUBITEMHITTEST
- #LVM_GETSUBITEMRECT
**EDIT : I do have a simple utility which allows you to edit the cells in a ListIcon gadget (Windows only) if it would be of any use? It's a bit of a cheat but it does work.