Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Martin Vieregg

Pages: 1 ... 5 6 [7] 8 9 ... 19
91
Programming / Re: how to stay a window on top
« on: May 09, 2020, 06:33:57 pm »
Thank you Doodle for your post. But I wonder why a Dialog Window has the behaviour I would like to have. Dialog Windows always stay on top above the main program (standard) window. I thaught that all windows are internally the same for the operating system and only with different properties. So it seems that you cannot write a Dialog Window call with WinCreateWindow or WinCreateStandardWindow.

In WDsibyl, I have got a list of existing forms of an application in the main form. A form which changes the ZOrder to TOP should send a message to the main form of the application and the main form should send a message back to all other forms. If the other form has got the "StayOnTop" property set, it should get the ZOrder TOP again. This conecpt works without timer messages. I will report if I managed it.

Do you have an idea how to turn off the system wide WS_TOPMOST flag after it has been set?




92
Programming is not my main job, and I use WDsibyl Pascal environment and for my few small C projects the old Borland C IDE 2.0 and there was not the need of installing a current C compiler. The feedback with MeShell users show me that a main purpose of MeShell will be to have a better frontend for commandline compilers. I first did not had these users in the focus and now I realize that these programs often generate more stderr output than stdout. So I have to check this purpose myself to find bugs and to get a feeling about the usability of my program with this purpose.

Now I want to install a current C compiler. I assume that meanwhile GCC is the only option after Open Watcom has been abandoned and Borland C for a much longer time. Is Gnu C 8.30 here:
https://smedley.id.au/downloads/gcc-8.3.0-os2-20190324.zip

the right location at the moment? I want to install the "mainstream" compiler, not the newest version. I prefer an easy installation.

How do you work with a commandline compiler? Which source code editors do you use?

93
Quote
I wonder how it is turned off when piping the output or redirecting? It seems automatic.

Yes, in the gcc docu, you can read that the default setting is "automatic".

Now, I have thaught about the color problem. The correct color handling with ESC sequences in stderr is not programmed yet, only for stdout. In MeShell 0.61, I will implement user settings for two different foreground (text) default colors for stdout and stderr output. If you use such compilers where a lot of (colored) output is running via stderr, the red color is definitely not the first choice. I will implement both default colors in the ini file and program parameters and I will implement a mechanism where you can easy transfer the current color settings to a string for the program parameters.

Do you use batch files for executing your compilers and tools?
Another idea for useful MeShell functionality would be to define unique shortcut strings which are simply replaced when sending the prompt string to cmd.exe. It would simplify this work. This would be more handy in some cases than writing tiny batch files.

Compilers from Unix often use Unix EOL encoded output. This is supported since MeShell 0.60 and was defective/not supported before.

94
OK, an interesting hint. So in GCC, a MeShell user has to use
-fdiagnostics-color=always

But by default, the stderr output is shown in red color in MeShell. So I have to turn this functionlity off in these circumstances. A checkbox is an option, perhaps in the Top Panel for fast access. Or I implement another more intelligent mechanism (?). Any ideas are appreciated. Turning off the color when ESC sequences are coming could be too late because the output already began in red color. Perhaps I could correct the output in the editor if an ESC sequence comes through the stderr pipe. An automatic solution would be preffered.

95
Yes, that is a plausible explanation. I found a page where this setting is described for gcc:

https://reversed.top/2015-10-25/enable-colorization-of-gcc-output/

Another program with this behaviour seems to be qt5 git. So it seems to be common in current unix-ported tools.

I could collect these settings in the MeShell docu, chapter "Compatibility problems with existing programs". If anyone uses MeShell for these programs, it would be nice to get a collection of the correct parameters.

96
Programming / Re: how to stay a window on top
« on: May 07, 2020, 11:38:01 pm »
Doodle,

I'm sorry for the false alarm, but all the code you have posted is working, even the code

Code: [Select]
WinSetWindowBits(hwnd, QWL_STYLE, WS_TOPMOST, WS_TOPMOST);
It seems that I did not use the correct frame handle. And I have to put the window on top again after this call, and then it stays on top system wide.

But I did not manage to turn it off again.

And I still did not manage to float on top only between my program windows and windows of other programs can hide my top window. WS_TOPMOST is system wide. I want to implement both options in the WDsibyl library.

97
We already discussed the question how commandline programs with colored text output are working. Meanwhile, I got feedback that several programs like the gcc compiler and other programs coming from Unix do not show colored output in MeShell. So they do not use ESC sequences which run through the pipe without problems. But the VIO window rests empty - in comparison to Laurence which programmed a sample for me (see here) where the output is shown without colors in MeShell and simultaneously colored in the VIO window.

