Hello,
I have the first frame with a button and DTextEntry. It should send
the text to the second frame and show it up in a RichText but somehow it's not working.
Code:
frame1:
reason = vgui.Create("DTextEntry",Panelgrey)
reason:SetPos(5,50)
reason:SetSize(480,150)
reason:SetFont("LabelFont1")
reason:AllowInput(true)
reason:SetMultiline(true)
reason:SetEditable ( true )
reason:SetDrawLanguageID(false)
reason:SetUpdateOnType(true)
reason:SetVerticalScrollbarEnabled( true )
reason.OnValueChange = function(self)
information = self:GetText()
end
buttonsend=vgui.Create("DButton",frame1)
buttonsend:SetPos(370,270)
buttonsend:SetSize(125,25)
buttonsend:SetText("")
buttonsend.Paint=function(self,w,h)
draw.RoundedBox(0,0,0,w,h,Color(141,27,27))
end
buttonsend.DoClick = function()
net.Start("reporthandler")
net.SendToServer()
net.Start("info")
net.WriteString(information)
net.SendToServer()
end
server:
net.Receive("info", function(len,ply)
local information = net.ReadString()
net.Start("infoo")
net.WriteString(information)
net.Send(ply)
end)
frame2:
local reportlist = vgui.Create("DListView", Panelgrey)
reportlist:Dock( FILL )
reportlist:SetMultiSelect( false )
reportlist:AddColumn("Test")
net.Receive("reports", function(length,ply)
Table = net.ReadTable()
for k,v in pairs(Table) do
reportlist:AddLine(v)
end
end)
function reportlist:DoDoubleClick()
IF = vgui.Create("DFrame")
IF:SetSize(450,250)
IF:SetPos(ScrW()/2 -225, ScrH()/2 -125)
IF:MakePopup()
net.Receive("infoo", function()
local information = net.ReadString()
ift = vgui.Create("DLabel", IF)
ift:SetPos(5, 30)
ift:SizeToContents(5)
ift:SetText(information)
end)
end
If you need more code, let me know.
Thanks in advance.
Sorry, you need to Log In to post a reply to this thread.