Jump to content

How to know when the tab switch to another?


Recommended Posts

Posted

Hi! in this time i wanna ask how to know that cause im making a panel, and has a first tab with a dxRectangle and i wanna destroy that rectangle when the tab is switched some body help me?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Thanks but now...In the first tab theres a Rectangle And how to do dissapear if change to another tab, buti f returns to that tab how to appear again the rectangle?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

Thanks for all! now the last dude, im making a panel, that in one part theres a tab, in that tab is the interface management the you can change colors, i put it like 3 editboxes R: G: B: And if you change it and click on set button the interface and the sample rectangle should change to the inserted color of RGB How to change color like that, i know is guiGetText and what else y should use to set the color?

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted
bool dxDrawRectangle ( int startX, int startY, float width, float height [, int color = white, bool postGUI = false] ) 

You have to use the event 'onClientRender' on this codes. You are using them, good. Instead of putting in: 'tocolor(255, 255, 255, 255)' you are going to do this:

--Add a variable which represents the current color: 
local gCurrentColor = tocolor(255, 255, 255, 255) 
  
--As soon as you change the color you can do this: 
local gR, gG, gB = guiGetText(youreditboxR), guiGetText(youreditboxG), guiGetText(youreditboxB) 
gCurrentColor = tocolor(tonumber(gR), tonumber(gG), tonumber(gB), 255) 

Be sure you only can enter numbers into the editboxes, if you add something else than a number, then you get alot of errors. (You can remove everything except digits with: 'string.gsub(yourstring, "%D", "")' )

Posted (edited)

I got a error, and only shows the rectangle why? whats wrong---

Edited by Guest

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted

@guiSetVisible thats the error, when i press 'o' doesnt open window, and draw rectangle,else i press again 'o' and appears that onClientRender is already handled so?

No i dont gonna put backdoors xD would be a private script, i use hasObjectPermissionTo cause i tried with isObjectInACLGroup and doesn't work :c

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

Posted
function toggleGUI() 
    if guiGetVisible(PanelAdmin) == false then 
        guiSetVisible(window,false) 
        showCursor(false) 
        removeEventHandler("onClientRender", getRootElement(), CurrentColor) 
    else 
        guiSetVisible(window,true) 
        showCursor(true) 
        addEventHandler("onClientRender", root, CurrentColor) 
    end 
end 
addEvent("Show",true) 
addEventHandler("Show",root,toggleGUI) 

Still not working

"El conocimiento jamás debe detenerse, por que es lo único que nos salvará cuando no nos quede más".

Att: -|TG|-Mister[Q]<.

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