Generic Invisibility Handler

Michael Kann mikekann at yahoo.com
Mon Feb 8 13:26:27 EST 2010


Andrew, screw the elegence. Try this:

Make 3 flds:
fld "uno"  -- just to test visibility
fld "dos"  -- just to test visibility
-----------------------
fld "visibility"

In fld "visibility" put the following text:

This is fld "visibility"
------------------------------------
record_update, show fld "uno"
record_update, show fld "dos"

-------------------------------------
record_change, hide fld "uno"
record_change, hide fld "dos"
---------------------------------------
--- finished with fld "visibility"
---------------------------------------
This fld holds your list of
all the actions that will trigger some
visibility change -- this is a handy item
to have around anyway, and easy to change.

Now for a couple of btns:

btn record_update has the following script:

on mouseUp
   put fld "visibility" into v
   filter v  with  "*update*"  -- chooses all the update lines
   set the itemDelimiter to comma
   repeat for each line cur_line in v
      do item 2 of cur_line     -- performs the show or the hide
   end repeat
end mouseUp

btn record_change has the following script:

on mouseUp
   put fld "visibility" into v
   filter v  with  "*change*"
   set the itemDelimiter to comma
   repeat for each line cur_line in v
      do item 2 of cur_line
   end repeat
end mouseUp

------
when an update or a change occurs then send a mouseUp to the correct btn
-------
Now you have a nice list of actions that you can change easily. You also have some btns to click on to simulate a record_change or a record_update. When everything is working o.k. you can hide the btns and the fld. 

Just as a warning. I'm probably the worst programmer who frequents this forum. So you might want to heed the experts. 

Good luck on your project. I checked out your website and it looks great.

Mike



--- On Mon, 2/8/10, Andrew Kluthe <andrew at rjdfarm.com> wrote:

> From: Andrew Kluthe <andrew at rjdfarm.com>
> Subject: Generic Invisibility Handler
> To: use-revolution at lists.runrev.com
> Date: Monday, February 8, 2010, 11:14 AM
> (Moderator Note: My previous post
> from akrevolt at gmail.com
> should be ignored
> or deleted. I mistakenly sent it from the wrong email. I'm
> very sorry.)
> 
> Hello,
> 
> I recently convinced my company to let me re-write our farm
> management
> software in RunRev. Part of my proposal for this was
> developing a module for
> this software within a week.
> 
> Going from zero RevTalk/Revolution knowledge to programming
> a fairly large
> database application has really been fun (no sarcasm
> intended).
> 
> But syntax (or lack thereof?) seems to be my biggest
> problem.
> 
> I have a lot of controls that need to be made visible and
> invisible
> depending on the user-state of the application (updating a
> record, adding a
> record, viewing a record).
> 
> I'm unsure how to use parameters with handlers in this one
> liner.
> 
> on hideObject pObjectType, pObjectName
>    set the invisible of pObjectType
> pObjectName to true
> end hideObject
> 
> on showObject pObjectType, pObjectName
>    set the invisible of pObjectType
> pObjectName to true
> end showObject
> 
> Any suggestions on helping this RevNub get this sorted out?
> In your
> response, try to include how the params are used in
> handlers. Thank you so
> much in advance for your replies!
> 
> 
> Hoping Rev can make my job easier (I am very tired of ASP
> .NET),
> 
> Andrew K.
> RJD Farm LLC
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


      



More information about the use-livecode mailing list