Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

v1.0.44 released: New GUI controls: TreeView and Status Bar


  • Please log in to reply
41 replies to this topic
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Here are the changes for v1.0.44.12:

Fixed timers interfering with double-clicks in FileSelectFile. [thanks DJAnonimo]

Fixed mouse hook causing a delay when pressing a GUI window's title bar buttons. [thanks Tekl]

Improved GUI windows to have CS_DBLCLKS so that OnMessage() can monitor double clicks via WM_LBUTTONDBLCLK, WM_RBUTTONDBLCLK, and WM_MBUTTONDBLCLK. [thanks Hardeep]

Improved ListViews to support logical sorting, which treats digits as numbers rather than mere characters. [thanks Tekl & Hacker]

toralf
  • Moderators
  • 4035 posts
  • Last active: Aug 20 2014 04:23 PM
  • Joined: 31 Jan 2005
Cool, thanks for the update.

Is it possible to add the logicalSort to the Sort command too? So that it isn't only available to ListViews.
Ciao
toralf
 
I use the latest AHK version (1.1.15+)
Please ask questions in forum on ahkscript.org. Why?
For online reference please use these Docs.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Wow, you were fast for the logical sorting...
toralf's request is a good idea, too... Even if I haven't used Sort yet.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004

Is it possible to add the logicalSort to the Sort command too? So that it isn't only available to ListViews.

(UPDATE: Laszlo has created a solution that might be suitable for most purposes at: Logical sort text-number sequences.)

I'd planned to do so, but unlike ListViews -- which do the conversion to Unicode for you if you send them a Unicode message -- the Sort command would require extra memory to be allocated and a call to MultiByteToWideChar() to convert to Unicode. This in turn would require that either a limit be placed on how large each line of text can be (which I don't like), or creation of a Unicode variation of the current sort routine (which would add a lot of code size). So compared to other priorities, working on that seemed a bad use of time (though it's still on the to-do list).

You could achieve logical sorting in a script by writing a sort algorithm and calling MultiByteToWideChar + StrCmpLogicalW via DllCall (requires Windows XP). Of course it would be slower than a built-in sort, but hopefully adequate. You could also take the amusing approach of creating a hidden ListView and putting your text into it, then sorting and retrieving the results, and finally destroying it without ever showing it.

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Here are the changes for v1.0.44.13:

Fixed ControlGetPos and ControlMove to work with ahk_id %ControlHWND%. [thanks Hardeep]

Fixed #CommentFlag to affect the line beneath it the same way as other lines. [thanks PhiLho]

Changed A_OSVersion to report Windows Vista as "WIN_VISTA" rather than "".

Added options to set min/max size of GUI windows; for example: Gui +MinSize320x240 +MaxSize640x480

Thalon
  • Members
  • 641 posts
  • Last active: Jan 02 2017 12:17 PM
  • Joined: 12 Jul 2005
Congratulation to your 8888 posts Chris :)
The min/max-size is a nice feature!
This offers more possibilities for GUIs!

Thx a lot!
Thalon

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Here are the changes for v1.0.44.14:

NOTE: Although this release has been extensively tested and is not expected to break any existing scripts, several low-level performance enhancements were made. If you have any mission-critical scripts, it is recommended that you retest them and/or wait a few weeks for any bugs to get fixed.

Fixed loop-variables like A_Index when accessed in more than one of a line's parameters. The inaccuracy occurred only when one of those parameters called a function that returned directly from the body of a loop. [thanks NumEric]

Changed ListVars to display ByRef parameters by their own name rather than the caller's.

Changed the Input command to do nothing on Windows 9x (not even setting ErrorLevel and OutputVar).

Raised the limit on the number of GUI fonts from 100 to 200. [thanks philou]

Changed StrLen()/StringLen and internal string-handling to avoid calculating a string's length when possible. Although this enhances performance (especially for large strings), scripts that use DllCall to pass a string via the address operator (&) rather than as a str parameter should call VarSetCapacity(Var, -1) to correct the internally-stored length (if it changed).

Improved performance slightly (above and beyond the StrLen improvement).

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
Interesting. I started to pass buffers using UInt, I suppose I have to check my libraries and see were I did that to change them to Str (if pure strings)...
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Passing by address performs better if the called function won't change the length of the string. This is because the program won't recalculate the length after the call. I've added this fact to the documentation:

Finally, when passing a string-variable to a function that will not change the length of the string, performance is improved by passing the variable by address (e.g. &MyVar) rather than as a "str" (especially when the string is very long). The following example converts a string to uppercase: DllCall("CharUpper", uint, &MyVar)

Also, it's always been necessary to call VarSetCapacity(Var, -1) after passing a string by address (if the string length changed) -- but now it's more important than ever because the variable's internal length is used for virtually everything, which makes problems more likely if it's inaccurate.

PhiLho
  • Moderators
  • 6850 posts
  • Last active: Jan 02 2012 10:09 PM
  • Joined: 27 Dec 2005
It was bugging me, so I come back...

Changed the Input command to do nothing on Windows 9x (not even setting ErrorLevel and OutputVar).

I see it was not supported in Win9x, I suppose it had side effects in the previous version. I know you didn't implemented it for Win9x because it needs an external DLL for the hook. It is a bit too bad, after all there are techniques to quietly unzip a DLL from an exe and remove it at the end, and even PSAPI is external. But I won't ask to work for an obsolete system, even if I still use it (hopefully not for long...).
Meanwhile, do you know some workaround to get one key, on this system, when a script is active but without GUI? I miss a bit my script where I can type accented capitals with my CapsLock key.
Posted Image vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Perhaps you could poll the state of all virtual key codes in a loop to detect when a key is pressed. Alternatively, you could try to make all keys into hotkeys temporarily (via Suspend or the Hotkey command).

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004

Added command Gui +LabelMyGui to support custom label names (e.g. "MyGuiClose" instead of "2GuiClose"). This also allows multiple GUI windows to share the same set of labels. [thanks Tekl]

I had missed that one being added somehow... What a pleasant surprise. Thanks :)