View previous topic :: View next topic |
Author |
Message |
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Tue Feb 09, 2016 1:45 pm Post subject: Form Designer ? Table Script? |
|
|
How do I manually edit a form created by form designer?
I want to use the form created in form designer, BUT have the form built and destroyed by a Table Script.
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Tue Feb 09, 2016 2:11 pm Post subject: |
|
|
you can access any object using formname.objectname and edit the properties as you see fit
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Tue Feb 09, 2016 3:19 pm Post subject: |
|
|
Sorry for my ignorance here.
So I cant view the Lua code I created in Form Designer?
I notice the encoding is ASCII85 in the .ct file but I have failed to convert it to Lua.
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Tue Feb 09, 2016 3:50 pm Post subject: |
|
|
Form Designer doesn't create Lua code for buttons, labels, sizes, positions, styles, etc. It is a binary data.
Then that binary data is compressed (zlib), then converted to a string (base85 encoding) so it could be saved in text/XML file (CT file is XML file)
Of course you can assign/create "onClick" function and FormDesigner will append this to Lua Script window.
For example, onclick for CELabel1 will be:
function CELabel1Click(sender)
end
This is the only connection between FormDesigner and Lua script.
_________________
|
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Tue Feb 09, 2016 4:21 pm Post subject: |
|
|
thanks mgr.
So I CANT design a form and view that form to learn how its built?
So I have to learn LUA parameters and placement the hard way . The 'sender' part is easy.
Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.
This is really disappointing.
_________________
|
|
Back to top |
|
|
mgr.inz.Player I post too much Reputation: 218
Joined: 07 Nov 2008 Posts: 4438 Location: W kraju nad Wisla. UTC+01:00
|
Posted: Tue Feb 09, 2016 4:39 pm Post subject: |
|
|
I saw once a script which gets components properties from existing form created with FormDesigner.
I think it is possible to write converter, but, it won't be perfect.
"So I CANT design a form and view that form to learn how its built? "
You can install Lazarus, create form with any components. Save your project. Open LFM file with text editor. That way you can learn something.
For example, I made this form:
Launched looks like this:
LFM file looks like this:
Code: | object Form1: TForm1
Left = 365
Height = 183
Top = 152
Width = 329
Caption = 'Form1'
ClientHeight = 183
ClientWidth = 329
LCLVersion = '1.3'
object Panel1: TPanel
Left = 20
Height = 143
Top = 20
Width = 289
Align = alClient
BorderSpacing.Around = 20
Caption = 'Panel1'
ClientHeight = 143
ClientWidth = 289
TabOrder = 0
object Button1: TButton
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter
AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom
Left = 107
Height = 30
Top = 102
Width = 75
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 10
Caption = 'Button1'
TabOrder = 0
end
object Label1: TLabel
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Panel1
AnchorSideBottom.Side = asrBottom
Left = 249
Height = 15
Top = 122
Width = 34
Anchors = [akRight, akBottom]
BorderSpacing.Right = 5
BorderSpacing.Bottom = 5
Caption = 'Label1'
ParentColor = False
end
end
end
|
From that, we can write Lua script.
Code: | myForm=createForm()
myForm.Left = 365
myForm.Height = 183
myForm.Top = 152
myForm.Width = 329
myForm.Caption = 'Form1'
myPanel=createPanel(myForm)
myPanel.Left = 20
myPanel.Height = 143
myPanel.Top = 20
myPanel.Width = 289
myPanel.Align = alClient
myPanel.BorderSpacing.Around = 20
myPanel.Caption = 'Panel1'
myButton=createButton(myPanel)
myButton.AnchorSideLeft.Control = myPanel
myButton.AnchorSideLeft.Side = asrCenter
myButton.AnchorSideBottom.Control = myPanel
myButton.AnchorSideBottom.Side = asrBottom
myButton.Anchors = '[akLeft, akBottom]'
myButton.BorderSpacing.Bottom = 10
myButton.Caption = 'Button1'
myButton.Height = 30
myButton.Top = 102
myButton.Width = 75
myLabel=createLabel(myPanel)
myLabel.AnchorSideRight.Control = myPanel
myLabel.AnchorSideRight.Side = asrBottom
myLabel.AnchorSideBottom.Control = myPanel
myLabel.AnchorSideBottom.Side = asrBottom
myLabel.Height = 15
myLabel.Width = 34
myLabel.Anchors = '[akRight, akBottom]'
myLabel.BorderSpacing.Right = 5
myLabel.BorderSpacing.Bottom = 5
myLabel.Caption = 'Label1' |
Should look like this:
_________________
Last edited by mgr.inz.Player on Tue Feb 09, 2016 4:58 pm; edited 1 time in total |
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Tue Feb 09, 2016 4:58 pm Post subject: |
|
|
installing now.
This will allow me to establish the basic design. Then just convert the scale and postition.
Very grateful. TY
mgz you are the man.
_________________
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25287 Location: The netherlands
|
Posted: Tue Feb 09, 2016 5:03 pm Post subject: |
|
|
akumakuja28 wrote: | thanks mgr.
So I CANT design a form and view that form to learn how its built?
So I have to learn LUA parameters and placement the hard way . The 'sender' part is easy.
Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.
This is really disappointing. |
keep in mind that building a form with code is a lot slower than using a binary setup.
that a lot of people use code instead of the designer doesn't mean it's the best solution. They just copy/paste eachother and go from that. (i still see people use the deprecated and undocumented classless functions to access objects. And sometimes even a mix of them)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
akumakuja28 Master Cheater Reputation: 16
Joined: 28 Jun 2015 Posts: 432
|
Posted: Tue Feb 09, 2016 6:09 pm Post subject: |
|
|
Dark Byte wrote: | akumakuja28 wrote: | thanks mgr.
So I CANT design a form and view that form to learn how its built?
So I have to learn LUA parameters and placement the hard way . The 'sender' part is easy.
Just would have been nice to use form designer to get all build parameters and copy & paste. yeah that sucks that this is not an option.
This is really disappointing. |
keep in mind that building a form with code is a lot slower than using a binary setup.
that a lot of people use code instead of the designer doesn't mean it's the best solution. They just copy/paste eachother and go from that. (i still see people use the deprecated and undocumented classless functions to access objects. And sometimes even a mix of them) |
I understand why you would use binary. File size, etc ....
I was just hoping to use the The Form builder which is very simple and intuitive vs learning all the commands, parameter, and parent etc... Seems easier for me to tear it apart vs building it and figuring out what I did wrong. I have established a quick way to build then use as reference. Plus everything in FormDesigner is Listed the same as control/set parameter's. No Biggie.
I agree. I would rather know the makeup of the Lua exactly right now.
I have no idea what that means yet
TY.
_________________
|
|
Back to top |
|
|
paul44 Expert Cheater Reputation: 2
Joined: 20 Jul 2017 Posts: 152
|
Posted: Sun Oct 17, 2021 8:48 am Post subject: use form data in Lua script? |
|
|
Is it possible to use the form data (<MyForm Class="TCEForm" Encoding="Ascii85">eUs...</MyForm>) from within a Lua script (incl startup)?
Reason: I'd like to offer a script that others can copy/paste into their own table, without the need of having it saved explicitly in their table ?
Already requested here: [ https://www.cheatengine.org/forum/viewtopic.php?t=613440&start=0&postdays=0&postorder=asc&highlight=&sid=47ea3bf6072f9fbcdbdf406c3cf0ae2c ]
btw: tried copy/paste of xml_part into new table: it will show up, i can edit it, but the script - calling the form - does not seem to work...
(even save as .frm and then load/save in other table does not seem to get it working either ~ can edit it though)
-EDIT-: I stand corrected: tried with "new" & existing table, and that worked fine (either loading a .FRM or .LFM file).
|
|
Back to top |
|
|
|