Author Topic: How can I bond a hotkey with Auto Hide button?  (Read 8295 times)

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
How can I bond a hotkey with Auto Hide button?
« on: November 08, 2006, 08:31:54 am »
How can I bond a hotkey with Auto Hide button?

Thanks a lot !

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #1 on: November 09, 2006, 07:31:18 am »
How can I bond a hotkey with Auto Hide button?

Thanks a lot !

Which auto-hide button are you referring to?

If what you want to do is show/ hide toolbars like search/ defs etc. then you can bind a key to toggle-search  toggle-defs etc. in the key bindings dialog.  Toggle-defs doesn't work as it should (on my system) - it doesn't close the toolbar if the toolbar has the focus, but you can press escape to switch the focus first.

Graeme
 
« Last Edit: November 09, 2006, 09:44:17 am by Graeme »

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: How can I bond a hotkey with Auto Hide button?
« Reply #2 on: November 10, 2006, 01:35:34 am »
Graeme,

Thank you !

When binding a key to toggle-search(toggle-defs etc.), it can hide toolbars, but not perfect !

For an example, when the toolbars hide automatically in my configuration, toggle-search(toggle-defs etc.) is not meaningful until press the auto-hide button to show at all times !

So I want to bind a key just as pressing the auto-hide button whatever
the toolbar or auto-hide button has the focus!

inventec

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #3 on: November 10, 2006, 07:50:30 am »

Inventec

I'm not sure I follow you.  First of all,which version of Slickedit are you using?

Whereabouts on the screen is this auto-hide button you're referring to?  Are you referring to the "pin" symbol to the left of the close button on the toolbar.  The pin points to the left when the window is in auto-hide mode and points downwards when not auto-hide.

Quote
For an example, when the toolbars hide automatically in my configuration, toggle-search(toggle-defs etc.) is not meaningful until press the auto-hide button to show at all times !

On my system, when I have the toolbars configured to hide automatically, toggle-defs , toggle-search work fine - they hide/show the toolbar as desired.  Is this not working for you or is the problem that you want to swap the auto-hide mode of the toolbar with a key instead of the mouse?

Graeme

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: How can I bond a hotkey with Auto Hide button?
« Reply #4 on: November 10, 2006, 08:24:34 am »
Graeme

Quote
First of all,which version of Slickedit are you using?
SlickEdit Version 11.0.0 in my machine .

Quote
is the problem that you want to swap the auto-hide mode of the toolbar with a key instead of the mouse?
Just as this, please help !

Thank you !

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #5 on: November 10, 2006, 10:15:50 am »
Inventec

I don't really know how to do this. 

toggle_auto_hide_tbsearch below sort of works for the search window only - if it's visible.

toggle_auto_hide2 doesn't work at all, I think because it gets the wrong window ID - but I don't know how to get the right window ID.

If you want to try out toggle_auto_hide_tbsearch (at your own risk), copy it to vusrmacs.e or somewhere and load the module.

Can you explain any more about why you need this?  I'm guessing when the window isn't visible you want it in auto-show mode so you can pop it up with either mouse or keyboard and when it's visible you want auto-hide mode off so it doesn't disappear.

If it's in auto-hide/show mode and you pop it up with the keyboard, you can then use the new command to turn off auto-hide and switch focus to the keyboard leaving the window visible -  why do you want it to stay visible?.  Then when you want it to go away, you use the new command again to put it back to auto-hide mode and hide it.  Is that what you're trying to do?


Code: [Select]
_command void toggle_auto_hide_tbsearch() name_info(','VSARG2_EDITORCTL)
{
   int wid = _find_formobj('_tbsearch_form');
   if (wid)
     tbAutoHideToggle(wid);
}

_command void toggle_auto_hide2() name_info(',')
{
   tbAutoHideToggle(_get_focus());
}


Graeme
« Last Edit: November 10, 2006, 10:18:17 am by Graeme »

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #6 on: November 11, 2006, 08:23:57 pm »
Inventec

If you're still keen to get this to work you could try something yourself along the following lines

Make your own version of functions like toggle_search (you see below)

Code: [Select]
_command void new_toggle_search()  name_info(','VSARG2_EDITORCTL)
{
   _str focus_ctl = _get_active_grep_view();
   _str last_toggled_toolbar_form_name = '_tbsearch_form';
   _tbToggleTabGroupToolbar('_tbsearch_form',focus_ctl);
}

