• DListView change Font and Line Size?
    8 replies, posted
Stupid question here, but I'm curious about this. As far as I've seen and tried you can't change the font and the line size of DListView. I'm wondering if there's any way to do something like this: [lua] SomeName = vgui.Create( "DListView", SomeParentShit) // All the usual setpos, setsize, addcolumn, etc... SomeName:SetFont("AUniqueFont") // AND something else that would be useful... SomeName:SetLineSize (20,20) //Set the actual size of the lines so they're not so fucking small... Clever I know. [/lua] So, change the font size of the letters, obviously, by default it's really small. Also, a way to change the line size too. No, I'm not talking about SetFixedWidth. Is there any reason this isn't possible? I'm just wondering if there's a "special" way around this. I've used DListView more and more, it's useful, but it would be nice to have a way to tweak it more.
[code] TheList = vgui.Create( "DListView" ) TheList:SetHeaderHeight( 16 ) -- The header height ( Column name/title/header ) TheList:SetDataHeight( 17 ) -- Line height local Col1 = TheList:AddColumn( "Address" ) local Col2 = TheList:AddColumn( "Port" ) Col2:SetMinWidth( 30 ) -- Line/column width Col2:SetMaxWidth( 30 ) TheList:AddLine( "192.168.0.1", "80" ) local line2 = TheList:AddLine( "192.168.0.2", "80" ) for id, pnl in pairs( line2.Columns ) do --pnl is DListViewLabel, although I don't know how exactly to set font end [/code]
[QUOTE=Robotboy655;42562637][code] TheList = vgui.Create( "DListView" ) TheList:SetHeaderHeight( 16 ) -- The header height ( Column name/title/header ) TheList:SetDataHeight( 17 ) -- Line height local Col1 = TheList:AddColumn( "Address" ) local Col2 = TheList:AddColumn( "Port" ) Col2:SetMinWidth( 30 ) -- Line/column width Col2:SetMaxWidth( 30 ) TheList:AddLine( "192.168.0.1", "80" ) local line2 = TheList:AddLine( "192.168.0.2", "80" ) for id, pnl in pairs( line2.Columns ) do --pnl is DListViewLabel, although I don't know how exactly to set font end [/code][/QUOTE] I love you so much right now. This works perfectly, thanks! Also, using your code I was able to find out how to set the font. Here's a full code for anyone else wondering about this. Put this into any clientside file. [lua] surface.CreateFont( "RobotBoyIsFuckingLegit", { font = "Times New Roman", size = 15, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false } ) TheList = vgui.Create( "DListView", YourParent) -- Set your parent! TheList:SetPos(1,1) -- Relative to parent. TheList:SetSize(500,500) TheList:SetHeaderHeight( 50 ) -- The header height ( Column name/title/header ) TheList:SetDataHeight( 50 ) -- Line height local Col1 = TheList:AddColumn( "Address" ) -- You need to do this for it to work local Col2 = TheList:AddColumn( "Port" ) Col2:SetMinWidth( 30 ) --***** Line/column width. Do not touch this. Bug found. See below. Col2:SetMaxWidth( 30 ) --***** Do not touch this. local line1 = TheList:AddLine( "192.168.0.1", "80" ) -- Need this too. local line2 = TheList:AddLine( "192.168.0.2", "80" ) -- Repeat this for each "line" you want to change the font for. So, you'd be able to change fonts of specific lines if you'd like. for id, pnl in pairs( line1.Columns ) do pnl:SetFont("RobotBoyIsFuckingLegit") -- Sets the font to whatever you made it in CreateFont! WHOOOOOO end for id, pnl in pairs( line2.Columns ) do pnl:SetFont("RobotBoyIsFuckingLegit") -- Sets the font to whatever you made it in CreateFont! WHOOOOOO end -- I'm sure you can figure it out from here. [/lua] ***** It seems that when you set this about 30 it crashes the whole game. I'm not able to play around with it much as it gets annoying as fuck after each crash. However, the times I checked it. It seems that setting those values below 30 is fine, but above it and the game crashes. SetMaxWidth doesn't seem to be affected as much. Here's the details from my game for anyone that knows about this. Everything else works fine, though. So, just leave those values as they are. This is on Windows 7 64-bit. Every update installed. Windows is activated and genuine. Problem signature: Problem Event Name: APPCRASH Application Name: hl2.exe Application Version: 0.0.0.0 Application Timestamp: 52341c19 Fault Module Name: kernel32.dll Fault Module Version: 6.1.7601.18229 Fault Module Timestamp: 51fb1115 Exception Code: c0000005 Exception Offset: 0001414e OS Version: 6.1.7601.2.1.0.256.48 Locale ID: 1033 Additional Information 1: 2a73 Additional Information 2: 2a7328d8bb40c81c93b4b5f46adb8e10 Additional Information 3: 2a73 Additional Information 4: 2a7328d8bb40c81c93b4b5f46adb8e10 Thanks again RobotBoy! I'm sure this will be useful for a lot of people. I'll leave the thread open in case anyone else wants to add to it or knows about this issue.
[QUOTE=Handsome Matt;42568571]Do you have a crash dump you could upload?[/QUOTE] I'm willing to do it. However, I don't know how. Would you be willing to tell me? I remember doing it a long time ago for something. I remember it had something to do with adding something to the registry and it gives out a .dmp file or something. I was trying to look up how to do it, but there's so many random ass sites with different answers.
-snip, ninja'd-
[QUOTE=Handsome Matt;42568743]Crash dumps should be generated automatically whenever the game crashes, you'll find them in your root GarrysMod directory: [I]D:\Games\SteamLibrary\SteamApps\common\GarrysMod[/I][/QUOTE] Well, shit... That was easier than I thought. I remember doing it for other things where you actually had to do it yourself and use a debugger to find it. Although, the directory isn't the same, but I got the idea. Yours is installed on another hard drive. For regular people it would normally be here: C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod In case people are wondering. Hmm, it doesn't seem to be creating one. Am I doing something wrong? Is there a way to "turn" it on? I know what you're talking about though. It's an .mdmp file and it's something like hl2_blah_blah.mdmp, but it won't make it. Yes, it created .mdmp files before. It just won't do it for this.
Well, as I've been unable to get an .mdmp file because Garry's Mod won't fucking create one for some reason, I'll do it another way. Pretty ironic that Garry's Mod doesn't create .mdmp files when I actually NEED them. Any other day it'll spam fucking 20 .mdmp files as soon as the game crashes, but when you need it, nope. However, we can improvise. I've made a code that'll actually recreate this issue that has been happening to me. Look, it doesn't affect me either way, but I'd appreciate it if someone would be willing to do this and upload an .mdmp file. I'm curious as to why this happens and I'd like it to be fixed. If you know what you're doing you can actually use this to crash client's games without them even knowing it was you. That's why I want this bug to be fixed or at least some information on it. Anyways, here's the instructions: 1. Put this into a clientside file: (Such as cl_init.lua) [lua] // // FOR TESTING! NOT INTENDED FOR REGULAR USE. // // See my post above for the "real" code. // surface.CreateFont( "RobotBoyIsFuckingLegit", { font = "Times New Roman", size = 15, weight = 500, blursize = 0, scanlines = 0, antialias = true, underline = false, italic = false, strikeout = false, symbol = false, rotary = false, shadow = false, additive = false, outline = false } ) function ThxForTesting () YouBetterGetAnMdmpFile = 30 local YourHealthDude = LocalPlayer():Health() if (YourHealthDude < 100) then YouBetterGetAnMdmpFile = 50 end TheList = vgui.Create( "DListView") TheList:SetPos(1,1) TheList:SetSize(500,500) TheList:SetHeaderHeight( 50 ) TheList:SetDataHeight( 50 ) local Col1 = TheList:AddColumn( "Address" ) local Col2 = TheList:AddColumn( "Port" ) Col2:SetMinWidth( YouBetterGetAnMdmpFile ) Col2:SetMaxWidth( 30 ) local line1 = TheList:AddLine( "192.168.0.1", "80" ) local line2 = TheList:AddLine( "192.168.0.2", "80" ) for id, pnl in pairs( line1.Columns ) do pnl:SetFont("RobotBoyIsFuckingLegit") end for id, pnl in pairs( line2.Columns ) do pnl:SetFont("RobotBoyIsFuckingLegit") end end hook.Add("HUDPaint",".mdmp won't fucking create",ThxForTesting) [/lua] 2. Launch Garry's Mod and join your localhost server. (Yes, you need a localhost server or dedicated server) Not tested with Single Player, but if you'd like to go ahead, but make it clear it was tested on Single Player! 3. Drop your health below 100 and it'll recreate what happens to me. I did this so that it's easier for people to test it. So, this way you don't have to mess with the Lua files. 4. Alt + Tab out of the game and "Close" the process. 5. Go to C:\Program Files (x86)\Steam\SteamApps\common\GarrysMod (OR your equivalent. If you changed it you'll know the directory.) 6. Locate the .mdmp files (More than one probably since Garry's Mod loves to crash.) 7. Make SURE that the .mdmp file is the proper one. They're time stamped and it'll say something like hl2_blah_blah_2013_time_stamps_something.mdmp 8. Go to: [URL="http://dumps.metastruct.uk.to/"]http://dumps.metastruct.uk.to/[/URL] and upload the .mdmp file. 9. Paste the link in here! 10. (Optional) Hope that someone knows how to read that shit. NOTE: Do this as soon as you join the server. Do not actually "play" the game. It'll slow down your FPS really fast. No, this has nothing to do with the crash.
Sorry, you need to Log In to post a reply to this thread.