Android Tutorial B4A, B4i, B4J and B4r API documentation - B4X Object Browser

Discussion in 'Tutorials & Examples' started by Vader, Jan 26, 2013.

  1. Roger Garstang

    Roger Garstang Well-Known Member Licensed User

    Nice. Something like this should be a part of B4A. All the files are there, it would only make sense to make use of them. It is even useful for those of us developing libraries to see full return types and our own documentation.

    Just a Couple Suggestions:
    1. XML always takes a while to parse. The Yellow Loading thing/label drawing over the controls just looks weird. I think I've only seen that in old Windows 3.x and JAVA apps. Adding a Status bar with a Progress Bar in it would look really sharp. I mostly do Win Mobile in C# lately and prefer straight code without .Net in my Desktop apps, so I can't remember if .Net has a built-in Progress Bar you can add to a Status Bar. If not you can just put the progress bar on the form or in other IDEs I just set the parent of the progress bar to the status bar then size it to match the panel size and it works well. I do remember .Net is strict on making you delegate something as simple as a progress update and won't let you update it from the GUI thread which got annoying too.

    2. Lots of flicker when the Treeview is updating. Might be a good idea to call BeginUpdate on it, load it, then call EndUpdate to make it smoother.
  2. Vader

    Vader Well-Known Member Licensed User

    1. Fixed
    Statusbar added
    I am also investigating having an additional Option to allow loading of XML data either at the beginning, or upon clicking the Namespace/File. This will speed up loading immensely (but spread the wait time out over the user's runtime session).

    2. Fixed
    Apparently there is a bug in .Net that stops BeginUpdate and EndUpdate from working properly - the Treeview never redraws. I however fixed it by creating a new BufferedTreeView that has Double Buffering enabled. Not my code, but works brilliantly.
  3. Vader

    Vader Well-Known Member Licensed User

    Version Added to first post.

    Renamed to B4A Object Browser
    Multiple paths can now be specified
    Statusbar added (progress and text) to show what load action is being performed
    Option added to allow loading of Libraries upon demand (ie when you click it), and set to default
    When choosing a file, the treeview expands that file's details automatically

    Treeview flickering is now much improved or removed
    When viewing Properties with Don't show empty parentheses selected, an empty bracket was shown in the usage.

    Known issues:
    Unicode text still not displaying correctly
    HTML codes not handled (eg <U>Text</U> is not displayed as Text)
  4. corwin42

    corwin42 Expert Licensed User

    Great tool.

    Just some comments:

    - If a method has the BA object as the first parameter you should hide it. It is hidden in the IDE, too.

    - There is a bit more documentation in the XML. If the library is selected on the left can you display the library documentation and if a class is selected and not a member can you display the object documentation?
  5. Vader

    Vader Well-Known Member Licensed User

    Please provide an example of each and I will ensure I cater for it in the next version (which will be soon).
  6. Vader

    Vader Well-Known Member Licensed User

    I see one... Core.Button.Initialize
  7. corwin42

    corwin42 Expert Licensed User

    You can see the BA parameter in AHQuickAction library in AHQuickAction.Initialize method.

    I think nearly all standard B4A libraries have a library documentation and an class/object documentation.
  8. Informatix

    Informatix Expert Licensed User

    The documentation of each method/property is an HTML text, so they may contain tags <></> and special chars like &amp; or &quote;. I admit it's not very common but if you want to create a perfect tool...
  9. Vader

    Vader Well-Known Member Licensed User

    Thanks guys. Rest assured I am working on implementing your suggestions.

    I have already fixed the following:
    Class comments not displayed
    Property Read or ReadWrite was not shown (I had to work out that it depends on the number of parameters)
    Property Return type was not shown
    Class Object Wrapper value was not shown
    Additional option added to not display BA object if it is the first parameter of a Method

    I have also implemented a create documentation feature where you can get the tool to create RTF documentation for the selected scope (Library/Class/Method/All)
    As an example, the complete B4A documentation set is around 1129 A4 pages, and took about 10 minutes for the tool to create it.

    This is actually the real reason why I have taken the time to create this tool - I was being selfish and needed documentation ;).

    And more...

    Watch this space.
  10. Vader

    Vader Well-Known Member Licensed User

    I can't find any XML file that has documentation at the Library level. Class yes, Library no.

    Do you have one for me?
  11. Vader

    Vader Well-Known Member Licensed User

    Updated to

    Toolbar buttons for all menu items
    Extra toolbar buttons for:
    • B4A documentation link (link is specified in Options)
    • Forum landing page
    • Android Packages landing page
    Any selected node in Classes and methods/Properties/Fields list can be searched (Right-click menu) - opens in Google search window
    Properties now specified as ReadWrite or ReadOnly
    Properties now have Return Type listed
    Classes have Wrapper shown
    Classes have Comment shown
    Standardised detail output to my upcoming documentation style (eg "Usage" becomes "Syntax")
    Treeview details are sorted before being written to Treeview (allows documentation to be sorted properly)
    Copy and Copy RTF (for details pane) right-click options
    Control of Full or short typename display across whole application is controlled by option
    Added option to hide BA Object if it is the first parameter in a method (this is the default value)

    Known issues:
    Unicode and HTML codes as per previous versions
    Re-setting of options required as per previous versions

    Link in Post 1.
    Last edited: Jan 30, 2013
  12. Roger Garstang

    Roger Garstang Well-Known Member Licensed User

    Love the new Copy and RTF options. Good idea on just loading the root elements in the tree too and just loading as needed. There is still some pretty good flicker though...especially on large trees like Core, Phone, or Dialog. It appears to be redrawing/rebuilding the entire tree for each element added instead of just adding the elements to that child node.

    So, on the progress bar, did you use the repeating one to not have to update it with all the delegating and such, or was there no way of know how far along the processing of the XML was? I never did get why Microsoft even added that style as it doesn't do much more than setting the mouse pointer to a wait cursor does. Without actually showing progress it is only slowing things down by needing to draw. Updating progress bars with a status will slow things down too once available. Usually I have a variable storing the current percentage and only update it when changed (Sometimes only on Even Percents too) since each redraw of it will add delay.
  13. Informatix

    Informatix Expert Licensed User

    On my slow PC at work, this flickering is going to kill my eyes. ;)
  14. Roger Garstang

    Roger Garstang Well-Known Member Licensed User

    It isn't that I don't like the tool or it is stopping me from using it or anything. The tool is great. I'm just giving feedback. .NET likes to impose a lot of limitations and has issues of its own, so is most likely a big part of the cause. My Trees in Win Mobile draw fine, so it could be a desktop thing too...who knows. Most of my desktop applications I make with PowerBASIC and FireFly. There are a lot of redraw and child clipping flags you have to use to really get things flicker free that .NET may not expose (ex. resize the window and the tree flickers too)...I don't get this in applications I make with PowerBASIC. You gain other things in Visual Studio like Anchors, Min/Max Window Size, Scaling, etc that you have to make yourself in lower level languages though too, so it is a trade-off.
  15. Vader

    Vader Well-Known Member Licensed User

    Thanks for the additional feedback guys. I have updated the first post with a couple of extra things to try and fix the flickering. I haven't upped the version number so you won't have to re-do the config.

    Let me know how that improves things (if at all).

  16. Vader

    Vader Well-Known Member Licensed User

  17. derez

    derez Expert Licensed User

    Good job, Vader. I started to use it and I like it very much :sign0188:

    I see that when I try to open a library which is made by converting a b4a class to a library I get an error.
    I attach an example of such library.

    Attached Files:

    Last edited: Jan 31, 2013
  18. Vader

    Vader Well-Known Member Licensed User

    The error you have reported is due to the following:
    Method _asview has no comment
    Method _class_globals has no comment
    Method _frame_color has no comment
    Method _line_color has no comment
    Method _set_button_font_size has no comment
    I have made changes so that problems such as this do not cause the tool to crash. This will be uploaded tonight (ie in the next few hours).

    Edit: I also see a few other things:
    Your Library (ie, not class) has a "DependsOn" node. I do not handle this, and so will have to write that in also.
    The names of your Methods have an Attribute called "DesignerName" (yes, Attribute, not value), which I will also have to handle.

    Thanks for reporting it.

    Edit: Is there a reference for these files that I can review to ensure I support all values and attributes?

    Last edited: Jan 31, 2013
  19. Informatix

    Informatix Expert Licensed User

  20. Vader

    Vader Well-Known Member Licensed User

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice