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 


[Solved] Can't Get Child to Expand with Parent

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
AntumDeluge
Cheater
Reputation: 0

Joined: 20 Dec 2018
Posts: 48

PostPosted: Thu Feb 21, 2019 5:09 pm    Post subject: [Solved] Can't Get Child to Expand with Parent Reply with quote

I've created a Form with two children: A Label & a Panel. In the Form Designer I can set the anchors & get the panel to fill the space of the Parent Form & resize with it. However, I can't seem to figure out how to do it in Lua scripting.

Example code:
Code:
local form = createForm(false)
form.BorderStyle = bsSizeable

local label = createLabel(form)
label.setCaption('Label 1')
label.AnchorSideTop.Control = form
label.AnchorSideTop.side = asrTop
label.AnchorSideLeft.Control = form
label.AnchorSideLeft.Side = asrCenter

local panel = createPanel(form)
panel.setColor(255)
-- anchor the top of the panel to the bottom of the label
panel.AnchorSideTop.Control = label
panel.AnchorSideTop.Side = asrBottom
-- anchor other sides of panel to main form
panel.AnchorSideLeft.Control = form
panel.AnchorSideLeft.Side = asrLeft
panel.AnchorSideRight.Control = form
panel.AnchorSideRight.Side = asrRight
panel.AnchorSideBottom.Control = form
panel.AnchorSideBottom.Side = asrBottom

I have attached an example image of what I want it to do.

Edit: D'oh! I just figured it out. I have to set the Anchors property string value:
Code:
panel.Anchors = '[akTop,akBottom,akLeft,akRight]'

I thought the Anchors property was a table.



panel_expand.png
 Description:
 Filesize:  4.68 KB
 Viewed:  1301 Time(s)

panel_expand.png


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