Obsolete test build - Tab3 control with autosizing, SetTimer improvements

Community news and information about new or upcoming versions of AutoHotkey
just me
Posts: 4862
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test build - Tab3 control with autosizing, SetTimer improvements

14 Mar 2016, 07:34

lexikos wrote:These changes may break scripts.

How about a new BIV A_ThisTimer providing all kinds of timers?
Remaining with AHK 1.1.25.02 until v2 will become beta.
User avatar
jNizM
Posts: 2295
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

14 Mar 2016, 09:26

Did I missed something?

Image
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
jballi
Posts: 445
Joined: 29 Sep 2013, 17:34

Re: New test build - autosizing Tab3, SetTimer improvements

14 Mar 2016, 09:54

lexikos wrote:Previously (since v1.1.01) the default value of Label was %A_ThisLabel%, even if there is no timer running or there is a timer running but it called a function. Scripts that relied on this weird behaviour will break.

If Label is omitted and the current thread was not started by a timer (or the timer has been deleted), an error is raised.

May is not the correct word. This change will break scripts. I write many of my subroutines to run as a standard subroutines and as timers. Almost all of these routines have SetTimer,,Off as the first line of the subroutine. If this change is implemented as is, I will have to change many many scripts to put back the %A_ThisLabel% or to precede the statement with the "Try" command. AutoHotkey v1.1.01 was released almost 5 years ago. This change can affect thousands if not hundreds of thousands of scripts or more. I sincerely urge you not to break scripts, especially for something that has been this way for almost 5 years.

Them be my thoughts.
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

14 Mar 2016, 19:04

just me wrote:How about a new BIV A_ThisTimer providing all kinds of timers?
Built-in variables can only return strings.

jballi wrote:AutoHotkey v1.1.01 was released almost 5 years ago.
Damn, you're right. :shock:
This change can affect thousands if not hundreds of thousands of scripts or more.
That seems likely to be exaggerated.

I think it should be sufficient to use A_ThisLabel as before, but falling back to the current timer when A_ThisLabel is empty. Do you see any problems with this? It would mean that a timer callback function wouldn't be able to use SetTimer,,xxx to disable/modify itself from within an internal gosub subroutine/after goto, but that seems like an edge case.

@jNizM: I didn't see this on my Windows 10 system. Thanks for pointing it out (although I had difficulty seeing it even with the red ellipse; a few words of description would have been useful).
User avatar
jNizM
Posts: 2295
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

15 Mar 2016, 02:44

v1.1.22.06-5+gc938422 vs v1.1.23.03-13+gfc20377
Image

The right grey Tab3 "border" line is missing in the latest version.

Windows 10 Enterprise
Version: 1511
Build: 10586.164
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

15 Mar 2016, 03:33

Yes, I know. You pointed it out in your previous post, and I acknowledged it. :?

The issue is that the "tab dialog" which hosts the controls is slightly too wide, and is covering the right border. It will be fixed.
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

15 Mar 2016, 07:13

v1.1.23.03-17+gf6a2f5e:
  • Fixed Tab3 right edge overlapping the border.
  • Changed SetTimer,, xxx to use A_ThisLabel as before, but fall back to the current timer when A_ThisLabel is empty.
jballi
Posts: 445
Joined: 29 Sep 2013, 17:34

Re: New test build - Tab3 control with autosizing, SetTimer improvements

15 Mar 2016, 12:38

lexikos wrote:I think it should be sufficient to use A_ThisLabel as before, but falling back to the current timer when A_ThisLabel is empty. Do you see any problems with this? It would mean that a timer callback function wouldn't be able to use SetTimer,,xxx to disable/modify itself from within an internal gosub subroutine/after goto, but that seems like an edge case.

Sounds right. I will download the latest version and give it a try/see. Thanks.
just me
Posts: 4862
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test build - Tab3 control with autosizing, SetTimer improvements

20 Mar 2016, 06:36

lexikos wrote:
just me wrote:How about a new BIV A_ThisTimer providing all kinds of timers?
Built-in variables can only return strings.
Because they were implemented this way at times when all variables always contained strings?
Remaining with AHK 1.1.25.02 until v2 will become beta.
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

20 Mar 2016, 22:15

Yes. The limitation will be removed at some point, but I prefer to not make these sort of changes in the v1 code base. Aside from that, I'd prefer not to add this variable at all since it has, in my opinion, limited usefulness.

The point of SetTimer's Label being optional is merely convenience. If you have any practical need to identify the current timer from a function which serves multiple timers, you can use Bind or a class with a Call method (patterns which will also work with any other callbacks, like Gui, menu, OnMessage, etc).
User avatar
jNizM
Posts: 2295
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

20 May 2016, 04:36

Hey lexikos,

some new updates about your motivation to integrate Tab3 into main release?

Im still on v1.1.23.03-17+gf6a2f5e :D
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

21 May 2016, 21:16

v1.1.24.00 integrates this branch.
User avatar
Drugwash
Posts: 307
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

24 May 2016, 12:04

I've wasted the whole day today unaware of the lonstanding issue in Tab regarding BackgroundTrans and ListView. Had I known about v1.1.24.00 earlier… :)
Anyway, fixing controls' background color in a themed Tab is most welcome, thank you!
I'd have two questions (one may have already been asked, haven't read this whole topic :oops: ):
- is Tab3 so different than Tab2 that it demanded its own separate control type instead of updating Tab2?
- could (only) this Tab change be easily backported to AHK Basic source, should one attempt to improve it?

