Skip to Content
SAP Visual Business

HowTo change the default layout

Tags:

The layout of the detail window is defined by structure CL_VBC_MAP_OBJECT_DETAILS=>GTYPE_LAYOUT_DESCR. This structure is pre-filled with default values and can be read via public read-only attribute LAYOUT_SETTINGS of class CL_VBC_MAP_OBJECT_DETAILS.
The layout descriptor structure holds the following values (in pixels):

  • WINDOW_HEIGHT - total height of window,
  • WINDOW_WIDTH - total width of window,
  • COLUMN_WIDTH - width of a column (only important in two column mode),
  • COLUMN_MARGIN - Left margin between window and column,
  • COLUMN_SPACE - Space between left and right column (only important in two column mode),
  • TOP_OFFSET - Space between caption (and sub-caption) and columns,
  • BOTTOM_OFFSET - Space between column bottom and window bottom (space for toolbar),
  • LINE_HEIGHT - Height of lines in the columns.
  • TOOLBAR_TYPE - Control type for toolbar elements (can be set with method SET_TOOLBAR_ELEMENT_TYPE).

The default settings are as follows:


LAYOUT_SETTINGS-WINDOW_WIDTH = 300.
LAYOUT_SETTINGS-WINDOW_HEIGHT = 200.
LAYOUT_SETTINGS-COLUMN_WIDTH = 300.
LAYOUT_SETTINGS-TOP_OFFSET = 5.
LAYOUT_SETTINGS-BOTTOM_OFFSET = 86.
LAYOUT_SETTINGS-LINE_HEIGHT = 16.
LAYOUT_SETTINGS-TOOLBAR_TYPE = CO_LINE_TYPE_LINK.


Can can adapt the layout to your needs and set the new layout by calling


LV_DETAILS->SET_LAYOUT_SETTINGS( LS_LAYOUT ).


Consistency checks

If you change the default layout setting you may do the following consistency checks:

  • In one column layout WINDOW_WIDTH = COLUMN_MARGIN + COLUMN_WIDTH
  • In two column layout WINDOW_WIDTH = COLUMN_MARGIN + 2 * COLUMN_WIDTH + COLUMN_SPACE
  • WINDOW_HEIGHT > N_LINES * LINE_HEIGHT + BOTTOM_OFFSET

No comments