B4J Question [ABMaterial] Editor how to anchor top & bottom in a cell

rwblinn

Well-Known Member
Licensed User
Longtime User
In progress, building the Look4How Viewer with ABMaterial 4.25.
The main page layout uses the navigation sidebar to list the items and a ABMEditor to show the item content. The grid has (only) 1 row and 1 cell which is used to show the editor.
B4X:
    page.AddRowsMV2(1,True,2,2,2,2,True,"").AddCellsOSMPV(1,0,0,0,12,12,12,2,2,2,2,True,"")

Question:
How to set the editor margins (better anchor), so that these fill the cell and stay fixed when
  • adding more text (the hor scrollbar should appear, the editor height should not exceed cell size and move over the fixed footer) or
  • change the screen size.
Tried several settings but these did not work.
B4X:
Dim Editor As ABMEditor
Editor.Initialize(page, "Editor", True, False, "")
'    page.Cell(RowNr,CellNr).PaddingBottom = 2
'    Editor.ForceMinimalInitialHeight = True
'    page.Cell(RowNr,CellNr).MarginLeft = 5
'    page.Cell(RowNr,CellNr).MarginRight = 5
'    page.Cell(RowNr,CellNr).MarginTop = 5
'    page.Cell(RowNr,CellNr).MarginBottom = 5   
'    page.Cell(RowNr,CellNr).SetFixedHeightFromBottom(10, True)
page.Cell(1,1).AddComponent(Editor)

In below screenshot, the editor is filling half the cell, instead of the full cell. When adding more text with CRLF the editor is expanding over the fixed footer.

upload_2018-5-15_11-32-13.png



In this screenshot the editor height is moving over the footer:
upload_2018-5-15_11-37-24.png
 

rwblinn

Well-Known Member
Licensed User
Longtime User
As an FYI
For the Look4HowViewer based on ABMaterial decided to pursue showing the content in an ABMLabel using richstrings = learned from the ABMaterial B4XHelp example, instead of the ABMEditor. Will post in the ABMaterial Feedback, some issues encountered with the ABMEditor.

Screenshot of the Look4HowViewer (in progress) based on ABMaterial.
upload_2018-5-18_10-15-1.png


The items title, category & memos, are shown in the navigation sidebar.
Clicking on an item loads the content, converts markup tags from a markup map (i.e. -={B}..{/B}, convert URLs, ...) and display the result in an ABMLabel.
Themes from a database are selected via ABMCombo (extracontent navigationbar).
A database is selected using the ABM InputBox.

Next developments:
  • search results in a non modal list dialog (not sure yet how to build),
  • copy selected or full content to the clipboard,
  • handle window resizing (noticed that the Select Theme Combo defined as navigationbar extra content disappears when shrinking the size of the screen), the same for the icons/text database and about,
  • display images instead of showing the URL (later stage)
  • ... CRUD items (a web version of Look4How, later stage)
Will post the first version here.
 

Attachments

  • upload_2018-5-18_9-41-22.png
    upload_2018-5-18_9-41-22.png
    32.5 KB · Views: 164
Last edited:
Upvote 0
Top