Hot Topic (More than 10 Replies) SIni setting for collapsed command tree? (Read 1723 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
SIni setting for collapsed command tree?
Aug 29th, 2007 at 7:29pm
Print Post Print Post  
SBasic routine to accomplish this here.

I don't want to use COMMAND TREE MODE: SINGLE because that only shows one mode at a time, either Add or Search/Update.  What I want is both to be available, but with the tree collapsed, so that the user needs to click on the plus signs to expand as needed.  Right now when I start up, everything is expanded, and it's visually aggressive for my newbie users.  Is there an .ini setting which will accomplish what I want?
« Last Edit: Aug 29th, 2007 at 9:38pm by Hammer »  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SIni setting for collapsed command tree?
Reply #1 - Aug 29th, 2007 at 7:35pm
Print Post Print Post  
No INI file setting, but you can use @ContractTreeItem.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SIni setting for collapsed command tree?
Reply #2 - Aug 29th, 2007 at 7:59pm
Print Post Print Post  
In the User Guide on Page 42 and 43 it gives you .ini setting as well as startup switch to do what you want to do.

Quote:
Single Level menu trees may make the initial transition for untrained users easier.
Single level menus can be set in two places …
Sesame.ini file
To set single level menus use the following line to the Sesame.INI file:
COMMAND TREE MODE: <SINGLE> | <FULL>
Single – Menu tree will only show one level of commands at time.
Full – Traditional mode wherein multiple levels are displayed at the same time.
Figure 12. Single Level vs Normal Level Display Menu Tree


Startup switch
To set single level menus use the following startup switch when running Sesame:
Sesame.exe -singlelevel
The -singlelevel command line startup switch causes the command tree in Sesame to
default to single level mode.
If you do not make an entry in the Sesame.Ini file or as a command line startup
switch, Full is the default.
Hiding the Menu Tree


  
Back to top
 
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #3 - Aug 29th, 2007 at 8:00pm
Print Post Print Post  
Will that work for application programming, On-Application-Open?  How would I refer to the Mode and Form branches?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SIni setting for collapsed command tree?
Reply #4 - Aug 29th, 2007 at 8:08pm
Print Post Print Post  
Infinity wrote on Aug 29th, 2007 at 8:00pm:
Will that work for application programming, On-Application-Open?

Yes, it will work On Application Open.

Quote:
  How would I refer to the Mode and Form branches?

Well, you could do it by hand using a list of your Databases, or you could get all slick about it. Version 2 has @ListDatabases. You could use this to write a generic routine that works even if you rename/add/delete Databases.  Smiley
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #5 - Aug 29th, 2007 at 8:08pm
Print Post Print Post  
Thank you Bharat, but what I'm looking for is something in between Single and Full.  With Single, if the user selects Add Mode, Search Mode disappears, and you have to back out of Add to get to it.  But with Full, the entire tree is expanded, and one user has already told me she gets confused by such an abundance of choices, and she starts clicking away at everything.  Unfortunately, I can't be by all my user's sides all day to hold their hands for them, much as they would like that.

What I'd like the user to see, when he opens the application is something like this:
Code
Select All
-MIARA
     -Forms
	    +Add Data
	    +Search/Update
 



Then, he can use the plus signs to expand to:
Code
Select All
-MIARA
     -Forms
	    -Add Data
		    +Customer
		    +Workorder
		    +Invoice
		    +Equipment
		    +Tariff
		    +Vehicles
		    +Employee
		    +PurchaseOrder
	    +Search/Update
 


and so on.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #6 - Aug 29th, 2007 at 8:16pm
Print Post Print Post  
Quote:
Yes, it will work On Application Open.

Super!
Quote:
Well, you could do it by hand using a list of your Forms, or you could get all slick about it. Version 2 has @ListDatabases and @ListFormsByDatabase. You could

I'm going to have to stop you there.   Shocked  You have too much faith in me.  I think you mean you could do it.  I, on the other hand, could tell my users "that's just the way it is, deal with it" and then study study study to learn these tricks and then one day (hopefully) succeed at the task and give it to them IT'S MAGIC WOO HOO!.
Quote:
combine these to write a generic routine that works even if you rename/add/delete Databases/Forms.

This sounds great; I'm hitting the books right now, give it the old college try.  Maybe if I had an ice cold gin & tonic by my side I could face the challenge with more enthusiasm (it's 82 degrees in my office today).
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: SIni setting for collapsed command tree?
Reply #7 - Aug 29th, 2007 at 8:32pm
Print Post Print Post  
Scott,

