{"id":1563,"date":"2016-05-12T12:30:00","date_gmt":"2016-05-12T12:30:00","guid":{"rendered":"http:\/\/www.mjtnet.com\/blog\/?p=1563"},"modified":"2016-05-12T12:40:04","modified_gmt":"2016-05-12T12:40:04","slug":"customizing-messageinput-boxes","status":"publish","type":"post","link":"https:\/\/www.mjtnet.com\/blog\/2016\/05\/12\/customizing-messageinput-boxes\/","title":{"rendered":"Customizing Message\/Input Boxes"},"content":{"rendered":"<p>Every now and then someone asks something like &#8220;How do I change the font in a modal dialog box?&#8221; or &#8220;Can I make an Input box multi-line?&#8221;.<\/p>\n<p>Well, no, you can&#8217;t do those things to the standard Message\/MessageModal or Input box functions.  But, don&#8217;t forget that with Macro Scheduler you have the ability to create your own dialogs and make them act and feel pretty much any way you like.  So the answer to the above questions, is &#8220;Create your own versions&#8221;.<\/p>\n<p>As an example, let&#8217;s say you want a modal dialog that looks and acts much like the standard modal message box created by MessageModal.  Only you want the text to be green in an italicized aerial font.  Here you go:<\/p>\n<pre class=\"brush: macroscript\">\/\/this would go at the top - customize as you wish\r\nDialog>CustomMsgBox\r\nobject CustomMsgBox: TForm\r\n  Left = 493\r\n  Top = 208\r\n  HelpContext = 5000\r\n  BorderIcons = [biSystemMenu]\r\n  BorderStyle = bsSingle\r\n  Caption = 'My Message'\r\n  ClientHeight = 170\r\n  ClientWidth = 319\r\n  Color = clBtnFace\r\n  Font.Charset = DEFAULT_CHARSET\r\n  Font.Color = clWindowText\r\n  Font.Height = -11\r\n  Font.Name = 'MS Sans Serif'\r\n  Font.Style = []\r\n  OldCreateOrder = True\r\n  ShowHint = True\r\n  OnTaskBar = False\r\n  PixelsPerInch = 96\r\n  TextHeight = 13\r\n  object MSMemo1: tMSMemo\r\n    Left = 0\r\n    Top = 0\r\n    Width = 321\r\n    Height = 137\r\n    Font.Charset = ANSI_CHARSET\r\n    Font.Color = clGreen\r\n    Font.Height = -11\r\n    Font.Name = 'Arial'\r\n    Font.Style = [fsBold, fsItalic]\r\n    ParentFont = False\r\n    TabOrder = 0\r\n  end\r\n  object MSButton1: tMSButton\r\n    Left = 121\r\n    Top = 143\r\n    Width = 75\r\n    Height = 25\r\n    Caption = 'OK'\r\n    DoubleBuffered = True\r\n    ModalResult = 2\r\n    ParentDoubleBuffered = False\r\n    TabOrder = 1\r\n    DoBrowse = False\r\n    BrowseStyle = fbOpen\r\n  end\r\nend\r\nEndDialog>CustomMsgBox\r\n\r\nSRT>ShowMsg\r\n  SetDialogProperty>CustomMsgBox,,Position,poScreenCenter\r\n  SetDialogProperty>CustomMsgBox,MSMemo1,Text,ShowMsg_Var_1\r\n  Show>CustomMsgBox,r\r\nEND>ShowMsg\r\n\r\n\/\/do this to call your message\r\nLet>MyMsg=Hello world, this is a lovely custom message box\r\nGoSub>ShowMsg,MyMsg<\/pre>\n<p>And don&#8217;t forget that once created you can call the dialog any time you like.  And if you want to use it in lots of scripts then put the dialog block and subroutine into an include file and use Include> at the top of each script you want to use it in.<\/p>\n<p>Now, it&#8217;s over to you.  Use your imagination and style the dialog any way you like.  We have some Custom Dialog tutorials here: <a href=\"http:\/\/www.mjtnet.com\/blog\/2010\/12\/16\/video-tutorial-an-introduction-to-custom-dialogs\/\">Part1<\/a>, <a href=\"http:\/\/www.mjtnet.com\/blog\/2011\/01\/10\/video-tutorial-custom-dialogs-part-2\/\">Part2<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every now and then someone asks something like &#8220;How do I change the font in a modal dialog box?&#8221; or &#8220;Can I make an Input box multi-line?&#8221;. Well, no, you can&#8217;t do those things to the standard Message\/MessageModal or Input box functions. But, don&#8217;t forget that with Macro Scheduler you have the ability to create [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5,6],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1563"}],"collection":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/comments?post=1563"}],"version-history":[{"count":7,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1563\/revisions"}],"predecessor-version":[{"id":2696,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1563\/revisions\/2696"}],"wp:attachment":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/media?parent=1563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/categories?post=1563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/tags?post=1563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}