Jump to content

Question - Gridlist


manve1

Recommended Posts

why would u need a grid list? As i didn't do anything with it

There is:

2 gridlists,

1 memo

and i want to make that when i click on one gridlist writing appears in memo (( I know how to make this ))

but when i click on the other gui, i need the first one to cancel out it's writing in memo

Link to comment
why would u need a grid list? As i didn't do anything with it

There is:

2 gridlists,

1 memo

and i want to make that when i click on one gridlist writing appears in memo (( I know how to make this ))

but when i click on the other gui, i need the first one to cancel out it's writing in memo

  
addEventHandler("onClientGUIClick", root, function(button, state, absoulteX, absoulteY) 
    if source == button then 
      local grid1 = guiGridListGetSelectedItem(GRid1) 
      local get1 = guiGridListGetItemText(GRid1, grid1, COL1) 
      local grid2 = guiGridListGetSelectedItem(GRid2) 
      local get2 = guiGridListGetItemText(GRid2, grid2, COL2) 
      if get1 == "" then 
        return  
      end 
      if get2 == "" then 
        return  
      end 
      ----اhere your code 
  end 
end 
) 
  

Link to comment

this works for me when i click on grid2 then on grid1:

click1 = function() 
local row,col = guiGridListGetSelectedItem ( grid )  
local row2,col2 = guiGridListGetSelectedItem ( grid2 )  
   if ( row == 0 ) and ( col == 1 ) then 
       guiSetText(text,english) 
   elseif ( row == 1 ) and ( col == 1 ) then 
       guiSetText(text,lithuanian) 
   elseif ( row == 2 ) and ( col == 1 ) then 
       guiSetText(text,portugese) 
   elseif ( row == 3 ) and ( col == 1 ) then 
       guiSetText(text,spanish) 
   elseif ( row == 4 ) and ( col == 1 ) then 
       guiSetText(text,italian) 
   elseif ( row == 5 ) and ( col == 1 ) then 
       guiSetText(text,latvian) 
   elseif ( row == 6 ) and ( col == 1 ) then 
       guiSetText(text,polish) 
        
   elseif ( row2 == 0 ) and ( col2 == 1 ) then 
       guiSetText(text,commands) 
   elseif ( row2 == 1 ) and ( col2 == 1 ) then 
       guiSetText(text,website) 
   elseif ( row2 == 2 ) and ( col2 == 1 ) then 
       guiSetText(text,updates) 
   elseif ( row2 == 3 ) and ( col2 == 1 ) then 
       guiSetText(text,staff) 
   end 
end 
addEventHandler('onClientGUIClick',root, click1)  

But, when i click from grid1 to grid2 it doesn't show grid2, it shows grid1

Link to comment
this works for me when i click on grid2 then on grid1:
click1 = function() 
local row,col = guiGridListGetSelectedItem ( grid )  
local row2,col2 = guiGridListGetSelectedItem ( grid2 )  
   if ( row == 0 ) and ( col == 1 ) then 
       guiSetText(text,english) 
   elseif ( row == 1 ) and ( col == 1 ) then 
       guiSetText(text,lithuanian) 
   elseif ( row == 2 ) and ( col == 1 ) then 
       guiSetText(text,portugese) 
   elseif ( row == 3 ) and ( col == 1 ) then 
       guiSetText(text,spanish) 
   elseif ( row == 4 ) and ( col == 1 ) then 
       guiSetText(text,italian) 
   elseif ( row == 5 ) and ( col == 1 ) then 
       guiSetText(text,latvian) 
   elseif ( row == 6 ) and ( col == 1 ) then 
       guiSetText(text,polish) 
        
   elseif ( row2 == 0 ) and ( col2 == 1 ) then 
       guiSetText(text,commands) 
   elseif ( row2 == 1 ) and ( col2 == 1 ) then 
       guiSetText(text,website) 
   elseif ( row2 == 2 ) and ( col2 == 1 ) then 
       guiSetText(text,updates) 
   elseif ( row2 == 3 ) and ( col2 == 1 ) then 
       guiSetText(text,staff) 
   end 
end 
addEventHandler('onClientGUIClick',root, click1)  

But, when i click from grid1 to grid2 it doesn't show grid2, it shows grid1

  
function click1() 
local row,col = guiGridListGetSelectedItem ( grid ) 
local row2,col2 = guiGridListGetSelectedItem ( grid2 ) 
   if source == grid then 
   if ( row == 0 ) and ( col == 1 ) then 
       guiSetText(text,english) 
   elseif ( row == 1 ) and ( col == 1 ) then 
       guiSetText(text,lithuanian) 
   elseif ( row == 2 ) and ( col == 1 ) then 
       guiSetText(text,portugese) 
   elseif ( row == 3 ) and ( col == 1 ) then 
       guiSetText(text,spanish) 
   elseif ( row == 4 ) and ( col == 1 ) then 
       guiSetText(text,italian) 
   elseif ( row == 5 ) and ( col == 1 ) then 
       guiSetText(text,latvian) 
   elseif ( row == 6 ) and ( col == 1 ) then 
       guiSetText(text,polish) 
    end 
  elseif source == grid2 then 
   if ( row2 == 0 ) and ( col2 == 1 ) then 
       guiSetText(text,commands) 
   elseif ( row2 == 1 ) and ( col2 == 1 ) then 
       guiSetText(text,website) 
   elseif ( row2 == 2 ) and ( col2 == 1 ) then 
       guiSetText(text,updates) 
   elseif ( row2 == 3 ) and ( col2 == 1 ) then 
       guiSetText(text,staff) 
      end 
   end 
end 
addEventHandler('onClientGUIClick',root, click1) 
  

Link to comment

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...