Sliding effects

Post

Posted
Rating:
#1 (In Topic #1435)
Regular
rj71 is in the usergroup ‘Regular’
 Hi All,

I have a form that has 6 panels on it. The top 2 are static and will not move. There are 4 below it that will be dynamic and only 1 at a time wil be "visible". Based on a keypress event, I'd like to have whichever panel "slide" into view rather than just appearing which is what it is doing right now and looks very boring. So my question is how to "slide" a panel up or even down on a form? I have been searching the forum and I think I have narrowed it down to putting these panels in a DrawingArea component…am I close?? Can anyone point me to a thread or the software farm that might have what I'm looking for?
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
rj71 is in the usergroup ‘Regular’
 Just an FYI, I am currently playing around with a scrollview trying to achieve this by scrolling up and down using scrollX and scrollY. This might work…I'll report back later.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Enthusiast
sadams54 is in the usergroup ‘Enthusiast’
if I was to do this I would place the panel and use the top and left objects of the panel and increment them to your liking. You may have to do a wait for a time delay so it doesn't go too fast. adjust it to your taste.

for example
if you have a panel called. panel1

Code

dim X as integer = 1
dim Y as integer = 1

for X = 1 to \{final location of panel}
   panel1.Left = x
   Panel1.Top = Y    ' this is something you can also increment if you want diagonal slide you do not have to set top each time if it stays the same. This line is optional
   wait 100   ' this provides a short delay so the panel can be seen moving and allows for redrawing
next
Online now: No Back to the top

Post

Posted
Rating:
#4
Guru
BruceSteers is in the usergroup ‘Guru’
Check out SidePanel and Expander containers
Online now: No Back to the top

Post

Posted
Rating:
#5
Avatar
Guru
cogier is in the usergroup ‘Guru’
Have a look at the attached program. Let me know if I am on the right track.

Attachment
Online now: Yes Back to the top

Post

Posted
Rating:
#6
Regular
rj71 is in the usergroup ‘Regular’
 Thanks guys! Cogier, that is the direction I am looking to go. I like how it's not very much code. I will study this and see if I can work in 4 or more panels with this. The goal is to have 4 or 5 panels (not sure how many right now) and a keypress event will move the "current"  panel out of view and then slide the next one into. Thanks cogier!
Online now: No Back to the top

Post

Posted
Rating:
#7
Regular
rj71 is in the usergroup ‘Regular’

cogier said

Have a look at the attached program. Let me know if I am on the right track.

PanelSlide-0.0.1.tar.gz


Ah! PanelExpand size is just shrinking… Very clever! Seems like I'm going to have to do some math to work in more panels  :D
Online now: No Back to the top

Post

Posted
Rating:
#8
Avatar
Guru
cogier is in the usergroup ‘Guru’
Here is a different way to animate the panels. This example has the 5 panels you want.

Attachment
Online now: Yes Back to the top

Post

Posted
Rating:
#9
Regular
rj71 is in the usergroup ‘Regular’

cogier said

Here is a different way to animate the panels. This example has the 5 panels you want.

PanelSlide-0.0.2.tar.gz

Thanks Cogier! I've never done any fancy eye candy in my apps before so I never bothered to play around with X and Y. I've got a form i'm working on and just for now it's a couple of picture boxes that slide up and down in unison and it looks like it's what I'm trying to accomplish here.
Online now: No Back to the top

Post

Posted
Rating:
#10
Regular
rj71 is in the usergroup ‘Regular’
I do actually have another question related to all the questions I've been asking the last few weeks including this one. I'm working on a personal project and all the user input to the app will be coming from a linux friendly remote control I found on amazon. Very similar to amazon's RC for their firestick type products. This particular thing, the moving of the panels, doesn't work very well when I put it in a keypress event. I get "gb.gtk3: warning: calling the event loop during a keyboard event handler is ignored" then the panel just disappears. If I put the code in a button and click it, it works perfectly, I can see it "slide" up and then out of view. Here's the code for the form I mentioned earlier:

Code (gambas)

  1.       dypan1.Y = dypan1.Y - 1
  2.       Wait 0.1
  3.       dypan1.Y = dypan1.Y - 2
  4.       Wait 0.1
  5.       dypan1.Y = dypan1.Y - 3
  6.       Wait 0.1
  7.       dypan1.Y = dypan1.Y - 4
  8.       Wait 0.1
  9.       dypan1.Y = dypan1.Y - 5
  10.       Wait 0.1
  11.       dypan1.Y = dypan1.Y - 6
  12.       Wait 0.1
  13.       dypan1.Y = dypan1.Y - 7
  14.       Wait 0.1
  15.       dypan1.Y = dypan1.Y - 8
  16.       Wait 0.1
  17.       dypan1.Y = dypan1.Y - 9
  18.       Wait 0.1
  19.       dypan1.Y = dypan1.Y - 10
  20.       Wait 0.1
  21.       dypan1.Y = dypan1.Y - 11
  22.       Wait 0.1
  23.       dypan1.Y = dypan1.Y - 12
  24.       Wait 0.1
  25.       dypan1.Y = dypan1.Y - 13
  26.       Wait 0.1
  27.       dypan1.Y = dypan1.Y - 14
  28.       Wait 0.1
  29.       dypan1.Y = dypan1.Y - 15
  30.       Wait 0.1
  31.  

I even tried to button_click inside the keypress event and that didn't work either. Why does this code work for a button click but not when using arrow up/down keys?
Online now: No Back to the top

Post

Posted
Rating:
#11
Regular
rj71 is in the usergroup ‘Regular’
 I'm going to start a new topic for that last question. Thanks for your help guys!
Online now: No Back to the top
1 guest and 0 members have just viewed this.