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 


Scrollbar for panels?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Tue Sep 02, 2014 1:29 am    Post subject: Scrollbar for panels? Reply with quote

Maybe im just blind but is there a way to make group boxes, panels, or page controls have a scroll bar at all?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Sep 02, 2014 4:58 am    Post subject: Reply with quote

No, there is no scrollbox component right now. Perhaps next version.
_________________
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
View user's profile Send private message MSN Messenger
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Tue Sep 02, 2014 9:50 am    Post subject: Reply with quote

Not a problem. Just means a slightly bigger window or breaking things down into page tabs.
Back to top
View user's profile Send private message
DaSpamer
Grandmaster Cheater Supreme
Reputation: 52

Joined: 13 Sep 2011
Posts: 1578

PostPosted: Tue Sep 02, 2014 10:59 am    Post subject: Reply with quote

You could draw a scrollbar.
I've drawn a scrollbar on image, and updated pos of the scrollbar, based on the current Y I copied rect from an image.
Another solution is using the mouse scroll events. (this isn't easy).

Basically place everything in 1 panel, extend the panel height and place everything in the order you want (increasing/decreasing all panel objects will impact performance a lot..).
(This script is basically from mgr.inz.Player UFO script
Here's an example (Just execute it and use the mouse scroll on the right side of the form*, as the form is the only object with scroll events, you can rewrite the function and achieve the same with an image, by storing old y of image, and on mouse movement even calculate the new y and the distance between old and new is the increase/decrease value of the panel position..)


Code:

function test()
   local desty = 0;
   local cury = 0;
   local scrolldis = 12 * 24;
   local f = createForm();
   local p = createPanel(f);
   p.Caption = '';
   p.height = f.height * 4;
   p.width = f.width-15;
   createCheckBox(p);
   for i =1, math.floor((p.height/24)) do
      local c = createCheckBox(p);
      c.Top = i * (5 + 19);
      c.Caption = i;
   end    
   local t = createTimer(f, false);
   t.Interval = 10
   local function scrollDelta(amount)
      local y = cury + amount
      y = math.min(0,math.max(y,f.height-p.height))
      if desty == y then return end
      desty = y
      if not t.Enabled then
         t.Enabled = true
      end
   end
   local function scrollOnTimer(timer)
      local y = cury
      local step = (desty-y) * 0.05
      if step < 1 and step > 0 then step = 1 end
      if step > -1 and step < 0 then step = -1 end
      y = y + step
      if step < 0 and y < desty then y = desty end
      if step > 0 and y > desty then y = desty end
      if math.abs(y) < 1 then y = 0 end
      cury = y
      if desty == y and timer then
         timer_setEnabled(timer,false)
      end
      print(math.floor(y));
      p.top = math.floor(y);
      f.Caption = math.floor(y/(f.Height-p.height)*100);
   end
   local function scrollUp()
      local speed = t.Enabled and 3 or 1
      scrollDelta(scrolldis*speed);
   end
   local function scrollDown()
      local speed = t.Enabled and (-3) or (-1)
      scrollDelta(scrolldis*speed);
   end
   setMethodProperty(f,'OnMouseWheelDown',scrollDown)
   setMethodProperty(f,'OnMouseWheelUp',scrollUp)
   t.OnTimer  = scrollOnTimer
end
test();

_________________
HEY Hitler
Do you get lazy when making trainers?
Well no more!
My CETrainer will generate it for you in seconds, so you won't get lazy! Very Happy

http://forum.cheatengine.org/viewtopic.php?t=564919
Back to top
View user's profile Send private 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: Tue Sep 02, 2014 1:48 pm    Post subject: Reply with quote

DaSpamer wrote:
(This script is basically from mgr.inz.Player UFO script

Not UFO, NFOWindow Very Happy Anyway, updated NFOwindow here: http://forum.cheatengine.org/viewtopic.php?t=576006




I can try to create "decent" custom scrollbar.

_________________
Back to top
View user's profile Send private message MSN Messenger
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Tue Sep 02, 2014 3:20 pm    Post subject: Reply with quote

Yeah after posting i was thinking about it. A double layer panel could do the trick. The idea is the normal panel for seperating parts of the form but another panel in side of that. A basic script could do a check on the form size and show a vertical track bar if needed in the main panel but not inside the second. The track bar would move the secondary panel up and down as needed.
Back to top
View user's profile Send private 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: Tue Sep 02, 2014 4:48 pm    Post subject: Reply with quote

WIP


_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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