Jump to content

Recommended Posts

Posted

Hi everybody
In plenty of topics, we read this in the help file :

Parameters
controlID : The control identifier (controlID) as returned by a GUICtrlCreate...() function, or -1 for the last created control.

But if you look at GUICtrlGetHandle topic, you'll simply read this :

Parameters
controlID : Control identifier as returned by a GUICtrlCreate...() function.

Could we please add the "-1" part as it works too ?
Thanks

Posted
8 hours ago, pixelsearch said:

ould we please add the "-1" part as it works too ?
Thanks

did you that it works?

Posted

Also what is strange is this :
* -1 works for GUICtrlGetHandle()
* -1 doesn't work for TrayItemGetHandle()

imho it should work for both.
After all we see a few -1 concerning the related "Tray scripts", for example help file, topic TrayCreateItem :

; Create a tray item with the radio item parameter selected.
TrayCreateItem("Radio 1", -1, -1, $TRAY_ITEM_RADIO)
TrayItemSetState(-1, $TRAY_CHECKED) ; -1 as 1st parameter <============

Here again, TrayItemSetState topic doesn't indicate that -1 is accepted as 1st parameter.
All this started while answering TimRude in this post

  • 3 months later...
Posted (edited)
@jpm In 2006/2007 @Ultima added some code inside the function _GUICtrlListView_SetItemText, this code was (and still is in the actual release 3.3.16.1) :

If $iSubItem = -1 Then
    Local $sSeparatorChar = Opt('GUIDataSeparatorChar')
    Local $i_Cols = _GUICtrlListView_GetColumnCount($hWnd)
    Local $a_Text = StringSplit($sText, $sSeparatorChar)
    If $i_Cols > $a_Text[0] Then $i_Cols = $a_Text[0]
    For $i = 1 To $i_Cols
        $iRet = _GUICtrlListView_SetItemText($hWnd, $iIndex, $a_Text[$i], $i - 1)
        If Not $iRet Then ExitLoop
    Next
    Return $iRet
EndIf

Until 2012, the help file indicated, for this function _GUICtrlListView_SetItemText :

$iSubItem [optional] 1-based index of the subitem or 0 to set the item 
Remarks : If $iSubItem = -1 row is set

In 2013, suddenly, the help file didn't indicate anything concerning the important remark :
Remarks : None

As Ultima's code is still present in 2023, the actual help file should (imho) indicate again :
Remarks : If $iSubItem = -1 row is set

Edit: here is an example showing what happens when $iSubItem = -1

#include <GUIConstantsEx.au3>
#include <GuiListView.au3>
#include <MsgBoxConstants.au3>

Example()

Func Example()
    Local $idListview
    GUICreate("ListView Set Item Text", 400, 300)
    $idListview = GUICtrlCreateListView("Item        |subitem        |subitem        ", 2, 2, 394, 268)
    GUISetState(@SW_SHOW)

    ; Add row 0
    GUICtrlCreateListViewItem("Item 0|SubItem1|SubItem2", $idListview)
    MsgBox($MB_TOPMOST, "", "Before modifying all text at once")

    ; Alter all text at once in row 0
    _GUICtrlListView_SetItemText($idListview, 0, "Item 0_alt|SubItem1_alt|SubItem2_alt", -1)
    MsgBox($MB_TOPMOST, "Parameter $iSubItem = - 1", "All text has been altered at once")

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>Example

Thanks for reading :)
Edited by pixelsearch
  • 3 months later...
Posted
Help file, topic _GDIPlus_ImageSaveToFile :
This is not an issue but It would be great to indicate that the compression level is 75% by default for jpg images (tested). If you want a better jpg quality (less compression), then you'll need to use _GDIPlus_ImageSaveToFileEx

For those who are interested, @UEZ indicated in this script how to resize AND rotate a jpg at same time. Not so easy but it can be helpful at times :)
  • 6 months later...
Posted

Helpfile, _SendMessage() example is missing #include <WindowsConstants.au3>

Some guy's script + some other guy's script = my script!

  • 2 weeks later...
Posted

Going trough the help file, I noticed  some "Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct " errors.
Comparing sources I found that the error in the links is due to and extra "../" in the links in the Tutorials area.
For example: <a href="../../functions/Run.htm">Run</a>

These errors have been there since the links were added to Tutorials in the help file for every version after v3.3.8.1 .

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

I try to avoid such warning, but I fail how to implement it in chm

snif!!!

Posted (edited)
8 hours ago, jpm said:

I fail how to implement it in chm

Either button like "Open this script" or maybe better, have a TCP/html server in AutoIt3Help.exe that will receive and act on the link to do the did.

http://localhost:8765/redirect?http://msdn.microsoft.com/query/dev10.query?appId=Dev10IDEF1&l=EN-US&k=k(Wow64EnableWow64FsRedirection);k(DevLang-C);k(TargetOS-WINDOWS)&rd=true

Is not how CHM is supposed to work but is 2002 tech that will not have the code revised and, them limiting it to have everyone use IE4 ( at the time ) was another way to augment browser traffic and, manage security by imposing limitations. ( but I'm getting into rant mode now )

And as a bonus could have "/EditScript?file.au3" as a link to replace "Open this script" button.
To open the link read the registry and if the handler does not exist use the folder structure ".\SciTE\SciTE.exe"

I don't foresee any misuse of the implementation. 

Edit: just found "Example: Link to a File Outside of Your Help System". It could be used for the redirector ?.

Notes
... ...
All other files will open in the program with which they are associated. For example, clicking a link to an .avi file will launch an instance of Microsoft Media Viewer. However, if a user does not have the appropriate program installed, he or she will not be able to open the file.

Edit2: instead of "http://", start with "MyHandler://" to use as redirector ?.

Edited by argumentum
more

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted
On 3/11/2024 at 5:20 PM, argumentum said:

Going trough the help file, I noticed  some "Make sure the web address //ieframe.dll/dnserrordiagoff.htm# is correct " errors.
Comparing sources I found that the error in the links is due to and extra "../" in the links in the Tutorials area.
For example: <a href="../../functions/Run.htm">Run</a>

These errors have been there since the links were added to Tutorials in the help file for every version after v3.3.8.1 .

The handling of ../../functions/Run.htm  is OK for the .chm and are modified for the Help's on the WEB

Posted (edited)
1 hour ago, jpm said:

The handling of ../../functions/Run.htm  is OK for the .chm

Is not. 
In the CHM, go to "Tutorial - Notepad" and click the Run in "Run("notepad.exe") ". Those links are the ones I'm referring to.
The ones in the text area are fine.

Edit: my bad. 
mk:@MSITStore:autoit.chm::/html/tutorials/functions/Run.htm  should be 
mk:@MSITStore:autoit.chm::/html/functions/Run.htm

Edited by argumentum
oops

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

I don't understand why we need to change something working both .chm and Web

  • 3 weeks later...
  • 2 months later...
Posted

Hello :)
Autoit Help file (3.3.16.1) topic GUICtrlSetState, we read :

$GUI_CHECKED (1) Radio, Checkbox or ListViewItem will be checked.

Shouldn't it be :

$GUI_CHECKED (1) Radio, Checkbox, MenuItem or ListViewItem will be checked.

Same goes for $GUI_UNCHECKED (4)
Thanks

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...