[Gambas-user] Menu.Group property???

Bruce bbruen at ...2308...
Thu Jul 12 03:21:23 CEST 2012


(Slightly out of line, I'm just trying to tie the above two responses
together)

On Wed, 2012-07-11 at 15:39 +0200, Benoît Minisini wrote:
> 
> The "group" name is the event name as specified at object creation.
> 
> In other words, the compiler transforms
> 
> { mnuGroup Menu
>    ...
>    { mnuGroupItem1 Menu MyGroup
> 
> into
> 
> mnuGroupItem1 = new Menu(menuGroup) As "MyGroup"
> 
> Look at the documentation of the NEW instruction.
> 
> Regards,
> 
> -- 
> Benoît Minisini
> 

Ah! As usual, I need to listen to my own maxims.  I have now installed a
large sign above my monitor saying "Read EVERY word of the help
page!"  :-)

And, that of course eliminates the need for an explicit observer.



On Wed, 2012-07-11 at 17:04 +0200, Tobias Boege wrote:
> 
> > You can do it without an Observer, too. Observers duplicate events to there could be some overhead
> > with this solution (unless that behaviour is desired) - besides the memory used for the Observer
> > object: Just re-attach those objects that you want to 'Group' to their parents with the same event
> > name:
> > 
> > For Each hObj In myGroupObjs
> >   Object.Attach(hObj, Object.Parent(hObj), sNewGroup)
> > Next
> > 
> > This could prevent former event handlers to interfere... (Just guessing. It's a matter of your
> > application)
> > 
> > Regards,
> > Tobi


Now, that is rather interesting.  I made a "recentfiles" library and a
tester that are attached, (this was a lot simpler than trying to build a
stand-alone model of our real dynamic menu need*).

I think I see what you are getting and maybe that approach would
simplify the at handling necessary in the client form, but I can't quite
get it to operate (still looking at the help page).  If you can spare
the time, would you take a look at the attached and comment on whether
it would simplify the client code requirements.

regards
Bruce


* for the sake of any interest, we have a gridview listing horses at
upcoming auctions. It has a fanciful "rating" based on the known
previous performances of the horse and a bunch of statutory events that
can occur in its history. The user wishes to look at the history of a
specific in more detail. We have tried various ways to display this with
varying success as the events (things like prior race performances,
barrier trials, vet examinations, notified gear changes, gelding, etc
etc etc) are quite different in their characteristics.  In the main, the
user wants to see a summary of the history and then drill down into one
of those events.  On average there are about a dozen or so events per
horse of interest to our demographic, but the number could be one to
several dozen.  So the idea is to put a popup menu on the gridview which
would be populated dynamically depending on the current selected row.
This would display the horses event history and allow an event to be
selected, whereupon a popup window would display the details of that
event.   


-------------- next part --------------
A non-text attachment was scrubbed...
Name: recentfiles-0.0.8.tar.gz
Type: application/x-compressed-tar
Size: 9775 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120712/01668f7f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testrecentmenu-0.0.1.tar.gz
Type: application/x-compressed-tar
Size: 5460 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20120712/01668f7f/attachment-0001.bin>


More information about the User mailing list