And a suggestion that may be useful for many users involved with DllCalls: add a built-in variable called A_CharSize that would hold the value of a character's size according to AHK version (ANSI/Unicode). Would avoid much overhead in functions that require on-the-fly calculation of a struct size, string length and/or other operations.

I would stretch the above request to another built-in variable called simply AW that would additionally avoid calculation overhead when choosing API versions based on AHK ANSI/Unicode version (such as DllCall("FormatMessage" AW […] vs DllCall("FormatMessage" (A_IsUnicode ? "W" : "A") […] ).

They would both improve code readability and - more important - script speed, especially when such functions are called repeatedly and/or execution time is critical.
User avatar
joedf
Posts: 5994
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

24 May 2016, 18:02

Tab vs Tab2 vs Tab3 :crazy:
A_CharSize would be nice :)
User avatar
jNizM
Posts: 2295
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

25 May 2016, 00:43

Drugwash wrote:And a suggestion that may be useful for many users involved with DllCalls: add a built-in variable called A_CharSize that would hold the value of a character's size according to AHK version (ANSI/Unicode). Would avoid much overhead in functions that require on-the-fly calculation of a struct size, string length and/or other operations.

VarSetCapacity(buf, size * (A_IsUnicode ? 2 : 1), 0) ?
[AHK] 1.1.26.01 x64 Unicode | [WIN] 10 Pro (Version 1703) x64
My GitHub Profile | Donations are appreciated if I could help you
User avatar
joedf
Posts: 5994
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

25 May 2016, 01:03

Yes that's what I usually use. :)
User avatar
Drugwash
Posts: 307
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

25 May 2016, 05:58

jNizM wrote:
Drugwash wrote:And a suggestion that may be useful for many users involved with DllCalls: add a built-in variable called A_CharSize that would hold the value of a character's size according to AHK version (ANSI/Unicode). Would avoid much overhead in functions that require on-the-fly calculation of a struct size, string length and/or other operations.

VarSetCapacity(buf, size * (A_IsUnicode ? 2 : 1), 0) ?


joedf wrote:Yes that's what I usually use. :)


Sure, there are more ways to skin a cat, but why perform on each and every such call an extra calculation (the ternary comparison or anything else) when a single steady variable can readily be available? Waste of time and moreso in functions or subroutines that are being called very frequently (i.e. API wrappers). Personally I see it a bit more than simple convenience. Haven't performed any comparison tests but theoretically there should be some gain, mostly depending on each machine's capabilities.

In my scripts I've been using the global variable AW (together with others, see below) in a compact script #included at the beginning of the autoexec section which allows a better compatibility when same scripts are being run under AHK Basic and AHK 1.1+ (I'm still using Win98SE as my main machine and developing scripts on it, in case someone is wondering). Very recently I've changed the logic a bit, making the extra script a function and putting it in the lib folder; on that occasion it occured to me the creation of the A_CharSize variable which I then included into the function. It would be nice (and consistent) if AHK 1.1+ would sport those two variables by default so that anybody running my scripts on their machines under AHK 1.1+ would not even require the presence of the extra script. Better compatibility. ;)

Oh well, that's it. Here's my extra script:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

lexikos
Posts: 5453
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control with autosizing, SetTimer improvements

25 May 2016, 06:26

An announcement topic for an obsolete test build is not the right place to request or discuss new features.

Drugwash wrote:- is Tab3 so different than Tab2 that it demanded its own separate control type instead of updating Tab2?
Yes. The differences are described in detail under the "Tab3 vs. Tab2 vs. Tab" heading in the GUI controls documentation.
- could (only) this Tab change be easily backported to AHK Basic source, should one attempt to improve it?
It could be done. As for how easily, I suppose it depends on the developer. The GUI code hasn't changed significantly, but there have been minor changes throughout the entire project for Unicode and x64 support.
User avatar
Drugwash
Posts: 307
Joined: 29 May 2014, 21:07
Location: Ploieşti, Romania
Contact:

Re: New test build - Tab3 control with autosizing, SetTimer improvements

25 May 2016, 06:46

lexikos wrote:An announcement topic for an obsolete test build is not the right place to request or discuss new features.

My apologies, I got a bit rusty. :oops: Actually I only wanted to express the joy of having that LV/Background issue fixed so promptly and then got carried away.
lexikos wrote:The differences are described in detail under the "Tab3 vs. Tab2 vs. Tab" heading in the GUI controls documentation.

Will look at the documentation more thoroughly, thank you.
lexikos wrote:It could be done. […] The GUI code hasn't changed significantly, but there have been minor changes throughout the entire project for Unicode and x64 support.

Unicode and x64 would be quite too much for now. The most important things I'd like to do in AHK Basic - if possible, if ever - would be synchronizing built-in variables and data types and then maybe a few important fixes/additions such as this Tab3. My C/C++ knowledge is extremely limited and first attempts failed, probably because I bit more than I could chew. :oops:

Talking about Tab3, after a prolonged testing I've noticed a visible flickering of the controls belonging to an inactive tab through the surface of the active tab. There is a ListView in one of the inactive tabs. AHK v1.1.24.0, Windows XP Pro SP4, Intel P4 1.8GHz, 576MB RAM, GeForce 5700. I wonder if anyone else noticed that. :?

Should I open a new topic in Bugs & Feature requests in regard to the suggested variables above?

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 3 guests