Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2022 closed Bug (No Bug)

Cross set contants

Reported by: Melba23 Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Cc:

Description

The $DT_PATH_ELLIPSIS and $DT_END_ELLIPSIS constants are cross-set in WindowsConstants.au3 as can be sen here:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$sPath = "C:\I am a very long path\Which needs to be\Shortened to fit\In the label.txt"

$hGUI = GUICreate("Test", 500, 500)

GUICtrlCreateLabel("Using $DT_PATH_ELLIPSIS:", 10, 10, 200, 20)
GUICtrlCreateLabel($sPath, 10, 40, 300, 30, $DT_PATH_ELLIPSIS)
GUICtrlSetBkColor(-1, 0xCCCCFF)
GUICtrlCreateLabel("MSDN says:" & @CRLF & _
				   "'replaces characters in the middle of the string with ellipses so that the result fits in the specified rectangle'", 10, 80, 480, 40)

GUICtrlCreateLabel("Using $DT_END_ELLIPSIS:", 10, 200, 200, 20)
GUICtrlCreateLabel($sPath, 10, 230, 300, 30, $DT_END_ELLIPSIS)
GUICtrlSetBkColor(-1, 0xCCFFCC)
GUICtrlCreateLabel("MSDN says:" & @CRLF & _
				   "'if the end of a string does not fit in the rectangle, it is truncated and ellipses are added'", 10, 270, 480, 40)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd


Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by BrewManNH

Looking at the values for the 2 constants, they are set correctly, they're just working backwards.

comment:2 Changed 9 years ago by trancexx

  • Resolution set to No Bug
  • Status changed from new to closed

Values are correctly set.
Microsoft SDK define values inside WinUser.h from where they are taken.

comment:3 follow-up: Changed 9 years ago by BrewManNH

The values are set correctly, but they're working backwards.

If you run the example script you will see that the $DT_PATH_ELLIPSIS example shows the ellipse is at the end of the line, and that the $DT_END_ELLIPSIS example shows the ellipse is in the middle of the line. The bug isn't in the constants file, the bug is in the execution of the label function.

comment:4 in reply to: ↑ 3 Changed 9 years ago by Jpm

Replying to BrewManNH:

The values are set correctly, but they're working backwards.

If you run the example script you will see that the $DT_PATH_ELLIPSIS example shows the ellipse is at the end of the line, and that the $DT_END_ELLIPSIS example shows the ellipse is in the middle of the line. The bug isn't in the constants file, the bug is in the execution of the label function.

Unless I don't understand the code, Autoit is not changing the $DT_..._ELLIPSIS value when creating a label so the inversion must be inside the Microsoft Windows code.
I remember googling and founding some forums wondering about this inversion.

comment:5 Changed 9 years ago by BrewManNH

So, it's a Windows bug and not an AutoIt bug? I get it now.

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 ticket will remain with no owner.
Author


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

 
Note: See TracTickets for help on using tickets.