AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

LVX: Row highlighting and cell editing for ListView controls
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Thu Dec 13, 2007 4:20 pm    Post subject: Reply with quote

the same.

About Notify, if you want to make good wrapper, you should use RegisterCallback to chain your notifications to existing OnMessage handler.
_________________
Back to top
View user's profile Send private message MSN Messenger
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Thu Dec 13, 2007 9:56 pm    Post subject: Reply with quote

I believe the latest update v1.04 resolves the Edit positioning bug. Since it's impossible (and I hope I'm wrong here) to change a ListView row height I left the edit to adjust its height automatically according to the currently selected font.

majkinetor wrote:
About Notify, if you want to make good wrapper, you should use RegisterCallback to chain your notifications to existing OnMessage handler.
How can this be done?
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Thu Dec 13, 2007 10:18 pm    Post subject: Reply with quote

I I understand correctly (which is not always the case), I think majekinor is referring to that (stolen from his ComboX script):
Code:
ComboX_setWndProc(hCtrl) {
   static cnt=-1, proc

   if (cnt=-1)
      VarSetCapacity(proc, 40)
   
   cnt++
   if (cnt > 10){
      msgBox Too many combos
      return
   }

   newProcAddr := RegisterCallback("ComboX_WndProc", "F", 4, &proc + cnt*4)
    old := DllCall("SetWindowLong", "UInt", hCtrl, "Int", -4, "Int", newProcAddr, "UInt")
   NumPut(old, &proc+cnt*4)
}


ComboX_wndProc(hwnd, uMsg, wParam, lParam){
   global ComboX_Active
   old := NumGet(A_EventInfo+0)   

   res := DllCall("CallWindowProcA", "UInt", old, "UInt", hwnd, "UInt", uMsg, "UInt", wParam, "UInt", lParam)
   if (uMsg = 8)
      ComboX_Hide(hwnd), ComboX_Active := ""
   return res
}


About using LVX, is there a way to have two listviews at the same time with colored rows?
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Fri Dec 14, 2007 1:05 am    Post subject: Reply with quote

No, comboX use subclassing, which is something that has to be done here too in order to support edit activation via ENTER.

It goes like this:

Code:
     oldfunc := OnMessage(WM_NOTIFY, "LVX_OnNotify")
     oldfunc := RegisterCallback(oldfunc, "", 4)


LVX_OnNotify(...){
    ; do your thing here
    return DllCall(oldfunc, wparam, lparam ..... );
}


There is tutorial here with Call instead RegisterCallback.
_________________
Back to top
View user's profile Send private message MSN Messenger
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Fri Dec 14, 2007 1:23 am    Post subject: Reply with quote

Doesn't the WM_NOTIFY pass through the WndProc?
majkinetor wrote:
There is tutorial here with Call instead RegisterCallback.
Very interesting, thanks.
Back to top
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Fri Dec 14, 2007 8:43 am    Post subject: Reply with quote

Quote:
Doesn't the WM_NOTIFY pass through the WndProc?

Yes, ofcourse.
I was telling that ComboX doesn't override WM_NOTIFY.

Suggested method is safer to do.
_________________
Back to top
View user's profile Send private message MSN Messenger
majkinetor



Joined: 24 May 2006
Posts: 3624
Location: Belgrade

PostPosted: Fri Dec 14, 2007 10:16 am    Post subject: Reply with quote

2Titan

I updated the tutorial page and posted example without Call module.
_________________
Back to top
View user's profile Send private message MSN Messenger
Klaus



Joined: 12 May 2005
Posts: 192
Location: Münster, Germany

PostPosted: Wed Jan 02, 2008 10:25 am    Post subject: Sorting disarranges colouring Reply with quote

Hi, Titan,
though it's noted in the sources ("Sorting will not affect coloured rows."), allow me a question mentioning this effect:
When I code a LVX_SetColor, the colour is attached to the row, not to the data. Each sorting or inserting data changes the rows that are coloured.

Does anyone see a chance that once coloured rows keep their colours even when they change their position/line number?

Thanks in advance,
Klaus

PS: Happy New Year everybody!
Back to top
View user's profile Send private message Send e-mail
garry



Joined: 19 Apr 2005
Posts: 1028
Location: switzerland

PostPosted: Wed Jan 02, 2008 11:26 am    Post subject: Reply with quote

hello Klaus,
made an example, change colors depending extension (not by row number)

http://www.autohotkey.com/forum/post-165703.html#165703

in example:
.....
stringsplit,BX,A_LoopReadLine,`;,
SplitPath,BX2,,,ext,,
LV_Add("",BX1,BX2)
if ext=exe ;when column2 is exe make it green
LVX_SetColour(I, 0x008000)
......
Back to top
View user's profile Send private message
bmcclure



Joined: 24 Nov 2007
Posts: 446

PostPosted: Fri Jan 11, 2008 4:48 am    Post subject: Reply with quote

Interesting functions. I was reading the documentation for LVX_CellEdit and noticed this:

The documentation syntax:
Quote:
LVX_CellEdit(r, c, set)

Actual function definition:
Code:
LVX_CellEdit(set = true)

_________________
-Ben

SteamLab
SteamLab Wiki

[Broken] - My industrial music [on GarageBand]
Back to top
View user's profile Send private message
bmcclure



Joined: 24 Nov 2007
Posts: 446

PostPosted: Fri Jan 11, 2008 5:36 am    Post subject: Reply with quote

I also don't understand how to properly use LVX_CellEdit

I want to use Enter for submit, like the default, but I also need to save the submitted value so that I can change my XML file afterward.

Is there any way I can get the submitted value, or be notified when it is submitted so I can get the new text out of the listview?
_________________
-Ben

SteamLab
SteamLab Wiki

[Broken] - My industrial music [on GarageBand]
Back to top
View user's profile Send private message
garry



Joined: 19 Apr 2005
Posts: 1028
Location: switzerland

PostPosted: Fri Jan 11, 2008 8:45 am    Post subject: Reply with quote

on first page is an example
add,delete, modify
with rightclick can modify selected row/column and overwrite (enter)
script example:
http://www.autohotkey.net/~garry/LVX_EX_103b.ahk
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Fri Jan 11, 2008 4:59 pm    Post subject: Reply with quote

bmcclure wrote:
I want to use Enter for submit, like the default, but I also need to save the submitted value so that I can change my XML file afterward
I forgot to mention in the docs that the function returns the entered value when the user leaves editing mode. You can prevent automatic updating on the ListView by specifying false for the third parameter then later setting it yourself manually with LVX_SetText().
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Jero3n



Joined: 19 Jan 2007
Posts: 151

PostPosted: Fri Jan 11, 2008 5:25 pm    Post subject: Reply with quote

Looks really nice, this is where I was searching for.
But I have one little problem...
I downloaded the newest version of it, and tried the example given in the first post.
It opens an ahk script, but it don't show anything :S
Yes, I included LVX.ahk, so that isn't the problem.
Please help me Razz
Back to top
View user's profile Send private message
Titan



Joined: 11 Aug 2004
Posts: 5049
Location: imaginationland

PostPosted: Fri Jan 11, 2008 5:30 pm    Post subject: Reply with quote

Jero3n wrote:
I downloaded the newest version of it, and tried the example given in the first post.
It opens an ahk script, but it don't show anything :S
I done the same just now and it works fine. What OS are you using?
_________________

RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group