Static frame with tab control

Posted by Fuelfire on 15-Aug-2016 09:52

Hello everybody. I have the static frame with large number of fields (p-file). I would like to add a Tab control (Microsoft Control) to the frame to simplify it. I can create an inherited control, but I can not place it on a frame. Maybe someone will show an example? Is it real? Thank you.

DEFINE INPUT PARAMETER Type_    AS CHAR NO-UNDO.
{shr_glob.i " "    " "}
{f_font.i}
{glob_clr.i}

RUN VALUE(path_lib + "cursor.p")(1).

ASSIGN Filt_result[1]   = ""
                  Filt_result[2]   = ""
                  Filt_result[3]   = ""
                  Filt_result[4]   = ""
                  Filt_result[5]   = ""
                  Filt_result[6]   = ""
                  Filt_result[7]   = ""
                  Filt_result[8]   = ""
                  Filt_result[9]   = ""
                  Filt_result[10] = ""
                  Filt_result[11] = ""
                  Filt_result[12] = ""
                  Filt_result[13] = ""
                  Filt_result[14] = ""
                  Filt_result[15] = ""
                  Filt_result[16] = ""
                  Filt_result[17] = ""
                  Filt_result[18] = ""
                  Filt_result[19] = ""
                  Filt_result[20] = ""
                  Filt_result[21] = ""
                  Filt_result[22] = ""
                  Filt_result[23] = ""
                  Filt_result[24] = ""
                  Filt_result[25] = ""
                  Filt_result[26] = ""
                  Filt_result[27] = ""
                  Filt_result[28] = ""
                  Filt_result[29] = "".


DEFINE VARIABLE Reason_          AS RECID NO-UNDO.
DEFINE VARIABLE Cancel_            AS LOGICAL NO-UNDO. 
DEFINE VARIABLE RetValue          AS CHARACTER NO-UNDO.
DEFINE VARIABLE Frame-hndl      AS HANDLE NO-UNDO. 
DEFINE VARIABLE w-hndl                 AS HANDLE NO-UNDO. 
DEFINE VARIABLE RetVal                AS LOGICAL NO-UNDO. 

DEFINE VARIABLE SHandle            AS HANDLE NO-UNDO. 
    
DEFINE BUTTON Save-but AUTO-GO
     LABEL "Сохранить" 
     SIZE 14 BY 1. 
DEFINE BUTTON Cancel-but AUTO-END-KEY DEFAULT
     LABEL "Отказ" 
     SIZE 14 BY 1. 

/*****************************************************************************************************/    
DEFINE FRAME DIALOG-1    
    
    div_vars.file_directory                  AT ROW 1 COL 40 COLON-ALIGNED
    VIEW-AS FILL-IN
    SIZE 40 BY 0.8  
    TOOLTIP "Архивная директория  для экспорта файлов в Equation. (Не должна содержать русских букв.)"

    div_vars.file_directory_arch        AT ROW 1.8 COL 40 COLON-ALIGNED
    VIEW-AS FILL-IN
    SIZE 40 BY 0.8  
    TOOLTIP "Архивная директория для экспорта файлов в Equation. (Не должна содержать русских букв.)"

    div_vars.file_directory_from       AT ROW 2.6 COL 40 COLON-ALIGNED
    VIEW-AS FILL-IN
    SIZE 40 BY 0.8  
    TOOLTIP "Архивная директория  для импорта файлов из Equation. (Не должна содержать русских букв.)"

    div_vars.file_directory_from_arch   AT ROW 3.4 COL 40 COLON-ALIGNED
    VIEW-AS FILL-IN
    SIZE 40 BY 0.8  
    TOOLTIP "Архивная директория для импорта файлов из Equation. (Не должна содержать русских букв.)"

    div_vars.file_prefix                         AT ROW 4.2 COL 40 COLON-ALIGNED
    VIEW-AS FILL-IN
    SIZE 40 BY 0.8  

...


    Save-but             AT ROW  29 COL  28
    Cancel-but          AT ROW  29 COL 42                 
    
    WITH /* AT ROW 2.5 COL 1
              SIZE  80 BY 7  */
              VIEW-AS DIALOG-BOX 
              KEEP-TAB-ORDER 
              SIDE-LABELS 
              NO-UNDERLINE 
              THREE-D 
              SCROLLABLE 
              FONT {&frame-font}
              TITLE "Просмотр справочников".           

ASSIGN Frame-hndl                   = FRAME DIALOG-1:HANDLE
                 Frame-hndl:HIDDEN = True.

Frame-hndl:TITLE = "Настройка директорий экспорта/импорта файлов в Систему Расчетов".

/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
ON CHOOSE OF Cancel-but OR 
      WINDOW-CLOSE OF FRAME DIALOG-1 OR
      END-ERROR OF FRAME DIALOG-1 ANYWHERE
DO:   
       ASSIGN Cancel_    = True
                         RetValue  = "1".
END.
ON VALUE-CHANGED OF div_vars.eq_comm IN FRAME DIALOG-1
DO:
    IF div_vars.eq_comm:SCREEN-VALUE = "0"
    THEN ASSIGN div_vars.WSURL:VISIBLE = FALSE.
    ELSE ASSIGN div_vars.WSURL:VISIBLE = TRUE.
END.
ON GO OF FRAME DIALOG-1 ANYWHERE
DO: 
.......   

Posted by Brian K. Maher on 15-Aug-2016 10:08

Build a .w using the AppBuilder, drop the OCX on it then save the result.
 
Copy and paste the appropriate code form tyhe .w into your code ... or .. do this all the easy way and just build your windows in the AppBuilder.

All Replies

Posted by Brian K. Maher on 15-Aug-2016 10:08

Build a .w using the AppBuilder, drop the OCX on it then save the result.
 
Copy and paste the appropriate code form tyhe .w into your code ... or .. do this all the easy way and just build your windows in the AppBuilder.

Posted by Fuelfire on 18-Aug-2016 04:11

I refuse this idea - trying to add new control in existing .p with static frame. Following the advice of Brian, I decided to create the new form (.cls) and built it in DevStudio. Thanks.

Posted by Brian K. Maher on 18-Aug-2016 04:48

I’m glad that solved your issue.  Adding an ActiveX control to a window is more involved than most people think as we need to create/maintain the .wrx file which provides the details we need to load the control from the registry at runtime along with the development and runtime license keys (these keys may/may not be needed).

This thread is closed