Door library (Beta) - Special library

berndgoedecke

Active Member
Licensed User
How to initialize the DataGrid with Door?

Hello Erol,
What I need at first is an answer to the question in the title.
I try to show the table only with a horizontal ScrollBar, similar to the example from agrahm:
http://www.basic4ppc.com/forum/showpost.php?p=11131&postcount=2

AddTable ("TabGrid", "TG", 0, 0, FW, FH-(12*Hs))
TOb.New1(True)
TOb.FromControl("TG")
TOb.SetProperty("ScrollBars","Horizontal")
TabGrid.show

The line, TOb.SetProperty("ScrollBars","Horizontal") results in an error like
Objectreference is not fixed in an objectintance (translated from german).
I think, this error is in context with the last line of your object dicription:
System_NS, System_Data, System_Drawing, System_Windows_Forms, System_Windows_Forms_Datagrid - Returns the fully qualified named :confused: (do you mean names?(d-key next s-key)) of these assemblies. System_Windows_Forms_Datagrid will only be set if at least one of the objects was initialized with New1(true).
If so, it would be nice to know how to use.

In the future I want to use features to reorder columns, to get the row height and to autosize columns, rows or cells, if this is possible.

Best regards

berndgoedecke
 

agraham

Expert
Licensed User
Adding additional events to controls is now supported. Each type of event provides access to an EventArgs which contains information about the event. I've taken Erel's first post and used it as the basis for a sort of help file and included an indication of the information in each type of EventArgs. To find out more detail I would suggest Googling for the name of the EventArgs you are interested in.
 

Attachments

agraham

Expert
Licensed User
As an example of the power of this library (and of .NET) I have created this example application which can "look inside" controls (this is called reflection in .NET-speak) and show the properties, events and methods they support.

Enter the type of a control (it is case-sensitive so "TextBox" not "Textbox") in the textbox and press Enter. Select the type of members to display and click on items in the list box for information about it. Events will show the type of EventHandler they use which should be one of those listed by Erel in the first post if they are to be used by this library.

Some B4PPC control names are not the same as their .NET names. A B4PPC Image is PictureBox, Menu is MenuItem, NumUpDown is NumericUpDown, RadioBtn is RadioButton, Table is DataGrid.

Calendar and ImageButton are custom controls based on the Control type.
 

Attachments

Last edited:

berndgoedecke

Active Member
Licensed User
Asking for DataGrid with ControlInfo on Device

Hello Agraham,
if I use your program with DataGrid on the Device the error Message: "Please enter a valid .NET control name" apears. Framework2.0 is installed and programs , using Tablecontrol are working. How could it be ? Is there an Framwork SP missing?

Best Regards

berndgoedecke
 

agraham

Expert
Licensed User
I now realise the significance of the System_Windows_Forms_Datagrid property of the Door library. On the desktop DataGrid lives in the System_Windows_Forms assembly, on the device it lives in the System_Windows_Forms_Datagrid assembly. :(

A crudely modified version of ControlInfo is attached which will show you DataGrid on the device. More elegantly it now shows all the signatures for overloaded mathods. :)
 

Attachments

Louis

Active Member
Licensed User
Hi. Could this library be possibl ported down to the .NET framework 1.1 and .NET CF 1.0? Thanks.
 

Erel

Administrator
Staff member
Licensed User
It uses several methods which are not available in .Net CF 1.0.
 

Erel

Administrator
Staff member
Licensed User
On the desktop you can change the ReadOnly property and make the table editable:
B4X:
    obj.FromControl("Table1")
    obj.SetProperty("ReadOnly",false)
 

HARRY

Active Member
Licensed User
Rename now possible?

Hi,

I have read the information on the DOOR library, it looks impressive.

Although I do not completely understand it, I got the idea that it should be possible now to realize an old wish of my (and others), being the possibility to rename a file, without the need for a lengthy copy and delete or the use of MortScript.

If I am right, can somebody give me a sample or just a hint how to realize what I want.

Harry
 

HARRY

Active Member
Licensed User
Rename

Agraham,

Thanks for your prompt reply.

The documentation on the FilesEx library reads : "As there is no real Rename function in .NET this is actually a FileMove within the same directory.". So I guess that this is not the solution I am looking for: the size of the files I am 'renaming' on a SD card is some 6-8 M Bytes, so copying takes quite some time.

I did hope that using the DOOR library a real rename was possible, but now I doubt.

What should be the code to test it:

create a FileObject??
assign a file to that object (with path)??
set the Name property ??
destroy the File Object??


Harry
 

dzt

Active Member
Licensed User
Hi,

Actually FileMove does not copy the files so the size shouldn't be a problem.
 

agraham

Expert
Licensed User
"As there is no real Rename function in .NET this is actually a FileMove within the same directory.". So I guess that this is not the solution I am looking for
Have you tried it? A FileMove operation does not necessarily imply a copy and delete. As I said there is no true rename in .NET (or in the Win32 API that I can find!), even the VisualBasic .NET Rename ends up calling the Windows Win32 MoveFile API function.
 

HARRY

Active Member
Licensed User
File Move

:sign0013:

Indeed, I didn't test the Rename function of the FileEx library. I just assumed that Move was identical to Copy. Of course, assuming is not the best way to operate; testing is the only solution. Now it works perfectly.

Yet, I am interested to know whether the same result could be reached with the DOOR library; just to understand a little bit it's possibilities.

Harry
 

agraham

Expert
Licensed User
I haven't tested it but it would look something like this. finfobj is an Object and args is an Object Array.
B4X:
finfobj.New1(false)
args.new1(1)
args.SetValue(0, "c:\temp\save\a.a", "System.String")
finfobj.CreateNew2("System.IO.FileInfo", args.Value)
If finfobj.GetProperty("Exists") = true Then
  finfobj.RunMethod2("MoveTo", "c:\temp\save\b.b", "System.String")   
End If
 

francisco cobos

Member
Licensed User
I'm iterested in build a piano program, and I guess it is possible emulate the piano keys whith the keyboard keys, if I'd had a event like KEYDOWN and KEYUP (The note is played form KeyDown event till KeyUp event or during the key is pressed). The problem is that manage the door library is too dificult for me, could you help me with an example?
Thanks very much
 
Top