schweizer
3rd February 2005, 10:24
Hi,
First Question, is it possible to use multi occurences fields in a window creted by the create.object(DsCmwindow)?
Second, does anyone know how to use the "DsCtoolBar" .
I found it in the create object.help but I'm not sure about the arguments.
The script looks like this.

#if BAANIV
#define BAANERP 0
#endif

#define COMMAND.ABORT 10
#define COMMAND.EXIT 11
#define COMMAND.FIRST 20
#define COMMAND.LAST 21
#define COMMAND.PREV 22
#define COMMAND.NEXT 23
#define COMMAND.CONTINUE 1

long m_window, uber, work_win, tool_1

function main()
{
create.main.window()
handle.event.loop()
}
function create.main.window()
{
string file(128)
string bufr(1) based
long buflen, fp, idp

m_window = create.object( DsCmwindow, 0,
DsNtitle, "MWindow",
DsNprocessgroup, get.pgrp(pid),
DsNminWidth, 200,
DsNmaxWidth, 200,
DsNminHeight, 200,
DsNmaxHeight, 200)



file = "${BSE}/gif/desktop.gif/printer1"

fp = seq.open(file, "r")
buflen = seq.seek(0, 2, fp)
alloc.mem(bufr, buflen)
seq.rewind(fp)
seq.read(bufr, buflen, fp)
seq.close(fp)
tool_1 = create.object(DsCpixmap, 0,
DsNdata, bufr, buflen,
DsNdataType, DSPIXGIF8 )
create.object(DsCtoolBar,m_window,
DsNcommandList,1,
DsNimageList,tool_1)

update.object(m_window)
}
function handle.event.loop()
{
long x,y
long event(EVTMAXSIZE)
while TRUE
next.event(event)
on case evt.type(event)
case EVTMENUSELECT:
on case evt.menu.return(event)
case COMMAND.ABORT:
message("jljlb")
return
case COMMAND.EXIT:
return
endcase
break
case EVTPUSHBUTTON:
if ( evt.button.return(event) = COMMAND.ABORT OR
evt.button.return(event) = COMMAND.EXIT ) then
return
endif
break
case EVTKEYPRESS:
case KEY_RETURN:
zoom.to$("tdsls4820s000", z.session, "", "", 0)
message("jljlb")
break
case EVTBUTTONDPRESS:
case EVTBUTTON3:
message("da kiegste wa")
x = evt.button.x(event)
y = evt.button.y(event)
break
default:
break
endcase
endwhile
}

Thanks in advance
Schweizer

NPRao
3rd February 2005, 22:08
I think you are looking for - DsCgrid (http://www.baanboard.com/programmers_manual_baanerp_help_functions_user_interface_objects_dscgrid)

schweizer
4th February 2005, 11:37
Thank you NPRao,
what I actually want to do, is to bring a session to a Handheld format.
I want to make them smaller.
For exemple, for a display session, I can read the table and put the output in an array, then I create fields on the Form (object) and then I fill the fields with the Table output.
If I scroll through the output I have allways refresh the array.
But I will try to play around with.
Now I have to think about, how to create the toolbar.
Once again, thanks for the help.
Rgrds.
Schweizer

NPRao
4th February 2005, 23:15
Never tried this, but refer to this link -

Character-based windows - overview and synopsis (http://www.baanboard.com/programmers_manual_baanerp_help_functions_char_b_win_overview_and_synopsis)

and a GTM example from -

Using Bold font in a form field (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=7048&perpage=15&display=&highlight=GTM&pagenumber=2)

RobertB
7th February 2005, 17:02
NPRao is right - you need DSCGrid, which is a kind of Excel-table-type of grid and is, in fact, what Baan itself uses to populate its' own multi-occurrence windows.

Here's some code I built a couple of years ago, which builds a window, a grid, some buttons and then fills the grid with data - it might get you going:

schweizer
9th February 2005, 12:22
Thanks to all for the answer.
But there are still two issues.
1. If I try to compile the script with the dscgrid function I get an error "unknown argument dsngridtype" although I changed the case of the letters.
2.to NPRao I tried the resize.window() but no result.
if I set the function in the form section I get the message "object not found"
I know I should set in the init.group section but there to set the group.<>
section.
Is it possible at all, to bring an ascii form to a handheld size?
May be it is only possible to change the size as small as the toolbar is?
These problems are not really important but I'm curious.
Thanks for your attention
Schweizer

günther
9th February 2005, 15:13
I've been successful in compiling the sample, but I get runtime errors ("object not found"). I guess that DsCGrid does not work on IVc4!

RobertB
9th February 2005, 15:20
I don't have any experience of IV, but if you look up "object" in the Programmers' Help in V, you can choose the option "objects and subobjects" and then "DsCgrid", you get a whole bunch of info on the various DsCgrid settings. If this works in IV, there might be different available settings listed there.

R

schweizer
9th February 2005, 16:32
Robert,
it is actually the point.
Even if I copy the argument, the compiler does not recognise the argument.
But anyway, I make it with the arrays, it is not so bad too and it works.
Thank you all again for the answer
Schweizer

günther
9th February 2005, 17:08
Sorry, but I don't think we can get this to work for IVc4. DsCGrid is defined (as 51), but create.object() with this object type results in "Fatal error: object ... is of unknown type 51". Hmm.

NPRao
9th February 2005, 21:05
Schweizer,
2.to NPRao I tried the resize.window() but no result.
if I set the function in the form section I get the message "object not found"
I know I should set in the init.group section but there to set the group.<>
section.

That works only for Character based Windows.

Refer to the link for more info -

Full-screen at session start-up (http://www.baanboard.com/baanboard/showthread.php?t=13000&page=1&pp=15&highlight=resize)

schweizer
16th February 2005, 10:45
Hi,
now I have a similar problem with DsNrowcolumn.
If I use the argument DsNjustify, while compiling I get the Error "DSNJUSTIFYBOTTOM not declared".
May be I need a new dll or include or it is only working in ERP and the arguments are not yet valid in c4.

RobertB
16th February 2005, 15:15
I don't have any experience of IV, but if you look up "object" in the Programmers' Help in V, you can choose the option "objects and subobjects" and then "DsCgrid", you get a whole bunch of info on the various DsCgrid settings. If this works in IV, there might be different available settings listed there. The point I was trying to make here is that the Baan Programmers' Help is the place to go when developing - whichever version of Baan you're using.

Each version of a programming language has its' own sets or subsets of objects, programming constructs and constants, which differ from version to version. So don't expect each and every constant to even be available in this or that version. If you want to make this thing work, go to your own Programmers' Help and find a constant that DOES make it work.

Extract from the Baan V Help on DsCrowColumn:

DsNjustify (long) [CSG] The justification of child windows within the cells of the
DsCrowColumn object. This is relevant only when
DsNpacking is set to DSPACKTIGHT.

The possible values for horizontal justification are:

DSJUSTIFY LEFT (default)
DSJUSTIFY CENTER
DSJUSTIFY RIGHT

The possible values for vertical justification are:

DSJUSTIFYTOP (default)
DSJUSTIFYMIDDEL
DSJUSTIFYBOTTOM

When setting this attribute, you must combine a horizontal
justification option and a vertical justification option.
Hope that helps,
R