xsharp.eu • Newbie Question Installing Bbrowser
Page 1 of 1

Newbie Question Installing Bbrowser

Posted: Sun Oct 04, 2020 9:56 pm
by Kuno Egger
.

.
I got VOXPorter to move my app into XIDE and now the first thing the compiler wants to see is bBrowser. So I bought the bBrowser.NET 4 upgrade online and installed it. But I can't seem to find any instructions on how to include bBrowser in my X-Sharp app. I copied the "bBrowser.NET 4 (XSharp Edition)" folder into my project folder but there are no further instructions after that.

Any advice would be greatly appreciated.

Kuno

Newbie Question Installing Bbrowser

Posted: Sun Oct 04, 2020 10:29 pm
by ic2
Hello Kuno,

I am not using bBrowser in X#, only in VO projects, but I assume it won't differ too much from VO. For VO there are many full working examples included, aren't those somewhere in a directory (like in my VO directory C:cavo29bBrowserSamples)?

Below is an example of a 2 column bBrowser + an icon using an array server (you can use a DBF just as easy). SetCaptions basically sets the columns, width, alignment; columns as follows:
...
LOCAL oColumn AS bDataColumn
oColumn :=SELF:GetColumn(cFieldname)
oColumn:Caption:=cCaption


and DisplayTheColumns nothing more than:

METHOD DisplayTheColumns(aFields) CLASS IC2bDataBrowser
SELF:Clear(FALSE)
SELF:OpenColumn(AFields)
RETURN nil

If you need more code (like the SetIcons called below, exporting a whole bBrowser to Excel with 1 method and more) just drop me a mail.

Dick

METHOD DefineDocBrowser CLASS DocLinks2
LOCAL aSymFields AS ARRAY
LOCAL aSymLogicFields AS ARRAY
LOCAL oOwner AS OBJECT
LOCAL oImageOk,oImageNotOk
LOCAL ob AS CODEBLOCK

oImageOk := bIcon {OK {}, 16} // Green V
oImageNotOk := bIcon {NotOk {}, 16} // Red cross


SELF:aData:={}
SELF:FillDocsArrays() // Fills array from arrayserver to display plain text from rtf control : uses RIGHTS to show or not show txtobject
aSymFields:={#Doc,#Pad}
aSymLogicFields:={#Doc,#Pad}

SELF:oDCbBrowser:Use(SELF:oAServer,aSymFields)
oOwner:=SELF:Owner
SELF:oDCbBrowser:SetCaptions(aSymLogicFields,{;
{"Document",200},;
{"Path",300},;
},"L",TRUE)

ob:={|Server,Icon1,Icon2| IIF(Server:Present, Icon1, Icon2)}
SELF:oDCbBrowser:DisplayTheColumns(aSymLogicFields)
SELF:oDCbBrowser:SetIcons(ob,1,oImageOk,oImageNotOk) // This should be AFTER DisplayTheColumn
RETURN NIL

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 1:02 am
by Kuno Egger
Yes, I have been using bBrowser extensively in VO for a very long time. It was just a matter of pointing at the bBrowser library. It appears it's not so easy in X-Sharp.

Kuno

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 4:00 am
by wriedmann
Hi Kuno,
copying the DLLs into you application directory is one possibility - the other is to change the references location for the bBrowser libraries.
Wolfgang

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 6:25 am
by Chris
Hi Kuno,

It's actually more or less the same thing as in VO, you need to add the bBrowser libraries to your app, except for in .Net this is called "adding references", but it is the same thing. To do this:

Open the app properties (F12 or from the menu Application->Properties), go to the "References" page, locate the bBrowser references in the list and double click on them. In case they are not registered in the GAC, just go to the "Browse" page, click the browse button and pick the bBrowser dlls from the location on disk where they are installed (typically in <Program files>bBrowser).

Please do not hesitate to ask for any other info!

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 7:59 pm
by Kuno Egger
Hi Chris,

Thank you for pointing me in the right direction. The DLL's were also neatly camouflaged in a folder called Assemblies. Silly me, I kept looking for them in a folder called bBrowser.NET 4. Hint for the veterans: a few simple instructions can save a newbie many hours.

Thanks again,

Kuno

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 8:24 pm
by Chris
Hi Kuno,

You're welcome! Yeah, there's some time needed to get used to the new terminology and new concepts in .Net, I remember it had taken me quite some time to understand the difference between assemblies/references and namespaces... Btw, "Assembly" in .Net is a very common term and it refers to any .exe or .dll (using .Net) file

Newbie Question Installing Bbrowser

Posted: Mon Oct 05, 2020 8:38 pm
by Kuno Egger
Thanks Chris!

Kuno