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 15th April 2003, 23:41
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Talking Code: BaaN Photo Editor

I have seen few postings on the board about displaying photos/picture with BaaN Tools.

Thanks to Vamsi and a few others, I got some baseline code to start with and finish it off.

I have this code in a DLL and it can be called by any program.

Code:
#define ALTF4		((1024-1) + 4)
function	extern	view.picture(string	pic.path(256))
{
DLLUSAGE
	view the *.gif file in a picture browser
ENDDLLUSAGE
long	gwin
long    cmap_sz
long    cmap(256)
long    icon_w, icon_h
long    valid.icon
long 	buflen, fp
string  imap(1)   based
string 	bufr(1)  based
long 	idc, idp, image
long	event(EVTMAXSIZE), type, option

on case ostype()
case	OS_WINDOWS_95:
case	OS_WINDOWS_NT:
		pic.path = tolower$(pic.path)
		|* Dos/Windows files are case insensitive
	break
case	OS_UNIX:
case	OS_OS400:
	break		|* Unix files are case sensitive
endcase
pic.path = strip$(shiftl$(pic.path))
if pic.path(len(pic.path) - 3) <> ".gif" then
	mess("zmadms0037", 1)			|* Only *.gif files can be used
	return
endif
fp = seq.open(pic.path, "r")
if fp < 0 then
	mess("zmadms0010", 1)			|* File Handling Errors
	return
endif
buflen = seq.seek(0, 2, fp)
e = alloc.mem(bufr, buflen)
e = seq.rewind(fp)
if seq.read(bufr, buflen, fp) > 0 then
	if get.pixmap.info(bufr, cmap_sz, icon_w, icon_h) then
		alloc.mem(imap, icon_w * icon_h)
		valid.icon = decompress.pixmap(bufr, cmap, imap)
		cmap(1) = rgb(128,128,128)
	endif
else
	mess("zmadms0010", 1)			|* File Handling Errors
	return
endif
e = seq.close(fp)
free.mem(bufr)
gwin = create.object(	DsCgwindow,	current.mwindow(),
			DsNbackground,    3 ,
			DsNwidth,         icon_w,
			DsNheight,        icon_h,
			DsNpointerCursor, DSCHAND, DsNeventMask, EVTALLEVENTMASK )
update.object(gwin)
idc = create.object(DsCcolormap,current.display(),DsNcolorTable,cmap,cmap_sz)
idp = create.object(	DsCpixmap,	current.display(),
			DsNcolormap,    idc,
			DsNwidth,       icon_w,
    			DsNheight,      icon_h,
    			DsNdata,        imap,
    			icon_w * 	icon_h,
    			DsNdataType,    DSPIXMAP8 )
image = create.sub.object(	gwin,       DsCgpImage,
    				DsNpixmap,        idp,
    				DsNx,             0,
    				DsNy,             0 )
raise.object(gwin)
repeat
	option = 0
	type = next.event(event)
	on case type
		case 	EVTKEYPRESS:
			if ( evt.keypress.key(event) = ALTF4 ) then
				option = 1
				break
			endif
		case	EVTBUTTONPRESS:
			if ( evt.button.button(event) = ALTF4 ) then
				option = 1
				break
			endif
	endcase
until (option)
if image <> 0 then
            destroy.sub.object(gwin, image)
endif
if gwin <> 0 then
	destroy.object(gwin)
endif
}
|******************************************************************************

Any suggestions and enhancements are welcome!
Attached Images
File Type: gif photo.gif (21.2 KB, 713 views)
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #2  
Old 25th April 2003, 19:45
rochus rochus is offline
Senior Member
 
Join Date: Mar 2002
Location: Switzerland
Posts: 189
rochus is on a distinguished road
Baan: xBaanxxx - DB: Oracle, DB2, SQL-Server - OS: Unix, MS, Linux
great stuff

any idea, how to prevent , that program ends after
pressing "Alt+F4" ?
Reply With Quote
  #3  
