Jump to content

[مساعدة]: Gridlist & Tooltip


Recommended Posts

السلام عليكم ورحمة الله وبركاته .،
كيفكم؟

كيف لما اقرب الماوس من Tooltip
=[" في الجدول تكون بحرف واحد ^"]=
مو كلمة كاملة .
code : LUA

-- Tooltip < : C:\Program Files (x86)\MTA San Andreas 1.5\skins\Lighter black2017
---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
addEventHandler("onClientResourceStart", resourceRoot,
    function()
      gridlistPlayer = guiCreateGridList(967, 239, 212, 279, false)
        guiGridListAddColumn(gridlistPlayer, "player", 0.9)
        guiGridListAddRow(gridlistPlayer)
        for id, player in ipairs ( getElementsByType ( "player" ) ) do
        guiGridListSetItemText(gridlistPlayer, 0, 1, string.find ( string.upper ( getPlayerName ( player ) ), string.upper ( player ), 1, true ), false, false)
        end
    end
)
addEventHandler("onClientMouseEnter", gridlistPlayer,
    function()
        if (gridlistPlayer) then
                aPlayer = gridlistPlayer:gsub("%a",string.upper,1)
            guiSetProperty(gridlistPlayer, "Tooltip", aPlayer)
            guiSetProperty(gridlistPlayer, "InheritsTooltipText", "True")
        end
    end
)    
addEventHandler("onClientMouseLeave", gridlistPlayer,
    function()
        if (gridlistPlayer) then
        guiSetProperty(gridlistPlayer, "InheritsTooltipText", "False")
        end
    end
)    

مثلا صور
23377.png

Link to comment
  On 05/11/2017 at 12:05, medo7 said:

الحين الكود تمام بس
ليش لما اقرب الماوس من
gridlist
ويكون مثلا باسم "medo7"
 بنفس tooltip تطلعلي
الاسم "medo7"
...انا بس ابي يكون بحرف واحد "M"
جمل في غلط في الكود سويت ولا ايش

Expand  

يعني هو شغال معك تمام بس تبي التول تيب يظهر الحرف الاول ؟

Link to comment
  On 05/11/2017 at 13:16, medo7 said:

يب

Expand  

بدل الكود الي مسويه بالحدث لهذا :
 

addEventHandler("onClientMouseEnter", gridlistPlayer,
    function()
        if (gridlistPlayer) then
            aPlayer = string.upper ( string.sub ( gridlistPlayer, 0, 1 ) )
            guiSetProperty(gridlistPlayer, "Tooltip", aPlayer)
            guiSetProperty(gridlistPlayer, "InheritsTooltipText", "True")
        end
    end
)   

 

Edited by iMr.WiFi..!
  • Like 1
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...