From 0e6eb6e76f8227b8055f5ea032f9582dcacee5f5 Mon Sep 17 00:00:00 2001 From: EverythingWindows Date: Sat, 3 Dec 2022 23:16:06 +0700 Subject: Console Font finished and the foundation of new window manager is there --- .../Categories/DuWM_Shifter_Console.Designer.vb | 157 +++++++++++++++++++++ .../Shifter/Categories/DuWM_Shifter_Console.resx | 120 ++++++++++++++++ .../Shifter/Categories/DuWM_Shifter_Console.vb | 48 +++++++ .../DuWM/Shifter/DuWM_Shifter.Designer.vb | 2 +- .../Applications/DuWM/Shifter/DuWM_Shifter.vb | 17 ++- .../DuWM/Shifter/DuWM_Shifter_Configs.vb | 1 + 6 files changed, 343 insertions(+), 2 deletions(-) create mode 100644 ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.Designer.vb create mode 100644 ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.resx create mode 100644 ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.vb (limited to 'ShiftOS-TheRevival/MainForms/Applications/DuWM') diff --git a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.Designer.vb b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.Designer.vb new file mode 100644 index 0000000..69e3a30 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.Designer.vb @@ -0,0 +1,157 @@ + _ +Partial Class DuWM_Shifter_Console + Inherits System.Windows.Forms.UserControl + + 'UserControl 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.lbl_Title = New System.Windows.Forms.Label() + Me.lbl_DescConsole = New System.Windows.Forms.Label() + Me.lbl_ConsoleFont = New System.Windows.Forms.Label() + Me.cmb_ConsoleFont = New System.Windows.Forms.ComboBox() + Me.lbl_ConsoleFontSize = New System.Windows.Forms.Label() + Me.cmb_ConsoleFontSize = New System.Windows.Forms.ComboBox() + Me.lbl_Example = New System.Windows.Forms.Label() + Me.txt_ConsoleExample = New System.Windows.Forms.TextBox() + Me.SuspendLayout() + ' + 'lbl_Title + ' + Me.lbl_Title.AutoSize = True + Me.lbl_Title.Font = New System.Drawing.Font("Segoe UI", 24.0!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle)) + Me.lbl_Title.Location = New System.Drawing.Point(11, 10) + Me.lbl_Title.Name = "lbl_Title" + Me.lbl_Title.Size = New System.Drawing.Size(136, 45) + Me.lbl_Title.TabIndex = 1 + Me.lbl_Title.Text = "Console" + ' + 'lbl_DescConsole + ' + Me.lbl_DescConsole.AutoSize = True + Me.lbl_DescConsole.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.lbl_DescConsole.ForeColor = System.Drawing.Color.Black + Me.lbl_DescConsole.Location = New System.Drawing.Point(15, 71) + Me.lbl_DescConsole.Name = "lbl_DescConsole" + Me.lbl_DescConsole.Size = New System.Drawing.Size(266, 21) + Me.lbl_DescConsole.TabIndex = 3 + Me.lbl_DescConsole.Text = "Choose Console font face and its size" + ' + 'lbl_ConsoleFont + ' + Me.lbl_ConsoleFont.AutoSize = True + Me.lbl_ConsoleFont.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.lbl_ConsoleFont.ForeColor = System.Drawing.Color.Black + Me.lbl_ConsoleFont.Location = New System.Drawing.Point(15, 106) + Me.lbl_ConsoleFont.Name = "lbl_ConsoleFont" + Me.lbl_ConsoleFont.Size = New System.Drawing.Size(135, 21) + Me.lbl_ConsoleFont.TabIndex = 4 + Me.lbl_ConsoleFont.Text = "Console Font Face" + ' + 'cmb_ConsoleFont + ' + Me.cmb_ConsoleFont.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed + Me.cmb_ConsoleFont.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.cmb_ConsoleFont.FormattingEnabled = True + Me.cmb_ConsoleFont.Items.AddRange(New Object() {"Consolas", "Courier New", "Lucida Console"}) + Me.cmb_ConsoleFont.Location = New System.Drawing.Point(156, 103) + Me.cmb_ConsoleFont.Name = "cmb_ConsoleFont" + Me.cmb_ConsoleFont.Size = New System.Drawing.Size(250, 30) + Me.cmb_ConsoleFont.TabIndex = 5 + ' + 'lbl_ConsoleFontSize + ' + Me.lbl_ConsoleFontSize.AutoSize = True + Me.lbl_ConsoleFontSize.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.lbl_ConsoleFontSize.ForeColor = System.Drawing.Color.Black + Me.lbl_ConsoleFontSize.Location = New System.Drawing.Point(15, 147) + Me.lbl_ConsoleFontSize.Name = "lbl_ConsoleFontSize" + Me.lbl_ConsoleFontSize.Size = New System.Drawing.Size(133, 21) + Me.lbl_ConsoleFontSize.TabIndex = 6 + Me.lbl_ConsoleFontSize.Text = "Console Font Size" + ' + 'cmb_ConsoleFontSize + ' + Me.cmb_ConsoleFontSize.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed + Me.cmb_ConsoleFontSize.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.cmb_ConsoleFontSize.FormattingEnabled = True + Me.cmb_ConsoleFontSize.Items.AddRange(New Object() {"6", "8", "9", "10", "11", "12", "14", "16"}) + Me.cmb_ConsoleFontSize.Location = New System.Drawing.Point(156, 144) + Me.cmb_ConsoleFontSize.Name = "cmb_ConsoleFontSize" + Me.cmb_ConsoleFontSize.Size = New System.Drawing.Size(70, 30) + Me.cmb_ConsoleFontSize.TabIndex = 5 + ' + 'lbl_Example + ' + Me.lbl_Example.AutoSize = True + Me.lbl_Example.Font = New System.Drawing.Font("Segoe UI", 12.0!) + Me.lbl_Example.ForeColor = System.Drawing.Color.Black + Me.lbl_Example.Location = New System.Drawing.Point(15, 189) + Me.lbl_Example.Name = "lbl_Example" + Me.lbl_Example.Size = New System.Drawing.Size(75, 21) + Me.lbl_Example.TabIndex = 6 + Me.lbl_Example.Text = "Example :" + ' + 'txt_ConsoleExample + ' + Me.txt_ConsoleExample.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ + Or System.Windows.Forms.AnchorStyles.Left) _ + Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.txt_ConsoleExample.BackColor = System.Drawing.Color.Black + Me.txt_ConsoleExample.BorderStyle = System.Windows.Forms.BorderStyle.None + Me.txt_ConsoleExample.Font = New System.Drawing.Font("Consolas", 11.0!) + Me.txt_ConsoleExample.ForeColor = System.Drawing.Color.White + Me.txt_ConsoleExample.Location = New System.Drawing.Point(19, 218) + Me.txt_ConsoleExample.Multiline = True + Me.txt_ConsoleExample.Name = "txt_ConsoleExample" + Me.txt_ConsoleExample.ReadOnly = True + Me.txt_ConsoleExample.Size = New System.Drawing.Size(600, 243) + Me.txt_ConsoleExample.TabIndex = 7 + Me.txt_ConsoleExample.Text = "devx@shiftos $> ver" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "ShiftOS 11 build 11.0.9" + ' + 'DuWM_Shifter_Console + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.White + Me.Controls.Add(Me.txt_ConsoleExample) + Me.Controls.Add(Me.lbl_Example) + Me.Controls.Add(Me.lbl_ConsoleFontSize) + Me.Controls.Add(Me.cmb_ConsoleFontSize) + Me.Controls.Add(Me.cmb_ConsoleFont) + Me.Controls.Add(Me.lbl_ConsoleFont) + Me.Controls.Add(Me.lbl_DescConsole) + Me.Controls.Add(Me.lbl_Title) + Me.ForeColor = System.Drawing.Color.Black + Me.Name = "DuWM_Shifter_Console" + Me.Size = New System.Drawing.Size(640, 480) + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lbl_Title As Label + Friend WithEvents lbl_DescConsole As Label + Friend WithEvents lbl_ConsoleFont As Label + Friend WithEvents cmb_ConsoleFont As ComboBox + Friend WithEvents lbl_ConsoleFontSize As Label + Friend WithEvents cmb_ConsoleFontSize As ComboBox + Friend WithEvents lbl_Example As Label + Friend WithEvents txt_ConsoleExample As TextBox +End Class diff --git a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.resx b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.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-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.vb b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.vb new file mode 100644 index 0000000..04551ae --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/Categories/DuWM_Shifter_Console.vb @@ -0,0 +1,48 @@ +Public Class DuWM_Shifter_Console + Private Sub DuWM_Shifter_Console_Load(sender As Object, e As EventArgs) Handles MyBase.Load + txt_ConsoleExample.Font = Console.TextBox1.Font + cmb_ConsoleFont.Text = GUISCustomizations.GUIConsoleFont.Name + cmb_ConsoleFontSize.Text = GUISCustomizations.GUIConsoleFont.Size + End Sub + + Private Sub cmb_ConsoleFont_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles cmb_ConsoleFont.DrawItem + e.DrawBackground() + If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then + e.Graphics.FillRectangle(Brushes.Black, e.Bounds) + End If + Dim sf As New StringFormat + Using b As New SolidBrush(e.ForeColor) + e.Graphics.DrawString(cmb_ConsoleFont.GetItemText(cmb_ConsoleFont.Items(e.Index)), e.Font, b, e.Bounds, sf) + End Using + e.DrawFocusRectangle() + End Sub + + Private Sub cmb_ConsoleFontSize_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles cmb_ConsoleFontSize.DrawItem + e.DrawBackground() + If (e.State And DrawItemState.Selected) = DrawItemState.Selected Then + e.Graphics.FillRectangle(Brushes.Black, e.Bounds) + End If + Dim sf As New StringFormat + Using b As New SolidBrush(e.ForeColor) + e.Graphics.DrawString(cmb_ConsoleFontSize.GetItemText(cmb_ConsoleFontSize.Items(e.Index)), e.Font, b, e.Bounds, sf) + End Using + e.DrawFocusRectangle() + End Sub + + Private Sub cmb_ConsoleFont_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmb_ConsoleFont.SelectedIndexChanged + Select Case cmb_ConsoleFont.SelectedItem + Case "Consolas" + txt_ConsoleExample.Font = New Font("Consolas", txt_ConsoleExample.Font.Size) + Case "Courier New" + txt_ConsoleExample.Font = New Font("Courier New", txt_ConsoleExample.Font.Size) + Case "Lucida Console" + txt_ConsoleExample.Font = New Font("Lucida Console", txt_ConsoleExample.Font.Size) + End Select + DuWM_Shifter_Configs.ConsoleFont = txt_ConsoleExample.Font + End Sub + + Private Sub cmb_ConsoleFontSize_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmb_ConsoleFontSize.SelectedIndexChanged + txt_ConsoleExample.Font = New Font(txt_ConsoleExample.Font.Name, cmb_ConsoleFontSize.SelectedItem) + DuWM_Shifter_Configs.ConsoleFont = txt_ConsoleExample.Font + End Sub +End Class diff --git a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.Designer.vb b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.Designer.vb index 97cb13b..78537a8 100644 --- a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.Designer.vb @@ -53,7 +53,7 @@ Partial Class DuWM_Shifter Me.lst_Features.Font = New System.Drawing.Font("Segoe UI", 12.0!) Me.lst_Features.FormattingEnabled = True Me.lst_Features.ItemHeight = 21 - Me.lst_Features.Items.AddRange(New Object() {"Desktop", "About"}) + Me.lst_Features.Items.AddRange(New Object() {"Console", "Desktop", "About"}) Me.lst_Features.Location = New System.Drawing.Point(0, 51) Me.lst_Features.Name = "lst_Features" Me.lst_Features.Size = New System.Drawing.Size(200, 399) diff --git a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.vb b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.vb index 04f68e6..da5046d 100644 --- a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.vb +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter.vb @@ -5,7 +5,7 @@ Private ChildFeature As String Private Sub Shifter_Load(sender As Object, e As EventArgs) Handles MyBase.Load - + CheckAvailability() End Sub Private Sub lst_Features_DrawItem(ByVal sender As Object, ByVal e As System.Windows.Forms.DrawItemEventArgs) Handles lst_Features.DrawItem @@ -37,6 +37,12 @@ Else Select Case lst_Features.SelectedItem + Case "Console" + Dim Shifter_Console As New DuWM_Shifter_Console + Shifter_Console.Size = pnl_Content.Size + ChildFeature = "Console" + pnl_Content.Controls.Clear() + pnl_Content.Controls.Add(Shifter_Console) Case "Desktop" Dim Shifter_Desktop As New DuWM_Shifter_Desktop Shifter_Desktop.Size = pnl_Content.Size @@ -59,6 +65,9 @@ Private Sub Apply() Select Case lst_Features.SelectedItem + Case "Console" + Console.TextBox1.Font = DuWM_Shifter_Configs.ConsoleFont + GUISCustomizations.GUIConsoleFont = Console.TextBox1.Font Case "Desktop" Desktop.BackColor = DuWM_Shifter_Configs.DesktopBackColor GUISCustomizations.DesktopColor = Desktop.BackColor @@ -69,4 +78,10 @@ Apply() Close() End Sub + + Private Sub CheckAvailability() + If Strings.AvailableFeature(53) = 0 Then + lst_Features.Items.Remove("Console") + End If + End Sub End Class \ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter_Configs.vb b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter_Configs.vb index 2b7c70d..219a45b 100644 --- a/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter_Configs.vb +++ b/ShiftOS-TheRevival/MainForms/Applications/DuWM/Shifter/DuWM_Shifter_Configs.vb @@ -1,3 +1,4 @@ Public Class DuWM_Shifter_Configs Public Shared DesktopBackColor As Color + Public Shared ConsoleFont As Font End Class -- cgit v1.2.3