mirror of
https://github.com/EverythingWindows/ShiftOS-TheRevival-Old.git
synced 2025-01-22 18:02:16 +00:00
rough working DuWM
This commit is contained in:
parent
c5b2c3e370
commit
a043f16287
9 changed files with 82 additions and 14 deletions
|
@ -16,6 +16,7 @@ Module TerminalAPI
|
|||
If Strings.IsFree = True Then
|
||||
Strings.ComputerInfo(0) = "shiftos"
|
||||
Strings.ComputerInfo(1) = "user"
|
||||
Strings.ComputerInfo(7) = 1
|
||||
Terminal_CheckFeature()
|
||||
Terminal_PrintPrompt()
|
||||
Terminal_AssignPrompt()
|
||||
|
@ -276,15 +277,15 @@ Module TerminalAPI
|
|||
Undeveloped()
|
||||
Case "shutdown", "shut down"
|
||||
TerminateShiftOS()
|
||||
Case "startx"
|
||||
Case "startg"
|
||||
Undeveloped()
|
||||
StartX()
|
||||
StartG()
|
||||
Case "shiftertest"
|
||||
DuWM_SecondWindowSet(Shifter)
|
||||
Console.Close()
|
||||
DuWM_FirstWindowSet(Console)
|
||||
Case "stopx"
|
||||
StopX()
|
||||
Case "stopg"
|
||||
StopG()
|
||||
Undeveloped()
|
||||
Case "textpad"
|
||||
If Strings.AvailableFeature(17) = "1" Then
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Module Terminate
|
||||
Public Sub TerminateShiftOS()
|
||||
NewLine("Stopping the Window Manager...")
|
||||
StopX()
|
||||
StopG()
|
||||
Console_Full()
|
||||
If Strings.OnceInfo(6) = "story" Then
|
||||
NewLine("Saving game...")
|
||||
|
|
|
@ -42,8 +42,7 @@ Partial Class Desktop
|
|||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.BackColor = System.Drawing.Color.Red
|
||||
Me.BackgroundImage = Global.ShiftOS_TheRevival.My.Resources.Resources.MenuBanner1
|
||||
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(192, Byte), Integer), CType(CType(0, Byte), Integer))
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.Button1)
|
||||
Me.ForeColor = System.Drawing.Color.White
|
||||
|
|
|
@ -12,6 +12,5 @@
|
|||
|
||||
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
||||
'DuWM_FirstWindowSet(Console)
|
||||
DuWM_SingleWindowSet(Console)
|
||||
End Sub
|
||||
End Class
|
|
@ -1,19 +1,29 @@
|
|||
Module DesktopManager
|
||||
Public Sub StartX()
|
||||
Public Sub StartG()
|
||||
Desktop.Show()
|
||||
Desktop.FormBorderStyle = FormBorderStyle.None
|
||||
Desktop.WindowState = FormWindowState.Maximized
|
||||
Desktop.TopMost = False
|
||||
IsConsoleParent = False
|
||||
OnlyOne = True
|
||||
Console.Close()
|
||||
WindowManagerChoose()
|
||||
Cursor.Show()
|
||||
End Sub
|
||||
|
||||
Public Sub StopX()
|
||||
Desktop.Close()
|
||||
Public Sub StopG()
|
||||
DuWM_CurrentProcess = 0
|
||||
Strings.ProcessID(0) = 0
|
||||
Strings.ProcessID(1) = 0
|
||||
Cursor.Hide()
|
||||
Console_Full()
|
||||
IsConsoleParent = True
|
||||
Console.Show()
|
||||
Desktop.Close()
|
||||
End Sub
|
||||
|
||||
Public Sub WindowManagerChoose()
|
||||
Select Case Strings.ComputerInfo(7)
|
||||
Case 1
|
||||
DuWM_Initiate()
|
||||
End Select
|
||||
End Sub
|
||||
End Module
|
||||
|
|
|
@ -2,6 +2,14 @@
|
|||
Public OnlyOne As Boolean
|
||||
Public FirstWindow As Form
|
||||
Public SecondWindow As Form
|
||||
Public DuWM_CurrentProcess As Integer = 0
|
||||
|
||||
Public Sub DuWM_Initiate()
|
||||
Strings.ProcessID(0) = 0
|
||||
Strings.ProcessID(1) = 0
|
||||
'DuWM_SingleWindowSet(Console)
|
||||
DuWM_NewProcess(Console)
|
||||
End Sub
|
||||
|
||||
Public Sub DuWM_FirstWindowSet(WindowName As Form)
|
||||
WindowName.Show()
|
||||
|
@ -27,6 +35,38 @@
|
|||
WindowName.Width = Desktop.Width - 20
|
||||
WindowName.Location = New Point(10, 10)
|
||||
FirstWindow = WindowName
|
||||
Strings.ProcessID(0) = 1
|
||||
End Sub
|
||||
|
||||
Public Sub DuWM_NewProcess(ProcessName As Form)
|
||||
Dim NewWindow As New DuWM_WindowContainer
|
||||
DuWM_CurrentProcess = DuWM_CurrentProcess + 1
|
||||
NewWindow.ChildForm = ProcessName
|
||||
NewWindow.ChildForm.TopLevel = False
|
||||
NewWindow.ChildForm.FormBorderStyle = FormBorderStyle.None
|
||||
NewWindow.ChildForm.WindowState = FormWindowState.Normal
|
||||
NewWindow.ChildForm.Visible = False
|
||||
NewWindow.DuWM_ContainerPanel.Controls.Add(NewWindow.ChildForm)
|
||||
Select Case NewWindow.ChildForm.Visible
|
||||
Case False
|
||||
NewWindow.ChildForm.Visible = True
|
||||
Case Else
|
||||
NewWindow.ChildForm.Visible = False
|
||||
End Select
|
||||
If ProcessName Is Console Then
|
||||
Strings.ProcessID(0) = 1
|
||||
NewWindow.DuWM_PID = 0
|
||||
Else
|
||||
Strings.ProcessID(1) = 1
|
||||
NewWindow.DuWM_PID = 1
|
||||
End If
|
||||
NewWindow.Show()
|
||||
Select Case DuWM_CurrentProcess
|
||||
Case 1
|
||||
NewWindow.Height = Desktop.Height - 20
|
||||
NewWindow.Width = Desktop.Width - 20
|
||||
NewWindow.Location = New Point(10, 10)
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
'Public Sub DuWM_GenerateWindowSet(WindowName As Form, PID As Integer)
|
||||
|
|
|
@ -25,10 +25,12 @@ Partial Class DuWM_WindowContainer
|
|||
Me.components = New System.ComponentModel.Container()
|
||||
Me.DuWM_ContainerPanel = New System.Windows.Forms.Panel()
|
||||
Me.DuWM_WMCheck = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.DuWM_ChildSize = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'DuWM_ContainerPanel
|
||||
'
|
||||
Me.DuWM_ContainerPanel.BackColor = System.Drawing.Color.Transparent
|
||||
Me.DuWM_ContainerPanel.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.DuWM_ContainerPanel.Location = New System.Drawing.Point(0, 0)
|
||||
Me.DuWM_ContainerPanel.Name = "DuWM_ContainerPanel"
|
||||
|
@ -38,6 +40,9 @@ Partial Class DuWM_WindowContainer
|
|||
'DuWM_WMCheck
|
||||
'
|
||||
'
|
||||
'DuWM_ChildSize
|
||||
'
|
||||
'
|
||||
'DuWM_WindowContainer
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
|
@ -46,6 +51,7 @@ Partial Class DuWM_WindowContainer
|
|||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.DuWM_ContainerPanel)
|
||||
Me.ForeColor = System.Drawing.Color.Black
|
||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
|
||||
Me.Name = "DuWM_WindowContainer"
|
||||
Me.Text = "DuWM_WindowContainer"
|
||||
Me.ResumeLayout(False)
|
||||
|
@ -54,4 +60,5 @@ Partial Class DuWM_WindowContainer
|
|||
|
||||
Friend WithEvents DuWM_ContainerPanel As Panel
|
||||
Friend WithEvents DuWM_WMCheck As Timer
|
||||
Friend WithEvents DuWM_ChildSize As Timer
|
||||
End Class
|
||||
|
|
|
@ -120,4 +120,7 @@
|
|||
<metadata name="DuWM_WMCheck.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="DuWM_ChildSize.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>168, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -3,12 +3,21 @@
|
|||
Public DuWM_PID As Integer
|
||||
|
||||
Private Sub DuWM_WindowContainer_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
DuWM_WMCheck.Start()
|
||||
DuWM_ChildSize.Start()
|
||||
End Sub
|
||||
|
||||
Private Sub DuWM_WMCheck_Tick(sender As Object, e As EventArgs) Handles DuWM_WMCheck.Tick
|
||||
If ChildForm.Visible = False Then
|
||||
Strings.ProcessID(DuWM_PID) = 0
|
||||
Close()
|
||||
End If
|
||||
If Strings.ProcessID(DuWM_PID) = 0 Then
|
||||
Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ChildSize_Tick(sender As Object, e As EventArgs) Handles DuWM_ChildSize.Tick
|
||||
ChildForm.Size = DuWM_ContainerPanel.Size
|
||||
End Sub
|
||||
End Class
|
Loading…
Reference in a new issue