Highlighted
Absent Member.
Absent Member.
2971 views

[archive] MS Rich Textbox Control 6.0

[Migrated content. Thread originally posted on 16 May 2007]

Hello,

has anyone experience with the Richt Textbox Control?
I create an RTF-File and want to display and print it out in an Cobol-Program.

To Create the Display - i used atm:


       screen section.
       01  main-screen.
           03 rtf-1, @RichTextBox,
              line 4, col 2, lines 40, size 80, id is 1.


        ...

       procedure division.

       ....

           modify rtf-1 LoadFile ("c:\muffrohr\test.rtf", rtfRtf).


Ok, the control is displayed and shows my RTF-File.
Problem: I can't navigate/activate the Control to do anything in it - or it dosn't show any Scrollbars.

If i look in the docs about the Control - The Scrollbars are default set to @rtfBoth
and Enabled is set to true as default.

Do i anything wrong during creating the Control?



Next Problem - Printing 😄
I found in the .def File i created with the AXDEDFGEN - Utility @SelPrint

How do i use it?
the doc-file says:
Objekt.SelPrint(LHDC As Long [VStartDoc])

Is it then
modify rtf-1 SelPrint(?????, ?????)

Can anyone help?

David Neidinger
0 Likes
13 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

The scrollbars should appear automatically when needed.

SelPrint is just for selecting an area of text for printing. The control itself does print, but you have to glue this with cobol. I will post an example.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0


       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  GRIDCTL.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "RICH.DEF".
           .
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT PRINT-FILE
           ASSIGN TO PRINT "-P SPOOLER".
       DATA DIVISION.
       FILE SECTION.
       FD  PRINT-FILE.
       01  PRINT-REC.
           03 FILLER       PIC X(80).

       WORKING-STORAGE SECTION.
       77 H-ACU-SPOOLER-DC PIC 9(9) COMP-5 EXTERNAL.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 13.
       SCREEN      SECTION.
       01  RICH-SCREEN.
           03      EDIT-BOX         RICHTEXTBOX
                   LINE             02
                   COL              02
                   SIZE             78
                   LINES            10.
           03      PUSH-BUTTON
                   LINE             13
                   COL              61
                   SIZE             14
                   TITLE            "E&xit"
                   SELF-ACT
                   EXCEPTION-VALUE  = 13.
       PROCEDURE DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "RichTextBox & OLE Demo"
                   SIZE             80
                   LINES            15
                   BACKGROUND-LOW.
           DISPLAY RICH-SCREEN.
           MODIFY  EDIT-BOX         TEXT =
                   "Type your text here, or drag and drop..."
                   OLEDRAGMODE      = rtfOLEDragAutomatic
                   OLEDROPMODE      = rtfOLEDropAutomatic.
           ACCEPT  RICH-SCREEN.
           OPEN    OUTPUT     PRINT-FILE.
           WRITE   PRINT-REC        FROM "Combining COBOL and ActiveX".
           MODIFY  EDIT-BOX         SelPrint(H-ACU-SPOOLER-DC, 0).
           CLOSE   PRINT-FILE.
           STOP    RUN.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

tested it yesterday...
i created the Control smaller - 5 lines and Text was 20 lines
no scrollbars 😞



i use atm a temporary solution and start notepad from cobol and print over it.
i start: wordpad.exe c:\muffrohr\test.rtf
or to print directly: wordpad.exe -p c:\muffrohr\test.rtf

not fine but until i understand the ActiveX-Control the user can live with it 😄

David

Edit: ah thx, i will test the source
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

Ok, i tested it 🙂

work:
the control is enabled
print works

not work
Scrollbars 😞

I added code to inquire the ScrollBarConstants and i get rtfNone
when i modify the Constant i become an error-code Property is read-only

hummmm....


       IDENTIFICATION               DIVISION.
       PROGRAM-ID.                  test99.
       ENVIRONMENT                  DIVISION.
       CONFIGURATION                SECTION.
       SPECIAL-NAMES.
           COPY    "RTF.DEF".
           .
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT PRINT-FILE
           ASSIGN TO PRINT "-P SPOOLER".
       DATA DIVISION.
       FILE SECTION.
       FD  PRINT-FILE.
       01  PRINT-REC.
           03 FILLER       PIC X(80).

       WORKING-STORAGE SECTION.
       77 H-ACU-SPOOLER-DC PIC 9(9) COMP-5 EXTERNAL.
       77 W-Var-ScrollBarsConstants  pic s9(9) comp-5.
       77  KEY-STATUS               IS SPECIAL-NAMES
           CRT STATUS               PIC 9(4) VALUE 0.
           88  EXIT-PRESSED         VALUE 13.
       SCREEN      SECTION.
       01  RICH-SCREEN.
           03      EDIT-BOX         RICHTEXTBOX
                   LINE             02
                   COL              02
                   SIZE             78
                   LINES            10.
           03      PUSH-BUTTON
                   LINE             13
                   COL              61
                   SIZE             14
                   TITLE            "E&xit"
                   SELF-ACT
                   EXCEPTION-VALUE  = 13.
       PROCEDURE DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   TITLE            "RichTextBox & OLE Demo"
                   SIZE             80
                   LINES            15
                   BACKGROUND-LOW.
           DISPLAY RICH-SCREEN.
           modify  EDIT-BOX LoadFile ("c:\muffrohr\test.rtf", rtfRtf).
           [COLOR="Red"]inquire EDIT-BOX  @ScrollBars
                   in W-Var-ScrollBarsConstants.
           display message box W-VAR-ScrollBarsConstants.
           move    rtfBoth to W-Var-ScrollBarsConstants.
           modify  EDIT-BOX  @ScrollBars =  W-Var-ScrollBarsConstants.[/COLOR]           ACCEPT  RICH-SCREEN.
           OPEN    OUTPUT     PRINT-FILE.
           WRITE   PRINT-REC        FROM " ".
           MODIFY  EDIT-BOX         SelPrint(H-ACU-SPOOLER-DC, 0).
           CLOSE   PRINT-FILE.
           STOP    RUN.


David
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

Now I remember. scrollbars can only be set at designtime. You need to have the designtime license to do this.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

hmmm
I remembered the Articel from you
http://www.acucorp.com/company/newsletter/newsletter_pdf/newsletter_2004_3.pdf (Page 6)

i understand that this controlls are licenced with AcuCobol since 6.2 and i have full access to this ActiveX-Controls - mistake from my side 😄
i think i stay on the other solution and open Wordpad from my aplication.

David
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

I think when I've worked with this control before, I needed a resource file (created from AcuBench) to get design time settings. Once I had this file created, all else was good.

Rob
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

So how exactly is this print working?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

Is that a question to me? If so, can you please be a bit more precise with your question? I presume you have tried to run the example application?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

I think when I've worked with this control before, I needed a resource file (created from AcuBench) to get design time settings. Once I had this file created, all else was good.

Rob


we have no AcuBench 🙂
and i found in the AcuManual nothing about to create a resource-file 😞

David
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] MS Rich Textbox Control 6.0

To make a resource file, Acubench is required. However, you do not need Acubench, as you have yourself learned, it works. It is just that some properties and methods of a control may be design time only. These methods/properties they require the control to be instantiated with a design time license to work. This, we cannot provide you. If you have for instance Visual Studio 6.0 installed on your machine, and uses Acubench, Acubench will find and use the design time license and thus allow you to add bars. The state of the control is then stored in the resource file. When your combiled object later on load this state from the resource, using a runtime license, it will set the control in the state it was when the control was designed. Thus you will get your bars.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.