Obsolete test build - Tab3 control with autosizing, SetTimer improvements

Community news and information about new or upcoming versions of AutoHotkey
User avatar
joedf
Posts: 6289
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

08 Oct 2015, 22:44

Alguimist wrote:With the advent of Tab3, the Tab2 will not be deprecated though, because it allows controls to be created outside the tab control, which can be very useful in some cases, for example, in a settings dialog, as follows:

Image

FileZilla Settings.ahk


Very nice replication, by the way! ;)
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Oct 2015, 01:46

lexikos wrote:No. I was, for a short time a few weeks ago.
Sorry, my bad.

lexikos wrote:If that was the cause, you could just set the bitmap via STM_SETIMAGE.
Yes, that's what I do in this case. And it actually reduces flickering dramatically. But I remember some discussions about AHK's 'noob-friendliness'.
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Oct 2015, 02:23

On my slow Windows 7 system and my fast Windows 10 system, it makes absolutely no difference. Either way (via STM_SETIMAGE or GuiControl), the control's background is erased when the picture changes, causing the same amount of flicker.
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Oct 2015, 04:32

lexikos wrote:... it makes absolutely no difference
Currently I'm running Win 10 on a lenovo Ideapad with a Core i3 2310-M CPU @ 2.10 GHz, 4 GB RAM, and Intel HD Graphics 3000. With STM_SETIMAGE (which I'm using since Win XP) and even with the new optionHBITMAP:... I can observe almost no flickering here, whereas GuiControl, , Pic, %PicPath% clearly flickers.

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

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

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Oct 2015, 07:06

With your previous script, replacing GuiControl with LoadPicture and STM_SETIMAGE made absolutely no difference to the results on my computers.

With your new script, using a filename vs handle makes absolutely no difference on Windows XP. Using LoadPicture on Windows 7/10, it appears to flicker less often. I believe this is due to the timing with which the desktop window manager updates the screen. I suppose that at 60Hz, you have between 0 and 16ms to erase the control's background and paint the new image before the screen updates. Loading the picture from file before calling GuiControl would reduce the time between removing the old bitmap and painting the new one onto the window (or more precisely, the window's off-screen buffer), thereby reducing (but not eliminating) the chance that you will see flicker.

I will see what I can do.
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Oct 2015, 08:11

Thanks for your efforts. After playing around with the pictures for a while I remembered the other options to reduce flickering. I don't know why I forget them frequently, sorry.

