Real Software Forums
http://forums.realsoftware.com/

Ideas how to implement an classroom (seats free/used) plan?
http://forums.realsoftware.com/viewtopic.php?f=10&t=47764
Page 1 of 1

Author:  mitch_stgt [ Thu May 02, 2013 1:34 pm ]
Post subject:  Ideas how to implement an classroom (seats free/used) plan?

Looks like things at airplane booking or theatre booking service (also shows an room/seat plan). Only diff: I have too much rooms / places to show all together in one view.

I am thinking how to implement an RB prog which has that main features:
- shows an (fixed) classroom plan with desks. Each desk can handle 2 students.
- you can click on the table (left side/rights side) and select place for used (gets red) / unused (default green)

Can i do that with some controls (to get positions) or using an pic overlay (with tables painted on) and get position by x/y of pic (to compute the places)?

Because different count of desks (places) in different sized rooms ( around 10) it should be scrollable (fixed zoom) or zoomable to get better sigth where the places are. An Text List can do that.

Should be not complete new (from beginning) coding if desk count in rooms changed.

Thanks for any ideas.
PS: Desktop app (only places data as an file on ftp / web for multiuser usage)

Author:  DaveS [ Thu May 02, 2013 3:21 pm ]
Post subject:  Re: Ideas how to implement an classroom (seats free/used) pl

Create a CLASS.... called "ClassRoom"... (hmm.. kind of a pun)

Make parameters at least the # of seats/desks, or maybe X rows by Y columns of desks

Than that CLASS would be able to handle any situation with one piece of code...

Author:  JeremK [ Thu May 02, 2013 3:25 pm ]
Post subject:  Re: Ideas how to implement an classroom (seats free/used) pl

I created a beach chair reservation display a few years ago.

I guess it would be quite similar to a Classroom with a different background layout.

Feel free to contact me by PM or through my website if you need any help.

Author:  timhare [ Thu May 02, 2013 3:31 pm ]
Post subject:  Re: Ideas how to implement an classroom (seats free/used) pl

Then give that class a Draw method that accepts a parameter, g as graphics. Have the class draw itself into the graphics context.

Use a canvas to display the classroom representation. The paint event would simply be:

theCurrentClassroom.Draw(g)

Use Canvas.Scroll to scroll the image.

Then give the class a method, ClickDeskAtXY(X as integer, Y as integer). That method will determine which desk is at the X,Y location, if any, and toggle its occupied status.

The Canvas MouseDown code would be

theCurrentClassroom.ClickDeskAtXY(X, Y)
me.Invalidate

You could make it more efficient by returning a boolean that tells whether a desk was clicked, so you only have to redraw the canvas if it actually changed.

if theCurrentClassroom.ClickDeskAtXY(X, Y) then me.Invalidate

Hope you start to get the picture.

Author:  mitch_stgt [ Fri May 03, 2013 10:47 am ]
Post subject:  Re: Ideas how to implement an classroom (seats free/used) pl

Thanks all for good hints!

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/