|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
gyan1010 Newbie cheater Reputation: 0
Joined: 22 Oct 2007 Posts: 23
|
Posted: Sat Jan 28, 2012 12:19 am Post subject: How do I access checkboxes in listviews |
|
|
From the form designer I noticed I could add Checkboxes in ListViews and decided to try it for my lua script.
I was able to add them buy setting the property
Code: | setProperty(lv, 'Checkboxes', 'True') |
But now that I have items, how do I access the state of each check box?
I've tried using getPropertyList on one of the items to see if it somewhere in there but get access violations.
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Sat Jan 28, 2012 10:53 am Post subject: |
|
|
the "checked" property is part of the ListItem class
try this: untested
Code: |
lvi=listitems_getItem(lv, indextolookup)
getProperty(lvi, "Checked")
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
gyan1010 Newbie cheater Reputation: 0
Joined: 22 Oct 2007 Posts: 23
|
Posted: Sat Jan 28, 2012 11:23 am Post subject: |
|
|
Thanks for the reply, that doesn't work though.
I cannot get listitems_getItem to return the item, it is not documented in help btw.
But I also tried getting this property using the return value from listitems_add which should return the ListItem class as well. Yet it says checked it not a property of that.
Here is my whole code so far along with a test for that line.
Code: | -- Form
f=createForm()
control_setSize(f,300,400)
setProperty(f, 'BorderStyle', 'bsDialog')
-- List View
lv = createListView(f)
control_setSize(lv,280,380)
control_setPosition(lv,10,10)
setProperty(lv, 'ViewStyle', 'vsReport')
setProperty(lv, 'Checkboxes', 'True')
setProperty(lv, 'ReadOnly', 'True')
-- Columns
lvc=listview_getColumns(lv)
c1=listcolumns_add(lvc)
listcolumn_setCaption(c1, 'Hacks')
setProperty(c1, 'AutoSize', 'True')
-- Rows
lvis=listview_getItems(lv)
-- addHack Function
hacks = {}
function addHack(name,search,replace,initialOffset)
i = #hacks + 1
hacks[i] =
{
-- Variables
search = search,
replace = replace,
initialOffset = initialOffset or 0,
-- Control Objects
_item = listitems_add(lvis)
}
listitem_setCaption(hacks[i]._item, name)
end
-- Test Data
addHack("Test Hack 1","","")
addHack("Test Hack 2","","",4)
addHack("Test Hack 3","","")
-- Testing
--print(getProperty(hacks[1]._item, "Checked"))
lvi=listitems_getItem(lvis, 1)
print(getProperty(lvi, "Checked")) |
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Sat Jan 28, 2012 11:46 am Post subject: |
|
|
sorry, listitems_getItem is a 6.2+ function, forgot that.
Also, seems like checked isn't a published property, so get/setProperty wouldn't work anyhow
Just wait till 6.2 if you need to use the undocumented "Checkbox" function, it's implemented there
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
gyan1010 Newbie cheater Reputation: 0
Joined: 22 Oct 2007 Posts: 23
|
Posted: Sat Jan 28, 2012 12:53 pm Post subject: |
|
|
Ok Thanks again!
Don't suppose there is any use asking for a beta version to play with is there?
|
|
Back to top |
|
|
gyan1010 Newbie cheater Reputation: 0
Joined: 22 Oct 2007 Posts: 23
|
Posted: Sun Jan 29, 2012 12:10 am Post subject: |
|
|
I'd also like to be able to perform other actions like color changing on the individual items in the listview. It seems that although they are indeed control objects, making them different than listboxes, we are locked out of accessing their properties.
Is this also something that will be changed in 6.2?
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25291 Location: The netherlands
|
Posted: Sun Jan 29, 2012 2:35 am Post subject: |
|
|
With the subitems you can add other columns (but that's already possible in 6.1)
Color though is something not implemented for 6.2 (Color isn't part of a listitem, or even listview. You draw it yourself at the position where the item is...)
perhaps 6.3
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
|
|
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 You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|