Let's develop OpenWinDOS

DOS specific questions.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

dodicat wrote: Sep 13, 2022 20:59 I get
42: Variable not declared, iActiveWindow in 'iActiveWindow = This.id'
But, as I say, I don't have dos here, maybe it is not an error fb fbdos.
So I created a shared integer iActiveWindow, and it seems OK here on windows fb.
iActiveWindow is already Shared and global at first line.
Do you use fbc 1.09 ?
If you don't put sleep 1,1 after flip you get a huge framerate while dragging, it might upset some cpu's.
if i remove sleep 1,1 from Loop i can't press ESC
Using a pointer is of course your choice, I would prefer just using an array of instances.
You can still create/delete or not show windows.
Your licence is huge, is it really necessary?
Your choice of course.
Anyway, good luck with your project.
The License is the GPL3 huge or not that it is.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Let's develop OpenWinDOS

Post by dodicat »

I must have failed to copy that line
Dim Shared iActiveWindow As Integer = 0
What I do is put both your files together and then run, rather than separate a .bi file.
My apologies.
Putting sleep 1,1 directly after flip works perfectly here, I can use escape.
It also gives the cpu that break after a graphics loop.
I measured with a framecounter

Code: Select all

Function framecounter() As Double
    Static As Double frame,fps
    frame=frame+1
    Static As Double t1,t2
    If frame>=fps Then
        t1 = Timer
        fps = frame/(t1-t2)
        t2=Timer
        frame=0
    End If
    Function=fps
End Function 
and just did
...
...-
Next
locate 25
print framecounter
Flip()
sleep 1,1
in the repaint sub.
I get a nice 64 fps here instead of > 1000 while dragging windows.
fb 1.09 here.
I was reading about GPL3, I never have done any sort of license on fb and I must have written hundred of thousands of lines of code here since 2006.
Most of it probably a load of cr*p, but never mind, you have your reasons I am sure.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

i tried the framecounter and in both cases for sleep 1, 1 i get 138fps
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

well as the program grows it became more heavy and slow in DOS...
i wonder how win3.11 was so light...
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

now windows are full operative..they can close, minimize, maximize, move and resize ... :!:
https://github.com/demosthenesk/OpenWinDOS
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: Let's develop OpenWinDOS

Post by dodicat »

Nice, Yes I have tried it BUT, believe it or not, I have to put sleep(1,1) after flip.
If I don't the program chokes up, very noticeable on a full screen window box.
Maybe that is where fb windows an fbdos differ.
Sorry I can't try DOS proper.
Good luck.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

dodicat wrote: Sep 15, 2022 11:25 Nice, Yes I have tried it BUT, believe it or not, I have to put sleep(1,1) after flip.
If I don't the program chokes up, very noticeable on a full screen window box.
Maybe that is where fb windows an fbdos differ.
Sorry I can't try DOS proper.
Good luck.
i have linux and i try it in DOSBOX-X.
For easiness i mount a linux folder as C and i copy paste the source there, also i have installed dos fbc
OK! I put sleep 1,1 after flip()
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

Well i did my tests!

Running the app in DOSBOX-X with CPU emulation max it is very slow
Running the app in VirtualBox with FreeDOS or MS-DOS it is ok because it uses a modern cpu from host system.
Running the app in native machine Linux it is very fast because it uses all cores of cpu of a modern system.
:idea:
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

dodicat wrote: Sep 15, 2022 11:25 Nice, Yes I have tried it BUT, believe it or not, I have to put sleep(1,1) after flip.
If I don't the program chokes up, very noticeable on a full screen window box.
Maybe that is where fb windows an fbdos differ.
Sorry I can't try DOS proper.
Good luck.
i created one For...Next Loop for all Window actions

Code: Select all

Sub DoEvents()
    For i As Integer = 1 To UBound(pWindows)    'doevents of every window
        If pWindows(i) = 0 Then Continue For    'skip deleted windows
        pWindows(i)->DoEvents
    Next
    
    WatchWindows()
    
'    CloseWindow()
'    ResizeWindow()
'    MoveWindow()
'    MinimizeWindow()
'    MaximizeWindow()
'    GetFocusWindow()
End Sub
before i run 6 For...Next for every window... Now only 2 (edited)
still is slow... for max cpu emulation Pentium III 866Mhz, 407000 cycles
well if set max cycles, dynamic core, Pentium is same fast as running on linux-laptop ubuntu 22.04
Dinosaur
Posts: 1478
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Re: Let's develop OpenWinDOS

Post by Dinosaur »

Hi All

As most here probably know I am using CGUI in DOS (in my very old machines, then Win7 in later and finally Linux for the last 10 years.

Even though I am very satisfied with CGUI and it's performance, I understand you would want to create a GUI for DOS.

I noticed nobody reported testing your attempts in a DOS machine.
So I got the program from Github and compiled it with fbc 1.07.1 32 bit for DOS.
Running it on a Fitlet that I have available for testing purposes.(64 Bit Quad Core running at 1Ghz)

The only problem I noticed was that when you move a Window, you have to click once to get focus before the Close window "X" will work.
There is no indication which window has the focus.(usually done by graying out the others)

Happy to do more testing when you get further along.

Regards
EDIT: If you keep Github up to date then I can be sure you have the latest changes there.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

Dinosaur wrote: Sep 17, 2022 0:48 Hi All

As most here probably know I am using CGUI in DOS (in my very old machines, then Win7 in later and finally Linux for the last 10 years.
I am interested for CGUI in DOS. Can you write a post how to install CGUI in DOS and an example of use it?
Here https://www.freebasic.net/wiki/ExtLibcgui says, supported platforms win32,linux
Thanks!
Even though I am very satisfied with CGUI and it's performance, I understand you would want to create a GUI for DOS.

I noticed nobody reported testing your attempts in a DOS machine.
So I got the program from Github and compiled it with fbc 1.07.1 32 bit for DOS.
Running it on a Fitlet that I have available for testing purposes.(64 Bit Quad Core running at 1Ghz)

The only problem I noticed was that when you move a Window, you have to click once to get focus before the Close window "X" will work.
There is no indication which window has the focus.(usually done by graying out the others)
Yes you are right, there is no indication for active window. This will be changed.
When you click Close(X) the window is getting focus and then closes.
The problem you face is that the click area for close X button is very tiny and needs to target X very closely
Happy to do more testing when you get further along.

Regards
EDIT: If you keep Github up to date then I can be sure you have the latest changes there.
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

well now active window has a color :idea:
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

Can anyone help to draw controls like buttons on windows...?
i need help....i am stack with buggy code.
https://drive.google.com/file/d/1BTYHPV ... p=drivesdk

Any help is welcomed !!!
demosthenesk
Posts: 237
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Let's develop OpenWinDOS

Post by demosthenesk »

demosthenesk wrote: Sep 19, 2022 20:08 Can anyone help to draw controls like buttons on windows...?
i need help....i am stack with buggy code.
https://drive.google.com/file/d/1BTYHPV ... p=drivesdk

Any help is welcomed !!!
Well i debug the code and i make it work.
https://drive.google.com/file/d/1J50gbl ... p=drivesdk
Post Reply