Reply to topic

Switch toolbars with key combination
Nate Peterson
Donor

Joined: 03 Aug 2007
Posts: 14
Reply with quote
You asked for it. Very Happy I remember reading somewhere in another thread that there was plans to add a key combination to switch between toolbars. Kinda like Alt+Tab in Windows except this would switch toolbars. Does Gizmo have a key combination for this already or are there plans to add one in the near future?
View user's profileSend private message
Logan Mueller
Support

Joined: 16 Nov 2003
Posts: 565
Reply with quote
Hi Nate,

This is definitely scheduled to be added in one of the up and coming releases. The hot key will probably be Alt+~, unless you think a better one would do?

_________________
Support is provided as a convenience to our users. We make no guarantees in the timeliness and accuracy in our responses. We reserve the right to refuse service to anyone.
View user's profileSend private messageVisit poster's website
Nate Peterson
Donor

Joined: 03 Aug 2007
Posts: 14
Reply with quote
Alt+~ seems a little strange at first but it's perfect actually. Sorta like hitting Alt+Tab. I don't think I know of any programs that use this key combo. Would it be easy to make it configurable? Smile
View user's profileSend private message
Logan Mueller
Support

Joined: 16 Nov 2003
Posts: 565
Reply with quote
Definitely! In the meantime, you can achieve this functionality by creating a Gizmo Script item, with instructions for rotating your current set of toolbars, and assign this a Hot Key.

_________________
Support is provided as a convenience to our users. We make no guarantees in the timeliness and accuracy in our responses. We reserve the right to refuse service to anyone.
View user's profileSend private messageVisit poster's website
Nate Peterson
Donor

Joined: 03 Aug 2007
Posts: 14
Reply with quote
Great OK then I want to declare an array for my toolbar guids, but the interpreter isn't taking it, and I can't find any examples for the array syntax in Gizmo Script. Can you help me out with this?
View user's profileSend private message
Logan Mueller
Support

Joined: 16 Nov 2003
Posts: 565
Reply with quote
Hi Nate,

Sadly, the current version of Gizmo Script has no concept of arrays or collections, but this will change in the future. For now, you could do this by using a state variable with a series of if-statements.

Here is an example:
Code:

//
// Set this to the total number of toolbars
//
int total_number_of_toolbars = 5;

//
// Define helper function for mapping incremental toolbar index to ID
//
string Get_Toolbar_ID_From_Index (int index)
{
    //
    // Put toolbar IDs here (toolbar GUID or name)
    //
    if (index == 0) return "Bottom, Right";
    else if (index == 1) return "Right";
    else if (index == 2) return "Top, Right";
    else if (index == 3) return "Top";
    else if (index == 4) return "Top, Left";

    return "Unknown";
}

//
//   Registry constants
//
string reg_settings_path = "Software\Arainia\Gizmo\Settings";
string reg_current_toolbar = "CurrentToolbarIndex";

//
// Get current toolbar index
//
int current_toolbar_index = 0;
Registry.GetInt (HKEY_CURRENT_USER, reg_settings_path, reg_current_toolbar, current_toolbar_index);

//
// Ensure that current toolbar is hidden
//
Toolbar.Hide (Get_Toolbar_ID_From_Index (current_toolbar_index));

//
// Circulate through toolbars
//
current_toolbar_index = (current_toolbar_index + 1) % total_number_of_toolbars;

//
// Update registry
//
Registry.SetInt (HKEY_CURRENT_USER, reg_settings_path, reg_current_toolbar, current_toolbar_index);

//
// Show desired toolbar
//
Toolbar.Show (Get_Toolbar_ID_From_Index (current_toolbar_index));

_________________
Support is provided as a convenience to our users. We make no guarantees in the timeliness and accuracy in our responses. We reserve the right to refuse service to anyone.
View user's profileSend private messageVisit poster's website
Switch toolbars with key combination
All times are GMT - 8 Hours  
Page 1 of 1  

  
  

 Reply to topic