Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Thu Sep 21, 2017 7:27 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Ideas how to implement an classroom (seats free/used) plan?
PostPosted: Thu May 02, 2013 1:34 pm 
Offline

Joined: Thu Oct 13, 2005 1:05 am
Posts: 101
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)


Top
 Profile  
Reply with quote  
 Post subject: Re: Ideas how to implement an classroom (seats free/used) pl
PostPosted: Thu May 02, 2013 3:21 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
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...

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Ideas how to implement an classroom (seats free/used) pl
PostPosted: Thu May 02, 2013 3:25 pm 
Offline

Joined: Thu Apr 10, 2008 6:03 am
Posts: 303
Location: Paris-La Défense, France
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.

_________________
Check my Website for high quality custom controls and classes (no plugins) for Windows, Mac OS and Linux
REALBasic 2012 R2 on Win 7 & Mac OS X


Top
 Profile  
Reply with quote  
 Post subject: Re: Ideas how to implement an classroom (seats free/used) pl
PostPosted: Thu May 02, 2013 3:31 pm 
Offline

Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12388
Location: Portland, OR USA
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Ideas how to implement an classroom (seats free/used) pl
PostPosted: Fri May 03, 2013 10:47 am 
Offline

Joined: Thu Oct 13, 2005 1:05 am
Posts: 101
Thanks all for good hints!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group