Highlighted
Absent Member.
Absent Member.
3097 views

[archive] Window Size/Mouse cut/paste

[Migrated content. Thread originally posted on 23 November 2005]

We have a character based software package developed in Acucobol which is normally run on unix. We have one customer who is using it on a Novell network. Recently they upgraded thier Acucobol runtime from the Dos version to the Windows 32bit version.

Using the MsDos runtime you can change the font size of a window to make it possible to enlarge the window and get larger type. Using the Windows runtime you get a fixed window, and there is no way to make the window larger. You also seem to lose the ability to cut and paste text in the window with the mouse.

Does anyone know of any tricks around this, possibly somehow to force it into a DOS window? (I've tried running it from a bat file and changing the properties, but under windows XP you don't even get DOS properties for a bat file).

This seems like a pretty high price to pay to 'upgrade'.
Brad Hayes
0 Likes
11 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

Add a display window statement before you diplay anything to the screen. The properties of the display window statement will allow you to adjust sizing (Standard graphical window, control font, resizeable).

The MS DOS window is a rare application that automatically resizes and adjust fonts as you resize the window, you normally have to build this type of logic into your program. ACUCOBOL-GT provides a layout manager. This layout manager can reposition controls when the screen is resized, but you'll need to adjust the font if that is what you expect the application to do..
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

I may have misread your posting. ACUCOBOL-GT has a console runtime crun.exe for Windows (to run under the DOS or Command prompt window) in addtion to the Windows runtime wrun32.exe
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

Thanks for your input. I'm not sure about coding for the window size, I don't think I can do it without doing it graphically, which would mean I would have to do it custom for this customer.

I'll check into the console runtime, I have heard of it, but was told the natural replacement would be the windows version unless there is a particular need for it.

brad
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

This code will allow you to specify font size for a "console" window simulation with the win32 runtime.

Remember this has to be in your absolutely first program and before any IO to screen is made!


       WORKING-STORAGE SECTION.
           COPY "FONTS.DEF".
       77 MyFont USAGE FONT.
       ...
       PROCEDURE DIVISION.
       ...
      *BEFORE you do any DISPLAY / ACCEPT statement...
      *Play around with the font size until you get the one you want
           MOVE    12               TO WFONT-SIZE.
           MOVE    "Courier New"    TO WFONT-NAME.
           MOVE    1                TO WFONT-BOLD-STATE
           CALL    "W$FONT"         USING
                   WFONT-GET-CLOSEST-FONT
                   MyFont
                   WFONT-DATA.
           DISPLAY STANDARD         WINDOW
                   FONT             MyFont.



As for The clipboard, I am afraid there is no short cut. What you *could* do, is to make a HOTKEY program. in which you would simulate the behavior of the console window.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

I suspect there must be something 'windows' about the syntax. I attempted to add that to the initial login program just as a test but I'm getting a compile error on the USAGE FONT declaration.

I'm checking out the console runtime. That might be the way to go.

Brad
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

we use a variable for the font-size which every user can set in the environment. so everyone can set the windows size as he like it.



       working-storage section.
       01  groesse     pic 99.
       01  groesse-x   redefines groesse pic xx.

       77  font-handle handle of font.
       copy "fonts.def".
      **************************************************
       procedure division.
       main section.
           accept groesse-x from environment "schirm".

           initialize wfont-data.
           move "Courier New" to wfont-name.
           move groesse       to wfont-size.
           call "w$font" using wfont-get-closest-font,
                font-handle, wfont-data.

           display standard window font font-handle.

           accept omitted tab.

       main-ende.
           exit.
       main-e.
      **************************************************
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

I am sorry about my example here. I have obviously moved too fast 🙂

First of all, prior to the call to w$font, please initialize WFONT-DATA, like:
INITIALIZE WFONT-DATA.

Second, USAGE font should of course be USAGE HANDLE OF FONT.

My apologies.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

It works, it was just a syntax error! (I'm sure you had no doubt) 😉

I created a wrapper program to run before our application and it seems to work just great!

One more question, is it possible to fix the loss of the cut/paste mouse functions with this kind of wrapper program?

Brad
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

Sort of, but you would have to use a HOT KEY approach then. Take a look in the documentation and also the notepad.cbl in the sample folder of your AcuGT installation.

Of course, this only shows you how to create a program to pop up in the middle of anywhere. Then you will have to program the mouse/marking simulation and put that in the clipboard, of which all is possible.

I usually think in cases like this, that the user normally wants particiular data. Would you not be better of just to have a pushbutton and send the data directly instead of depending on mouse activity?
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

No, the pushbutton would make it a windows program.

We're currently not coding for any of this. I'm just trying to regain the functionality our users had with the MsDos runtime that they can no longer use since they've upgraded to the true windows runtime.

brad
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Window Size/Mouse cut/paste

I suppose cut'n paste from console windows is indeed very much a Windows feature, is it not? 🙂

Pushbuttons in ACU may be displayed in a console mode as well.

However, you may also assign it to a hotkey if you like. The hotkey would then work regardless of OS you are running.

Your call. The posibilities are there.
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.