Ticket #2273: GUICtrlSetData_Bug.au3

File GUICtrlSetData_Bug.au3, 1.5 KB (added by mwnn@…, 12 years ago)

Full example for long strings getting cropped at hyphen.

Line 
1#include <GUIConstantsEx.au3>
2#include <EditConstants.au3>
3
4Global Const $APP_NAME = "GUICtrlSetData_Bug"
5
6Global $gui_Main
7Global $txt_Path1, $txt_Path2, $txt_Path3, $cmd_Path1, $cmd_Path2, $cmd_Path3
8Global $Path1 = "C:\Temp\Outbox\AutoIt_GUICtrlSetData\AB123 4567CDExyF08.ini"
9Global $Path2 = "C:\Temp\Outbox\AutoIt_GUICtrlSetData\AB123-4567CDExyF08.ini"
10Global $Path3 = "C:\Temp\Outbox\AutoIt_GUICtrlSetData\AB123_4567CDExyF08.ini"
11
12Opt("MustDeclareVars", 1)
13
14AppMain()
15
16Func AppMain()
17    Local $msg = ""
18
19    $gui_Main = GUICreate($APP_NAME, 365, 90)
20
21    $txt_Path1 = GUICtrlCreateEdit("", 10, 10, 320, 19, $ES_READONLY + $ES_WANTRETURN)
22    $txt_Path2 = GUICtrlCreateEdit("", 10, 35, 320, 19, $ES_READONLY + $ES_WANTRETURN)
23    $txt_Path3 = GUICtrlCreateEdit("", 10, 60, 320, 19, $ES_READONLY + $ES_WANTRETURN)
24   
25    $cmd_Path1 = GUICtrlCreateButton("...", 335,  8, 22, 22)
26    $cmd_Path2 = GUICtrlCreateButton("...", 335, 33, 22, 22)
27    $cmd_Path3 = GUICtrlCreateButton("...", 335, 58, 22, 22)
28
29    GUICtrlSetData($txt_Path1, $Path1)
30    GUICtrlSetData($txt_Path2, $Path2)
31    GUICtrlSetData($txt_Path3, $Path3)
32
33    GUISetState(@SW_SHOW, $gui_Main)
34
35    While 1
36        $msg = GUIGetMsg()
37        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
38        If $msg = $cmd_Path1 Then MsgBox(0, $APP_NAME, GUICtrlRead($txt_Path1))
39        If $msg = $cmd_Path2 Then MsgBox(0, $APP_NAME, GUICtrlRead($txt_Path2))
40        If $msg = $cmd_Path3 Then MsgBox(0, $APP_NAME, GUICtrlRead($txt_Path3))
41    WEnd
42
43    GUIDelete()
44EndFunc