Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Coloring menu tree items (Read 2589 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Coloring menu tree items
Sep 5th, 2007 at 1:16pm
Print Post Print Post  
Is it possible to set the colors of the text on the Command tree?  I'd like to visually distinguish between the list of databases under the Add Data branch (Green) and the Search/Update branch (Blue)

Is it possible to remove the application's "New" "Open" and "Save" buttons if the user is not an Admin?
« Last Edit: Sep 7th, 2007 at 2:14pm by Hammer »  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Some design questions.
Reply #1 - Sep 5th, 2007 at 2:30pm
Print Post Print Post  
In the Application Programming use RelabelTreeItem (was in Version 1.x)

/*
RelabelTreeItem can use the browser formatting codes:
  @. Print rest of line, don't look for more '@' signs
  @@ Print rest of line starting with '@'
  @l Use a large (24 point) font
  @m Use a medium large (18 point) font
  @s Use a small (11 point) font
  @b Use a bold font (adds FL_BOLD to font)
  @i Use an italic font (adds FL_ITALIC to font)
  @f or @t Use a fixed-pitch font (sets font to FL_COURIER)
  @c Center the line horizontally
  @r Right-justify the text
  @B0, @B1, ... @B255 Fill the backgound with fl_color(n)      
  @C0, @C1, ... @C255 Use fl_color(n) to draw the text
  @F0, @F1, ... Use fl_font(n) to draw the text
  @S1, @S2, ... Use point size n to draw the text
  @u or @_ Underline the text.
  @- draw an engraved line through the middle.
*/

Here is an example:
var n as Int

//  If @Group <> "Supervisors" Then {     //Commented out for now
If @userID <> "bob" Then {
     n = @RelabelTreeItem(@Application + "!Forms!Search/Update","")
     n = @RelabelTreeItem(@Application + "!Forms!Search/Update!Members","")
     n = @HideTreeItem(@Application + "!Forms!Search/Update!Members!Payments")
     n = @HideTreeItem(@Application + "!Forms!Search/Update!Members!Payments")
     n = @RelabelTreeItem(@Application + "!Forms!Search/Update!tblRooms!frmRooms", "@mSearch Rooms")
     n = @RelabelTreeItem(@Application + "!Forms!Add Data!tblRooms!frmRooms", "@S20@C255@B0Add Rooms")   //white on black
     // n = @RelabelTreeItem(@Application + "!Forms!Add Data!tblRooms!frmRooms", "@S20@C0@B255Add Rooms")   //black on white
}
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
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: Some design questions.
Reply #2 - Sep 6th, 2007 at 5:14pm
Print Post Print Post  
Hi Bob!

What is "FL_" (as in "FL_COLOR")

I see how you get black or white text with @C0 or @C255, but how do you get Green and Blue?
  

**
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: Some design questions.
Reply #3 - Sep 6th, 2007 at 5:43pm
Print Post Print Post  
Infinity wrote on Sep 6th, 2007 at 5:14pm:
Hi Bob!

What is "FL_" (as in "FL_COLOR")

I see how you get black or white text with @C0 or @C255, but how do you get Green and Blue?


Scott,

This method is not really part of Sesame. It is a side effect of the underlying GUI toolkit  (FLTK) that we don't really support. The FLs refer to constants within that toolkit. You can't access them directly.

The color numbers are looking at an internal FLTK color table. You'd have to play with the numbers to see what's what.
  

- 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: Some design questions.
Reply #4 - Sep 6th, 2007 at 5:48pm
Print Post Print Post  
Ah, I see.  Actually, I don't but that's OK.  I played with some of the stuff Bob showed me and did manage to change some colors, but if it's not supported I'd probably better not mess with it.

Which brings me back to the original question: is there a way with Sesame to color the text of the command tree items?
  

**
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: Some design questions.
Reply #5 - Sep 6th, 2007 at 6:06pm
Print Post Print Post  
Infinity wrote on Sep 6th, 2007 at 5:48pm:
Which brings me back to the original question: is there a way with Sesame to color the text of the command tree items?

Not an officially supported way.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Some design questions.
Reply #6 - Sep 6th, 2007 at 6:17pm
Print Post Print Post  
Infinity wrote on Sep 6th, 2007 at 6:12pm:
Thank you.  Can using the FLTK method of relabeling "break" anything?

Not that we know of, but we also don't test it. You will have to change any @SelectTreeItem and suchlike calls to use the altered value.
  

- 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: Some design questions.
Reply #7 - Sep 6th, 2007 at 6:21pm
Print Post Print Post  
Thank you Erika & Bob.
  

**
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: Some design questions.
Reply #8 - Sep 6th, 2007 at 6:47pm
Print Post Print Post  
Infinity wrote on Sep 5th, 2007 at 1:16pm:
Is it possible to remove the application's "New" "Open" and "Save" buttons if the user is not an Admin?


If you give the admin users a different INI file then yes you can. The following entries in the INI file will disable those three buttons.

DISABLE BUTTONBAR BUTTON: NEW
DISABLE BUTTONBAR BUTTON: OPEN
DISABLE BUTTONBAR BUTTON: SAVE

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
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: Some design questions.
Reply #9 - Sep 6th, 2007 at 7:03pm
Print Post Print Post  
Infinity wrote on Sep 6th, 2007 at 5:14pm:
Hi Bob!

What is "FL_" (as in "FL_COLOR")

I see how you get black or white text with @C0 or @C255, but how do you get Green and Blue?


Not that I'm supporting this or encouraging it, but @C32256 will give you Blue and @C8257536 will give you Green. If you are trying to get a different shade don't just start changing the numbers around, as you probably won't get the results you want. Those numbers came from the following piece of code

Code
Select All
Color = @BShiftLeft(R, 24) + @BShiftLeft(G, 16) + @BShiftLeft(B, 8) 



Where R, G, and B are the Red, Green, and Blue values you want the color to have. Note. R, G, and B must be 255 or less.

32256 = R:0 G:0 B:126 or THIS COLOR
8257536 = R:0 G:126 B:0 or THIS COLOR

-Ray
  

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


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Some design questions.
Reply #10 - Sep 6th, 2007 at 8:59pm
Print Post Print Post  
If you use the Sesame Custom Color picker in the Designer, I believe the values shown can be used to get the colors you want.  This is probably based on the FLTK color chooser tool.

Scott - I have sent you an off-line email with more information. Since this is not Sesame supported, I don't want to add any more confusion.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
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: Some design questions.
Reply #11 - Sep 6th, 2007 at 9:17pm
Print Post Print Post  
Bob_Hansen wrote on Sep 6th, 2007 at 8:59pm:
If you use the Sesame Custom Color picker in the Designer, I believe the values shown can be used to get the colors you want. 


You can use any number of programs to get the RGB values for the color that you want, such as MS Paint or any number of image editing tools. The trick is the shifting of the bits to get the correct color that you want as the last 8 bits, of the 32 bit number, must be 0's as that tells it to create a color using the first 24 bits.

-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: Some design questions.
Reply #12 - Sep 7th, 2007 at 10:39am
Print Post Print Post  
Quote:
The following entries in the INI file will disable those three buttons.

DISABLE BUTTONBAR BUTTON: NEW
DISABLE BUTTONBAR BUTTON: OPEN
DISABLE BUTTONBAR BUTTON: SAVE 


Faaaantastic.  I'll need to add this one to my list of .ini entries.

And thanks for the advice on the color settings, I'll experiment with them today.


  

**
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: Some design questions.
Reply #13 - Sep 7th, 2007 at 11:00am
Print Post Print Post  
Quote:
The following entries in the INI file will disable those three buttons.

DISABLE BUTTONBAR BUTTON: NEW
DISABLE BUTTONBAR BUTTON: OPEN
DISABLE BUTTONBAR BUTTON: SAVE

This is successfully graying the New and Open buttons, but Save is still operational.
  

**
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: Some design questions.
Reply #14 - Sep 7th, 2007 at 11:06am
Print Post Print Post  
Here's the result of my current experimentation with the topics discussed in this thread:
http://www.jamiara.com/colors1.jpg
The colored tree items look fantastic, WOO HOO!.  New and Open are grayed, but Save is still available.
  

**
Captain Infinity
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print