i'm trying to get this:
the semi-transparent rectangle, but not working
i'm working whit Windows Xp. Some way to do it
Thanks
[WX WIDGETS LUA] Semi-transparent shape
Re: [WX WIDGETS LUA] Semi-transparent shape
You can't do this in one step. For shading the background you need one wxFrame without decorations, which is just black with 50% (or similar) transparency.
-> wxTopLevelWindow::SetTransparent
On top of that you can place a "shaped" frame. Check the "shaped" sample on how to do this.
-> wxNonOwnedWindow::SetShape
-> wxTopLevelWindow::SetTransparent
On top of that you can place a "shaped" frame. Check the "shaped" sample on how to do this.
-> wxNonOwnedWindow::SetShape
Use the source, Luke!
Re: [WX WIDGETS LUA] Semi-transparent shape
I have this:
When I press the A key I need the transparent background to appear whit the dialog box
the shape of a dialog is not important
thanks
Code: Select all
function OnKeyDown(event)
if event:GetKeyCode() == 65 then
dialog_messageA()
end
if event:GetKeyCode() == 67 then
dialog:Destroy()
end
end
fuction dialog_messageA()
local dialog = wx.wxDialog(panel, wx.wxID_ANY, "", wx.wxDefaultPosition, wx.wxSize(500, 150),wx.wxNO_BORDER)
function On_key(event)
if event:GetKeyCode() == 67 then
dialog:Destroy()
end
end
function OnPaint(event)
event:Skip()
local dc = wx.wxPaintDC(dialog)
dc:SetPen(wx.wxWHITE_PEN)
dc:DrawRectangle(1,1, 498, 15)
dc:SetPen(wx.wxPen(wx.wxColour(240,240,240),0,0))
dc:SetBrush(wx.wxBrush(wx.wxColour(240,240,240), 0))
dc:DrawLine(1,38, 498, 38)
dc:DrawRectangle(1,106, 498, 43)
dc:SetTextForeground(wx.wxColour(100,100,100))
dc:DrawText("CONFIGURACION", 30, 13)
dc:delete()
end
dialog:Connect(wx.wxEVT_PAINT, OnPaint)
dialog:Connect(wx.wxEVT_KEY_DOWN, On_key)
end
funtion main()
frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "Mi Ventana", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxNO_BORDER)
panel = wx.wxPanel(frame, wx.wxID_ANY)
panel:Connect(wx.wxEVT_KEY_DOWN, OnKeyDown)
end
the shape of a dialog is not important
thanks
Re: [WX WIDGETS LUA] Semi-transparent shape
Like i said, for a "clean" solution you need two different frames: One that blends the background and another one on top.
However, there is a way to cheat: You can grab the screen content (using wxScreenDC), put it into a bitmap, blend it programatically towards black and use that as the background for your custom drawing.
However, there is a way to cheat: You can grab the screen content (using wxScreenDC), put it into a bitmap, blend it programatically towards black and use that as the background for your custom drawing.
Use the source, Luke!
Re: [WX WIDGETS LUA] Semi-transparent shape
Uknow to call method SetTransparent() on a wxFrame
this is the error on Windows XP, but in windows 7 works fine
this is the error on Windows XP, but in windows 7 works fine
Re: [WX WIDGETS LUA] Semi-transparent shape
I know that wxLua is based on wxWidets 2.8.x, but SetTransparent() is available in wx 2.8.x and should also work under XP. I have no idea what to do about this.Nolram_07 wrote:Uknow to call method SetTransparent() on a wxFrame
this is the error on Windows XP, but in windows 7 works fine
Use the source, Luke!
Re: [WX WIDGETS LUA] Semi-transparent shape
SetTransparent() is available on wxLua-2.8.12.x, but that version not working in Windows XP = "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix the problem"doublemax wrote:I know that wxLua is based on wxWidets 2.8.x, but SetTransparent() is available in wx 2.8.x and should also work under XP. I have no idea what to do about this.
Re: [WX WIDGETS LUA] Semi-transparent shape
Sorry, i can't help with that. Seems to be a wxLua problem.
Maybe you can try the other approach which is probably easier to implement anyway?
Maybe you can try the other approach which is probably easier to implement anyway?
Use the source, Luke!
Re: [WX WIDGETS LUA] Semi-transparent shape
Yes, i will try whit the bitmap
really
thanks a lot. Doublemax, really appreciate the answers.
really
thanks a lot. Doublemax, really appreciate the answers.