Old 25th April 2003, 19:54
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,905
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
If you wanted

You can actually drop the code after the repeat statement. Of course then you need to make sure you can exit the session.

If you wanted you could actually drop this code into a 4gl session and put a company logo on a session. That is how I tested it - I actually put the code into a init.form section.

Mark
Reply With Quote
  #4  
Old 8th July 2003, 21:54
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
oh well, after all I found a BaaN standard function to do this.

I found it in the tools library - ttstp_stddll

image.display
long image.display( const string image.path() )

image.display() appears to activate ttdskimage and sends the image.path as a parameter. ttdskimage appears to call create.pixmap() and then proceed to create a window to display the image in. It appears to process ALT-F4 to shut down the window and resize events.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #5  
Old 22nd July 2003, 16:51
Eddie Monster's Avatar
Eddie Monster Eddie Monster is offline
Guru
 
Join Date: Nov 2001
Location: Pittsburgh, PA, USA
Posts: 343
Eddie Monster is on a distinguished road
Baan: Baan IVc4 - DB: MS SQL Server 2008 R2 - OS: MS Server 2008 R2
Example... please

NPRao,

Could you please provide an example of the image.display() function used in code? I am having trouble getting my code to compile correctly.

Thanks!
Reply With Quote
  #6  
Old 22nd July 2003, 18:48
Francesco's Avatar
Francesco Francesco is offline
Guru
 
Join Date: Aug 2001
Location: Antwerp, BE
Posts: 727
Francesco is on a distinguished road
Baan: 5b - DB: Oracle - OS: Solaris
If I may

I used Prashant's finding to introduce my newborn to my collegues in (Baan)style.
This was all it took in a 3GL script:
Code:
|***************************************************
|* cecusffjonah  0  VRC B50o b  uat 
|* Show Jonah
|* francesco
|* 07-09-03 [04:51]
|***************************************************
|* Script Type: 0
|***************************************************
	
function main()
{
	image.display( "/opt/apps/baan/tmp/jonah.gif" )
}
__________________
Cheers,

Francesco
..............................................................

Admiral Business Solutions | My World | Baan Board | IT Happens!

"If everyone is thinking alike, then somebody isn't thinking" -- George Patton
"It's easy to cry 'bug' when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully." -- Doug Vargas
Reply With Quote
  #7  
Old 22nd July 2003, 19:59
Eddie Monster's Avatar
Eddie Monster Eddie Monster is offline
Guru
 
Join Date: Nov 2001
Location: Pittsburgh, PA, USA
Posts: 343
Eddie Monster is on a distinguished road
Baan: Baan IVc4 - DB: MS SQL Server 2008 R2 - OS: MS Server 2008 R2
Compilation Error

Here is my code. I'm trying to use it within a form (maybe that is the problem...)

|******************************************************************************
|* tdtstimage 0 VRC B40C c4 obg4
|* View Image on Form Test
|* erice
|* 07-22-03 [09:34]
|******************************************************************************
|* Script Type: 4
|******************************************************************************
| Written by: Eric Edder
| Request: TR
|****************************** DECLARATION SECTION ***************************
declaration:

| Selection Criteria

| Working Storage

| Libraries


|****************************** PROGRAM SECTION ***************************
|****************************** ZOOM FROM SECTION ***************************
|****************************** FORM SECTION ***************************

form.1:
init.form:
get.screen.defaults()

|****************************** CHOICE SECTION ***************************

choice.cont.process:
on.choice:
image.display("/app/baan4/bse/common/test.gif")

|****************************** FIELD SECTION ***************************
|****************************** MAIN TABLE SECTION ***************************
|****************************** FUNCTION SECTION ***************************
functions:

|******************************************************************************
| This function...
|******************************************************************************
|function main.function()
|{

|}

|****************************** END OF SCRIPT ***************************



and this is my error upon compiling:

Error: Unresolved reference to function 'image.display'

