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 


Changing only height or only width

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
mgr.inz.Player
I post too much
Reputation: 218

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Thu Aug 11, 2011 3:35 pm    Post subject: Changing only height or only width Reply with quote

Code:

function control_setWidth(control, NewWidth)
   OldWidth,OldHeight = control_getSize(control)
   control_setSize(control, NewWidth, OldHeight)
end

function control_setHeight(control, NewHeight)
   OldWidth,OldHeight = control_getSize(control)
   control_setSize(control, OldWidth, NewHeight)
end


-- update form size
function ItemsCountChanged(itemsForm,itemscount)
   if (itemscount > 10) then
      form_new_height = 140 + (itemscount - 10) * (10 + 4)
      --
      -- 10 - height of label, 4  - border spacing
     
      control_setHeight(itemsForm, form_new_height)
   end
   ---
   --- rest of code (placing labels, etc.)
   ---
end


Why? Because we can't use something like this:
control_setSize(control, NewWidth, -1) - to change only width
control_setSize(control, -1, NewHeight) - to change only height

_________________
Back to top
View user's profile Send private message MSN Messenger
hack0535
Cheater
Reputation: 2

Joined: 16 Oct 2011
Posts: 28

PostPosted: Thu Jan 19, 2012 1:01 am    Post subject: Reply with quote

Try this!!

width, height = control_getSize(control)

control_setSize(control, width -1, height ) - to change only width
control_setSize(control, width, height - 1) - to change only height
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