Hot Topic (More than 10 Replies) @HideTreeItem - Search Menu (Read 3635 times)
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
@HideTreeItem - Search Menu
May 5th, 2005 at 4:42pm
Print Post Print Post  
I seem to be having problems hiding the search menu in my application.  My programming is as follows:

var vHideTree as Int

vHideTree = @HideTreeItem("Employee Database!Forms!Search/Update!Employee!Employee!Search Menu")

It is still showing the search menu when I preview the application.

I know that there is a menu choice under view, Close Command Area but would prefer to deal with it in the programming above.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #1 - May 5th, 2005 at 4:51pm
Print Post Print Post  
Right after the line of code above do:
WriteLn(@Error)

If it says Yes, then it can't find the item you are trying to hide. If this is the case, check your spelling and names.

If you want to prevent a Form called Employee from being opened in Search from the application menu, you probably just want:
vHideTree = @HideTreeItem("Employee Database!Forms!Search/Update!Employee!Employee")

TreeItem paths don't continue off into other menus or into dialog boxes. They are not commands. They cannot reference anything other than a findable path to a single item on a single menu tree.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #2 - May 5th, 2005 at 6:23pm
Print Post Print Post  
Thanks for the quick response.

However, the WriteLn(@Error) does not indicate any errors when I add it to the code and run test program.

I can hide the form but I am really just  trying to hide the search menu as most users do not require this side menu due to the command buttons created in the form.  It also enhances the visual effects of the form on screen.

Is the Search or Add Data menu not part of the tree ?

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #3 - May 5th, 2005 at 6:33pm
Print Post Print Post  
Quote:
However, the WriteLn(@Error) does not indicate any errors when I add it to the code and run test program.


@Error returns runtime errors, not a syntax errors. The "test program" can only chack for syntax errors. You need to run the program to check for @error conditions.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #4 - May 5th, 2005 at 7:25pm
Print Post Print Post  
I wasn't 100% on this function WriteLn(@error).  Thanks for the clarification.

I previewed the program with this code and when it opens, it indicates NO.

I added a second HideTree function to hide the Application Utilities and that works but I can't get the Search menu to hide.

var vHideTree as Int

vHideTree = @HideTreeItem("Employee Database!Forms!Search/Update!Employee!Employee!Search Menu")

vHideTree = @HideTreeItem("Employee Database!Application Utilities")

WriteLn(@error)

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: @HideTreeItem - Search Menu
Reply #5 - May 5th, 2005 at 7:28pm
Print Post Print Post  
Hello Louis,

You have to call @Error immediatly after the first @HideTreeItem to see if it is failing.

So your code would be

var vHideTree as Int

vHideTree = @HideTreeItem("Employee Database!Forms!Search/Update!Employee!Employee!Search Menu")

WriteLn(@error)

This would tell you if there is a problem with this HideTreeItem.

The code you want is simply

Code
Select All
vHideTree = @HideTreeItem("Search Menu") 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #6 - May 5th, 2005 at 8:01pm
Print Post Print Post  
Louis,

You may want to call CloseCommandArea.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #7 - May 5th, 2005 at 8:08pm
Print Post Print Post  
Well, I tried both of the codes below with the @error function and it still indicates NO and does not hide the Search menu, so I am stumped.

Out of curiosity, why can you shorten the path to the Search menu that much ?  I assumed that you had to indicate every level for the function to work properly.

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #8 - May 5th, 2005 at 8:28pm
Print Post Print Post  
Mark:

I would prefer to keep the main menu visible but would like to hide the sub menu upon entering the form whether the user is adding or searching/updating.

The CloseCommandArea would eliminate both in my case.

Thanks,

Louis

  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: @HideTreeItem - Search Menu
Reply #9 - May 5th, 2005 at 8:37pm
Print Post Print Post  
Hello Louis,

Put the vHideTree = @HideTreeItem("Search Menu") call in your forms on retrieve spec open programming.

Quote:
Out of curiosity, why can you shorten the path to the Search menu that much ?  I assumed that you had to indicate every level for the function to work properly.


You do have to indicate every level for the tree that you are on, but the Search Menu is not part of the Application menu. There are essentially four different trees. The Application Menu, Search Menu, Add Data Menu, and Search Update Menu.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #10 - May 5th, 2005 at 8:46pm
Print Post Print Post  
Louis,

I'm sorry. I'm giving you debugging instructions for a different command. To see if you have an invalid tree path inspect the return value from @HideTreeItem.

var vHideTree as Int

vHideTree = @HideTreeItem("Employee Database!Forms!Search/Update!Employee!Employee!Search Menu")
WriteLn(vHideTree)

If the WriteLn window shows 0, Sesame was unable to find the tree path you specified.

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #11 - May 5th, 2005 at 9:28pm
Print Post Print Post  
Ray's previous suggestion to put the code into the On Retrieve Spec Open hides the Search menu but leaves the command area still there, but blank.  I was really trying to close this Command Area automatically when a user goes into the Search/Update mode (or add data mode) so that the whole form could be seen.

I tried Mark's suggestion with CloseCommandArea but that closes the Application menu as well. 

