// http://akelpad.sourceforge.net/forum/viewtopic.php?p=14871#14871
// Version: 2013-08-15
// Author: KDJ
//
// *** Font dialog with monospace fonts ***
//
// Required to include: ChooseFont_function.js
//
// Usage:
//   Call("Scripts::Main", 1, "FontDialogMonospace.js")
//
// Remark:
//   It works similarly to Command(4201) - Font dialog, but displays only monospace fonts.

if (AkelPad.Include("ChooseFont_function.js"))
{
  var hMainWnd = AkelPad.GetMainWnd();
  var hEditWnd = AkelPad.GetEditWnd();
  var lpLOGFONT;

  if (hEditWnd)
  {
    if (lpLOGFONT = ChooseFont(hMainWnd, 4, hEditWnd, 0, 1, 1))
    {
      AkelPad.SystemFunction().Call("User32::SendMessageW", hMainWnd, 1234 /*AKD_SETFONT*/, 0, lpLOGFONT);
      AkelPad.MemFree(lpLOGFONT);
    }
  }
}
