Source language: Translate to:

toolbar question

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

toolbar question

Postby stevec » Fri Jun 26, 2015 10:01 am

I have a simple app that I am trying to build a toolbar with several buttons grouped together , group9
I have a button that I have that I'd like to click on and open the toolbar and if I click on the button again, close it.

I have tried the IF command;

Suggestions on a better way of trying to do this?

Thanks;
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: toolbar question

Postby Neosoft Support » Fri Jun 26, 2015 10:10 am

Maybe you could have two buttons with different icons. One button opens the toolbar and the other closes it. You can show or hide one of the two buttons depending on whether the toolbar is visible or not.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: toolbar question

Postby stevec » Fri Jun 26, 2015 10:15 am

Thought of that, was just trying to clean it up and have only one button.
Thanks
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: toolbar question

Postby Gaev » Fri Jun 26, 2015 10:25 am

stevec:

I have a button that I have that I'd like to click on and open the toolbar and if I click on the button again, close it.
I have tried the IF command;

Why don't you post your code here ? ... and tell us where the code is not performing as expected.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: toolbar question

Postby stevec » Fri Jun 26, 2015 10:40 am

Gaev


Here is what I'm trying

If "[Group9]" "<>" "hide"
ShowObject "Group9" "None" "0"
SetVar "[Group9]" "show"
Else
If "[Group9]" "=" "show"
HideObject "Group9" "None" "0"
SetVar "[Group9]" "Hide"

EndIf
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: toolbar question

Postby Gaev » Fri Jun 26, 2015 11:17 am

stevec:

In your publication's startup section ...
Code: Select all
ShowObject "Group9" "None" "0"
SetVar "[Group9State]" "Visible"
... or ...
Code: Select all
HideObject "Group9" "None" "0"
SetVar "[Group9State]" "Hidden"

... depending on whether you want to start with a "hidden" or "visible" state.

In the click action of your Button ...
Code: Select all
If "[Group9State]" "=" "Hidden"
   ShowObject "Group9" "None" "0"
   SetVar "[Group9State]" "Visible"
Else
   HideObject "Group9" "None" "0"
   SetVar "[Group9State]" "Hidden"
EndIf
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: toolbar question

Postby stevec » Fri Jun 26, 2015 11:32 am

AWESOME!!!!!!!!!!!!!!!!!!!
Thanks;
:P :P :P :P :P
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: toolbar question

Postby Tony Kroos » Fri Jun 26, 2015 2:07 pm

If you do not want to mess with object state variable and just get current status of any object use GetObjectInfo at any time
Tony Kroos
 
Posts: 402
Joined: Thu Oct 15, 2009 3:43 pm

Re: toolbar question

Postby stevec » Fri Jun 26, 2015 2:49 pm

Thanks
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho

Re: toolbar question

Postby Gaev » Fri Jun 26, 2015 3:00 pm

If you do not want to mess with object state variable and just get current status of any object use GetObjectInfo at any time

:idea: :idea: :idea: :idea:

Code: Select all
GetObjectInfo "Group9" "Visible" "[Status]"
If "[Status]" "=" "True"
   HideObject "Group9" "None" "0"
Else
   ShowObject "Group9" "None" "0"
EndIf
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: toolbar question

Postby stevec » Sat Jun 27, 2015 8:30 am

you are the coding master! :mrgreen: :mrgreen: :mrgreen: :mrgreen:
Steve Christensen
stevec
 
Posts: 223
Joined: Fri Apr 15, 2005 7:33 am
Location: Boise, Idaho


Return to NeoBook Action Commands

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron