Modify

Opened 18 years ago

Closed 18 years ago

#102 closed Bug (Fixed)

ControlCommand(SelectString) - wrong selection order again

Reported by: Zedna Owned by: J-Paul Mesnage
Milestone: 3.2.11.1 Component: AutoIt
Version: 3.2.10.0 Severity:
Keywords: Cc:

Description

When there is value ABC|ABC_DEF in ComboBox then
ControlCommand($gui,,$h_combo1,'SelectString','ABC') --> problem: selects ABC_DEF and not ABC
As workaround I used:
_GUICtrlComboBox_SelectString($h_combo2, 'ABC') --> OK: selects ABC

Note:
Here is link to very similar BUG which was fixed already - http://www.autoitscript.com/forum/index.php?showtopic=54738
That older bug is fixed but now in 3.2.10 version doesn't work this new testing example:
both comboboxes are the same
on the first one is applied ControlCommand(SelectString)
on the first one is applied _GUICtrlComboBox_SelectString() as workaround

#include <GUIConstants.au3>
#Include <GuiComboBox.au3>

$gui = GUICreate("SelectString test", 212, 212)
$combo1 = GUICtrlCreateCombo('',10, 20, 100, 100)
GUICtrlSetData($combo1, '|ABC|ABC_DEF', 'ABC_DEF')
GUICtrlCreateLabel('Problem',130, 20, 100)
$combo2 = GUICtrlCreateCombo('ABC|ABC_DEF',10, 70, 100, 100)
GUICtrlSetData($combo2, '|ABC|ABC_DEF', 'ABC_DEF')
GUICtrlCreateLabel('OK',130, 70, 100)
GUISetState(@SW_SHOW)

$h_combo1 = ControlGetHandle($gui, "", $combo1)
$h_combo2 = ControlGetHandle($gui, "", $combo2)

; TEST: should select first row in ComboBox
ControlCommand($gui,'',$h_combo1,'SelectString','ABC') ; problem: selects ABC_DEF
_GUICtrlComboBox_SelectString($h_combo2, 'ABC') ; OK: selects ABC

While 1
	$msg = GUIGetMsg()
	Select
		Case $msg = $GUI_EVENT_CLOSE
			ExitLoop
	EndSelect
WEnd

OS: WINXP SP2 CZ

Attachments (0)

Change History (3)

comment:1 by Zedna, 18 years ago

correction in description:

both comboboxes are the same
on the first one is applied ControlCommand(SelectString)
on the second one is applied _GUICtrlComboBox_SelectString() as workaround

comment:2 by J-Paul Mesnage, 18 years ago

Milestone: 3.2.11.1
Owner: set to J-Paul Mesnage
Status: newaccepted

comment:3 by J-Paul Mesnage, 18 years ago

Resolution: fixed
Status: acceptedclosed

Fixed in version: 3.2.11.1

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.