Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 9th September 2003, 05:34
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
Pictures on Baan IV Forms

Firstly, I can not take any credit for the development of this code... It was posted in the thread: Photo Display on Form , by '~Vamsi'. I have just turned it into an easy to use include....

Simply call it by;
igen0100.display.photo.default(<full path and filename to GIF file>)

Don't forget to destroy the objects with;
igen0100.clear.photo.display()
either in the choice.end.program and choice.abort.program, or when you need the picture cleared..
Attached Files
File Type: txt photos.txt (7.7 KB, 1200 views)
Reply With Quote
  #2  
Old 9th September 2003, 09:56
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
will this code not work for Baan V?
Reply With Quote
  #3  
Old 9th September 2003, 22:06
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
never tried in Baan V, but can't see why not (it wouldn't be a difficult job to port it to Baan V, if it doesn't)...
Reply With Quote
  #4  
Old 17th September 2003, 14:09
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Resizing windows

Hi Ruskin,

Used this function, and seems to work well. Have got one problem though:

Say I use this in a display session, where the session opens let's say on nearly full screen. In the init.form (tried also before.form) I call the function to display a gif in the top-right corner. This works ok. Then I resize the window (just with the mouse) and make it smaller. The gif's location will not be adjusted accordingly (i.e. recalculate the proportions from the window edges), and as a result the whole window looks clumsy with this gif stuck out there on an unsuitable location. Basically it will be impossible to decrease the window-width smaller than the original size, because this gif stays stuck on the original (width) location.

Encountered this? Have a solution for it? Would be great, because the way it is now, I cannot apply it.


Tia,

En.
Reply With Quote
  #5  
Old 17th September 2003, 14:19
NvanBeest's Avatar
NvanBeest NvanBeest is offline
Guru
 
Join Date: May 2003
Location: South Africa
Posts: 521
NvanBeest is on a distinguished road
Baan: BaanIVc4 - DB: Oracle, TBase, SQL Server - OS: AIX, Linux, Window$
Hi En.

Have a look at the function change.sub.object. You could call this to move and/or resize the picture in the choice.resize.frm section.
__________________
Regards,
Nico
Reply With Quote
  #6  
Old 18th September 2003, 05:50
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
Not sure if the solution by NvanBeest will work (redrawing the sub-object, when the main object is not large enough, won't work)... It may automatically resize the main object, so will be worth trying. But the best solution, is as he suggested, in the choice.resize.frm

What you should do, is call;
igen0100.clear.photo.display

Then call the;
igen0100.display.photo.in.location
function, to recreate the photo, with the new x,y co-ordinates and photo height/width. You may need to determine the x.y co-ordinates yourself in this case.

Thus, when the user resizes the form, it clears and redraws the image.
Reply With Quote
  #7  
Old 22nd September 2003, 18:22
learner's Avatar
learner learner is offline
Guru
 
Join Date: Dec 2002
Location: New zealand
Posts: 562
learner is on a distinguished road
Baan: BaaN Vc with sp 28 - DB: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit - OS: HP-UX B.11.31
could u please provide a screen shot

Hello,

Could u please provide a screen shot of the form with the pic on it.... I don't have an access to the system right now.

Regards

Learner
Reply With Quote
  #8  
Old 23rd September 2003, 12:58
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Hey Ruskin,

Thanks for your advice. I had already tried the way you described, but received bw-errors. Thought it was as a result. After debugging, I saw that in the function clear.photo.display(), there is a destroy on object.mimg which caused the errors, for there was never an update.object on object.mimg...

I now use a clear.photo.display() and display.photo.in.location() in the choice.resize.frm after.choice section (and in case of multiple forms -> tabs, it is necessary to re-display also on each before.form), and now it works perfectly.

Thanks a lot!!


Kind regards,

En.
Reply With Quote
  #9  
Old 23rd September 2003, 14:49
~Vamsi's Avatar
~Vamsi ~Vamsi is offline
Guru
 
Join Date: Aug 2001
Location: San Diego CA, USA
Posts: 590
~Vamsi will become famous soon enough
Baan: ~*~ - DB: ~*~ - OS: ~*~
En,

Could you please post the code with the updates.
__________________
~Vamsi
Vamsi Potluru
Baan XL Yet another tool to format Baan output in Excel from Baan Board
This one just happens to be free :)

Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
  #10  
Old 23rd September 2003, 16:35
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
I made only few little changes.

Here it goes:
In function init.photo.settings:
Code:
function igen0100.init.photo.settings()
{
	long	int.value(MWINMAXSIZE)

|	if not igen0100.init        or
|	   igen0100.form.width = 0  or
|	   igen0100.form.height = 0 then
|		igen0100.init = true
		igen0100.object.main = current.mwindow()
		get.mwindow.attrs(int.value)
		igen0100.form.width  = int.value(11)
		igen0100.form.height = int.value(12)
|	endif
}
I pipe-lined the conditions, because I want the window attributes to be re-read every time the function is called [in order to get the right location when resizing a form].

