Font size of Alert box

 From:  Michael Gibson
11565.2 In reply to 11565.1 
Hi Brian,

re:
> Is it possible to change the font size of text in the Alert box created, or
> used, by a script? (javascript?)
> Or change the color?

Sorry no there isn't a way to modify the appearance of moi.ui.alert().

But you can make your own dialog instead.


> Does Moi just use the javascript alert box? Or is there a programmed alert box

moi.ui.alert() uses the Qt message box dialog.

For making your own custom one here is an example to get you started.
Put this into a file MyAlert.htm inside of the appdata commands folder:

code:
<html>
	<head>
		<title>Window title</title>

		<style>
			#text_container {
				padding-top:0.2em;
				min-width:15em;
				font-size:110%;
			}

			#buttons_container {
				text-align:right;
				white-space:nowrap;
				margin-top:0.7em;
			}

		</style>
	</head>

	<body class="DialogBody">
		<div id="text_container">
		</div>

		<div id="buttons_container">
			<moi:DialogOK/>
		</div>

		<script>
			if ( g_Text )
				text_container.innerText = g_Text;
		</script>
	</body>
</html>


Then when you want to show it, do this:

code:
var dlg = moi.ui.createDialog( 'moi://commands/MyAlert.htm' );
dlg.htmlWindow.g_Text = 'Text of alert';
dlg.window.doModal();


You should get this:



- Michael