Modify

#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 on Nov 15, 2008 at 3:09:12 AM.
basket.jpg (12.4 KB ) - added by anonymous on Jun 25, 2010 at 6:46:42 PM.

Download all attachments as: .zip

Change History (9)

by anonymous, on Nov 15, 2008 at 3:09:12 AM

Attachment: testimage.gif added

comment:1 by anonymous, on Nov 15, 2008 at 9:58:49 PM

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 by Valik, on Nov 16, 2008 at 2:51:29 AM

Severity: NoneBlocking

comment:3 by TicketCleanup, on Nov 16, 2008 at 5:00:02 AM

Severity: BlockingNone

Automatic ticket cleanup.

comment:4 by Jpm, on Nov 16, 2008 at 7:33:03 AM

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 by anonymous, on Nov 17, 2008 at 1:10:28 AM

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.

in reply to:  5 comment:6 by Valik, on Nov 17, 2008 at 2:49:08 AM

Owner: set to Jon
Severity: NoneBlocking
Status: newassigned

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 by Valik, on Nov 20, 2008 at 12:11:21 AM

Resolution: No Bug
Status: assignedclosed

by anonymous, on Jun 25, 2010 at 6:46:42 PM

Attachment: basket.jpg added

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


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