I'll give you a few tips on what you're gonna need to do this.

@ListDatabases() Page 282 Programming Guide 2.0
@CountStringArray() page 197 Programming Guide 2.0
@AccessStringArray() page 157 Programming Guide 2.0
@Application() page 164 Programming Guide 2.0
@ContractTreeItem() page page 195 Programming Guide 2.0

And a While loop(Pages 68-70 just in case).

-Ray
  

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


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #8 - Aug 29th, 2007 at 8:35pm
Print Post Print Post  
Thanks Ray, I'll see what I can put together.  In the meantime, please whip up an .ini setting that will accomplish it 15 minutes after I've perfected the code.   Grin
  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: SIni setting for collapsed command tree?
Reply #9 - Aug 29th, 2007 at 8:52pm
Print Post Print Post  
I doubt there would be much of a use for this to be an INI entry, maybe a general contract/expand tree item one but not one so defined.

Btw. It's only 25 lines of SBasic code with several lines of white space to do what you want to do.

-Ray
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: SIni setting for collapsed command tree?
Reply #10 - Aug 29th, 2007 at 9:13pm
Print Post Print Post  
Quote:
Btw. It's only 25 lines of SBasic code with several lines of white space to do what you want to do.

-Ray


Scott, I will be glad to help you out with the several lines of white space if it would help.  Wink
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #11 - Aug 29th, 2007 at 9:22pm
Print Post Print Post  
WOO HOO!  This is working REAL NICE:
Code
Select All
var vTree as Int

// Contracts the Command Tree mode items

vTree = @ContractTreeItem("MIARA!Forms!Add Data")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!CUSTOMER")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!WORKORDR")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!INVOICE")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!EQUIPMENT")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!TARIFF")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!VEHICLES")
vTree = @ContractTreeItem("MIARA!Forms!Add Data!EMPLOYEE")

vTree = @ContractTreeItem("MIARA!Forms!Search/Update")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!CUSTOMER")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!WORKORDR")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!INVOICE")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!EQUIPMENT")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!TARIFF")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!VEHICLES")
vTree = @ContractTreeItem("MIARA!Forms!Search/Update!EMPLOYEE") 



Thanks again to everyone for the pointers, and thank you Robert but I buy my white space by the gross.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SIni setting for collapsed command tree?
Reply #12 - Aug 29th, 2007 at 9:24pm
Print Post Print Post  
Quote:
Btw. It's only 25 lines of SBasic code with several lines of white space to do what you want to do.


17 lines and works like a charm.  Smiley
Code
Select All
var vList as String
var vCount as Int
var vLoop as Int
var vApp as String
var vDB as String
var vTemp as Int

	vApp = @Application
	vList = @ListDatabases()
	vCount = @CountStringArray(vList)
	For vLoop = 1 to vCount
		vDB = @AccessStringArray(vList, vLoop)
		vTemp = @ContractTreeItem(vApp + "!Forms!Add Data!" + vDB)
		vTemp = @ContractTreeItem(vApp + "!Forms!Search/Update!" + vDB)
	Next
	vTemp = @ContractTreeItem(vApp + "!Forms!Add Data!")
	vTemp = @ContractTreeItem(vApp + "!Forms!Search/Update!")

 



  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: SIni setting for collapsed command tree?
Reply #13 - Aug 29th, 2007 at 9:36pm
Print Post Print Post  
See, what did I say?  I said 15 minutes, and I waaay overshot the mark.  I posted my code at 5:22 and TWO MINUTES LATER Erika posted hers, which results in a much prettier display.  I was off by 13 minutes.

You guys are the greatest, no question about it.
  

**
Captain Infinity
Back to top
IP Logged