Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Sharing : CEPanel As Hi-Light Bar Cursor

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1668

PostPosted: Sat Mar 23, 2019 1:32 am    Post subject: Sharing : CEPanel As Hi-Light Bar Cursor Reply with quote

This is a simple script for implementing CEPanel as a hi-light bar cursor when entering to a selected object or text.

Code:
-- =================================================== --
-- Custom Text Hi-light Bar via CEPanel Manipulation   --
-- Author : Corroder                                   --
-- Date   : March 22, 2019                             --
-- Desc.  : Sample for implementation CEPanel as       --
--          Hi-light Bar when enter an object / text   --
-- =================================================== --

------------------------------------------------------ Make GUI
f = createForm()
f.Width = 200
f.Height = 200
f.Position = 'poScreenCenter'
f.Color = '0xfffffff'
f.BorderStyle = 'bsToolWindow'
f.Caption = 'CRDR'

l1 = createLabel(f)
l1.top = 10
l1.caption = 'Text 1'
l1.Font.Name = 'Verdana'
l1.Font.Size = 14
l1.width = 100
l1.left = math.floor((f.width - l1.width) / 2)
l1.height = 40
l1.name = 'l1'

l2 = createLabel(f)
l2.top = l1.top + l1.height + 10
l2.caption = 'Text 2'
l2.Font.Name = 'Verdana'
l2.Font.Size = 14
l2.width = 100
l2.left = math.floor((f.width - l2.width) / 2)
l2.height = 40
l2.name = 'l2'

p = createPanel(f)
p.left = 1
p.width = f.width - 2
p.BorderStyle = 'bsSingle'
p.BorderWidth = 2
p.BevelInner = 'bvLowered'
p.visible = false

------------------------------------------------------ Make Functions
function pCursorIn(sender)  --- Show Hi-light Panel Bar when mouse enter the object
 p.visible = true
 p.caption = sender.Caption
 p.top = sender.top + 2
 p.height = sender.height + 2
 p.color = '0x87CEEB'
 p.Font.Name = sender.Font.Name
 p.Font.Size = sender.Font.Size
 sender.sendToBack()
end

function pCursorOut(sender) -- Hide Hi-light Panel Bar when mouse left the object
 if not sender then
 sender.visible = true
 sender.bringToFront()
 p.visible = false
end
end

function formEnter()  -- Normalize Form GUI and Hi-light Panel Bar
 p.visible = false
end

function labelClicked()  -- Do something when Hi-light Panel Bar has clicked
 print(p.Caption..' has been clicked')
end

function exiter()  -- close CE and clear memory
 closeCE()
 return caFree
end

------------------------------------------------------ Events Handler
f.onMouseEnter = formEnter
l1.onMouseEnter = pCursorIn
l2.onMouseEnter = pCursorIn
l1.onMouseLeave = pCursorOut
l2.onMouseLeave = pCursorOut
p.onClick = labelClicked
f.onClose = exiter

note = [[ If you have created objects/texts selection which over than 5,
          it is better considering to make your object using global name and
          call the event handler using global function ]]



Hope you can develop this method for the better. Good luck... Very Happy

_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
AylinCE
Grandmaster Cheater Supreme
Reputation: 37

Joined: 16 Feb 2017
Posts: 1532

PostPosted: Sun Mar 24, 2019 11:57 am    Post subject: Reply with quote

Thanks Corroder.
I shared the topic in the link functionally Smile

https://forum.cheatengine.org/viewtopic.php?p=5747310#5747310

_________________
Hi Hitler Different Trainer forms for you!
https://forum.cheatengine.org/viewtopic.php?t=619279
Enthusiastic people: Always one step ahead
Do not underestimate me Master: You were a beginner in the past
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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 can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites