Morfik Tip: Pretty up the ‘Loading…’ message - Take #2
March 4, 2007As predicted, Morfik acted switftly upon my note about the (inability of the) customization of the “Loading…” message. So from 0.9.17.7 on you have a much cleaner solution. It is…
…simple. Now you can create a server-side application event (i.e. an event of your application object) called OnPrintLoadingMessage() that will be called exactly before the default “Loading…’ message is going to be printed, so you can print your own message, and by setting the var parameter Print to False you can prevent the Framework from printing its own message, thus you can completely control the appearance of the “splash screen”.
To enter the following example, do the following:
- Go to the Project (top) tab.
- Select the Server (bottom) tab.
- Press F11 to bring up the Properties sheet.
- Double-click on OnPrintLoadingMessage.
- Paste in the following code:
Procedure <YourAppNameHere>XApp.XAppPrintLoadingMessage(Response: THTTPResponse; Var Print: Boolean);
Begin
// -------- start of copy only this part --------
Response.WritelnString(' <div id="__LoadingText" '+
'style="left:48%;top:45%;position:absolute;font-weight:bold;'+
'text-align:center;font-size:12px;font-family:verdana,serif;'+
'background-color:#f0f0f0;padding:10px 14px 10px 14px;border:1px dotted gray;'+
'color:red;">');
Response.WritelnString(' Loading...');
Response.WritelnString(' </div>');
Print := False;
// -------- end of copy only this part --------
End;
You will also find other interesting events here that may control the genration of the initial bootstrap “code”: look at Procedure TFormServer.GenerateMainHTMLPage; in FrameWork\SystemServerDocForm.mmd for more details.

Simple way to add an image to the waiting message: Response.WritelnString('
chtx | July 15, 2007Simple way to add an image to the waiting message:
Response.WritelnString(’ ‘ );
then link the image ‘ajax-loader.gif’ to the project using the resource management form (see below).
PS0: Don’t forget the ‘?cls=res’ (see http://www.morfikwiki.com/Inserting_images_into_TextLabel_captions)
PS1: Resources’ management is a little boring because I do not found an easy way to access it directly (needs enhancement?).
My two methods to add an image (ex. ajax-loader.gif) into the project’s resources:
1. Add an Image to the project - Open its Picture property - link to ‘ajax-loader.gif’ in the ‘Repository Form’ - Valid -> Delete the Image component // Done…
2. Morfik IDE ‘Project->Project Options…” menu - ‘Application’ - ‘Background image’ button - link to ‘ajax-loader.gif’ in the ‘Repository Form’ - Valid -> Delete the ‘Background image’ field - Press ‘OK’ button //Done…
PS3: Nice waiting animated gifs can be found at http://ajaxload.info/
Hope this help.
Chtx.
This is cool but originally you said something about
Tyler | August 31, 2007This is cool but originally you said something about embedding flash could you expand on that?