Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

LVA: Color individual cells of a ListView, and more ...


  • Please log in to reply
41 replies to this topic
Morpheus
  • Members
  • 475 posts
  • Last active: Oct 21 2014 11:08 AM
  • Joined: 31 Jul 2008

Things to Do:
- Implement an editcontrol to be shown to edit individual cells
- same as above, but with a dropdownbox


has this been implemented? are there any other controls that have done this?

i know i've seen some other IDEs that use these controls, maybe the Visual Basic platform where they use one of these controls which handles all the settings of a particular control or something. i want one of these for my app


for example, this properties box in the image below, you can click the cells and edit them or get a dropdown, etc

<!-- m -->http://www.cs.trinit... ... w.ht30.jpg<!-- m -->


<!-- m -->http://www.autohotke...topic19929.html<!-- m -->

ApertureLabs
  • Guests
  • Last active:
  • Joined: --
Having problems with displaying colors atfer a Gui window containing a colored listview is destroyed and recreated. Anyone have a solution for this?

dadepp
  • Members
  • 27 posts
  • Last active: Feb 28 2012 08:33 PM
  • Joined: 12 Jun 2008
First off I'm sorry it took me this long to reply, but I was otherwise preoccupied and the notification mail got lost/spammfiltered or i simply overlooked it. (that and I must admit, I kinda forgot about LVA :oops: ).

Then the problems:

The problem I'm having is that the listview is on a second gui. When you destroy and reopen the Gui, I run into both lagginess and a redrawing problem. Does LVA not handle a destroyed and recreated Listview?

In short: NO. LVA was never intended to handle destruction and recreation of listviews. Everytime a control is created it is assigned a Handle, and this handle is used internally to keep track of which listview is currently redrawing. So everytime it is destroyed the handle changes and thus the previous data is invalid. That might be a reason for the lagginess, but I can't be sure.

To fix freezing bug you can also try this:

1. Remove subclassing. Put return in lva_Subclass function as first line.
2. Put critical 500, in lva_OnNotify function.

Well since I never encountered this freezing bug, I opted to have the subclassing as standard, an apologize to everyone that encountered this.
I'll upload a new version with critical in it, and subclassing standard off.
But the subclassing is noted in the Docs: Set 3rd parameter of LVA_ListViewAdd (UseFix !) to false.

Is it possible that someone could develop a function to draw a line through the cell to create a strike through look?

This is almost already possible, but has nothing to do with this function. What needs changing is the font part of the current cell. As it stands its a minor change to the code to include a check for the font, but I had/still have trouble parsing the font format, since per windows you are only allowed to change a few properties of the font.

So all in all, I'm sorry it took me this long to respond, but I'll upload a minor bugfix version right away. Edit: Uploaded v1.1
If I get around to it in the next 2-3 weeks, I'll rewrite it from scratch (more or less), and try to include better support for listview destruction and font.

ApertureLabs
  • Guests
  • Last active:
  • Joined: --

In short: NO. LVA was never intended to handle destruction and recreation of listviews. Everytime a control is created it is assigned a Handle, and this handle is used internally to keep track of which listview is currently redrawing. So everytime it is destroyed the handle changes and thus the previous data is invalid. That might be a reason for the lagginess, but I can't be sure.


Is there a way for LVA to discard that handle (possibly to free itself from the lag?), and get the new handle of the new listview?

S0und
  • Members
  • 100 posts
  • Last active: Apr 08 2015 10:07 AM
  • Joined: 16 Feb 2007

In short: NO. LVA was never intended to handle destruction and recreation of listviews. Everytime a control is created it is assigned a Handle, and this handle is used internally to keep track of which listview is currently redrawing. So everytime it is destroyed the handle changes and thus the previous data is invalid. That might be a reason for the lagginess, but I can't be sure.


Is there a way for LVA to discard that handle (possibly to free itself from the lag?), and get the new handle of the new listview?



bump!


btw, can i create a control with a set handle? So every time i destory my gui, and recreate it, i will use the same LV handle.

oldbrother
  • Members
  • 149 posts
  • Last active: Nov 09 2014 07:36 PM
  • Joined: 06 Jul 2005
The download link is broken.
I am wondering if anyone can share his saved LVA.ahk.
Thanks!

S0und
  • Members
  • 100 posts
  • Last active: Apr 08 2015 10:07 AM
  • Joined: 16 Feb 2007

 

 

here you go



oldbrother
  • Members
  • 149 posts
  • Last active: Nov 09 2014 07:36 PM
  • Joined: 06 Jul 2005

Thank you so much!



biatche
  • Members
  • 90 posts
  • Last active: Jul 01 2013 03:26 AM
  • Joined: 23 Feb 2008

After seeing that the following lines don't do a thing whatsoever

 

LVA_ListViewAdd("lv_Query", "AR ac cbsilver")
OnMessage("0x4E", "LVA_OnNotify")
LVA_SetCell("lv_Query", _row, 3, "yellow", "green")

 

I went ahead to test the sample gui on page 1, and here's the ss

 

  • vKhxGPAl.jpg

 

What could be wrong? Im using ahk 1.1.10.1 x64 on win7 x64



toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005

I found maybe a bug, the red code i added to fix it.

Basically when you sepcified Col = 1 the second column got the image. This additions fixes it.

This fits now also to the comment in the original code "Using 1 for Col , is the same as using: LV_Modify(Row, "Icon" . iNum) !)"

LVA_SetSubItemImage(LVvar, Row, Col, iNum){
  GuiControlGet, hLV, Hwnd, %LVvar%
  VarSetCapacity(LVItem, 60, 0)
  if (Row < 1)
    Row := 1
  if (Col < 1)
    Col := 1
  NumPut(2, LVItem, 0)
  NumPut(Row-1, LVItem, 4)
  NumPut(Col-1, LVItem, 8)
  NumPut(iNum-1, LVItem, 28)
  SendMessage, 4102, 0, &LVItem,, ahk_id %hLV%
}

Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005

LVA doesn't work with 64bit Unicode.

Would you consider to upgrade LVA to work with 64bit?

 

I updated the LVA_SetSubItemImage with some help of other forum members. But to adjust the other functions is above my head.

LVA_SetSubItemImage(LVvar, Row, Col, iNum){
  Static LVM_SETITEM := A_IsUnicode ? 0x104C : 0x1006 ; LVM_SETITEMW : LVM_SETITEMA
  Static LVITEMSize := 48 + (A_PtrSize * 3)
  Static OffImage := 20 + (A_PtrSize * 2)
  GuiControlGet, hLV, Hwnd, %LVvar%
  VarSetCapacity(LVItem, LVITEMSize, 0)
  Row := (Row < 1) ? 1 : Row
  Col := (Col < 1) ? 1 : Col
  NumPut(2, LVItem, 0, "UInt")
  NumPut(Row-1, LVItem, 4, "Int")
  NumPut(Col-1, LVItem, 8, "Int")
  NumPut(iNum-1, LVItem, OffImage, "Int")
  SendMessage, % LVM_SETITEM, 0, &LVItem,, ahk_id %hLV%
}

Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005

This workd great in the default view mode "report".

But how could the first (and only) "cell" in the view mode "icon" be colored?


Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.