Should I try to make my form call a 3GL program to display the image?
Reply With Quote
Sponsored Links
  #8  
Old 22nd July 2003, 20:06
Eddie Monster's Avatar
Eddie Monster Eddie Monster is offline
Guru
 
Join Date: Nov 2001
Location: Pittsburgh, PA, USA
Posts: 343
Eddie Monster is on a distinguished road
Baan: Baan IVc4 - DB: MS SQL Server 2008 R2 - OS: MS Server 2008 R2
Baan IV?

Is this function even available in Baan IV????
Reply With Quote
  #9  
Old 22nd July 2003, 20:14
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Eddie,

Check the functions prototype of the tools object - ttstp_stddll
Quote:
>bic_info6.2 -?
bic_info6.2: illegal option ?
Show Object Information (c)

Usage: bic_info6.2 [-aideushwcV] [-f[flags]] object

-a : Show all object information
-i : Show assembler
-d : Show used DLL's
-e : Show exported DLL function prototypes
-u : Show usage of DLL (description)
-s : Show symboltable
-h : Show object header
-w : Show object idents (what)
-c : Check checksum
-f : Show all flags
-f<flg> : Test flags 1=NOTRANSACTIONS 2=DEBUG
4=PROFILE 8=DLL
-qo <out>: Redirect output to file out
-qe <err>: Redirect error output to file err
-set <env=val>:
set environment variable
-V : Show version
You can use $ bic_info6.2 -e ottstp_stddll to check the function prototypes if this function is available in your BaaN version or not.
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #10  
Old 22nd July 2003, 20:31
Eddie Monster's Avatar
Eddie Monster Eddie Monster is offline
Guru
 
Join Date: Nov 2001
Location: Pittsburgh, PA, USA
Posts: 343
Eddie Monster is on a distinguished road
Baan: Baan IVc4 - DB: MS SQL Server 2008 R2 - OS: MS Server 2008 R2
bic_info6.1

Thank you for the quick response!

I ran bic_info6.1 but I'm not quite sure what all of that information is (sounds like that could be an entirely new post).


I used the following command (using the -a switch instead of -e to see what was available):

bic_info6.1 -a ottstp_stddll

in the DLL prototype there was a long list of functions. The only 'display' functions were:

display.enumerate()
display.info()
display.note()

Does this mean that I can't use it or I need to update some sort of object??? Please advise, I'm a little lost.
Reply With Quote
  #11  
Old 22nd July 2003, 20:56
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Eddie,

use $ bic_info6.1 -e ottstp_stddll to check the function prototypes if this function is available in your BaaN version or not.

If the function is not available then you need to check up with the BaaN support if you there are any latest patches in tools.

Also, this function might not have been ported to the BaaN-4 series. I cannot validate that as I do not have access to BaaN-4 versions, and we are working on BaaN-5.2

BaaN support gave me this info.
Caution -
Quote:
"image.display() is not documented in the programmers guide and is not supported for customer use. Since it is declared as extern, they can use it, but at their own risk. We may make changes to these at any time without notification."
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #12  
Old 23rd July 2003, 08:41
rupertb's Avatar
rupertb rupertb is offline
Senior Member
 
Join Date: Jun 2002
Location: NY, USA
Posts: 192
rupertb is on a distinguished road
Baan: T2.2, BIVb2, BIVc4, Vc - DB: Oracle, INFORMIX, DB2, SQL - OS: AIX, WIN
No Prashanth image.display() is not available in c4 it looks like eddie will have to take the long road...

Regards,
Rupert
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
CODE: BaanXL - Yet another Baan to Excel utility. ~Vamsi Code & Utilities 45 23rd July 2013 03:43
ERP Security, Baan Example NPRao General Discussion & Chat 2 24th January 2003 00:57
BSP-US (LLC) added as a Baan Education Alliance svandenh General Discussion & Chat 1 20th August 2001 19:44


All times are GMT +2. The time now is 02:51.


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