It sounds like I have to do a custom menu to deal with this unless there is another way to Close the command areas other than on the Application menu.

Thanks for the help.

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #12 - May 5th, 2005 at 9:57pm
Print Post Print Post  
Louis,

You can put the CloseCommandArea(1) command in the On Retrieve Spec Open event. You can then reopen the command area CloseCommandArea(0) in the command buttons on your search menu, or in your On Form Entry event. Or vice-versa. I'm not really clear on when you want it closed and when you want it open.

It's not just a question of what command you issue, but also when you issue it. You should be able to find places to call this command that allow you to open and close the command tree at the time it is needed.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #13 - May 6th, 2005 at 2:23pm
Print Post Print Post  
Thanks for following thru on this.  This is what I have done:

App Property Manager - On App open: CloseCommand Area state is open

In the Employee Form - On Form Entry: CloseCommand Area state is closed

In the Employee Form - On Form Change: CloseCommand Area state is closed

In the Employee Form - On Retrive Spec Open: CloseCommand Area state is closed

In the Employee Form - On Form Exit: 2 CloseCommand Area states: open first then closed

The effect is that the application menu should always appear but when you go into search update, the search menu is hidden when you scroll thru records or change data and when you exit back out to the App Menu, the App Menu is still visible.

One problem still:  when you exit add data, it hides the App Menu and I am not sure how to fix this.

Would an Event called On Add or Exit Data Menu / On Add or Exit Seach Menu be useful ?

Thanks,

Louis


  

Louis Galvao
Back to top
 
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #14 - May 6th, 2005 at 3:38pm
Print Post Print Post  
Further clarification to the problem I mentioned above:

if I enter add data mode or search update mode and do nothing within the form and hit escape, the App menu closes.

I am able to manually re-open via View!Open Command Area.

If there is a way to avoid this, it would be great.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #15 - May 6th, 2005 at 3:52pm
Print Post Print Post  
You probably don't need this one:
In the Employee Form - On Form Change

As to the other problem, try something like this:
Code
Select All
GLOBAL CODE
RunExitProgrammingOnCloseForm(1)

On Form Exit
If @FormWillClose() = 1
{
	  CloseCommandArea(0)
}
 



If you have other On Form Exit programming, you may need a flag to prevent it from running when you don't want it to.  The code above is off the top of my head, but give it a try.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #16 - May 6th, 2005 at 6:09pm
Print Post Print Post  
I removed the On Form Change code and you were right - I don't need this.

I inserted your code and removed my code from On Form exit and it operates in the same manner as before i.e. it closes the App Menu when you enter the form and hit escape immediately.   

I hope we go thru the programming guide from top to bottom at the upcoming training later this month so I can become more familiar with all the available functions and commands.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: @HideTreeItem - Search Menu
Reply #17 - May 6th, 2005 at 7:41pm
Print Post Print Post  
Louis,

You may not be able to catch every case. In general, people either want the command area open or closed, not open in some places and closed in others. SBasic can't see every interface event. There may be certain cases, such as opening Add mode and not typing anything, that bypass any event that would trigger code.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: @HideTreeItem - Search Menu
Reply #18 - May 9th, 2005 at 7:11pm
Print Post Print Post  
Hello Louis,

I've been playing with this and I have come up with a way that catches most cases.

Now the tree will be open during the Search mode. You can close it in the On Retrieve Spec Open event but since there is no On Retrieve Spec Close event and the Form Exit programming does not run when leaving the Retrieve spec, if the user opens Search/Update and hits esc the tree will remain closed.

Code
Select All
** PROGRAMMING SECTION: [Form] [On Form Entry] **
RunExitProgrammingOnCloseForm(1)
CloseCommandArea(1)


** PROGRAMMING SECTION: [Form] [On Form Exit] **
If @FormWillClose() = 1 Then
{
	CloseCommandArea(0)
} 



-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #19 - May 9th, 2005 at 8:15pm
Print Post Print Post  
Ray:

Thanks for continuing to look into this.

It appears that it has narrowed it down to only one instance now - if you go into Search/Update and immediately press escape, the command area remains closed in the App Menu.

I can live with this for now as typically you will always do some sort of search/update on a record and if it does happen, you can easily re-open via the View option.

Thanks,

Louis
  

Louis Galvao
Back to top
 
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2483
Joined: Aug 20th, 2003
Re: @HideTreeItem - Search Menu
Reply #20 - May 9th, 2005 at 8:25pm
Print Post Print Post  
Hello Louis,

The Open Command Area being available on the View toolbar is actually a bug that is fixed in the next release.

You can on the other hand just hit enter, then F10 and finally Esc and you will have the command Tree back.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Louis Galvao
Full Member
***
Offline


"Sufferin' Succatash"

Posts: 265
Location: Canada
Joined: Feb 14th, 2005
Re: @HideTreeItem - Search Menu
Reply #21 - May 9th, 2005 at 8:58pm
Print Post Print Post  
Thanks Ray.

Looking forward to the next release.

Louis

  

Louis Galvao
Back to top
 
IP Logged