Integrating multimedia artwork into JADE applications

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Integrating multimedia artwork into JADE applications

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:10 pm

by JADE News Administrator >> Thu, 29 Oct 1998 5:03:09 GMT

Hi,
I have an application that needed to be "dressed up" and the Multimedia Dept. were commissioned to create a set of background, splash, login and picturebuttons -- to give the interface a contemporary feel. This they did admirably and supplied the results as a set of BMP picture files.

However, to create the required interface and integrate the pictures into my application was not quite so straightforward. Below are the results of my research that can be used by anyone wanting to create a similar look and feel with a set of bitmap files.

Some of you may be familiar with the MARS application. That has a great interface and now my Kiwi Dairies system has a similar look and feel also.

Procedure to follow:

1. Create a main form that will be maximised to cover the whole screen. In my case I called this JACSMain. This is going to have a title bar, a background picture and a row of picture controls across the top that simulate pushbuttons.

Make this a reasonable size but you do not have to worry about exact coordinates because will will open the form in a maximised state. The backdrop picture will expand to fill the entire form no matter what the screen resolution.

Set the following properties for it in the Painter :

Common - borderstyle 1 - Fixed Single
Specific - maxButton - False
Specific - mdiChild - 1 - Not MDI form
Specific - mdiFrame - False
Specific - minButton - True
Specific - windowState - 2 - Maximised
set the title, icon etc to what you want .......................................

2. Create a picture control to be a reasonable size on the form. Mine is called pic_Backdrop. Set the following properties :

Common - borderstyle 0 - None
Common - parent - JACSMain
Common - show3D - 1 - Not 3D
Specific - picture - backgrnd.BMP (or whatever your backdrop picture is) Specific - stretch - 1 - Picture to Control

3. Put other picture controls across the top or down the size according to how many "simulated" pushbuttons you require.

Make them all stretch to 2 - Control to Picture. Line them up using the Alignment icons etc. You should have 3 picture files for each simulated picture button. One to represent the button in its up state, one in its down or depressed state and one in its disabled state. You can put all these in in the Painter.

4. Create a reference at your Application level of type Form. Call this something like myParentForm i.e. select the Application class in the Class Browser and drill down to the actual application and add in a reference.

5. In the load event of the main form you would have something like the following to load up a login form on top (inside) your main form. By setting the applications myParentForm reference to be the instance of the main form then we can refer to that in the next called screen (in my case a login form).

vars
login_form: LoginJACS;begin

setFormCommon; //---Perform common functions like centreWindow etc etc

//---Set the applications parent form ...
app.myParentForm := self;

create login_form;
login_form.show; //---Do NOT make this showModal
end;

6. In your main form create a method called create with the following statements :

//---Dynamically reset height/width of backdrop to that of main screen pic_Backdrop.height := self.height;
pic_Backdrop.width := self.width;

//---Ensure backdrop is sent to back ....
pic_Backdrop.zOrder(0);

//---Dynamically change the width of menuend to expand to right of screen
pic_MenuEND.width := self.width - pic_MenuEND.left;

This method will be executed automatically everytime an instance of your main form is created. What happens is that the main form is maximised to full screen -- and then the backdrop picture control is expanded to be the same height and width as the main form. So, no matter what your screen resolution the background or backdrop picture will expand beautifully.

Then I ensure that the backdrop picture is always presented with it being at the back i.e. the other picture controls painted on top are always shown above the backfrop picture.

Then I have a little picture called pic_Menuend which is a block of the background to my picture buttons. I have these across the top and this statement ensures that this last one is expand horizontally to fill up to the extreme right of my screen.

7. Change the properties of your Application (Browse Applications...) and change the Startup form to specify your new main "parent" form.

8. In the load event of the first form of your actual application (in my case a login form) put this statement :

//---Explicitly define relationship to ensure child always on top of parent ...
// (can only do this on non-MODAL forms like ComplaintsMain)
setFormParent(app.myParentForm);

This ensures that the called form is a child of the main form and doing this ensures that the main form always stays behind this child form (I have found this methodology works better than employing mdiFrame etc --- mdiFrame forms cannot have controls put on top of pictures etc -- quite a restriction...)

9. Background pictures may get pretty big -- mine is 1.4mb --- too big to load into a JADE picture control with the standard settings. If you have problems loading large pictures edit the following statement in your JADE.INI file and then you should be ble to load big pictures OK :

In the [JADEClient] section increase the TransientCacheSizeLimit to 3 million ie.
TransientCacheSizeLimit = 30000000

10. It's important that the first actual screen of your application is not modal (in order to be able to still access the simulated pushbuttons on the main form). Whether you make your other forms modal is up to you to control .......

This works well for me now and now it's all documented -- so let me know if its of use to you.

Cheers
Alan J.Thomson phone ... 09-277-7961 x744
e-Mail: athomson@cardinal.co.nz
Wonderland: http://home.clear.net.nz/pages/athomson
______/7__/7__/7__/7______
\::*::::*::::::A l a n:::::::: ::: ::/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Je ne regrette rien"

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Integrating multimedia artwork into JADE applications

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:10 pm

by Paul Mathews >> Mon, 14 Dec 1998 7:23:58 GMT

Hi Alan I have have been adding a Menu to the CMBase, named in your honor, FATMenu.

I think for real applications this is the better way to go than a half pregant MDI model.

My Reasons against MDI
a) When ever something gets slight offscreen scroll bars occur and frankly do not really help anybody.
b) Cannit have the images etc that this technique sucggested by Alan provides.
c) Unless feeling suicidal, it unlikely all your forms are going to be fully inherited any way for MDI menuing.

My Reasons for Alans approach,
a) all the reasons above.
b) in the future this approach will be more transferable to the Web
(with lighter images).

Perversly am having problems with the maximise 4.19, it takes up the whole screen swallowing the Task bar, when I try to control it
manually it does not maximise at all. Will contact support about this soon.


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 11 guests