Jump to content

Help File/Documentation Issues. (Discussion Only)


Recommended Posts

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

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 :

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

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

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
    Return $iRet

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>


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

    ; 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")

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

Thanks for reading :)
Edited by pixelsearch
Link to comment
Share on other sites

  • 3 months later...
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 :)
Link to comment
Share on other sites

  • 6 months later...

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...