So it seems that there is a third way of showing colored text besides a VIO output to the screen buffer and ESC sequences via Stdout. Can someone explain please how this works? The linked thread contains an attachment with a colored tree.exe. It seems to be an old 16 bit application. It shows colored directory names in the original commandline window, MeShell shows the output without color and the MeShell VIO window rests empty. This behaviour seems to happen often with utilities coming from Unix like gcc.


98
Utilities / Re: MeShell commandline frontend timetable
« on: May 07, 2020, 03:47:39 pm »
And again, a new version of MeShell:

 MeShell 0.60

  • WPS integration (see docu main chapter)
  • System Menu entries like in original command line window
  • When saving output and command history (Settings notebook, Page Save), the current directies are stored and restored when restarting MeShell.
  • Unix Output now shown correct.
  • Again bugfixes.

The new chapter about WPS integration is short:

Quote
In the Top Panel, you find a folder icon. Clicking or pressing F5 opens the WPS folder which is current in the current prompt.

Reverse, you can drop a folder icon into the MeShell editor. There are two different behaviours: Dropping into the read-only area (old output) generates a "cd Foldername" and the folder directory gets the current directory in the commandline interpreter. Dropping into the area where you type a new command copies the full folder name as text into the edit area.

Double clicking to a filename executes the WPS default association, e.g. clicking to a text file name opens the associated editor. MeShell completes a file name by adding the full directory name from the last prompt in the old ouput, if the filename contains no backslash characters. This works for example with a "dir" command.

The normal drag and drop functionality of the editor is supported, nevertheless. But it is restricted to the area where you can edit behind the current prompt. Default is copying file content, Ctrl copies the file name without directory name and Ctrl-Shift the full file name.



99
Programming / Re: how to stay a window on top
« on: April 29, 2020, 11:00:01 pm »
Code: [Select]
#define WS_TOPMOST  0x00200000L

...
ulStyle = WS_VISIBLE | WS_TOPMOST;
hwndSaverWindow = WinCreateWindow(...ulStyle...)

Great, thank you Doodle. This code works. But it only works if I set the flag when creating the window, later with WinSetWindowBits it does not has an effect.

But now the window floats system wide. This is a very interesting and useful setting. I implement this lazarus-compatible in WDsibyl:
tForm.FormStyle = fsSystemStayOnTop

But I also want to implement the same, but only for a single application, so windows of other applications can hide my  "topmost" window:
tForm.FormStyle = fsStayOnTop

Is there also a flag or a way where I can achieve this?

100
Utilities / Re: MeShell commandline frontend timetable
« on: April 27, 2020, 09:30:52 am »
Pasting from clipboard fails in 0.55 if not a complete line with RETURN is copied. This is in 0.56 fixed: MeShell 0.56

101
Utilities / Re: MeShell commandline frontend timetable
« on: April 25, 2020, 03:34:41 pm »
I have again updated to a new version MeShell 0.55
There is no functionaltiy added. A handful bugs (also crashes) are fixed. Some specific stuff has not been programmed yet, e.g. copying several commands from the clipboard into MeShell.

102
Programming / Re: MeShell and PAUSE in a cmd file
« on: April 22, 2020, 07:20:39 pm »
Yes, I did it, but I tried to find something with "flush".... Thank you.
But anyway, exeuting DosResetBuffer in the helper app has no effect. I also tried to DosClose and DosOpen the named pipe. Also no effect. I really wonder how other command-line frontends do the job.

103
Programming / Re: MeShell and PAUSE in a cmd file
« on: April 22, 2020, 03:45:33 pm »
Now I am very close to a solution. Someone answered that I have to use fflush(). But fflush(mystream) is Standard C and requires a stream, not an OS/2 HFILE which is opened via DosOpen(). Is there a comparible call for OS/2 HFILE to flush the buffer ? The editor can detect the problem and the helper calls a flush call for stdout.

104
Programming / Re: MeShell and PAUSE in a cmd file
« on: April 22, 2020, 10:35:59 am »
I put the question to stackoverflow forum. Let's see what happens.

105
Programming / Re: MeShell and PAUSE in a cmd file
« on: April 21, 2020, 12:46:43 pm »
Still the stdout problem of a query: Meanwhile, I've tested what happens if the helper sends characters to MeShell. But it does not has an effect, I see the helper output immediately in MeShell, and the line which should be shown from the user program still does not appear.

I found out that in Windows 10 the new written commandline pauses 3 seconds before the query is shown. (e.g. "copy" a file to a destination where a file with the same name exists). So it seems the Windows programmers had to fight with the same problem and also made a "dirty hack" which I am looking for. "UNZIP" query (with the query via stderr) comes immediately.

P. S. The Windows 10 commandline has also limits: 32767 lines.

Pages: 1 ... 5 6 [7] 8 9 ... 19