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 

ListView AltSubmit (A_GuiEvent stays on 'Normal' a while)

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
adamrgolf



Joined: 28 Dec 2006
Posts: 362

PostPosted: Wed Jul 23, 2008 10:51 am    Post subject: ListView AltSubmit (A_GuiEvent stays on 'Normal' a while) Reply with quote

When I select a new row from the example below, I get the tooltip with the file name immediately. If I click that same row again, I do not get the tooltip with the file name immediately. The script sits on the GuiEvent 'Normal' for longer than I would think, then loads my tooltip.

In the example, you'll see the tooltip at x0 y0 showing A_GuiEvent, then the tooltip that loads at the mouse will show the file name.

Is this proper behavior? Because it seems backwards & slow to me.

Try it out:

Code:
#SingleInstance,Force
OnExit,GuiClose

Gui,Add,ListView,AltSubmit gLV,TEST|TEST

Loop,%A_WinDir%\*.*
   {
      If A_Index >10
         Break
      LV_Add("",A_LoopFileName,"o hai")
   }

Gui, Show

Return

LV:
   Critical
   ToolTip, %A_GuiEvent%,0,0,2
   If (A_GuiEvent="I")
      {
         LV_GetText(name,A_EventInfo,1)
         ToolTip, %name%
         SetTimer, RemTT,On
      }
Return

RemTT:
   SetTimer, RemTT,Off
   Sleep, 1000
   ToolTip,
Return

GuiClose:
   ExitApp
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 337
Location: Texas, USA

PostPosted: Wed Jul 23, 2008 1:34 pm    Post subject: Reply with quote

This information is from observation only. I did not check the source code or Microsoft to verify.

When clicking a ListView item that is already selected, AutoHotkey or the OS (probably the OS) waits for another click (i.e. double-click) before deciding that the initial click was the only click. Only after this determination can the program/OS send the notifications that you're looking for.

To verify this, go to the Control Panel and change the double-click speed of your mouse to as fast as it can go. After making this change, try your test again. Your ToolTip should be more responsive when you click on an item that is already selected.

Them be my thoughts...
Back to top
View user's profile Send private message
adamrgolf



Joined: 28 Dec 2006
Posts: 362

PostPosted: Thu Jul 24, 2008 6:20 am    Post subject: Reply with quote

True, this does make it respond faster, but its still not instant.

My question i guess is, why when selecting a new row are the guievents recieved as I then Normal, but when clicking an already highlighted row is it recieved Normal (pause) then I... ? Shouldn't a newly selected row also wait to see if you are going to double click?
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 337
Location: Texas, USA

PostPosted: Thu Jul 24, 2008 10:05 am    Post subject: Reply with quote

adamrgolf wrote:
Shouldn't a newly selected row also wait to see if you are going to double click?

It does. But because you clicked on an unselected row, codes for a single click are sent first. If the single-click becomes a double-click, codes for a double-click are sent.

The ToolTip in the code is good but to see what is actually happening and in what order, put an "outputdebug A_GuiEvent=%A_GuiEvent%" statement in the code right after the Critical statement. Open a debugger and try the test again. When you single-click on an unselected row, you'll see all of the codes you're expecting. But when you double-click on an unselected row, you'll see that all of the codes for a single-click are sent first and then codes for a double-click follow.

I hope this helps.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
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