Author Topic: How to use different font in different fonts in symbol, reference and etc?  (Read 15343 times)

foolmuff

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
I would like to use a bigger font in source code window to edit and
another smaller font in symbol window, reference window and etc
to preview. But now I could only change them together.
How can I modify them respectively?
« Last Edit: December 20, 2006, 08:47:59 AM by foolmuff »

Ding Zhaojie

  • Senior Community Member
  • Posts: 194
  • Hero Points: 37
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #1 on: December 20, 2006, 04:22:29 PM »
Try my solution:

Load my setfont.e;
OK, you have the function "SetEditFont" to call. Use it to change the fonts as you like (you can call it in the "got_focus" event of edit control).

Examples:

Change the font in symbol window as the "Command line" font:
Open tagwin.e;
Add this function to change the font:
Code: [Select]
edit1.on_got_focus()
{
   SetEditFont(edit1, CFG_UNICODE_SOURCE_WINDOW);
}
Reload tagwin.e
Close then open symbol window. You will get a new font :)

To changing the Reference window:
Open tagrefs.e then add this function:
Code: [Select]
void _shellEditor.on_got_focus()
{
   SetEditFont(_shellEditor, CFG_UNICODE_SOURCE_WINDOW);
}

To changing the Build window:
Open tbshell.e then add:
Code: [Select]
void _shellEditor.on_got_focus()
{
   SetEditFont(_shellEditor, CFG_UNICODE_SOURCE_WINDOW);
}

...

Note the font "CFG_SBCS_DBCS_SOURCE_WINDOW" could be:
Code: [Select]
Command Line,                 CFG_CMDLINE                 
Status Line,                  CFG_STATUS                 
SBCS/DBCS Source Windows,     CFG_SBCS_DBCS_SOURCE_WINDOW
Hex Source Windows,           CFG_HEX_SOURCE_WINDOW       
Unicode Source Windows,       CFG_UNICODE_SOURCE_WINDOW   
File Manager Windows,         CFG_FILE_MANAGER_WINDOW     
Diff Editor Source Windows,   CFG_DIFF_EDITOR_WINDOW     
Parameter Info,               CFG_FUNCTION_HELP           
Parameter Info Fixed,         CFG_FUNCTION_HELP_FIXED     
Menu,                         CFG_MENU                   
Dialog,                       CFG_DIALOG                 
HTML Proportional,            CFG_MINIHTML_PROPORTIONAL   
HTML Fixed,                   CFG_MINIHTML_FIXED         

Enjoy!

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #2 on: December 20, 2006, 06:20:51 PM »
Great solution again !
Thanks Ding and get a HP++

HS2

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #3 on: December 20, 2006, 07:34:01 PM »
For me it's better to use e.g. *.on_create2() handler to imm. override the font.
Otherwise I'd need to click on the control first ...

One more patch could be applied to tbsearch.e:
tbsearch.e - _create_grep_buffer():
Code: [Select]
   // maybe change default CFG_WINDOW_TEXT to another one (@see SetEditFont)
   parse _default_font(CFG_UNICODE_SOURCE_WINDOW) with font_name ',' size ',' font_flags ',' ;
and
Code: [Select]
void _search0.on_create2()
{
  SetEditFont( _search0 );
}

BTW: in v11.02 the tagrefs.e patch should be
Code: [Select]
void ctlrefedit.on_create2()
{
   SetEditFont( ctlrefedit );
}

HS2

foolmuff

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #4 on: December 21, 2006, 02:17:06 AM »
Thank you very much!

However, where are tagrefs.e and tbshell.e?
I could not found them in my slickedit configuration directory.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #5 on: December 21, 2006, 10:44:43 AM »
Slick install dir -> /macros

HS2

cmcgavran

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #6 on: February 10, 2007, 07:23:27 PM »
Hi - I'd also like to change the font for the build window in particular. I've tried the solutions above and they seem to have absolutely no effect. I assume after these changes the font setting in tools-options-font under "Unicode Source Window" should affect the build window? It does not  ???.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #7 on: February 12, 2007, 11:06:38 AM »
Hi cmcgavran,

try to verify that your changes are really in effect.
Add a 'say' call to the 'tbshell.e' patch, re-load it, exit Slick (saving it's settings) and restart Slick:
Example:
Code: [Select]
void _shellEditor.on_create2()
{
   // dbg
   say ("_shellEditor.on_create2 -> SetEditFont");

   // use default font
   // SetEditFont( _shellEditor );

   // explicitely set font
   SetEditFont( _shellEditor, CFG_UNICODE_SOURCE_WINDOW );
}

HS2

cmcgavran

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #8 on: February 13, 2007, 04:34:34 PM »
Yes, it doesn't seem to be loading.. I see no results from the "say". I've searched for tbshell.e and this is the only one...

Hi cmcgavran,

try to verify that your changes are really in effect.
Add a 'say' call to the 'tbshell.e' patch, re-load it, exit Slick (saving it's settings) and restart Slick:
Example:
Code: [Select]
void _shellEditor.on_create2()
{
   // dbg
   say ("_shellEditor.on_create2 -> SetEditFont");

   // use default font
   // SetEditFont( _shellEditor );

   // explicitely set font
   SetEditFont( _shellEditor, CFG_UNICODE_SOURCE_WINDOW );
}

HS2

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #9 on: February 13, 2007, 10:58:28 PM »
Just to be sure - you did a 'Macro -> Load Module: <tbshell.e>' or a 'load' on cmdline with 'tbshell.e' files opened after editing (applying the patch) ?

HS2

cmcgavran

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #10 on: February 14, 2007, 02:19:24 AM »
Just to be sure - you did a 'Macro -> Load Module: <tbshell.e>' or a 'load' on cmdline with 'tbshell.e' files opened after editing (applying the patch) ?

HS2

Yes... several times. tbshell.e from my slickedit/macro directory.

hs2

  • Senior Community Member
  • Posts: 2761
  • Hero Points: 292
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #11 on: February 14, 2007, 09:31:44 AM »
Ok - last try:

Add this handler and test-macro to 'tbshell.e' and load it.
Code: [Select]
void _shellEditor.on_got_focus()
{
   // dbg
   say ("_shellEditor.on_got_focus -> SetEditFont");
   SetEditFont(_shellEditor, CFG_UNICODE_SOURCE_WINDOW);
}
_command void tbshelltest ()
{
   // vsapi win
   say ("tbshelltest");
   // status line
   message ("tbshelltest");
}

You will get the 'vsapi.dll'-window when you activate the 'Build' win or just invoke the 'tbshelltest' command on SE cmdline to verify that all your changes are in effect. Otherwise some really strange things are going on there ...

Good luck,

HS2

cmcgavran

  • Community Member
  • Posts: 5
  • Hero Points: 0
Re: How to use different font in different fonts in symbol, reference and etc?
« Reply #12 on: February 15, 2007, 12:15:40 AM »
OK I figured it out... since I had installed slickedit as root, it didn't seem as if I could load modules correctly. After a chown to me and then a bunch of reloads of the various modules, I have my fonts changing. Thanks!