Modify

Opened 6 years ago

Closed 5 years ago

#2945 closed Bug (Fixed)

Center and right justified text broken on native buttons when colours set

Reported by: AlanParry Owned by: Jon
Milestone: 3.3.15.0 Component: AutoIt
Version: 3.3.13.19 Severity: None
Keywords: Cc:

Description

Hi,

After upgrading my scripts from 3.3.8.1 to 3.3.12.0/3.3.13.19 it appears that center and right justification of native buttons aren't working properly now when either

i) GUICtrlSetDefColor or GUICtrlSetDefBkColor called before a button wiht aligned text is created

ii) GUICtrlSetColor or GUICtrlSetBkColor is called after the text alignment has been set.


An alternate problem is: if the alignment is set using GUICtrlSetStyle after the colour has been set then the colours settings are lost (but the alignment is then correct).
(Note also:- Strangely after loosing set default colours with a style change, setting just the background colour restores the foreground colour as well, as can be seen in the last set of examples).


The problems occur on 3.3.12.0 and 3.3.13.19. Slightly different but similar issues occurred in 3 3.8.1. My suspicion is that it that it might be related to the bug fix for #2299 at milestone 3.3.9.21.
In 3.3.8.1 Left and Right alignment were wrong but center was correct.

The permutations of: default color settings; alignment at creation; style changes; and color changes effect the issue in different ways. So I have attached a script that shows the permutations and labels those which are wrong.


Without wishing to state the obvious I wonder if the values used by MS for alignments are causing any confusion as

BS_CENTER = BitOR(BS_LEFT, BS_RIGHT)

so simple bit tests don't always do what expected.

Regards
Alan Parry

Attachments (1)

ButtonTextJustify.au3 (2.5 KB) - added by AlanParry 6 years ago.

Download all attachments as: .zip

Change History (6)

Changed 6 years ago by AlanParry

comment:1 Changed 6 years ago by Jpm

You win the price of the better repro script.
Seriously I have a look

comment:2 Changed 6 years ago by AlanParry

Thanks - I think!

I was was getting confused with all the cases and versions - building a table of all the cases made it much clearer for me.

Its 2 problems I think:

i) The Owner draw routines for native buttons that is used for coloured buttons gets the bit testing of the alignment wrong.

ii) When GUICtrlSetStyle is called on a button that is owner-draw to change the alignment, the button stops being owner-draw.

Thanks for looking
Alan Parry

comment:3 Changed 6 years ago by Jpm

I fix the problem.
A fix has been sent to Jon for integration

Thanks the error was due to the coloring

comment:4 Changed 6 years ago by AlanParry

Great!
Amazing response time: reported and fixed in 24 hours - I look forward to the next release

Thanks
Alan Parry

comment:5 Changed 5 years ago by Jon

  • Milestone set to 3.3.15.0
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [11408] in version: 3.3.15.0

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


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

 
Note: See TracTickets for help on using tickets.