In function clear.photo.display()
Code:
function igen0100.clear.photo.display()
{
	destroy.object(igen0100.object.mpix)
	destroy.object(igen0100.object.midc)
	destroy.object(igen0100.object.midp)
|	destroy.object(igen0100.object.mimg)
	update.object(igen0100.object.main)
}
I pipe-lined the destroy.object(igen0100.object.mimg), because there is never an update.object on mimg; therefor it results in a bw-error 'Object %d not found'.

For the rest I only changed some of the default sizing and positioning, but this is depending on each one's personal preferences. I for instance do not understand why the minimum height+width sizes have to be 100 (any reason Ruskin??), so I pipe-lined this piece:
Code:
|	if igen0100.hght < 100 then
|		igen0100.hght = 100
|	endif
|	if igen0100.wdth < 100 then
|		igen0100.wdth = 100
|	endif

I finally changed the default locations in the default.x/y.position() functions to be displayed default in the far top right corner. So for default x pos I have:
return(igen0100.form.width - igen0100.wdth)
and for y pos:
return(20).


Regards,

En.
Reply With Quote
  #11  
Old 25th September 2003, 02:32
Ruskin's Avatar
Ruskin Ruskin is offline
Unconfirmed User
 
Join Date: Feb 2002
Location: New Zealand
Posts: 91
Ruskin is on a distinguished road
Baan: All - DB: MS-SQL, Informix, Oracle - OS: UNIX and NT Server
Thanks En...

Sorry I haven't responded earlier, haven't been to the site for a few days.

You are quite correct, the sub object does not need a 'destroy.object' function for it. Thanks for pointing that out... Also, I found I got some BW errors when destroying the object multiple times, so amended the clear function as follows;
Code:
function igen0100.clear.photo.display()
{
	if igen0100.object.mpix then
		destroy.object(igen0100.object.mpix)
		igen0100.object.mpix = 0
	endif
	if igen0100.object.midc then
		destroy.object(igen0100.object.midc)
		igen0100.object.midc = 0
	endif
	if igen0100.object.midp then
		destroy.object(igen0100.object.midp)
		igen0100.object.midp = 0
	endif
|	destroy.object(igen0100.object.mimg)
	if igen0100.object.main then
		update.object(igen0100.object.main)
	endif
}

The only reason I made the minimum height and width at 100, was for our photos. At that size they fit on our form perfectly and aren't dis-proportional. It's entirely up to you, whether you use that minimum size or create your own...

kind regards...
Reply With Quote
  #12  
Old 25th September 2003, 09:29
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Thanks Ruskin!
Reply With Quote
  #13  
Old 12th June 2006, 15:11
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Improved version..

To all that may find it usefull...

I have used Ruskin's function for the past couple of years for displaying of logo's on some customized sessions. I was now working on a good efficient item file as a display session in Baan. One of the requirements, was including images of the item, up-to 5 images per item.

I wanted to use my existing function (Ruskin's), but saw that the function can actually only handle display of one image per form. I therefor improved the function to be able to handle display of up-to 5 images each time.

There is an optional argument in the function call, which passes the image number. I have done it in the way of an optional argument, so that I will not have to change all the program scripts which call the function till now... If the optional argument is not filled, then the image number will be defaulted to 1 (for display of one image only).

Attached is the code...

If anyone has further suggestions and/or remarks, I'm always here to listen...


Regards,
En
Attached Files
File Type: txt EN0303_itdrom0100_display.photo.txt (11.3 KB, 395 views)
Reply With Quote
Sponsored Links
  #14  
Old 1st July 2006, 08:26
jhansirani's Avatar
jhansirani jhansirani is offline
Junior Member
 
Join Date: Oct 2003
Location: hyderabad
Posts: 28
jhansirani is on a distinguished road
Baan: baan4c4 - DB: oracle 9i - OS: windows 2003 server
Hi Ruskin,

Is this is helpful for multiple records? Example - if we select empno and we select photo - it will go for particular employee.gif and display?

Thanks & Regards,
Jhansi Rani B
Reply With Quote
  #15  
Old 3rd July 2006, 09:26
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Of course you can do it. I use it for instance for items. Per item I could have up to five different images. So the file names are <itemcode>1, <itemcode>2 etc, and the session calls the corresponding images.

The same you can do with your employees...

Good luck!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BaaN Open World and IVc4 Muetze Open World, Portal & Decision Manager 8 2nd February 2012 10:38
ERPJewels Hitesh Shah Third Party Products 10 6th November 2006 05:38
Should Baan provide a level 2 database driver for SQL server 2000 on BaanIVc4? patvdv Polls and Surveys 6 28th March 2003 13:22
Baan on Oracle Guru for Hire Will travel OracleBaanGuru Jobs and Resumes 1 19th June 2002 15:57


All times are GMT +2. The time now is 00:13.


©2001-2017 - Baanboard.com - Baanforums.com