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 

Edit control not redrawing upon gaining focus.

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



Joined: 23 Sep 2007
Posts: 142

PostPosted: Fri Oct 05, 2007 3:10 am    Post subject: Edit control not redrawing upon gaining focus. Reply with quote

When I click the scroll bar of an edit control in an AHK GUI, the portion of the edit that was hidden behind another window is not drawn when it comes to the front.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Tue Nov 13, 2007 7:02 pm    Post subject: Reply with quote

I tried it with the following script but couldn't reproduce the problem:
Code:
gui, add, edit, w100 r10, 1`n2`n3`n4`n5`n6`n7`n8`n9`n10`n
gui show
return

GuiClose:
ExitApp
I put a calculator in front of the GUI and then clicked the scroll bar, but it seemed to redraw okay. Maybe it only affects certain desktop themes.
Back to top
View user's profile Send private message Send e-mail
Xander



Joined: 23 Sep 2007
Posts: 142

PostPosted: Tue Nov 13, 2007 8:53 pm    Post subject: Reply with quote

Your example works for me as well (it draws correctly). I've been able to narrow it down a bit further.. the edit control must be part of a tab control to reproduce this. Adding a tab control to your code produces the drawing error:
Code:
gui, add, tab, , Tab
gui, add, edit, w100 r10, 1`n2`n3`n4`n5`n6`n7`n8`n9`n10`n
gui show
return

GuiClose:
ExitApp


I don't think this is a high priority bug if there isn't a simple fix..
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Fri Nov 16, 2007 4:01 am    Post subject: Reply with quote

Thanks for the example; I can reproduce this behavior now.

There only solutions I see for this are:
(1) Redesigning tab controls to be more traditional. This would be a lot of coding and testing and would have a high risk of breaking existing scripts.
(2) Putting tab controls lower in the z-order than the controls they contain (this is already done for tab controls that contain list-views). This has the drawback of changing the tab-key navigation order so that the tab control is after vs. before the controls it contains. This is less ergonomic, but more importantly it would break any existing script that relies on tab-key navigation order (e.g. scripts that send tab keystrokes to a GUI window).

Since option #1 should probably be implemented later as a new/improved type of tab control (keeping the old control for backward compatibility), it's probably best to go with option #2.

Comments are welcome, especially about the likelihood of breaking existing scripts. Is it worth it?
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10464

PostPosted: Wed Nov 21, 2007 2:58 pm    Post subject: Reply with quote

Since the tab control has been a part of the language for so long, backward compatibility seems important (namely the order of tab-key navigation). So I decided to keep the existing tab control and add a "tab2" control that doesn't have these redrawing issues (e.g. activating a GUI window by clicking certain parts of its controls, such as scrollbars, might redraw improperly).

Future scripts should use Tab2 instead of Tab whenever possible. For example:
Gui, Add, Tab2,, General|View|Appearance|Settings
Back to top
View user's profile Send private message Send e-mail
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