then have an auto-hide command that toggled auto-hide for last_toggled_toolbar_form_name

Code: [Select]
_command void toggle_auto_hide_tbsearch() name_info(','VSARG2_EDITORCTL)
{
   int wid = _find_formobj(last_toggled_toolbar_form_name);
   if (wid)
     tbAutoHideToggle(wid);
}

I dunno if this would work or if it does what you want - it doesn't work for the defs toolbar coz I think the key bindings get overridden there or something.  You could do it more easily by modifying _tbToggleTabGroupToolbar slick source but as you can see described in slickcmacroconventionsandbestpracticesforendusers.pdf on slick website, modifying slick source is not recommended. 

You said you wanted the auto-hide operation to apply to the toolbar that had the focus - is that correct?
If so, what sequence of operations do you do that give the toolbar the focus and how do you identify that the toolbar has the focus?

Graeme
« Last Edit: November 11, 2006, 08:37:49 pm by Graeme »

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: How can I bond a hotkey with Auto Hide button?
« Reply #7 on: November 15, 2006, 12:48:34 am »
Graeme

Quote
Make your own version of functions like toggle_search (you see below)


Code:
_command void new_toggle_search()  name_info(','VSARG2_EDITORCTL)
{
   _str focus_ctl = _get_active_grep_view();
   _str last_toggled_toolbar_form_name = '_tbsearch_form';
   _tbToggleTabGroupToolbar('_tbsearch_form',focus_ctl);
}

then have an auto-hide command that toggled auto-hide for last_toggled_toolbar_form_name


Code:
_command void toggle_auto_hide_tbsearch() name_info(','VSARG2_EDITORCTL)
{
   int wid = _find_formobj(last_toggled_toolbar_form_name);
   if (wid)
     tbAutoHideToggle(wid);
}

I  tried to do it as this,  but not useful !


Quote
If what you want to do is show/ hide toolbars like search/ defs etc. then you can bind a key to toggle-search  toggle-defs etc. in the key bindings dialog. 


Now I bind a key to toggle-search etc. as you said,

but I still hope developers can give a solution in next(next...) version .

Thank you, I have known about slickedit more !

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #8 on: November 15, 2006, 01:44:44 am »

Hi Inventec

Now I bind a key to toggle-search etc. as you said,

but I still hope developers can give a solution in next(next...) version .

Thank you, I have known about slickedit more !

ok, but I have a feeling you might need to describe what you're trying to do in a little more detail.  Maybe send a feature request to slickedit if you haven't already, coz they won't necessarily read this thread.

Graeme

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: How can I bond a hotkey with Auto Hide button?
« Reply #9 on: November 16, 2006, 03:06:55 am »
Graeme,

OK, I use with slickedit as editor and viewer well, so I hope it is perfect .

Now I explain details what happen frequently in my project .


Sometimes I view functions with symbol-toolbar pane in source files,

then the toolbar should show all the times(auto-show status), So I need

to swap it's status with mouse because it auto hide often;

Maybe after some minutes I want toolbar to be auto hide, then need to

swap it's status with mouse again, I feel so trouble !

That's all .


Thanks for your strongly support !


Inventec

Graeme

  • Senior Community Member
  • Posts: 2161
  • Hero Points: 268
Re: How can I bond a hotkey with Auto Hide button?
« Reply #10 on: November 16, 2006, 08:26:21 am »

ok, well just in case you didn't try this yourself, here's a couple of macros you could try.

Code: [Select]
_command void toggle_auto_hide_tbsymbols1() name_info(','VSARG2_EDITORCTL)
{
   int wid = _find_formobj('_tbtagwin_form');
   if (wid)
      tbAutoHideToggle(wid);
}

_command void toggle_auto_hide_tbsymbols2() name_info(','VSARG2_EDITORCTL)
{
   int wid = _find_formobj('_tbtagwin_form');
   if (wid)
   {
      int wid = _tbIsVisible('_tbtagwin_form');
      if (wid > 0) {
         tbAutoHideToggle(wid);
      }
      else
      {
         tbShow('_tbtagwin_form');
      }
   }
}


Graeme

inventec

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: How can I bond a hotkey with Auto Hide button?
« Reply #11 on: November 17, 2006, 12:56:40 am »
Graeme,

I tried to do this as you said,

it's useful,

but not perfect for me !

OK, we stop checking this case,

if developer won't check it !


Graeme, Thanks a lot !

Inventec