BackgroundTrans (if the images aren't transparent) or GuiControl, -/+Redraw seem to have at least the same effect here. So a hint in the docs to use these option might be sufficient.
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test build - Tab3 control

18 Oct 2015, 07:50

lexikos wrote:v1.1.22.07-19+g6c206a4
Menu improvements:
Added options for the Add and Insert sub-commands. The parameter formerly known as Pn can contain a list of options, with the same syntax as Gui/GuiControl: space/tab delimited, optional + or - prefix.
  • Radio: If checked, a bullet point is used instead of a check mark.
    ...

Are you interested in adding built-in support for radio groups?
CheckMenuRadioItem wrote:Checks a specified menu item and makes it a radio item. At the same time, the function clears all other menu items in the associated group and clears the radio-item type flag for those items.
Source
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

18 Oct 2015, 16:43

No, I am not interested. It looks trivial to do with DllCall and MenuGetHandle, or even Menu Check/Uncheck and a loop.
Zvonko
Posts: 200
Joined: 19 Jun 2015, 11:52

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

21 Nov 2015, 08:56

LoadPicture():
I am not sure if this is relevant:
Converting single-image ico to png: My first test (using AutoHotkey112207_27_g615a1ce_w.exe) shows that with LoadPicture() the transparency is lost (!) even on newer Windows versions.
https://autohotkey.com/boards/viewtopic.php?f=5&t=10611
For me as a newbie it is frustrating to fail due to "little" problems in projects in which the entire concept and even complex functions are working perfectly...
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

21 Nov 2015, 18:09

No, it's not relevant. LoadPicture preserves the transparency. GdipCreateBitmapFromHBITMAP does not. See other thread.
User avatar
jNizM
Posts: 2317
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

08 Dec 2015, 06:11

My conclusion so far for Tab3: works without any problems

Is there a plan to release it?
[AHK] 1.1.28.02 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
Alguimist
Posts: 233
Joined: 05 Oct 2015, 16:41

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

08 Dec 2015, 15:17

It seems that the color parameter of the Gui Font command is being ignored inside a Tab3 for Text and GroupBox controls.

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

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

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

08 Dec 2015, 20:38

@jNizM: I intend to look into auto-sizing of the control before releasing it.

@Alguimist: It is overridden by the theme. I'll see if that can be "fixed" without breaking the themed background (which is a gradient on XP).
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test build - Tab3 control

11 Dec 2015, 21:38

I wrote:
jNizM wrote:How can you add the Edit after the tab with y+10 if you dont know how big the Tab is on a non static Gui?
...
Also, it's actually very easy: just add the y+10 control after the tab control but before the tab's contents, as demonstrated by tab-order.ahk (#2 control). It messes up the tab order for Tab and Tab2, but Tab3 is okay.

I just realized that if you want the bottom edge of the tab control plus the current margin (which would be y+m if the tab control was the previous control), in many cases you can just specify x (absolute or xm) and omit y. It will default to placing the control below the lowest control.

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

Gui Add, Tab,, One
Gui Add, Text,, Inside the tab control.
Gui Tab
Gui Add, Text, xm, Outside the tab control.
Gui Show
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

09 Jan 2016, 04:56

Hello lexikos,

when will the changes regarding to v1.1.22.07-19+g6c206a4 (menues / pictures / icons) be released? Do you already have a timeline? The results of my tests seem to be faultless.
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

10 Jan 2016, 02:16

There are some complications with Tab3 auto-sizing and control positioning which I will need to sort out (and test) before integrating Tab3. As my motivation has been low lately, I intend to include only the non-Tab changes in the next release. But first, I have to finish writing the documentation. It could be a few days or a few weeks, depending on my level of interest.
just me
Posts: 5397
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

10 Jan 2016, 07:16

As my motivation has been low lately, I intend to include only the non-Tab changes in the next release.
No problem for me.
It could be a few days or a few weeks, depending on my level of interest.
Well, so what would boost your level of interest in case it's low?
User avatar
jNizM
Posts: 2317
Joined: 30 Sep 2013, 01:33
GitHub: jNizM
Contact:

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

14 Jan 2016, 05:10

just me wrote:
It could be a few days or a few weeks, depending on my level of interest.
Well, so what would boost your level of interest in case it's low?


Maybe a good beer (or two) :D
Image
[AHK] 1.1.28.02 x64 Unicode | [WIN] 10 Pro (Version 1803) x64 | [GitHub] Profile
Donations are appreciated if I could help you
User avatar
Flipeador
Posts: 780
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina
Contact:

Re: New test builds - Tab3 control, Menu improvements, LoadPicture, new vars

16 Jan 2016, 15:48

test menu & LoadPicture()

Code: [Select all] [Expand] [Download] (Untitled.ahk)GeSHi © Codebox Plus


thanks for update!
lexikos
Posts: 5939
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

New test build - autosizing Tab3, SetTimer improvements

13 Mar 2016, 04:21

v1.1.23.03-13+gfc20377

Tab3

Includes Tab3 control as before, with the addition that its width and/or height (if left unspecified) are automatically calculated based on the contents of the tab control.
  • If only one dimension is specified, the other dimension is calculated automatically.
  • Autosizing occurs only once, either when you call Gui Show for the first time or when you call Gui Tab with a different tab control number/name (or none at all). This is done so that the next control you add can be relative to the Tab control. Any controls you add after that will not be taken into account (and you can utilize this fact).
  • Controls on all tabs of that tab control are taken into account.
SetTimer

These changes may break scripts.

If the Label parameter is completely omitted (not an empty variable or expression), it defaults to the timer which launched the current thread. This should make it much easier for timers which use bound functions to delete themselves (by calling SetTimer,, Delete). Since SetTimer, label behaves like SetTimer, label, On for timers which already exist, SetTimer with no parameters will re-enable the timer which launched the thread.

If Label is an object created by the script (not a function or label) and Period is negative, the timer is deleted automatically after it is run. This occurs after the timer function returns, but only if the timer did not re-enable itself. This is effectively the same as if the timer function calls SetTimer,, Delete. Note that because the timer is deleted, its Period and Priority are not retained, which differs from the previous behaviour. Again, this change does not affect functions or labels.

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.

If Label is an expression which resolves to an object or empty string, an error is raised. This is to help debugging, because AutoHotkey v1 does not support passing objects to commands; instead, SetTimer receives only an empty string. Note that % variable is optimized at load time to become %variable%, so you can still pass an object this way.

If Label is specified but resolves to an empty variable, an error is raised. This is for consistency (and see below).

I also believe it would be extremely rare that one would need an expression or variable to resolve to either "the current timer" or "some other timer". It seems more likely that any empty variable or expression is simply an error. If you need to work around this, you can conditionally call SetTimer,, xxx or SetTimer, label, xxx, or (in some cases) use A_ThisLabel or A_ThisFunc.

SetTimer and other commands

When passing a function reference (not a custom object) to SetTimer, Hotkey, GuiControl or Menu, the parameter count of the function is now checked against the number of parameters that the command will supply. If the function requires too many parameters, an error is raised or ErrorLevel is set (as appropriate). This validation was already done for functions passed by name.

Return to “Announcements”

Who is online

Users browsing this forum: No registered users and 1 guest