Skip to Content
avatar image
Former Member

Docking and splitter container

Hi,

I need to create 2 containers as per the attached document, that are resizeable in both x and y axis.

I have been able to do this, similar to in transaction DWDM, where I have 2 cl_gui_container's inside a customer container.

But this solution does not allow resizing in the vertical axis, as they are tied inside the "fixed" customer container.

Is there a way to create the docking and splitters that allow both axis resizing?

Thanks

Tony

shot.jpg (77.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 23, 2014 at 11:59 AM

    Hi Tony,

    of course you can create both types of containers (docking and Splitter).

    Here is an example to create a splitter container :

    Data declarations:

    DATA: lo_gui_container_head     TYPE REF TO cl_gui_container,

             lo_gui_container_costs    TYPE REF TO cl_gui_container,

             lo_gui_splitter_container TYPE REF TO cl_gui_splitter_container,

             lo_event_receiver         TYPE REF TO lcl_event_receiver,

             lo_event_receiver_head    TYPE REF TO lcl_event_receiver_head,

             lo_custom_container_head  TYPE REF TO cl_gui_custom_container.

    part from the source code :

    CREATE OBJECT lo_custom_container_head

           EXPORTING

             container_name = 'ALV_GRID'.

    *Create SPLITTER and SPLITTER panes

    * here we can define if splitters are horizontal or vertical:

         IF rb_hori IS INITIAL.

           lv_rows = 2.

           lv_columns = 1.

         ELSE.

           lv_rows = 1.

           lv_columns = 2.

         ENDIF.

    * create splitter:

         CREATE OBJECT lo_gui_splitter_container

           EXPORTING

             parent  = lo_custom_container_head

             rows    = lv_rows

             columns = lv_columns.

    * Splitter for Header

         CALL METHOD lo_gui_splitter_container->get_container

           EXPORTING

             row       = 1

             column    = 1

           RECEIVING

             container = lo_gui_container_head.

         CALL METHOD lo_gui_splitter_container->set_row_height

           EXPORTING

             id     = 1

             height = 20.

         IF sy-subrc <> 0.

    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

         ENDIF.

    * 2nd Spiltter for details:

         CALL METHOD lo_gui_splitter_container->get_container

           EXPORTING

             row       = lv_rows

             column    = lv_columns

           RECEIVING

             container = lo_gui_container_costs.

    * splitter for header

         CREATE OBJECT alv_head

           EXPORTING

             i_parent = lo_gui_container_head.

    * Objekt ALV grid mit splitter anlegen:

         CREATE OBJECT alv_grid

           EXPORTING

             i_parent = lo_gui_container_costs.


    * create handlers for both spitters :


    CREATE OBJECT lo_event_receiver_head.

         CREATE OBJECT lo_event_receiver.

         SET HANDLER lo_event_receiver->handle_hotspot_click            FOR alv_grid.

         SET HANDLER lo_event_receiver_head->handle_double_click        FOR alv_head.

         SET HANDLER lo_event_receiver_head->handle_toolbar             FOR alv_head.

         SET HANDLER lo_event_receiver_head->handle_before_user_command FOR alv_head.

         SET HANDLER lo_event_receiver_head->handle_hotspot_click_head  FOR alv_head.

    * display both tables in the spitters:

    CALL METHOD alv_head->set_table_for_first_display

           EXPORTING

             is_layout            = ls_layout

             it_toolbar_excluding = lt_toolbar_excluding[]

             i_default            = lv_default

             i_save               = lv_save

             is_variant           = ls_disvarhead

           CHANGING

             it_outtab            = gt_head[]

             it_fieldcatalog      = gt_cathead.

         CALL METHOD alv_grid->set_table_for_first_display

           EXPORTING

             is_layout            = ls_layout

             is_variant           = ls_disvariant

             i_default            = lv_default

             i_save               = lv_save

             it_toolbar_excluding = lt_toolbar_excluding[]

           CHANGING

             it_outtab            = gt_details[]

             it_fieldcatalog      = gt_fieldcatalog[]

             it_filter            = gt_filter[].



    Hope this helps

    Regards

    Fred


    Add comment
    10|10000 characters needed characters exceeded