Modify

Opened 3 years ago

Closed 3 years ago

#3518 closed Bug (Fixed)

_GUICtrlStatusBar_SetParts() - cannot set parts from $aPartWidth

Reported by: anonymous Owned by: Jpm
Milestone: 3.3.15.1 Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: Cc:

Description

As summary says - function cannot properly set parts based on width array. Correction is simple - when filling structure from width array you need use:

$cParts = 0
...
$cParts += $aPartWidth[$x]
DllStructSetData($tParts, 1, $cParts, $x + 1)

instead:

DllStructSetData($tParts, 1, $aPartWidth[$x], $x + 1)

Attachments (0)

Change History (6)

comment:1 Changed 3 years ago by Jpm

Hi,
I don't know where you get such $cParts has I cannot see any change in this area
PLease use the standard Delivery or the beta

comment:2 Changed 3 years ago by anonymous

Hi,
I invented $cParts myself for purpose of countering bug in _GUICtrlStatusBar_SetParts().
Basically it calculates right edge of parts from parts width.
on a side note - is may english so bad?

comment:3 Changed 3 years ago by Jpm

I still don't undrstand just follow Ticket creation guidelines as I don't have a cristal ball to reproduce

comment:4 Changed 3 years ago by anonymous

i do not have mach time left...

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $Form1 = GUICreate("Form1", 889, 334, 742, 690)
Local $Button1 = GUICtrlCreateButton("Click to see BUG with PartsWidth", 424, 88, 128, 128, $BS_MULTILINE)
Local $StatusBar1 = _GUICtrlStatusBar_Create($Form1)
;
Local $StatusBar1_PartsRightEdge[8] = [50, 100, 150, 200, 250, 300, 350, -1]
Local $StatusBar1_PartsWidth[8] = [50, 50, 50, 50, 50, 50, 50, -1]
;

_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsRightEdge)
_GUICtrlStatusBar_SetText($StatusBar1, "0", 0)
_GUICtrlStatusBar_SetText($StatusBar1, "1", 1)
_GUICtrlStatusBar_SetText($StatusBar1, "2", 2)
_GUICtrlStatusBar_SetText($StatusBar1, "3", 3)
_GUICtrlStatusBar_SetText($StatusBar1, "4", 4)
_GUICtrlStatusBar_SetText($StatusBar1, "5", 5)
_GUICtrlStatusBar_SetText($StatusBar1, "6", 6)
_GUICtrlStatusBar_SetText($StatusBar1, "7", 7)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 24)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$k = False

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $Button1
			$k = Not $k
			If $k Then
				_GUICtrlStatusBar_Destroy ($StatusBar1)
				$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
				GUICtrlSetData ($Button1, "Click to see there a no BUG with PartsRightEdge")

				_GUICtrlStatusBar_SetParts($StatusBar1, -1, $StatusBar1_PartsWidth)
				_GUICtrlStatusBar_SetText($StatusBar1, "0", 0)
				_GUICtrlStatusBar_SetText($StatusBar1, "1", 1)
				_GUICtrlStatusBar_SetText($StatusBar1, "2", 2)
				_GUICtrlStatusBar_SetText($StatusBar1, "3", 3)
				_GUICtrlStatusBar_SetText($StatusBar1, "4", 4)
				_GUICtrlStatusBar_SetText($StatusBar1, "5", 5)
				_GUICtrlStatusBar_SetText($StatusBar1, "6", 6)
				_GUICtrlStatusBar_SetText($StatusBar1, "7", 7)
				_GUICtrlStatusBar_SetMinHeight($StatusBar1, 24)
			Else
				_GUICtrlStatusBar_Destroy ($StatusBar1)
				$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
				GUICtrlSetData ($Button1, "Click to see BUG with PartsWidth")

				_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsRightEdge)
				_GUICtrlStatusBar_SetText($StatusBar1, "0", 0)
				_GUICtrlStatusBar_SetText($StatusBar1, "1", 1)
				_GUICtrlStatusBar_SetText($StatusBar1, "2", 2)
				_GUICtrlStatusBar_SetText($StatusBar1, "3", 3)
				_GUICtrlStatusBar_SetText($StatusBar1, "4", 4)
				_GUICtrlStatusBar_SetText($StatusBar1, "5", 5)
				_GUICtrlStatusBar_SetText($StatusBar1, "6", 6)
				_GUICtrlStatusBar_SetText($StatusBar1, "7", 7)
				_GUICtrlStatusBar_SetMinHeight($StatusBar1, 24)
			EndIf

	EndSwitch
WEnd

comment:5 Changed 3 years ago by Jpm

I understand,
The Function and the doc need to be fixed as passing @aParts[] and $aPartsWidth[] can be conflictual
Definitly if no Parts, the widths must be sum up
Not sure what to do with Widths not positive

comment:6 Changed 3 years ago by Jpm

  • Milestone set to 3.3.15.1
  • Owner set to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [11831] in version: 3.3.15.1

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.