Jump to content

[REL] dxGridlists Framework


t3wz

Recommended Posts

Posted

dxGridlists

Code used in the video:

local screen_size = { guiGetScreenSize( ) } 
  
local gridlist = dxGrid:Create ( ( screen_size[1] / 2 ) - 250, ( screen_size[2] / 2 ) - 150, 500, 300 ); 
  
gridlist:AddColumn ( "Nick", 400 ) 
gridlist:AddColumn ( "Ping", 100 ) 
  
for i = 1, 50 do 
    gridlist:AddItem ( 1, "Player "..i.." Name" ) 
    gridlist:AddItem ( 2, tostring ( math.random (  10, 100 ) ) ) 
end 
  

This framework allows you to make gridlists with dxs, The gridlists works like the default CEGUI system so you won't have a lot of work to adapt your code for this framework.

Note that the core is writed in the OOP format (using metatables, not the MTA default system) so you have to write your scripts in this format too, The self for all functions should be the gridlist which you want to perform an action and not something else.

You're free to fork, edit and use this as you want, but sell it or remove the author's name isn't permitted, Also pull requests to improve the code are welcome :)

Fell free to contact me if you have any questions or something else.

How to use

To use this you have to download and include the main file within your project folder and add it to the meta.xml file, After this you can use all the functions that are listed in the documentation page.

Download

Documentation

The documentation can be found at the project wiki, There also examples there.

__

Sorry if there's some grammar errors, my english isn't that good :P

  • Like 1
Posted

MAKE A CHANGE IN SCRIPT OF KEEPING ID OF COLUMN PLEASE ,ONLY A SUGGESTION (I USED IT AND IT WAS NICE BUT BECAUSE OF THIS ID MATTER I GOT DIFFICULTY IN SETTING ITEMS)

Posted
Nice ;
Nice Man ,

Thanks

Looks nice, good job.
Nice looks awesome
Look nice , keep the great job
finally a good dx gridlist, thanks ;)

Thanks guys :P

MAKE A CHANGE IN SCRIPT OF KEEPING ID OF COLUMN PLEASE ,ONLY A SUGGESTION (I USED IT AND IT WAS NICE BUT BECAUSE OF THIS ID MATTER I GOT DIFFICULTY IN SETTING ITEMS)

What you mean? explain better.

Posted

hi t3wz

this no is working

addCommandHandler('GetData', function ( ) 
local i = gridlist:GetSelectedItem ( ) 
local data = gridlist:GetItemDetails ( 1 , i ) 
outputChatBox (i..'-'..data) 
    end 
    ) 

Please fix this ^

Posted
hi t3wz

this no is working

addCommandHandler('GetData', function ( ) 
local i = gridlist:GetSelectedItem ( ) 
local data = gridlist:GetItemDetails ( 1 , i ) 
outputChatBox (i..'-'..data) 
    end 
    ) 

Please fix this ^

Sorry about this :P it's fixed now, download the latest version.

  • 3 weeks later...
  • 1 month later...
  • 3 weeks later...
Posted
Does it support color-coded text?

No, it uses the clip/wordBreak arguments so color-coded texts aren't possible.

Oh... It's very sad. Perhaps you should consider to implement this feature in the future as some parameter like default gui-gridlist. Thanks for the reply anyway.

Posted
Oh... It's very sad. Perhaps you should consider to implement this feature in the future as some parameter like default gui-gridlist. Thanks for the reply anyway.

Ha, i thought that you were talking about HEX colors, btw i've added support to RGB colors, feel free to look at the repo if you want :P

Posted
Does it support color-coded text?

No, it uses the clip/wordBreak arguments so color-coded texts aren't possible.

You could add it by spliting the string into different draws.

Posted

@ t3ws

jd0zp

Is there any way you can fix this? The gridlist doesn't scroll sideways like the CEGUI one does. The text is also centered.

Posted

@Tails

Horizontal scroll isn't implemented, What you can do to "fix" this:

  • Increase the gridlist's width.
  • Put a character limit to the video name.

About the centered text, it is made to work like this, if you want to, here's the line responsible for processing the text of the row, you can edit this as you wish.

@Tomas

Good idea, i'll take a look into this later.

Posted

The standard CEGUI gridlists are so bad that I just have to use yours. So it will have to be either or both of the options you mentioned then.

Any plans for the future though to implement horizontal scrolling?

Edit:

Oh, another thing. Can you make the all the dx elements relative, so they scale with every resolution and the positions stay the same?

Posted

I'd really like to use your gridlists but I'm afraid I need to go back to CEGUI as they don't scale well with different resolutions.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...