on 05-07-2016 7:50 AM
Hi, everybody
I am developing a quite big add-on using VB.NET and SDK
I started learning SDK using the samples given in SDK Help, and I develop everything entirely in code, because I have not learned other techniques.
All dimensions and positions are specified in code. I am not using any visual tool (Screen Painter, B1DE, SAP B1 Studio..)
I notice that my form is rather slow to load. Not a big problem, but if it loads faster, users will be more happy.
I have studied the "Working with XML" example in DI sample, and notice it loads very fast (but it's a small file. Mine is much bigger).
I am thinking of converting all my forms into XML, but would like some advice before jumping ahead.
My Questions:
What I do is to calculate screen resolution using these codes:
Public VirtualScreenWidth As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Width
Public VirtualScreenHeight As Double = System.Windows.Forms.SystemInformation.VirtualScreen.Height
Then I express all my dimensions and positions in terms of these variables. ex:
oItem = FormSelx.Items.Add("O_ToOt", SAPbouiCOM.BoFormItemTypes.it_OPTION_BUTTON)
oItem.TextStyle = SAPbouiCOM.BoFontStyle.fs_Bold
oItem.Left = 0.5 * VirtualScreenWidth
oItem.Top = 0.59 * VirtualScreenHeight
Can a form be saved as XML even if dimensions are expressed parametrized as above?
--------------
Added:
Just as a test, I modified the XML file to incorporate a formula (125*2 instead of 250)
<item uid="EditText1" type="16" left="157" tab_order="0" width="125 * 2"
But it does not work.
My only hope is that it will work if the XML file is generated by SDK, not just edited .. but maybe I am dreaming!
-------------
Any advice will be most welcome. I never worked with XML before.
Thanks
Leon
Hi Leon,
the form loads much faster when using XML files. Basically you are just building the XML via code the way you are doing it.
I don't get exactly what you mean by " adding the necessary SDK code" since you are just shortcut the creation of the form - everything else stays as ist is.
I would strongly recommend to use B1Studio to create the forms - it is simply the easiest way. As for the dimensions and positioning I stay with what I said in the other thread.
Afaik you can't use formulas in integer fields - but you can of course modify your xml before adding it. The usual approach would be to calculate needed properties ( left,top, width..) when from is resized or loaded.
ARD creation is the same.
I don't know about your project, but you should definitly have a look into the B1Studio template for Visual Studio ( 2010 or SBO 9.1PL3 = 2013 ). If it is applicable ( it has some flaws ) in your case it would simplify your life a lot.
regards,
Maik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Maik
Thanks a lot for your reply.
And thanks a lot for being really patient with me.
You have stressed many times the importance of B1 studio, but you know, bad habits are difficult to change. Although hard coding is tough and time consuming, I have paradoxically come to love it. But I have started learning SAP B1Studio.
I have a few questions concerning SAP B1 Studio
The big problem is that a perfect form displays only on the computer from which the
form was designed. On all others, the form is distorted. I also have the problem of
QUADRANT LINES mentioned last time.
Does SAP B1 Studio solve the problem of Resolution. You mentioned RESIZING. But to
use resizing, you've got to know the new screen resolution? Does Studio handle
resizing automatically?
Best Regards
Leon
/
Hi Leon,
which version is up to you. In theory standalone B1 Studio is used by designers to create the form visually.
Personally I prefer the VS version if I create addons which are not complex or don't involve system forms ( to use the framework abilities ).
In all other cases I design the form in B1Studio and export as *.srf ( the "old" xml version of forms ).
Resolution / resize issues I handle in form resize after event if necessary - try to settle with a minimum form size and link items to each other ( folders and grids would need manual resizing in any case ).
B1 Studio is a tool and framework but nothing more ( no auto resizing ).
regards,
Maik
User | Count |
---|---|
102 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.