Hi,
I’m trying to make a transparent Listbox, Is there any way to make this ancient Listbox of Xojo to not draw any color on background?!
With NSTableView i can just set it’s bgcolor to clearColor.
Hi,
I get an eye to find an answer, but I failed: I do not know how to make the listbox background transparent.
I checked because usually, I set vertical and horizontal dotted lines and I set two alternate colours for the Rows. So the question was a good question to get an answer for (because if I never think at that !)
- Return True in the CellBackgroundPaint event to prohibit the Xojo framework to draw anything.
- Try to subclass the listbox in the Objective C Runtime and overriding the drawRect: method in Xojo. In Objective C it would look like that:
- (void)drawRect:(NSRect)rect {
[[NSColor clearColor] set];
NSRectFill(rect);
}
Ok, I couldn’t find a way to transparent background for dtListbox either!
If i could ony combine dtPlugin with MBS classes… for example if i could access : dtListbox.NSTableViewMBS
Can you cheat it? Fill the window color or pattern in CellBackgroundPaint.
What if the background is not a solid color? maybe a random gradient?
Cheating belongs to VB6 not a 2014 IDE.
[quote=61085:@Mojtaba Komeili]What if the background is not a solid color? maybe a random gradient?
Cheating belongs to VB6 not a 2014 IDE.[/quote]
Still you have to cheat sometimes.
I implemented a falsely transparent listbox drawing in the Listbox.CellBackgroundPaint the portion of a background picture.
However this works well if the background is a predefined picture…
Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean
g.ClearRect ( 0, 0, g.Width, g.Height )
return false
End Function
[quote=72988:@Peter Wagemans]Function CellBackgroundPaint(g As Graphics, row As Integer, column As Integer) As Boolean
g.ClearRect ( 0, 0, g.Width, g.Height )
return false
End Function[/quote]
If you use this, the listbox will always use the color of the Window. If you put a listbox into a container with
some other color and embed it it won’t work. Sadly, they only way to get transparency is to fake the background.
I doubt the listbox will ever be able to be transparent.
Hmm well not really. Might be an option for rare cases.
[quote=60892:@Mojtaba Komeili]Hi,
I’m trying to make a transparent Listbox, Is there any way to make this ancient Listbox of Xojo to not draw any color on background?!
With NSTableView i can just set it’s bgcolor to clearColor.[/quote]
If you need the ListBox to be transparent over the background, making it the same color works. If you need it over a picture or other controls, you can apply the cloak technology : draw what is behind the control onto its background.
Jean-Paul, you really should reopen your plugins for sale. It is no point to show what they do if people cannot buy them.
Sure. I am aware of that. I just wanted to point out that the g.clearrect solution posted above doesn’t work in a container environment.
True. [quote=255222:@jean-paul devulder]dplugins dtlistview support this feature,
strange, i miss the thread !
I heard the plugin isn’t for sale anymore so why posting ? Still nice though - except for the scroller.
I didn’t want to rant about your plugin. I was sort of expecting an overlay scroller
but you can probably change/customize it.