Modify

Opened 11 years ago

Closed 11 years ago

#680 closed Bug (No Bug)

Listview and image background problem

Reported by: anonymous Owned by: Jon
Milestone: Component: AutoIt
Version: 3.2.12.1 Severity: Blocking
Keywords: Cc:

Description

When there is an image set as the background of a GUI and a listview on top, when certain things appear over the listview, ex. msgbox, in that particular area of the listview after the msgbox is gone there will be a "hole" and you will see through the listview to the image background. The following example with the uploaded image demonstrates it. The $GUI_ENABLE, I put to make sure the listview shows after the GUI shows, could be put right after the msgbox IN THIS PARTICULAR EXAMPLE to show the listview in its entirety after the msgbox clears, but in many other examples it fails.

#include <GUIConstantsEx.au3>

GUICreate("Test", 300, 300)
GUICtrlCreatePic(@ScriptDir & "\testimage.gif", 0, 0, 300, 300)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel("Something", 30, 30, 200, 25)
$listview = GUICtrlCreateListView("1col|2col",10,10,280,280)
GUISetState()
GUICtrlSetState ( $listview, $gui_enable )

Sleep(2000)
MsgBox(0,0,0)


While 1
	Sleep(50)
WEnd

Is this known, or can it be resolved. This doesn't happen with any other gui control I've tried.

Attachments (2)

testimage.gif (985 bytes) - added by anonymous 11 years ago.
basket.jpg (12.4 KB) - added by anonymous 9 years ago.

Download all attachments as: .zip

Change History (9)

Changed 11 years ago by anonymous

comment:1 Changed 11 years ago by anonymous

The listview also messes up when a column is dragged to be larger or smaller and there is an image set in the background.

comment:2 Changed 11 years ago by Valik

  • Severity changed from None to Blocking

comment:3 Changed 11 years ago by TicketCleanup

  • Severity changed from Blocking to None

Automatic ticket cleanup.

comment:4 Changed 11 years ago by Jpm

The GUI controlq are created in reverse Z-ORDER. this means the Last is at the bottom of the list, the first one get control first.
So you have several solutions:

  • create the pic at the end
  • use GUICtrlSetState($listview, $GUI_ONTOP) can be use before GUISetState()

comment:5 follow-up: Changed 11 years ago by anonymous

OK, I see your solution works...to an extent. But the problem still exists in a sense. If I'm not mistaken, my example does follow the order layout of a GUI in that what comes first goes on the bottom (In layout sense); in that logic, I shouldn't need the $GUI_ONTOP because the image comes before the listview.
But besides that, the solution just isn't working for one of my listviews, the reason for this ticket. I have searched all through my script and can't pinpoint why it isn't working for that listview...so this still is a "bug" I would say. I concocted a solution that works for the one mischievous listview by cycling through highlighting the items in list right after the msgbox that is invisible to the eye, but that is only a band aid, much like the $GUI_ONTOP...I believe.
The following code is a perfect example, after the msgbox appears don't press OK, scroll down once by clicking in the middle of the scroll bar, not the arrow, and you will see the same whole in the listview appear. Scroll again and it will be gone. My point being, this doesn't happen with any other control and the $GUI_ONTOP doesn't fix the root of the problem.

#include <GUIConstantsEx.au3>
#include <GUIListView.au3>

$GUI = GUICreate("Test", 300, 300, 500)
GUICtrlCreatePic(@ScriptDir & "\testimage.gif", 0, 0, 300, 300)
GUICtrlSetState(-1, $GUI_DISABLE)

$listview = _GUICtrlListView_Create($GUI, "1col|2col|col3",10,10,280,280)

_GUICtrlListView_SetColumnWidth($listview, 0, 80)
_GUICtrlListView_SetColumnWidth($listview, 1, 80)
_GUICtrlListView_SetColumnWidth($listview, 2, 80)

For $i = 0 To 100
	
_GUICtrlListView_AddItem($listview, "col 1")	
_GUICtrlListView_AddSubItem($listview, $i, "col 2", 1)
_GUICtrlListView_AddSubItem($listview, $i, "col 3", 2)

Next

GUICtrlSetState($listview, $GUI_ONTOP)
GUISetState()

MsgBox(0,0,0)

Sleep(5000)
;While 1
;	Sleep(50)
;WEnd

As I said, I fixed my current issue, but I think this should still be looked at and fixed IMO.

comment:6 in reply to: ↑ 5 Changed 11 years ago by Valik

  • Owner set to Jon
  • Severity changed from None to Blocking
  • Status changed from new to assigned

Replying to anonymous:

If I'm not mistaken, my example does follow the order layout of a GUI in that what comes first goes on the bottom (In layout sense);

Wrong. The first control is on top. The second control is right below that. The third control is below the second and so forth. Your code creates the picture control first there-fore it is drawn over top of everything else.

This is not a bug. There is nothing broken. You just do not understand how the Z-Order works. Once you understand that, you'll see that your code is written wrong for what you are trying to do.

comment:7 Changed 11 years ago by Valik

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

Changed 9 years ago by anonymous

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.