AutoHotkey Community

It is currently May 26th, 2012, 1:02 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: December 13th, 2007, 4:20 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
the same.

About Notify, if you want to make good wrapper, you should use RegisterCallback to chain your notifications to existing OnMessage handler.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2007, 9:56 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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?

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 13th, 2007, 10:18 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2007, 1:05 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2007, 1:23 am 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Doesn't the WM_NOTIFY pass through the WndProc?
majkinetor wrote:
There is tutorial here with Call instead RegisterCallback.
Very interesting, thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2007, 8:43 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 14th, 2007, 10:16 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
2Titan

I updated the tutorial page and posted example without Call module.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
PostPosted: January 2nd, 2008, 10:25 am 
Offline

Joined: May 12th, 2005, 8:20 am
Posts: 331
Location: Münster, Germany
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!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 2nd, 2008, 11:26 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
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)
......


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 4:48 am 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
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

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 5:36 am 
Offline

Joined: November 24th, 2007, 9:07 pm
Posts: 774
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

My Trac projects
My Wiki
[Broken] - My music


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 8:45 am 
Offline

Joined: April 19th, 2005, 10:26 am
Posts: 2249
Location: switzerland
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 4:59 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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().

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 5:25 pm 
Offline

Joined: January 19th, 2007, 9:09 pm
Posts: 147
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 :P


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 5:30 pm 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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?

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 56 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Exabot [Bot], sjc1000 and 46 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group