Posted: Tue Dec 24, 2019 12:16 am Post subject: Trick To Hi-Lighting Cursor Inside CE Trainer
This is about how to 'hi-lighting' mouse cursor when entering a component inside a CE Trainer. Example below :
Code:
--- Define function when the mouse enters a component
--- in this case, is component color
function onEnterLabel(sender)
sender.Color = 0xFF -- red color
end
--- Define function when the mouse left a component
--- in this case, is restore component color
function onLeaveLabel(sender)
sender.Color = 0xFFFFFF -- white color as default in this example
end
--- Process hack codes
function label_click(sender)
if sender.Name == 'label1' then
print('CELabel 1 has been clicked')
elseif sender.Name == 'label2' then
print('CELabel 2 has been clicked')
elseif sender.Name == 'label3' then
print('CELabel 3 has been clicked')
elseif sender.Name == 'label4' then
print('CELabel 4 has been clicked')
elseif sender.Name == 'label5' then
print('CELabel 5 has been clicked')
end
end
--- Create Trainer GUI
f = createForm()
f.Caption = 'Test Label Hi-light'
local label = {};
label[1] = createLabel( f )
label[2] = createLabel( f )
label[3] = createLabel( f )
label[4] = createLabel( f )
label[5] = createLabel( f )
--- Hi-light and access the hack functions
for x = 1, #label do
label[x].Name = 'label'..x
label[x].Caption = "This CELabel " .. tostring( x )
label[x].setPosition(10, x * 20)
label[x].Color = 0xFFFFFF
label[x].onMouseEnter = onEnterLabel
label[x].onMouseLeave = onLeaveLabel
label[x].onClick = label_click
end
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum