diff --git a/shiftos_next.v12.suo b/shiftos_next.v12.suo index 85df75b..889f93b 100644 Binary files a/shiftos_next.v12.suo and b/shiftos_next.v12.suo differ diff --git a/shiftos_next/APIs/Skins.vb b/shiftos_next/APIs/Skins.vb index 7b87a5c..b381690 100644 --- a/shiftos_next/APIs/Skins.vb +++ b/shiftos_next/APIs/Skins.vb @@ -47,6 +47,23 @@ BasicWM.Desktop.Redraw() End Sub + 'Copy skin file to save data + + Public Sub loadskin(file As String) + If IO.Directory.Exists(bwmskin) Then + IO.Directory.Delete(bwmskin, True) + IO.Directory.CreateDirectory(bwmskin) + IO.File.Copy(file, bwmskin + "data.bsk") + loadskindata() + End If + End Sub + + 'Copy skin from save data to file + + Public Sub saveskin(file As String) + Dim savelines() As String = IO.File.ReadAllLines(bwmskin + "data.bsk") + IO.File.WriteAllLines(file, savelines) + End Sub #End Region diff --git a/shiftos_next/BWM and CMD Apps/SkinLoader.Designer.vb b/shiftos_next/BWM and CMD Apps/SkinLoader.Designer.vb new file mode 100644 index 0000000..fb3a6df --- /dev/null +++ b/shiftos_next/BWM and CMD Apps/SkinLoader.Designer.vb @@ -0,0 +1,170 @@ + _ +Partial Class SkinLoader + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.Titlebar = New shiftos_next.Titlebar() + Me.Label1 = New System.Windows.Forms.Label() + Me.pnlwindowpreview = New System.Windows.Forms.Panel() + Me.prev_titlebar = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.prev_desktop = New System.Windows.Forms.Panel() + Me.prev_newterminal = New System.Windows.Forms.Button() + Me.btnapply = New System.Windows.Forms.Button() + Me.btnload = New System.Windows.Forms.Button() + Me.btnsave = New System.Windows.Forms.Button() + Me.pnlwindowpreview.SuspendLayout() + Me.prev_desktop.SuspendLayout() + Me.SuspendLayout() + ' + 'Titlebar + ' + Me.Titlebar.AppName = "Skin Loader" + Me.Titlebar.Dock = System.Windows.Forms.DockStyle.Top + Me.Titlebar.Font = New System.Drawing.Font("Courier New", 8.25!) + Me.Titlebar.ForeColor = System.Drawing.Color.White + Me.Titlebar.Location = New System.Drawing.Point(0, 0) + Me.Titlebar.Name = "Titlebar" + Me.Titlebar.Size = New System.Drawing.Size(458, 32) + Me.Titlebar.TabIndex = 0 + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Location = New System.Drawing.Point(12, 53) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(119, 14) + Me.Label1.TabIndex = 1 + Me.Label1.Text = "Preview (Window)" + ' + 'pnlwindowpreview + ' + Me.pnlwindowpreview.Controls.Add(Me.prev_titlebar) + Me.pnlwindowpreview.Location = New System.Drawing.Point(15, 84) + Me.pnlwindowpreview.Name = "pnlwindowpreview" + Me.pnlwindowpreview.Size = New System.Drawing.Size(431, 127) + Me.pnlwindowpreview.TabIndex = 2 + ' + 'prev_titlebar + ' + Me.prev_titlebar.BackColor = System.Drawing.Color.Gray + Me.prev_titlebar.Dock = System.Windows.Forms.DockStyle.Top + Me.prev_titlebar.Location = New System.Drawing.Point(0, 0) + Me.prev_titlebar.Name = "prev_titlebar" + Me.prev_titlebar.Size = New System.Drawing.Size(431, 30) + Me.prev_titlebar.TabIndex = 0 + Me.prev_titlebar.Text = "Application" + Me.prev_titlebar.TextAlign = System.Drawing.ContentAlignment.MiddleLeft + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Location = New System.Drawing.Point(15, 227) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(126, 14) + Me.Label2.TabIndex = 3 + Me.Label2.Text = "Preview (Desktop)" + ' + 'prev_desktop + ' + Me.prev_desktop.Controls.Add(Me.prev_newterminal) + Me.prev_desktop.Location = New System.Drawing.Point(15, 244) + Me.prev_desktop.Name = "prev_desktop" + Me.prev_desktop.Size = New System.Drawing.Size(431, 161) + Me.prev_desktop.TabIndex = 4 + ' + 'prev_newterminal + ' + Me.prev_newterminal.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.prev_newterminal.Location = New System.Drawing.Point(17, 13) + Me.prev_newterminal.Name = "prev_newterminal" + Me.prev_newterminal.Size = New System.Drawing.Size(109, 23) + Me.prev_newterminal.TabIndex = 0 + Me.prev_newterminal.Text = "New Terminal" + Me.prev_newterminal.UseVisualStyleBackColor = True + ' + 'btnapply + ' + Me.btnapply.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnapply.Location = New System.Drawing.Point(338, 417) + Me.btnapply.Name = "btnapply" + Me.btnapply.Size = New System.Drawing.Size(108, 23) + Me.btnapply.TabIndex = 5 + Me.btnapply.Text = "Apply Skin" + Me.btnapply.UseVisualStyleBackColor = True + ' + 'btnload + ' + Me.btnload.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnload.Location = New System.Drawing.Point(207, 417) + Me.btnload.Name = "btnload" + Me.btnload.Size = New System.Drawing.Size(125, 23) + Me.btnload.TabIndex = 6 + Me.btnload.Text = "Load from File" + Me.btnload.UseVisualStyleBackColor = True + ' + 'btnsave + ' + Me.btnsave.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnsave.Location = New System.Drawing.Point(93, 417) + Me.btnsave.Name = "btnsave" + Me.btnsave.Size = New System.Drawing.Size(108, 23) + Me.btnsave.TabIndex = 7 + Me.btnsave.Text = "Save to File" + Me.btnsave.UseVisualStyleBackColor = True + ' + 'SkinLoader + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(7.0!, 14.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.Black + Me.ClientSize = New System.Drawing.Size(458, 452) + Me.Controls.Add(Me.btnsave) + Me.Controls.Add(Me.btnload) + Me.Controls.Add(Me.btnapply) + Me.Controls.Add(Me.prev_desktop) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.pnlwindowpreview) + Me.Controls.Add(Me.Label1) + Me.Controls.Add(Me.Titlebar) + Me.Font = New System.Drawing.Font("Courier New", 8.25!) + Me.ForeColor = System.Drawing.Color.White + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None + Me.Name = "SkinLoader" + Me.Text = "SkinLoader" + Me.pnlwindowpreview.ResumeLayout(False) + Me.prev_desktop.ResumeLayout(False) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents Titlebar As shiftos_next.Titlebar + Friend WithEvents Label1 As System.Windows.Forms.Label + Friend WithEvents pnlwindowpreview As System.Windows.Forms.Panel + Friend WithEvents prev_titlebar As System.Windows.Forms.Label + Friend WithEvents Label2 As System.Windows.Forms.Label + Friend WithEvents prev_desktop As System.Windows.Forms.Panel + Friend WithEvents prev_newterminal As System.Windows.Forms.Button + Friend WithEvents btnapply As System.Windows.Forms.Button + Friend WithEvents btnload As System.Windows.Forms.Button + Friend WithEvents btnsave As System.Windows.Forms.Button +End Class diff --git a/shiftos_next/BWM and CMD Apps/SkinLoader.resx b/shiftos_next/BWM and CMD Apps/SkinLoader.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/shiftos_next/BWM and CMD Apps/SkinLoader.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/shiftos_next/BWM and CMD Apps/SkinLoader.vb b/shiftos_next/BWM and CMD Apps/SkinLoader.vb new file mode 100644 index 0000000..dd0003f --- /dev/null +++ b/shiftos_next/BWM and CMD Apps/SkinLoader.vb @@ -0,0 +1,39 @@ +Public Class SkinLoader + + Public skintoload As String + + Public Sub readfile(file As String) + Dim filinf As New IO.FileInfo(file) + If filinf.Extension = ".bsk" Then + Dim loadlines() As String = IO.File.ReadAllLines(file) + prev_titlebar.BackColor = Color.FromArgb(loadlines(0)) + prev_titlebar.ForeColor = Color.FromArgb(loadlines(1)) + prev_desktop.BackColor = Color.FromArgb(loadlines(2)) + prev_newterminal.BackColor = Color.FromArgb(loadlines(3)) + prev_newterminal.ForeColor = Color.FromArgb(loadlines(4)) + Else + basicwm_infobox.showinfo("Unsupported file", "The skin file provided cannot be read.") + End If + + End Sub + + Private Sub btnload_Click(sender As Object, e As EventArgs) Handles btnload.Click + file_skimmer.mode = "open" + file_skimmer.application = "skin_loader" + file_skimmer.Show() + End Sub + + Private Sub btnapply_Click(sender As Object, e As EventArgs) Handles btnapply.Click + If Not skintoload = "" Then + loadskin(skintoload) + Else + basicwm_infobox.showinfo("Can't apply skin!", "Cannot apply the skin, as there is currently no skin file loaded.") + End If + End Sub + + Private Sub btnsave_Click(sender As Object, e As EventArgs) Handles btnsave.Click + file_skimmer.mode = "save" + file_skimmer.application = "skin_loader" + file_skimmer.Show() + End Sub +End Class \ No newline at end of file diff --git a/shiftos_next/BWM and CMD Apps/file skimmer.Designer.vb b/shiftos_next/BWM and CMD Apps/file skimmer.Designer.vb index 4d2aabd..337f346 100644 --- a/shiftos_next/BWM and CMD Apps/file skimmer.Designer.vb +++ b/shiftos_next/BWM and CMD Apps/file skimmer.Designer.vb @@ -46,6 +46,7 @@ Partial Class file_skimmer Me.Label1 = New System.Windows.Forms.Label() Me.btnsave = New System.Windows.Forms.Button() Me.pnltop = New shiftos_next.Titlebar() + Me.lbextension = New System.Windows.Forms.Label() Me.topmenu.SuspendLayout() Me.tools.SuspendLayout() Me.pnlsave.SuspendLayout() @@ -176,6 +177,7 @@ Partial Class file_skimmer ' 'pnlsave ' + Me.pnlsave.Controls.Add(Me.lbextension) Me.pnlsave.Controls.Add(Me.txtfilename) Me.pnlsave.Controls.Add(Me.Label1) Me.pnlsave.Controls.Add(Me.btnsave) @@ -191,7 +193,7 @@ Partial Class file_skimmer Me.txtfilename.ForeColor = System.Drawing.Color.White Me.txtfilename.Location = New System.Drawing.Point(86, 5) Me.txtfilename.Name = "txtfilename" - Me.txtfilename.Size = New System.Drawing.Size(421, 20) + Me.txtfilename.Size = New System.Drawing.Size(376, 20) Me.txtfilename.TabIndex = 2 ' 'Label1 @@ -225,6 +227,15 @@ Partial Class file_skimmer Me.pnltop.Size = New System.Drawing.Size(591, 32) Me.pnltop.TabIndex = 5 ' + 'lbextension + ' + Me.lbextension.AutoSize = True + Me.lbextension.Location = New System.Drawing.Point(468, 8) + Me.lbextension.Name = "lbextension" + Me.lbextension.Size = New System.Drawing.Size(35, 14) + Me.lbextension.TabIndex = 3 + Me.lbextension.Text = ".xxx" + ' 'file_skimmer ' Me.AcceptButton = Me.btnsave @@ -277,4 +288,5 @@ Partial Class file_skimmer Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents btnsave As System.Windows.Forms.Button Friend WithEvents pnltop As shiftos_next.Titlebar + Friend WithEvents lbextension As System.Windows.Forms.Label End Class diff --git a/shiftos_next/BWM and CMD Apps/file skimmer.vb b/shiftos_next/BWM and CMD Apps/file skimmer.vb index 4b2d9b1..cf10447 100644 --- a/shiftos_next/BWM and CMD Apps/file skimmer.vb +++ b/shiftos_next/BWM and CMD Apps/file skimmer.vb @@ -63,6 +63,8 @@ FileType = "Data File" Case ".dri" FileType = "Driver" + Case ".bsk" + FileType = "Basic WM Skin" Case Else FileType = "Unknown File" End Select @@ -76,8 +78,21 @@ Else Dim filinf As New IO.FileInfo(file) Select Case filinf.Extension + Case ".txt" + If boughttextpad = True Then + Dim sr As New IO.StreamReader(file) + TextPad.txtfilebody.Text = sr.ReadToEnd() + sr.Close() + TextPad.Show() + Else + basicwm_infobox.showinfo("File can't be opened.", "The file """ & filinf.Name & """ can't be opened because a program able to open it has not been found.") + End If + Case ".bsk" + SkinLoader.readfile(file) + SkinLoader.skintoload = file + SkinLoader.Show() Case Else - basicwm_infobox.showinfo("Exodus - File Format not valid", "The format of the file """ & filinf.Name & """ is not a format in which Exodus File Browser can read.") + basicwm_infobox.showinfo("File can't be opened.", "The file """ & filinf.Name & """ can't be opened because a program able to open it has not been found.") End Select End If End Sub @@ -90,11 +105,18 @@ End If Else If mode = "open" Then - Select Case Application + Dim filinf As New IO.FileInfo(lvfiles.SelectedItems(0).Tag) + Select Case application Case "textpad" - Dim sr As New IO.StreamReader(lvfiles.SelectedItems(0).Tag.ToString) - TextPad.txtfilebody.Text = sr.ReadToEnd() - sr.Close() + If filinf.Extension = ".txt" Then + Dim sr As New IO.StreamReader(lvfiles.SelectedItems(0).Tag.ToString) + TextPad.txtfilebody.Text = sr.ReadToEnd() + sr.Close() + Me.Close() + End If + Case "skin_loader" + SkinLoader.readfile(lvfiles.SelectedItems(0).Tag.ToString) + SkinLoader.skintoload = lvfiles.SelectedItems(0).Tag.ToString Me.Close() End Select Else @@ -120,6 +142,12 @@ btndelete.Visible = boughtfileskimmerdelete If mode = "save" Then pnlsave.Visible = True + Select Case application + Case "textpad" + lbextension.Text = ".txt" + Case "skin_loader" + lbextension.Text = ".bsk" + End Select Else pnlsave.Visible = False End If @@ -165,10 +193,12 @@ Else Select Case Application Case "textpad" - Dim sw As New IO.StreamWriter(currentdir + "\" + txtfilename.Text) + Dim sw As New IO.StreamWriter(currentdir + "\" + txtfilename.Text + ".txt") sw.Write(TextPad.txtfilebody.Text) sw.Close() Me.Close() + Case "skin_loader" + saveskin(currentdir + "\" + txtfilename.Text + ".bsk") End Select End If Else diff --git a/shiftos_next/bin/Debug/ShiftOS Next - 0.0.1 Alpha 3.exe b/shiftos_next/bin/Debug/ShiftOS Next - 0.0.1 Alpha 3.exe new file mode 100644 index 0000000..8139db3 Binary files /dev/null and b/shiftos_next/bin/Debug/ShiftOS Next - 0.0.1 Alpha 3.exe differ diff --git a/shiftos_next/bin/Debug/shiftos_next.exe b/shiftos_next/bin/Debug/shiftos_next.exe index 8139db3..de34cd6 100644 Binary files a/shiftos_next/bin/Debug/shiftos_next.exe and b/shiftos_next/bin/Debug/shiftos_next.exe differ diff --git a/shiftos_next/bin/Debug/shiftos_next.pdb b/shiftos_next/bin/Debug/shiftos_next.pdb index 177c865..c2a0139 100644 Binary files a/shiftos_next/bin/Debug/shiftos_next.pdb and b/shiftos_next/bin/Debug/shiftos_next.pdb differ diff --git a/shiftos_next/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/shiftos_next/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 79049e5..3f4a582 100644 Binary files a/shiftos_next/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/shiftos_next/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/shiftos_next/obj/Debug/shiftos_next.SkinLoader.resources b/shiftos_next/obj/Debug/shiftos_next.SkinLoader.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/shiftos_next/obj/Debug/shiftos_next.SkinLoader.resources differ diff --git a/shiftos_next/obj/Debug/shiftos_next.exe b/shiftos_next/obj/Debug/shiftos_next.exe index 8139db3..de34cd6 100644 Binary files a/shiftos_next/obj/Debug/shiftos_next.exe and b/shiftos_next/obj/Debug/shiftos_next.exe differ diff --git a/shiftos_next/obj/Debug/shiftos_next.pdb b/shiftos_next/obj/Debug/shiftos_next.pdb index 177c865..c2a0139 100644 Binary files a/shiftos_next/obj/Debug/shiftos_next.pdb and b/shiftos_next/obj/Debug/shiftos_next.pdb differ diff --git a/shiftos_next/obj/Debug/shiftos_next.vbproj.FileListAbsolute.txt b/shiftos_next/obj/Debug/shiftos_next.vbproj.FileListAbsolute.txt index 0841ad8..1167a87 100644 --- a/shiftos_next/obj/Debug/shiftos_next.vbproj.FileListAbsolute.txt +++ b/shiftos_next/obj/Debug/shiftos_next.vbproj.FileListAbsolute.txt @@ -45,3 +45,4 @@ C:\Users\Michael\Documents\GitHub\shiftos-next\shiftos_next\bin\Debug\shiftos_ne C:\Users\Michael\Documents\GitHub\shiftos-next\shiftos_next\bin\Debug\shiftos_next.xml C:\Users\Michael\Documents\GitHub\shiftos-next\shiftos_next\obj\Debug\shiftos_next.Titlebar.resources C:\Users\Michael\Documents\GitHub\shiftos-next\shiftos_next\obj\Debug\shiftos_next.Shifter.resources +C:\Users\Michael\Documents\GitHub\shiftos-next\shiftos_next\obj\Debug\shiftos_next.SkinLoader.resources diff --git a/shiftos_next/obj/Debug/shiftos_next.vbproj.GenerateResource.Cache b/shiftos_next/obj/Debug/shiftos_next.vbproj.GenerateResource.Cache index c645f46..bb41ff7 100644 Binary files a/shiftos_next/obj/Debug/shiftos_next.vbproj.GenerateResource.Cache and b/shiftos_next/obj/Debug/shiftos_next.vbproj.GenerateResource.Cache differ diff --git a/shiftos_next/shiftos_next.vbproj b/shiftos_next/shiftos_next.vbproj index db76ab6..bce8575 100644 --- a/shiftos_next/shiftos_next.vbproj +++ b/shiftos_next/shiftos_next.vbproj @@ -78,6 +78,12 @@ Form + + SkinLoader.vb + + + Form + basicwm_infobox.vb @@ -161,6 +167,9 @@ Shifter.vb + + SkinLoader.vb + Titlebar.vb