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 


Edit box control

 
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: 1667

PostPosted: Sun May 05, 2019 6:07 am    Post subject: Edit box control Reply with quote

Hi, there

Say I have :

Code:
DisplayBox = createEdit(form)
DisplayBox.AutoSize = false
DisplayBox.setPosition(5,5)
DisplayBox.setSize(335,40)
DisplayBox.BorderStyle = 'bsNone'
DisplayBox.Color = '14481663'
DisplayBox.Font.Size = 20
DisplayBox.Text = ''
DisplayBox.Alignment = 'taRightJustify'
DisplayBox.ReadOnly = true


With edit box set Read Only = true, the user can't be typing anything to the edit box. This is like I want.
But, how I avoid the "flashing cell' and avoid the user block text on the edit box ?.

Thanks



EditBox Control.jpg
 Description:
 Filesize:  28.29 KB
 Viewed:  1538 Time(s)

EditBox Control.jpg



_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
TheyCallMeTim13
Wiki Contributor
Reputation: 50

Joined: 24 Feb 2017
Posts: 976
Location: Pluto

PostPosted: Sun May 05, 2019 6:18 am    Post subject: Reply with quote

I don't mess with the Lua GUI stuff in CE. But in other languages I tend to get around this kind of thing by making a label look like an text box; thus just modify the border, margins, and padding to look like a text box (some times it needs to be nested inside a panel/canvas to look right). I usually make a class that inherits from label or panel/canvas, with CE Lua you could probably make a sort of "createLebelBox" function.
_________________
Back to top
View user's profile Send private message Visit poster's website
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Sun May 05, 2019 6:21 am    Post subject: Reply with quote

Sure, TheyCallMeTim13, if not find a way to solve the mentioned thread then I plan to change editbox to a label Very Happy
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
panraven
Grandmaster Cheater
Reputation: 55

Joined: 01 Oct 2008
Posts: 942

PostPosted: Sun May 05, 2019 7:52 am    Post subject: Reply with quote

May steal focus to another focusable ui when target ui got focused (event OnEnter).
Code:

...
UDF1.CEEdit1.OnEnter =  function(me)
  UDF1.CEEdit2.Text = "Don't touch "..(me.Name or tostring(me))
  UDF1.CEEdit2.SetFocus()
end
...


focusable ui seems only limited to certain type, like edit, button but not label.
And they have to be visible and enabled.
To make it not visible, set its position outside form boundary.
Negative position seems not work, ie setPosition(-100,-100) not ok, setPosition(1000,1000) ok.
CEEdit1 may still got focus when the form 1st time show if it is the first focusable ui, run UDF1.CEEdit2.SetFocus() before form show.
Empty UDF1.CEEdit2.Text and set readonly if it is suppose to be invisible.

_________________
- Retarded.
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Mon May 06, 2019 3:50 am    Post subject: Reply with quote

Thanks, Panraven. I tried your method for CEEdit2. It seems to work by 'hiding' CE Edit2 out of form boundary. Nice trick...
_________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
Back to top
View user's profile Send private message
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