2508291614
控制項從屬設定更正 程式碼重構/瘦身 調整減少videoview閃爍 已點歌曲頁面自動定位邏輯調整
This commit is contained in:
parent
04c10d23cb
commit
9b6772686c
@ -10,8 +10,15 @@ namespace DBObj
|
||||
private Artist A ;
|
||||
private Artist B ;
|
||||
public bool isPublicSong { get; set; }
|
||||
|
||||
public PlayState state;
|
||||
|
||||
public SongData()
|
||||
{
|
||||
basic = new("", "", "", "", 1, 1, "");
|
||||
A = new("", "");
|
||||
B = new("", "");
|
||||
isPublicSong = false;
|
||||
}
|
||||
public SongData(string songNumber, string song, string filename, int humanVoice, bool isPublic)
|
||||
{
|
||||
basic = new(songNumber, song, "", filename, humanVoice, 0, "");
|
||||
|
@ -1,6 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.TextBox;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm : Form
|
||||
@ -269,7 +268,6 @@ namespace DualScreenDemo
|
||||
|
||||
private void SetPictureBoxToggleLightAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
pictureBoxToggleLight.Visible = isVisible;
|
||||
if (isVisible) SetUIVisible(pictureBoxToggleLight);
|
||||
else CloseUI(pictureBoxToggleLight);
|
||||
}
|
||||
|
@ -1417,6 +1417,7 @@ namespace DualScreenDemo
|
||||
|
||||
private SongData currentSelectedSong;
|
||||
|
||||
//vod介面點擊事件
|
||||
public void Label_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -2300,8 +2301,34 @@ namespace DualScreenDemo
|
||||
autoRefreshTimer.Start(); // 开始自动刷新
|
||||
// 已點歌曲錨點
|
||||
var List = SongList.GetHistory();
|
||||
totalPages = (int)Math.Ceiling((double)List.Count / itemsPerPage);
|
||||
var targetNum = multiPagePanel.itemsPerPage - List.Count % multiPagePanel.itemsPerPage;
|
||||
int index = List.FindIndex(song => song.GetState() == PlayState.Playing);
|
||||
int remainder=(List.Count-index)%multiPagePanel.itemsPerPage;
|
||||
if (remainder !=0&&remainder!=1)
|
||||
{
|
||||
|
||||
if (List.Count < multiPagePanel.itemsPerPage)
|
||||
{
|
||||
int itemsToInsert = multiPagePanel.itemsPerPage - index;
|
||||
|
||||
for (int i = 0; i < itemsToInsert; i++)
|
||||
{
|
||||
List.Insert(index, new SongData());
|
||||
}
|
||||
}
|
||||
{
|
||||
int itemsToInsert = multiPagePanel.itemsPerPage - remainder;
|
||||
|
||||
for (int i = 0; i < itemsToInsert; i++)
|
||||
{
|
||||
List.Insert(index, new SongData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
totalPages = (int)Math.Ceiling((double)List.Count / itemsPerPage);
|
||||
index = List.FindIndex(song => song.GetState() == PlayState.Playing);
|
||||
int page = 0;
|
||||
if ((index+1) > multiPagePanel.itemsPerPage) page = Math.Abs((index+1) / multiPagePanel.itemsPerPage);
|
||||
|
||||
|
@ -1,25 +1,214 @@
|
||||
using System.IO;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
private PictureBox pictureBoxEnglishSingers;
|
||||
|
||||
private Button[] numberButtonsForSingers;
|
||||
private Button[] letterButtonsForEnglishSingers;
|
||||
private Button modifyButtonEnglishSingers;
|
||||
private Button clearButtonEnglishSingers;
|
||||
private Button closeButtonEnglishSingers;
|
||||
|
||||
private (int X, int Y, int Width, int Height) modifyButtonEnglishCoords;
|
||||
private (int X, int Y, int Width, int Height) clearButtonEnglishCoords;
|
||||
private (int X, int Y, int Width, int Height) closeButtonEnglishCoords;
|
||||
|
||||
private RichTextBox inputBoxEnglishSingers;
|
||||
|
||||
private void InitializeButtonsForEnglishSingers()
|
||||
{
|
||||
InitializeEngAlphbtSingerBtns(pictureBoxEnglishSingers,LetterButtonEnglishSingers_Click);
|
||||
InitializeInputBoxEnglishSingers();
|
||||
InitializeEngSingersButton();
|
||||
}
|
||||
private void InitializeEngSingersButton()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
modifyButtonEnglishSingers = new Button { Name = "modifyButtonEnglishSingers" };
|
||||
ConfigureButton(modifyButtonEnglishSingers, 650, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["mouseDown"])),
|
||||
ModifyButtonEnglishSingers_Click);
|
||||
|
||||
pictureBoxEnglishSingers.Controls.Add(modifyButtonEnglishSingers);
|
||||
|
||||
|
||||
clearButtonEnglishSingers = new Button { Name = "clearButtonEnglishSingers" };
|
||||
ConfigureButton(clearButtonEnglishSingers, 8, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["mouseDown"])),
|
||||
ClearButtonEnglishSingers_Click);
|
||||
|
||||
pictureBoxEnglishSingers.Controls.Add(clearButtonEnglishSingers);
|
||||
|
||||
|
||||
closeButtonEnglishSingers = new Button { Name = "closeButtonEnglishSingers" };
|
||||
ConfigureButton(closeButtonEnglishSingers, 730, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["mouseDown"])),
|
||||
CloseButtonEnglishSingers_Click);
|
||||
|
||||
pictureBoxEnglishSingers.Controls.Add(closeButtonEnglishSingers);
|
||||
}
|
||||
private void InitializeEngAlphbtSingerBtns(Control control, EventHandler handler)
|
||||
{
|
||||
numberButtonsForSingers = new Button[10];
|
||||
letterButtonsForEnglishSingers = new Button[26];
|
||||
// 設置上排按鈕
|
||||
int x = 8;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CreateNumberEngSingerBtns(i, x, 65, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
|
||||
x = 8;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CreateEngAlphbtSingerBtns(i, x, 135, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
|
||||
x = 40;
|
||||
for (int i = 10; i < 19; i++)
|
||||
{
|
||||
CreateEngAlphbtSingerBtns(i, x, 205, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
// 設置下排按鈕
|
||||
x = 88;
|
||||
for (int i = 19; i < 26; i++)
|
||||
{
|
||||
CreateEngAlphbtSingerBtns(i, x, 275, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
}
|
||||
private void CreateNumberEngSingerBtns(int index, int x, int y, Control control, EventHandler handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
// 創建語音按鈕並設置其屬性
|
||||
numberButtonsForSingers[index] = new Button
|
||||
{
|
||||
Name = $"ButtonsForEnglish_{ButtonsNumberSymbols[index]}", // 按鈕名稱設為語音符號名稱
|
||||
};
|
||||
|
||||
ConfigureButton(numberButtonsForSingers[index], x, y, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_mouseDown"])),
|
||||
handler);
|
||||
|
||||
// 設置按鈕的 Tag 屬性為對應的語音符號
|
||||
numberButtonsForSingers[index].Tag = ButtonsNumberSymbols[index];
|
||||
|
||||
// 將按鈕添加到表單的控制項集合中
|
||||
control.Controls.Add(numberButtonsForSingers[index]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error creating button at index {index}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
private void CreateEngAlphbtSingerBtns(int index, int x, int y, Control control, EventHandler handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
// 創建語音按鈕並設置其屬性
|
||||
letterButtonsForEnglishSingers[index] = new Button
|
||||
{
|
||||
Name = $"ButtonsForEnglishSingers_{ButtonsEnglishSymbols[index]}", // 按鈕名稱設為語音符號名稱
|
||||
};
|
||||
|
||||
ConfigureButton(letterButtonsForEnglishSingers[index], x, y, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_mouseDown"])),
|
||||
handler);
|
||||
|
||||
// 設置按鈕的 Tag 屬性為對應的語音符號
|
||||
letterButtonsForEnglishSingers[index].Tag = ButtonsEnglishSymbols[index];
|
||||
|
||||
// 將按鈕添加到表單的控制項集合中
|
||||
control.Controls.Add(letterButtonsForEnglishSingers[index]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error creating button at index {index}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeInputBoxEnglishSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
string fontName = "Times New Roman";
|
||||
float fontSize = 26;
|
||||
FontStyle fontStyle = FontStyle.Regular;
|
||||
Color foreColor = Color.Black;
|
||||
|
||||
inputBoxEnglishSingers = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxEnglishSingers",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxEnglishSingers, 10, 12, 455, 47);
|
||||
|
||||
pictureBoxEnglishSingers.Controls.Add(inputBoxEnglishSingers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxEnglishSingers(string imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
pictureBoxEnglishSingers.Image = originalImage;
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxEnglishSingers, 390, 360, 808, 356);
|
||||
|
||||
pictureBoxEnglishSingers.Visible = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetEnglishSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
if (isVisible) SetUIVisible(pictureBoxEnglishSingers);
|
||||
else CloseUI(pictureBoxEnglishSingers);
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
};
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnglishSearchSingersButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
UpdateSSearchBtn(englishSearchButton, englishSearchActiveBackground);
|
||||
@ -41,122 +230,6 @@ namespace DualScreenDemo
|
||||
ResetinputBox();
|
||||
pictureBoxEnglishSingers.Visible = true;
|
||||
}
|
||||
|
||||
private (int X, int Y, int Width, int Height)[] numberButtonCoords;
|
||||
|
||||
private void LoadNumberButtonCoordsFromConfig()
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
string iniPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "img.ini");
|
||||
IniData data = parser.ReadFile(iniPath);
|
||||
|
||||
|
||||
var buttonList = new List<(int X, int Y, int Width, int Height)>();
|
||||
|
||||
for (int i = 1; i <= 10; i++)
|
||||
{
|
||||
var coordString = data["NumberButtonCoordinates"][$"button{i}"];
|
||||
var coords = coordString.Split(',');
|
||||
buttonList.Add((int.Parse(coords[0]), int.Parse(coords[1]), int.Parse(coords[2]), int.Parse(coords[3])));
|
||||
}
|
||||
|
||||
numberButtonCoords = buttonList.ToArray();
|
||||
}
|
||||
|
||||
private Button CreateButton(string name, (int X, int Y, int Width, int Height) coords, string normalImagePath, string mouseDownImagePath, string mouseOverImagePath, EventHandler clickEventHandler)
|
||||
{
|
||||
var button = new Button
|
||||
{
|
||||
Name = name,
|
||||
FlatStyle = FlatStyle.Flat,
|
||||
FlatAppearance = { BorderSize = 0, MouseDownBackColor = Color.Transparent, MouseOverBackColor = Color.Transparent },
|
||||
BackgroundImageLayout = ImageLayout.Stretch,
|
||||
BackgroundImage = Image.FromFile(Path.Combine(serverPath, normalImagePath))
|
||||
};
|
||||
|
||||
ResizeAndPositionButton(button, coords.X, coords.Y, coords.Width, coords.Height);
|
||||
|
||||
button.MouseEnter += (sender, e) => button.BackgroundImage = Image.FromFile(Path.Combine(serverPath, mouseOverImagePath));
|
||||
button.MouseLeave += (sender, e) => button.BackgroundImage = Image.FromFile(Path.Combine(serverPath, normalImagePath));
|
||||
button.MouseDown += (sender, e) => button.BackgroundImage = Image.FromFile(Path.Combine(serverPath, mouseDownImagePath));
|
||||
button.MouseUp += (sender, e) => button.BackgroundImage = Image.FromFile(Path.Combine(serverPath, normalImagePath));
|
||||
|
||||
button.Click += clickEventHandler;
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
|
||||
private void InitializeNumberButtonsForSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
numberButtonCoords = LoadButtonCoordinates(data, "NumberButtonCoordinates", 10);
|
||||
var buttonImages = LoadButtonImages(data, "NumberButtonImages", 10);
|
||||
|
||||
numberButtonsForSingers = new Button[10];
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
string normalImagePath = buttonImages[$"button{i}"].normal;
|
||||
string mouseDownImagePath = buttonImages[$"button{i}"].mouseDown;
|
||||
string mouseOverImagePath = buttonImages[$"button{i}"].mouseOver;
|
||||
|
||||
|
||||
if (normalImagePath == null || mouseDownImagePath == null || mouseOverImagePath == null)
|
||||
{
|
||||
Console.WriteLine($"Error: One or more image paths for button{i} are null.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
numberButtonsForSingers[i] = CreateButton(
|
||||
$"numberButton_{i}",
|
||||
numberButtonCoords[i],
|
||||
normalImagePath,
|
||||
mouseDownImagePath,
|
||||
mouseOverImagePath,
|
||||
NumberButtonForSingers_Click
|
||||
);
|
||||
numberButtonsForSingers[i].Tag = (i + 1) % 10;
|
||||
this.Controls.Add(numberButtonsForSingers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void NumberButtonForSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
var button = sender as Button;
|
||||
if (button != null && button.Tag != null)
|
||||
{
|
||||
if (inputBoxEnglishSingers.Visible)
|
||||
{
|
||||
inputBoxEnglishSingers.Text += button.Tag.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeLetterButtonsForEnglishSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
var buttonImages = LoadButtonImages(data, "EnglishLetterButtonImages", 26);
|
||||
string qwertyLayout = "QWERTYUIOPASDFGHJKLZXCVBNM";
|
||||
letterButtonsForEnglishSingers = new Button[26];
|
||||
|
||||
for (int i = 0; i < 26; i++)
|
||||
{
|
||||
var coords = data["EnglishLetterButtonCoordinates"][$"button{i}"].Split(',');
|
||||
letterButtonsForEnglishSingers[i] = CreateButton(
|
||||
$"letterButton_{qwertyLayout[i]}",
|
||||
(int.Parse(coords[0]), int.Parse(coords[1]), int.Parse(coords[2]), int.Parse(coords[3])),
|
||||
buttonImages[$"button{i}"].normal,
|
||||
buttonImages[$"button{i}"].mouseDown,
|
||||
buttonImages[$"button{i}"].mouseOver,
|
||||
LetterButtonEnglishSingers_Click
|
||||
);
|
||||
letterButtonsForEnglishSingers[i].Tag = qwertyLayout[i];
|
||||
this.Controls.Add(letterButtonsForEnglishSingers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void LetterButtonEnglishSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -169,95 +242,21 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeButtonsForEnglishSingers()
|
||||
{
|
||||
InitializeNumberButtonsForSingers();
|
||||
InitializeLetterButtonsForEnglishSingers();
|
||||
|
||||
|
||||
InitializeModifyButtonEnglishSingers();
|
||||
|
||||
|
||||
InitializeClearButtonEnglishSingers();
|
||||
|
||||
|
||||
InitializeCloseButtonEnglishSingers();
|
||||
|
||||
InitializeInputBoxEnglishSingers();
|
||||
}
|
||||
|
||||
private void InitializeModifyButtonEnglishSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
modifyButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "modifyButtonEnglishSingers");
|
||||
var buttonImages = LoadButtonImages(data, "ModifyButtonImagesEnglish");
|
||||
|
||||
modifyButtonEnglishSingers = CreateSpecialButton(
|
||||
"btnModifyEnglishSingers",
|
||||
modifyButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ModifyButtonEnglishSingers_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(modifyButtonEnglishSingers);
|
||||
}
|
||||
|
||||
private void ModifyButtonEnglishSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (this.Controls.Contains(inputBoxEnglishSingers) && inputBoxEnglishSingers.Text.Length > 0)
|
||||
if (pictureBoxEnglishSingers.Controls.Contains(inputBoxEnglishSingers) && inputBoxEnglishSingers.Text.Length > 0)
|
||||
{
|
||||
inputBoxEnglishSingers.Text = inputBoxEnglishSingers.Text.Substring(0, inputBoxEnglishSingers.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeClearButtonEnglishSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
clearButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonEnglishSingers");
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesEnglish");
|
||||
|
||||
clearButtonEnglishSingers = CreateSpecialButton(
|
||||
"btnClearEnglishSingers",
|
||||
clearButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ClearButtonEnglishSingers_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(clearButtonEnglishSingers);
|
||||
}
|
||||
|
||||
private void ClearButtonEnglishSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Controls.Contains(inputBoxEnglishSingers) && inputBoxEnglishSingers.Text.Length > 0)
|
||||
if (pictureBoxEnglishSingers.Controls.Contains(inputBoxEnglishSingers) && inputBoxEnglishSingers.Text.Length > 0)
|
||||
{
|
||||
inputBoxEnglishSingers.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCloseButtonEnglishSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
closeButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonEnglishSingers");
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesEnglish");
|
||||
|
||||
closeButtonEnglishSingers = CreateSpecialButton(
|
||||
"btnCloseEnglishSingers",
|
||||
closeButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
CloseButtonEnglishSingers_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(closeButtonEnglishSingers);
|
||||
}
|
||||
|
||||
private void CloseButtonEnglishSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -266,7 +265,8 @@ namespace DualScreenDemo
|
||||
FindEnglishSingers();
|
||||
SetEnglishSingersAndButtonsVisibility(false);
|
||||
}
|
||||
private void FindEnglishSingers(){
|
||||
private void FindEnglishSingers()
|
||||
{
|
||||
string searchText = inputBoxEnglishSingers.Text;
|
||||
string query = string.IsNullOrWhiteSpace(searchText)
|
||||
? "SELECT * FROM artists LIMIT 1000;"
|
||||
@ -281,158 +281,5 @@ namespace DualScreenDemo
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSingers(currentArtistList);
|
||||
}
|
||||
private void InitializeInputBoxEnglishSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
parser.Parser.Configuration.AssigmentSpacer = "";
|
||||
parser.Parser.Configuration.CommentString = "#";
|
||||
parser.Parser.Configuration.CaseInsensitive = true;
|
||||
|
||||
|
||||
IniData data;
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
int x = int.Parse(data["InputBoxEnglishSingers"]["X"]);
|
||||
int y = int.Parse(data["InputBoxEnglishSingers"]["Y"]);
|
||||
int width = int.Parse(data["InputBoxEnglishSingers"]["Width"]);
|
||||
int height = int.Parse(data["InputBoxEnglishSingers"]["Height"]);
|
||||
string fontName = data["InputBoxEnglishSingers"]["FontName"];
|
||||
float fontSize = float.Parse(data["InputBoxEnglishSingers"]["FontSize"]);
|
||||
FontStyle fontStyle = (FontStyle)Enum.Parse(typeof(FontStyle), data["InputBoxEnglishSingers"]["FontStyle"]);
|
||||
Color foreColor = Color.FromName(data["InputBoxEnglishSingers"]["ForeColor"]);
|
||||
|
||||
inputBoxEnglishSingers = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxEnglishSingers",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxEnglishSingers, x, y, width, height);
|
||||
|
||||
this.Controls.Add(inputBoxEnglishSingers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxEnglishSingers(string imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
parser.Parser.Configuration.AssigmentSpacer = "";
|
||||
parser.Parser.Configuration.CommentString = "#";
|
||||
parser.Parser.Configuration.CaseInsensitive = true;
|
||||
|
||||
|
||||
IniData data;
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
int x = int.Parse(data["PictureBoxEnglishSingers"]["X"]);
|
||||
int y = int.Parse(data["PictureBoxEnglishSingers"]["Y"]);
|
||||
int width = int.Parse(data["PictureBoxEnglishSingers"]["Width"]);
|
||||
int height = int.Parse(data["PictureBoxEnglishSingers"]["Height"]);
|
||||
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
pictureBoxEnglishSingers.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxEnglishSingers, x, y, width, height);
|
||||
|
||||
pictureBoxEnglishSingers.Visible = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetEnglishSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
|
||||
pictureBoxEnglishSingers.Visible = isVisible;
|
||||
if (isVisible) pictureBoxEnglishSingers.BringToFront();
|
||||
|
||||
foreach (var button in numberButtonsForSingers)
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
}
|
||||
|
||||
foreach (var button in letterButtonsForEnglishSingers)
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
}
|
||||
|
||||
|
||||
if (modifyButtonEnglishSingers != null)
|
||||
{
|
||||
modifyButtonEnglishSingers.Visible = isVisible;
|
||||
if (isVisible) modifyButtonEnglishSingers.BringToFront();
|
||||
}
|
||||
|
||||
if (clearButtonEnglishSingers != null)
|
||||
{
|
||||
clearButtonEnglishSingers.Visible = isVisible;
|
||||
if (isVisible) clearButtonEnglishSingers.BringToFront();
|
||||
}
|
||||
if (closeButtonEnglishSingers != null)
|
||||
{
|
||||
closeButtonEnglishSingers.Visible = isVisible;
|
||||
if (isVisible) closeButtonEnglishSingers.BringToFront();
|
||||
}
|
||||
|
||||
|
||||
if (inputBoxEnglishSingers != null)
|
||||
{
|
||||
inputBoxEnglishSingers.Visible = isVisible;
|
||||
if (isVisible) inputBoxEnglishSingers.BringToFront();
|
||||
}
|
||||
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
|
||||
|
||||
pictureBoxEnglishSingers.Refresh();
|
||||
foreach (var button in numberButtonsForSingers.Concat(letterButtonsForEnglishSingers))
|
||||
{
|
||||
button.Refresh();
|
||||
}
|
||||
|
||||
|
||||
if (modifyButtonEnglishSingers != null) modifyButtonEnglishSingers.Refresh();
|
||||
if (clearButtonEnglishSingers != null) clearButtonEnglishSingers.Refresh();
|
||||
if (closeButtonEnglishSingers != null) closeButtonEnglishSingers.Refresh();
|
||||
if (inputBoxEnglishSingers != null) inputBoxEnglishSingers.Refresh();
|
||||
};
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,23 +1,113 @@
|
||||
using System.IO;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
private PictureBox pictureBoxPinYinSingers;
|
||||
private Button[] letterButtonsForPinYinSingers;
|
||||
private Button modifyButtonPinYinSingers;
|
||||
private Button clearButtonPinYinSingers;
|
||||
private Button closeButtonPinYinSingers;
|
||||
|
||||
private (int X, int Y, int Width, int Height) modifyButtonPinYinCoords;
|
||||
private (int X, int Y, int Width, int Height) clearButtonPinYinCoords;
|
||||
private (int X, int Y, int Width, int Height) closeButtonPinYinCoords;
|
||||
|
||||
private RichTextBox inputBoxPinYinSingers;
|
||||
|
||||
private void InitializeButtonsForPinYinSingers()
|
||||
{
|
||||
InitializeInputBoxPinYinSingers();
|
||||
InitializePinYinSingersButton();
|
||||
InitializeAlphbtBtns(pictureBoxPinYinSingers, LetterButtonPinYinSingers_Click);
|
||||
}
|
||||
private void InitializePinYinSingersButton()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
modifyButtonPinYinSingers = new Button { Name = "modifyButtonPinYinSingers" };
|
||||
ConfigureButton(modifyButtonPinYinSingers, 650, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["mouseDown"])),
|
||||
ModifyButtonPinYinSingers_Click);
|
||||
|
||||
pictureBoxPinYinSingers.Controls.Add(modifyButtonPinYinSingers);
|
||||
|
||||
|
||||
clearButtonPinYinSingers = new Button { Name = "clearButtonPinYinSingers" };
|
||||
ConfigureButton(clearButtonPinYinSingers, 8, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["mouseDown"])),
|
||||
ClearButtonPinYinSingers_Click);
|
||||
|
||||
pictureBoxPinYinSingers.Controls.Add(clearButtonPinYinSingers);
|
||||
|
||||
|
||||
closeButtonPinYinSingers = new Button { Name = "closeButtonPinYinSingers" };
|
||||
ConfigureButton(closeButtonPinYinSingers, 730, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["mouseDown"])),
|
||||
CloseButtonPinYinSingers_Click);
|
||||
|
||||
pictureBoxPinYinSingers.Controls.Add(closeButtonPinYinSingers);
|
||||
}
|
||||
|
||||
private void InitializeInputBoxPinYinSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
string fontName = "Times New Roman";
|
||||
float fontSize = 26;
|
||||
FontStyle fontStyle = FontStyle.Regular;
|
||||
Color foreColor = Color.Black;
|
||||
|
||||
inputBoxPinYinSingers = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxPinYinSingers",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxPinYinSingers, 20, 25, 448, 57);
|
||||
|
||||
pictureBoxPinYinSingers.Controls.Add(inputBoxPinYinSingers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxPinYinSingers(string imagePath)
|
||||
{
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
pictureBoxPinYinSingers.Image = originalImage;
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxPinYinSingers, 390, 360, 808, 356);
|
||||
|
||||
pictureBoxPinYinSingers.Visible = true;
|
||||
}
|
||||
|
||||
private void SetPinYinSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
if (isVisible) SetUIVisible(pictureBoxPinYinSingers);
|
||||
else CloseUI(pictureBoxPinYinSingers);
|
||||
};
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
#region 按鈕點擊事件
|
||||
private void PinyinSingerSearchButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -39,30 +129,6 @@ namespace DualScreenDemo
|
||||
//SetPictureBoxArtistSearchAndButtonsVisibility(false);
|
||||
pictureBoxPinYinSingers.Visible = true;
|
||||
}
|
||||
|
||||
private void InitializeLetterButtonsForPinYinSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
var buttonImages = LoadButtonImages(data, "PinYinLetterButtonImages", 26);
|
||||
string qwertyLayout = "QWERTYUIOPASDFGHJKLZXCVBNM";
|
||||
letterButtonsForPinYinSingers = new Button[26];
|
||||
|
||||
for (int i = 0; i < 26; i++)
|
||||
{
|
||||
var coords = data["PinYinLetterButtonCoordinates"][$"button{i}"].Split(',');
|
||||
letterButtonsForPinYinSingers[i] = CreateButton(
|
||||
$"letterButton_{qwertyLayout[i]}",
|
||||
(int.Parse(coords[0]), int.Parse(coords[1]), int.Parse(coords[2]), int.Parse(coords[3])),
|
||||
buttonImages[$"button{i}"].normal,
|
||||
buttonImages[$"button{i}"].mouseDown,
|
||||
buttonImages[$"button{i}"].mouseOver,
|
||||
LetterButtonPinYinSingers_Click
|
||||
);
|
||||
letterButtonsForPinYinSingers[i].Tag = qwertyLayout[i];
|
||||
this.Controls.Add(letterButtonsForPinYinSingers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void LetterButtonPinYinSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -75,91 +141,21 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeButtonsForPinYinSingers()
|
||||
{
|
||||
InitializeLetterButtonsForPinYinSingers();
|
||||
InitializeSpecialButtonsForPinYinSingers();
|
||||
InitializeInputBoxPinYinSingers();
|
||||
}
|
||||
|
||||
private void InitializeSpecialButtonsForPinYinSingers()
|
||||
{
|
||||
|
||||
InitializeModifyButtonPinYinSingers();
|
||||
|
||||
|
||||
InitializeClearButtonPinYinSingers();
|
||||
|
||||
|
||||
InitializeCloseButtonPinYinSingers();
|
||||
}
|
||||
|
||||
private void InitializeModifyButtonPinYinSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
modifyButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "modifyButtonPinYinSingers");
|
||||
var buttonImages = LoadButtonImages(data, "ModifyButtonImagesPinYin");
|
||||
|
||||
modifyButtonPinYinSingers = CreateSpecialButton(
|
||||
"btnModifyPinYinSingers",
|
||||
modifyButtonPinYinCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ModifyButtonPinYinSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void ModifyButtonPinYinSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (this.Controls.Contains(inputBoxPinYinSingers) && inputBoxPinYinSingers.Text.Length > 0)
|
||||
if (pictureBoxPinYinSingers.Controls.Contains(inputBoxPinYinSingers) && inputBoxPinYinSingers.Text.Length > 0)
|
||||
{
|
||||
inputBoxPinYinSingers.Text = inputBoxPinYinSingers.Text.Substring(0, inputBoxPinYinSingers.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeClearButtonPinYinSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
clearButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonPinYinSingers");
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesPinYin");
|
||||
|
||||
clearButtonPinYinSingers = CreateSpecialButton(
|
||||
"btnClearPinYinSingers",
|
||||
clearButtonPinYinCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ClearButtonPinYinSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void ClearButtonPinYinSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Controls.Contains(inputBoxPinYinSingers) && inputBoxPinYinSingers.Text.Length > 0)
|
||||
if (pictureBoxPinYinSingers.Controls.Contains(inputBoxPinYinSingers) && inputBoxPinYinSingers.Text.Length > 0)
|
||||
{
|
||||
inputBoxPinYinSingers.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCloseButtonPinYinSingers()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
closeButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonPinYinSingers");
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesPinYin");
|
||||
|
||||
closeButtonPinYinSingers = CreateSpecialButton(
|
||||
"btnClosePinYinSingers",
|
||||
closeButtonPinYinCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
CloseButtonPinYinSingers_Click
|
||||
);
|
||||
}
|
||||
|
||||
private void CloseButtonPinYinSingers_Click(object sender, EventArgs e)
|
||||
{
|
||||
pictureBoxPinYinSingers.Visible = false;
|
||||
@ -167,7 +163,8 @@ namespace DualScreenDemo
|
||||
FindPinYinSingers();
|
||||
SetPinYinSingersAndButtonsVisibility(false);
|
||||
}
|
||||
private void FindPinYinSingers(){
|
||||
private void FindPinYinSingers()
|
||||
{
|
||||
string searchText = inputBoxPinYinSingers.Text;
|
||||
// 在這裡添加搜尋歌曲的邏輯
|
||||
// 例如:根據輸入框的內容搜尋歌曲
|
||||
@ -185,196 +182,6 @@ namespace DualScreenDemo
|
||||
multiPagePanel.LoadSingers(currentArtistList);
|
||||
|
||||
}
|
||||
|
||||
private void InitializeInputBoxPinYinSingers()
|
||||
{
|
||||
try
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
parser.Parser.Configuration.AssigmentSpacer = "";
|
||||
parser.Parser.Configuration.CommentString = "#";
|
||||
parser.Parser.Configuration.CaseInsensitive = true;
|
||||
|
||||
|
||||
IniData data;
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
int x = int.Parse(data["InputBoxPinYinSingers"]["X"]);
|
||||
int y = int.Parse(data["InputBoxPinYinSingers"]["Y"]);
|
||||
int width = int.Parse(data["InputBoxPinYinSingers"]["Width"]);
|
||||
int height = int.Parse(data["InputBoxPinYinSingers"]["Height"]);
|
||||
string fontName = data["InputBoxPinYinSingers"]["FontName"];
|
||||
float fontSize = float.Parse(data["InputBoxPinYinSingers"]["FontSize"]);
|
||||
FontStyle fontStyle = (FontStyle)Enum.Parse(typeof(FontStyle), data["InputBoxPinYinSingers"]["FontStyle"]);
|
||||
Color foreColor = Color.FromName(data["InputBoxPinYinSingers"]["ForeColor"]);
|
||||
|
||||
inputBoxPinYinSingers = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxPinYinSingers",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxPinYinSingers, x, y, width, height);
|
||||
|
||||
/*inputBoxPinYinSingers.TextChanged += (sender, e) =>
|
||||
{
|
||||
string searchText = inputBoxPinYinSingers.Text;
|
||||
var searchResults = allSongs.Where(song => song.ArtistAPinyin.Replace(" ", "").StartsWith(searchText))
|
||||
.Union(allSongs.Where(song => song.ArtistBPinyin.Replace(" ", "").StartsWith(searchText)))
|
||||
.ToList();
|
||||
currentPage = 0;
|
||||
currentSongList = searchResults;
|
||||
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage);
|
||||
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSongs(currentSongList);
|
||||
};*/
|
||||
|
||||
this.Controls.Add(inputBoxPinYinSingers);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private (int X, int Y, int Width, int Height) pictureBoxPinYinSingerCoords;
|
||||
|
||||
private void LoadPictureBoxPinYinSingerCoordsFromConfig()
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
string iniPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "img.ini");
|
||||
IniData data = parser.ReadFile(iniPath);
|
||||
|
||||
|
||||
var coords = data["PictureBoxPinYinSingers"];
|
||||
pictureBoxPinYinSingerCoords = (
|
||||
int.Parse(coords["X"]),
|
||||
int.Parse(coords["Y"]),
|
||||
int.Parse(coords["Width"]),
|
||||
int.Parse(coords["Height"])
|
||||
);
|
||||
}
|
||||
|
||||
private void ShowImageOnPictureBoxPinYinSingers(string imagePath)
|
||||
{
|
||||
|
||||
LoadPictureBoxPinYinSingerCoordsFromConfig();
|
||||
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
Rectangle displayArea = new Rectangle(pictureBoxPinYinSingerCoords.X, pictureBoxPinYinSingerCoords.Y, pictureBoxPinYinSingerCoords.Width, pictureBoxPinYinSingerCoords.Height);
|
||||
|
||||
|
||||
pictureBoxPinYinSingers.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxPinYinSingers, displayArea.X, displayArea.Y, displayArea.Width, displayArea.Height);
|
||||
|
||||
pictureBoxPinYinSingers.Visible = true;
|
||||
}
|
||||
|
||||
private void SetPinYinSingersAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
|
||||
if (pictureBoxPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("pictureBoxPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureBoxPinYinSingers.Visible = isVisible;
|
||||
if (isVisible) pictureBoxPinYinSingers.BringToFront();
|
||||
pictureBoxPinYinSingers.Refresh();
|
||||
}
|
||||
|
||||
if (letterButtonsForPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("letterButtonsForPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var button in letterButtonsForPinYinSingers)
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
Console.WriteLine("A button in letterButtonsForPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
button.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modifyButtonPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("modifyButtonPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
modifyButtonPinYinSingers.Visible = isVisible;
|
||||
if (isVisible) modifyButtonPinYinSingers.BringToFront();
|
||||
modifyButtonPinYinSingers.Refresh();
|
||||
}
|
||||
|
||||
if (clearButtonPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("clearButtonPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
clearButtonPinYinSingers.Visible = isVisible;
|
||||
if (isVisible) clearButtonPinYinSingers.BringToFront();
|
||||
clearButtonPinYinSingers.Refresh();
|
||||
}
|
||||
|
||||
if (closeButtonPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("closeButtonPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
closeButtonPinYinSingers.Visible = isVisible;
|
||||
if (isVisible) closeButtonPinYinSingers.BringToFront();
|
||||
closeButtonPinYinSingers.Refresh();
|
||||
}
|
||||
|
||||
if (inputBoxPinYinSingers == null)
|
||||
{
|
||||
Console.WriteLine("inputBoxPinYinSingers is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
inputBoxPinYinSingers.Visible = isVisible;
|
||||
if (isVisible) inputBoxPinYinSingers.BringToFront();
|
||||
inputBoxPinYinSingers.Refresh();
|
||||
}
|
||||
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
};
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -5,7 +5,6 @@ namespace DualScreenDemo
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
private PictureBox pictureBoxWordCountSingers;
|
||||
private Button[] numberWordCountButtonsForSingers;
|
||||
private Button modifyButtonWordCountSingers;
|
||||
private Button clearButtonWordCountSingers;
|
||||
private Button closeButtonWordCountSingers;
|
||||
|
@ -1,22 +1,220 @@
|
||||
using System.IO;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
/* 歌曲查詢 英文輸入 */
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
public partial class PrimaryForm
|
||||
{
|
||||
/* 主頁面設計 */
|
||||
private PictureBox pictureBoxEnglishSongs;
|
||||
|
||||
private Button[] numberButtonsForSongs;
|
||||
private Button[] letterButtonsForEnglishSongs;
|
||||
private int[] ButtonsNumberSymbols = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
||||
private string[] ButtonsEnglishSymbols = ["Q","W","E","R","T","Y","U","I","O","P",
|
||||
"A","S","D","F","G","H","J","K","L",
|
||||
"Z","X","C","V","B","N","M"];
|
||||
private Button modifyButtonEnglishSongs;
|
||||
private Button clearButtonEnglishSongs;
|
||||
private Button closeButtonEnglishSongs;
|
||||
private RichTextBox inputBoxEnglishSongs;
|
||||
|
||||
private void InitializeButtonsForEnglishSongs()
|
||||
{
|
||||
InitializeInputBoxEnglishSongs();
|
||||
InitializeEngAlphbtBtns(pictureBoxEnglishSongs,LetterButtonEnglishSongs_Click);
|
||||
InitializeEngSongsButton();
|
||||
}
|
||||
|
||||
private void InitializeEngSongsButton()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
modifyButtonEnglishSongs = new Button { Name = "modifyButtonEnglishSongs" };
|
||||
ConfigureButton(modifyButtonEnglishSongs, 650, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesEnglish"]["mouseDown"])),
|
||||
ModifyButtonEnglishSongs_Click);
|
||||
|
||||
pictureBoxEnglishSongs.Controls.Add(modifyButtonEnglishSongs);
|
||||
|
||||
|
||||
clearButtonEnglishSongs = new Button { Name = "clearButtonEnglishSongs" };
|
||||
ConfigureButton(clearButtonEnglishSongs, 8, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesEnglish"]["mouseDown"])),
|
||||
ClearButtonEnglishSongs_Click);
|
||||
|
||||
pictureBoxEnglishSongs.Controls.Add(clearButtonEnglishSongs);
|
||||
|
||||
|
||||
closeButtonEnglishSongs = new Button { Name = "closeButtonEnglishSongs" };
|
||||
ConfigureButton(closeButtonEnglishSongs, 730, 275, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesEnglish"]["mouseDown"])),
|
||||
CloseButtonEnglishSongs_Click);
|
||||
|
||||
pictureBoxEnglishSongs.Controls.Add(closeButtonEnglishSongs);
|
||||
}
|
||||
private void InitializeEngAlphbtBtns(Control control, EventHandler handler)
|
||||
{
|
||||
numberButtonsForSongs = new Button[10];
|
||||
letterButtonsForEnglishSongs = new Button[26];
|
||||
// 設置上排按鈕
|
||||
int x = 8;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CreateNumberBtns(i, x, 65, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
|
||||
x = 8;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CreateEngAlphbtBtns(i, x, 135, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
|
||||
x = 40;
|
||||
for (int i = 10; i < 19; i++)
|
||||
{
|
||||
CreateEngAlphbtBtns(i, x, 205, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
// 設置下排按鈕
|
||||
x = 88;
|
||||
for (int i = 19; i < 26; i++)
|
||||
{
|
||||
CreateEngAlphbtBtns(i, x, 275, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
}
|
||||
private void CreateEngAlphbtBtns(int index, int x, int y, Control control, EventHandler handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
// 創建語音按鈕並設置其屬性
|
||||
letterButtonsForEnglishSongs[index] = new Button
|
||||
{
|
||||
Name = $"ButtonsForEnglish_{ButtonsEnglishSymbols[index]}", // 按鈕名稱設為語音符號名稱
|
||||
};
|
||||
|
||||
ConfigureButton(letterButtonsForEnglishSongs[index], x, y, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["EnglishLetterButtonImages"][$"button{index}_mouseDown"])),
|
||||
handler);
|
||||
|
||||
// 設置按鈕的 Tag 屬性為對應的語音符號
|
||||
letterButtonsForEnglishSongs[index].Tag = ButtonsEnglishSymbols[index];
|
||||
|
||||
// 將按鈕添加到表單的控制項集合中
|
||||
control.Controls.Add(letterButtonsForEnglishSongs[index]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error creating button at index {index}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
private void CreateNumberBtns(int index, int x, int y, Control control, EventHandler handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
// 創建語音按鈕並設置其屬性
|
||||
numberButtonsForSongs[index] = new Button
|
||||
{
|
||||
Name = $"ButtonsForEnglish_{ButtonsNumberSymbols[index]}", // 按鈕名稱設為語音符號名稱
|
||||
};
|
||||
|
||||
ConfigureButton(numberButtonsForSongs[index], x, y, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["NumberButtonImages"][$"button{index}_mouseDown"])),
|
||||
handler);
|
||||
|
||||
// 設置按鈕的 Tag 屬性為對應的語音符號
|
||||
numberButtonsForSongs[index].Tag = ButtonsNumberSymbols[index];
|
||||
|
||||
// 將按鈕添加到表單的控制項集合中
|
||||
control.Controls.Add(numberButtonsForSongs[index]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error creating button at index {index}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeInputBoxEnglishSongs()
|
||||
{ /* 英文輸入介面設定,參考 config.ini */
|
||||
try
|
||||
{
|
||||
string fontName = "Times New Roman";
|
||||
float fontSize = 26;
|
||||
FontStyle fontStyle = FontStyle.Regular;
|
||||
Color foreColor = Color.Black;
|
||||
|
||||
inputBoxEnglishSongs = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxEnglishSongs",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxEnglishSongs, 10, 12, 455, 47);
|
||||
|
||||
pictureBoxEnglishSongs.Controls.Add(inputBoxEnglishSongs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
/* 圖片位置設置 */
|
||||
private void ShowImageOnPictureBoxEnglishSongs(string imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
pictureBoxEnglishSongs.Image = originalImage;
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxEnglishSongs, 390, 360, 808, 356);
|
||||
|
||||
pictureBoxEnglishSongs.Visible = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetEnglishSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
if (isVisible) SetUIVisible(pictureBoxEnglishSongs);
|
||||
else CloseUI(pictureBoxEnglishSongs);
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
};
|
||||
|
||||
if (pictureBoxEnglishSongs.InvokeRequired)
|
||||
{
|
||||
pictureBoxEnglishSongs.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
|
||||
private void EnglishSearchSongsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
zhuyinSearchSongButton.BackgroundImage = zhuyinSearchSongNormalBackground;
|
||||
@ -26,9 +224,6 @@ namespace DualScreenDemo
|
||||
handWritingSearchSongButton.BackgroundImage = handWritingSearchSongNormalBackground;
|
||||
numberSearchSongButton.BackgroundImage = numberSearchSongNormalBackground;
|
||||
|
||||
bool shouldBeVisible = !pictureBoxEnglishSongs.Visible;
|
||||
|
||||
|
||||
var configData = LoadBtnConfigData();
|
||||
string imagePath = Path.Combine(serverPath, configData["ImagePaths"]["EnglishSongs"]);
|
||||
|
||||
@ -44,79 +239,6 @@ namespace DualScreenDemo
|
||||
ResetinputBox();
|
||||
pictureBoxEnglishSongs.Visible = true;
|
||||
}
|
||||
|
||||
|
||||
private void InitializeNumberButtonsForSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
numberButtonCoords = LoadButtonCoordinates(data, "NumberButtonCoordinates", 10);
|
||||
var buttonImages = LoadButtonImages(data, "NumberButtonImages", 10);
|
||||
/* 按鈕圖片路徑設置 */
|
||||
numberButtonsForSongs = new Button[10];
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
string normalImagePath = buttonImages[$"button{i}"].normal;
|
||||
string mouseDownImagePath = buttonImages[$"button{i}"].mouseDown;
|
||||
string mouseOverImagePath = buttonImages[$"button{i}"].mouseOver;
|
||||
|
||||
|
||||
if (normalImagePath == null || mouseDownImagePath == null || mouseOverImagePath == null)
|
||||
{
|
||||
Console.WriteLine($"Error: One or more image paths for button{i} are null.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
numberButtonsForSongs[i] = CreateButton(
|
||||
$"numberButton_{i}",
|
||||
numberButtonCoords[i],
|
||||
normalImagePath,
|
||||
mouseDownImagePath,
|
||||
mouseOverImagePath,
|
||||
NumberButtonForSongs_Click
|
||||
);
|
||||
numberButtonsForSongs[i].Tag = (i + 1) % 10;
|
||||
this.Controls.Add(numberButtonsForSongs[i]);
|
||||
}
|
||||
}
|
||||
/* 按鈕按下事件 */
|
||||
private void NumberButtonForSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
var button = sender as Button;
|
||||
if (button != null && button.Tag != null)
|
||||
{
|
||||
if (inputBoxEnglishSongs.Visible)
|
||||
{
|
||||
inputBoxEnglishSongs.Text += button.Tag.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 鍵盤對應按鈕位置 */
|
||||
private void InitializeLetterButtonsForEnglishSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
var buttonImages = LoadButtonImages(data, "EnglishLetterButtonImages", 26);
|
||||
string qwertyLayout = "QWERTYUIOPASDFGHJKLZXCVBNM";
|
||||
letterButtonsForEnglishSongs = new Button[26];
|
||||
|
||||
for (int i = 0; i < 26; i++)
|
||||
{
|
||||
var coords = data["EnglishLetterButtonCoordinates"][$"button{i}"].Split(',');
|
||||
letterButtonsForEnglishSongs[i] = CreateButton(
|
||||
$"letterButton_{qwertyLayout[i]}",
|
||||
(int.Parse(coords[0]), int.Parse(coords[1]), int.Parse(coords[2]), int.Parse(coords[3])),
|
||||
buttonImages[$"button{i}"].normal,
|
||||
buttonImages[$"button{i}"].mouseDown,
|
||||
buttonImages[$"button{i}"].mouseOver,
|
||||
LetterButtonEnglishSongs_Click
|
||||
);
|
||||
letterButtonsForEnglishSongs[i].Tag = qwertyLayout[i];
|
||||
this.Controls.Add(letterButtonsForEnglishSongs[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private void LetterButtonEnglishSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -130,94 +252,21 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeButtonsForEnglishSongs()
|
||||
{
|
||||
InitializeNumberButtonsForSongs();
|
||||
InitializeLetterButtonsForEnglishSongs();
|
||||
|
||||
|
||||
InitializeModifyButtonEnglishSongs();
|
||||
|
||||
|
||||
InitializeClearButtonEnglishSongs();
|
||||
|
||||
|
||||
InitializeCloseButtonEnglishSongs();
|
||||
|
||||
InitializeInputBoxEnglishSongs();
|
||||
}
|
||||
|
||||
private void InitializeModifyButtonEnglishSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
modifyButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "modifyButtonEnglishSongs");
|
||||
var buttonImages = LoadButtonImages(data, "ModifyButtonImagesEnglish");
|
||||
|
||||
modifyButtonEnglishSongs = CreateSpecialButton(
|
||||
"btnModifyEnglishSongs",
|
||||
modifyButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ModifyButtonEnglishSongs_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(modifyButtonEnglishSongs);
|
||||
}
|
||||
|
||||
private void ModifyButtonEnglishSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (this.Controls.Contains(inputBoxEnglishSongs) && inputBoxEnglishSongs.Text.Length > 0)
|
||||
if (pictureBoxEnglishSongs.Controls.Contains(inputBoxEnglishSongs) && inputBoxEnglishSongs.Text.Length > 0)
|
||||
{
|
||||
inputBoxEnglishSongs.Text = inputBoxEnglishSongs.Text.Substring(0, inputBoxEnglishSongs.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeClearButtonEnglishSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
clearButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonEnglishSongs");
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesEnglish");
|
||||
|
||||
clearButtonEnglishSongs = CreateSpecialButton(
|
||||
"btnClearEnglishSongs",
|
||||
clearButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
ClearButtonEnglishSongs_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(clearButtonEnglishSongs);
|
||||
}
|
||||
|
||||
private void ClearButtonEnglishSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.Controls.Contains(inputBoxEnglishSongs) && inputBoxEnglishSongs.Text.Length > 0)
|
||||
if (pictureBoxEnglishSongs.Controls.Contains(inputBoxEnglishSongs) && inputBoxEnglishSongs.Text.Length > 0)
|
||||
{
|
||||
inputBoxEnglishSongs.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeCloseButtonEnglishSongs()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
closeButtonEnglishCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonEnglishSongs");
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesEnglish");
|
||||
|
||||
closeButtonEnglishSongs = CreateSpecialButton(
|
||||
"btnCloseEnglishSongs",
|
||||
closeButtonEnglishCoords,
|
||||
buttonImages.normal,
|
||||
buttonImages.mouseOver,
|
||||
buttonImages.mouseDown,
|
||||
CloseButtonEnglishSongs_Click
|
||||
);
|
||||
|
||||
this.Controls.Add(closeButtonEnglishSongs);
|
||||
}
|
||||
|
||||
private void CloseButtonEnglishSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@ -226,7 +275,8 @@ namespace DualScreenDemo
|
||||
SetEnglishSongsAndButtonsVisibility(false);
|
||||
FindEnglishSongs();
|
||||
}
|
||||
private void FindEnglishSongs(){
|
||||
private void FindEnglishSongs()
|
||||
{
|
||||
string searchText = inputBoxEnglishSongs.Text;
|
||||
// 檢查是否為空字串或空白字元
|
||||
string query = string.IsNullOrWhiteSpace(searchText)
|
||||
@ -240,206 +290,6 @@ namespace DualScreenDemo
|
||||
// 更新多頁面面板的內容
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSongs(searchResults);
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void InitializeInputBoxEnglishSongs()
|
||||
{ /* 英文輸入介面設定,參考 config.ini */
|
||||
try
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
parser.Parser.Configuration.AssigmentSpacer = "";
|
||||
parser.Parser.Configuration.CommentString = "#";
|
||||
parser.Parser.Configuration.CaseInsensitive = true;
|
||||
|
||||
|
||||
IniData data;
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
int x = int.Parse(data["InputBoxEnglishSongs"]["X"]);
|
||||
int y = int.Parse(data["InputBoxEnglishSongs"]["Y"]);
|
||||
int width = int.Parse(data["InputBoxEnglishSongs"]["Width"]);
|
||||
int height = int.Parse(data["InputBoxEnglishSongs"]["Height"]);
|
||||
string fontName = data["InputBoxEnglishSongs"]["FontName"];
|
||||
float fontSize = float.Parse(data["InputBoxEnglishSongs"]["FontSize"]);
|
||||
FontStyle fontStyle = (FontStyle)Enum.Parse(typeof(FontStyle), data["InputBoxEnglishSongs"]["FontStyle"]);
|
||||
Color foreColor = Color.FromName(data["InputBoxEnglishSongs"]["ForeColor"]);
|
||||
|
||||
inputBoxEnglishSongs = new RichTextBox
|
||||
{
|
||||
Visible = false,
|
||||
Name = "inputBoxEnglishSongs",
|
||||
ForeColor = foreColor,
|
||||
Font = new Font(fontName, fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, fontStyle)
|
||||
};
|
||||
|
||||
ResizeAndPositionControl(inputBoxEnglishSongs, x, y, width, height);
|
||||
|
||||
this.Controls.Add(inputBoxEnglishSongs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
/* 圖片位置設置 */
|
||||
private void ShowImageOnPictureBoxEnglishSongs(string imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
var parser = new FileIniDataParser();
|
||||
parser.Parser.Configuration.AssigmentSpacer = "";
|
||||
parser.Parser.Configuration.CommentString = "#";
|
||||
parser.Parser.Configuration.CaseInsensitive = true;
|
||||
|
||||
|
||||
IniData data;
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
int x = int.Parse(data["PictureBoxEnglishSongs"]["X"]);
|
||||
int y = int.Parse(data["PictureBoxEnglishSongs"]["Y"]);
|
||||
int width = int.Parse(data["PictureBoxEnglishSongs"]["Width"]);
|
||||
int height = int.Parse(data["PictureBoxEnglishSongs"]["Height"]);
|
||||
|
||||
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
|
||||
pictureBoxEnglishSongs.Image = originalImage;
|
||||
|
||||
|
||||
ResizeAndPositionPictureBox(pictureBoxEnglishSongs, x, y, width, height);
|
||||
|
||||
pictureBoxEnglishSongs.Visible = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void SetEnglishSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
|
||||
if (pictureBoxEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("pictureBoxEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
pictureBoxEnglishSongs.Visible = isVisible;
|
||||
if (isVisible) pictureBoxEnglishSongs.BringToFront();
|
||||
pictureBoxEnglishSongs.Refresh();
|
||||
}
|
||||
|
||||
if (numberButtonsForSongs == null)
|
||||
{
|
||||
Console.WriteLine("numberButtonsForSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var button in numberButtonsForSongs)
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
Console.WriteLine("A button in numberButtonsForSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
button.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (letterButtonsForEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("letterButtonsForEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var button in letterButtonsForEnglishSongs)
|
||||
{
|
||||
if (button == null)
|
||||
{
|
||||
Console.WriteLine("A button in letterButtonsForEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
button.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modifyButtonEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("modifyButtonEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
modifyButtonEnglishSongs.Visible = isVisible;
|
||||
if (isVisible) modifyButtonEnglishSongs.BringToFront();
|
||||
modifyButtonEnglishSongs.Refresh();
|
||||
}
|
||||
|
||||
if (clearButtonEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("clearButtonEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
clearButtonEnglishSongs.Visible = isVisible;
|
||||
if (isVisible) clearButtonEnglishSongs.BringToFront();
|
||||
clearButtonEnglishSongs.Refresh();
|
||||
}
|
||||
|
||||
if (closeButtonEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("closeButtonEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
closeButtonEnglishSongs.Visible = isVisible;
|
||||
if (isVisible) closeButtonEnglishSongs.BringToFront();
|
||||
closeButtonEnglishSongs.Refresh();
|
||||
}
|
||||
|
||||
if (inputBoxEnglishSongs == null)
|
||||
{
|
||||
Console.WriteLine("inputBoxEnglishSongs is null");
|
||||
}
|
||||
else
|
||||
{
|
||||
inputBoxEnglishSongs.Visible = isVisible;
|
||||
if (isVisible) inputBoxEnglishSongs.BringToFront();
|
||||
inputBoxEnglishSongs.Refresh();
|
||||
}
|
||||
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
};
|
||||
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,4 @@
|
||||
using System.IO;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
|
||||
namespace DualScreenDemo
|
||||
{
|
||||
@ -10,15 +8,193 @@ namespace DualScreenDemo
|
||||
private PictureBox pictureBoxPinYinSongs;
|
||||
// 存放拼音按鈕的陣列
|
||||
private Button[] letterButtonsForPinYinSongs;
|
||||
private string[] AlphabetSymbols=["Q","W","E","R","T","Y","U","I","O","P",
|
||||
"A","S","D","F","G","H","J","K","L",
|
||||
"Z","X","C","V","B","N","M"];
|
||||
// 特殊功能按鈕(修改、清除、關閉)
|
||||
private Button modifyButtonPinYinSongs;
|
||||
private Button clearButtonPinYinSongs;
|
||||
private Button closeButtonPinYinSongs;
|
||||
// 用於顯示輸入文字的輸入框
|
||||
private RichTextBox inputBoxPinYinSongs;
|
||||
/// <summary>
|
||||
/// 拼音歌曲搜尋按鈕點擊事件
|
||||
/// </summary>
|
||||
|
||||
|
||||
// 初始化拼音輸入相關的 UI 控件
|
||||
private void InitializeButtonsForPinYinSongs()
|
||||
{
|
||||
InitializeInputBoxPinYinSongs();
|
||||
InitializePinYinSongsButton();
|
||||
InitializeAlphbtBtns(pictureBoxPinYinSongs,LetterButtonPinYinSongs_Click);
|
||||
}
|
||||
|
||||
// 初始化拼音輸入框 (RichTextBox)
|
||||
private void InitializeInputBoxPinYinSongs()
|
||||
{
|
||||
try
|
||||
{
|
||||
//字型設定
|
||||
string fontName = "Times New Roman";
|
||||
float fontSize = 26;
|
||||
FontStyle fontStyle = FontStyle.Regular;
|
||||
Color foreColor = Color.Black;
|
||||
|
||||
// 創建拼音輸入框 (RichTextBox)
|
||||
inputBoxPinYinSongs = new RichTextBox
|
||||
{
|
||||
Visible = false, // 預設為隱藏
|
||||
Name = "inputBoxPinYinSongs", // 設定控制項名稱
|
||||
ForeColor = foreColor, // 設定文字顏色
|
||||
Font = new Font(
|
||||
fontName,
|
||||
fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, // 根據螢幕大小調整字體
|
||||
fontStyle
|
||||
)
|
||||
};
|
||||
|
||||
// 設定輸入框的位置與大小
|
||||
ResizeAndPositionControl(inputBoxPinYinSongs, 20,25, 448, 57);
|
||||
|
||||
pictureBoxPinYinSongs.Controls.Add(inputBoxPinYinSongs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
private void InitializePinYinSongsButton()
|
||||
{
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
modifyButtonPinYinSongs = new Button { Name = "modifyButtonPinYinSongs" };
|
||||
ConfigureButton(modifyButtonPinYinSongs, 650, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ModifyButtonImagesPinYin"]["mouseDown"])),
|
||||
ModifyButtonPinYinSongs_Click);
|
||||
|
||||
pictureBoxPinYinSongs.Controls.Add(modifyButtonPinYinSongs);
|
||||
|
||||
|
||||
clearButtonPinYinSongs = new Button { Name = "clearButtonPinYinSongs" };
|
||||
ConfigureButton(clearButtonPinYinSongs, 8, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["ClearButtonImagesPinYin"]["mouseDown"])),
|
||||
ClearButtonPinYinSongs_Click);
|
||||
|
||||
pictureBoxPinYinSongs.Controls.Add(clearButtonPinYinSongs);
|
||||
|
||||
|
||||
closeButtonPinYinSongs = new Button { Name = "closeButtonPinYinSongs" };
|
||||
ConfigureButton(closeButtonPinYinSongs, 730, 264, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["CloseButtonImagesPinYin"]["mouseDown"])),
|
||||
CloseButtonPinYinSongs_Click);
|
||||
|
||||
pictureBoxPinYinSongs.Controls.Add(closeButtonPinYinSongs);
|
||||
}
|
||||
|
||||
private void InitializeAlphbtBtns(Control control, EventHandler handler)
|
||||
{
|
||||
// 初始化字母按鈕陣列,總共有 26 個按鈕
|
||||
letterButtonsForPinYinSongs = new Button[26];
|
||||
|
||||
// 設置上排按鈕
|
||||
int x = 8;
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
CreateAlphbtBtns(i, x, 100, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
|
||||
x = 40;
|
||||
for (int i = 10; i < 19; i++)
|
||||
{
|
||||
CreateAlphbtBtns(i, x, 182, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
// 設置下排按鈕
|
||||
x = 88;
|
||||
for (int i = 19; i < 26; i++)
|
||||
{
|
||||
CreateAlphbtBtns(i, x, 264, control, handler);
|
||||
x += 80;
|
||||
}
|
||||
}
|
||||
private void CreateAlphbtBtns(int index, int x, int y,Control control,EventHandler handler)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 加載配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
// 創建語音按鈕並設置其屬性
|
||||
letterButtonsForPinYinSongs[index] = new Button
|
||||
{
|
||||
Name = $"PinYinLetterButtons_{AlphabetSymbols[index]}", // 按鈕名稱設為語音符號名稱
|
||||
};
|
||||
|
||||
ConfigureButton(letterButtonsForPinYinSongs[index], x, y, 72, 67,
|
||||
new Bitmap(Path.Combine(serverPath, data["PinYinLetterButtonImages"][$"button{index}_normal"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["PinYinLetterButtonImages"][$"button{index}_mouseOver"])),
|
||||
new Bitmap(Path.Combine(serverPath, data["PinYinLetterButtonImages"][$"button{index}_mouseDown"])),
|
||||
handler);
|
||||
|
||||
// 設置按鈕的 Tag 屬性為對應的語音符號
|
||||
letterButtonsForPinYinSongs[index].Tag = AlphabetSymbols[index];
|
||||
|
||||
// 將按鈕添加到表單的控制項集合中
|
||||
control.Controls.Add(letterButtonsForPinYinSongs[index]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error creating button at index {index}: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
// 顯示拼音歌曲圖片
|
||||
// <param name="imagePath">圖片路徑</param>
|
||||
private void ShowImageOnPictureBoxPinYinSongs(string imagePath)
|
||||
{
|
||||
// 使用指定的圖片路徑建立 Bitmap 影像
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
// 將載入的圖片設定為 pictureBoxPinYinSongs 的影像
|
||||
pictureBoxPinYinSongs.Image = originalImage;
|
||||
|
||||
// 調整 PictureBox 的大小與位置
|
||||
ResizeAndPositionPictureBox(pictureBoxPinYinSongs, 390, 360, 808, 356);
|
||||
// 顯示 PictureBox
|
||||
pictureBoxPinYinSongs.Visible = true;
|
||||
|
||||
}
|
||||
|
||||
// 設定拼音模式的 UI 是否可見
|
||||
// <param name="isVisible">是否可見</param>
|
||||
private void SetPinYinSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
// 定義一個委派 (Action),用於更新 UI 控件的可見性
|
||||
System.Action action = () =>
|
||||
{
|
||||
SuspendLayout();
|
||||
if (isVisible) SetUIVisible(pictureBoxPinYinSongs);
|
||||
else CloseUI(pictureBoxPinYinSongs);
|
||||
};
|
||||
|
||||
// 如果當前執行緒不是 UI 執行緒,則使用 Invoke 確保執行於 UI 執行緒
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#region 按鈕點擊事件
|
||||
// 拼音歌曲搜尋按鈕點擊事件
|
||||
private void PinyinSearchSongsButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 更新搜尋模式按鈕的背景圖
|
||||
@ -47,51 +223,8 @@ namespace DualScreenDemo
|
||||
ResetinputBox();
|
||||
pictureBoxPinYinSongs.Visible = true;
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化拼音按鈕
|
||||
/// </summary>
|
||||
private void InitializeLetterButtonsForPinYinSongs()
|
||||
{
|
||||
// 從設定檔 (config.ini) 讀取配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
// 從配置數據中載入拼音字母按鈕的影像 (包含正常、點擊、滑鼠懸停三種狀態)
|
||||
var buttonImages = LoadButtonImages(data, "PinYinLetterButtonImages", 26);
|
||||
|
||||
// 定義 QWERTY 鍵盤排列的字母順序
|
||||
string qwertyLayout = "QWERTYUIOPASDFGHJKLZXCVBNM";
|
||||
|
||||
// 初始化拼音按鈕陣列,長度為 26(對應英文字母)
|
||||
letterButtonsForPinYinSongs = new Button[26];
|
||||
|
||||
// 迴圈遍歷 26 個字母,依序建立按鈕
|
||||
for (int i = 0; i < 26; i++)
|
||||
{
|
||||
// 從配置檔案讀取當前按鈕的座標資訊 (X, Y, Width, Height)
|
||||
var coords = data["PinYinLetterButtonCoordinates"][$"button{i}"].Split(',');
|
||||
|
||||
// 建立拼音按鈕,並設定名稱、座標、影像與事件處理函式
|
||||
letterButtonsForPinYinSongs[i] = CreateButton(
|
||||
$"letterButton_{qwertyLayout[i]}", // 按鈕名稱,例如 "letterButton_Q"
|
||||
(int.Parse(coords[0]), int.Parse(coords[1]), int.Parse(coords[2]), int.Parse(coords[3])), // 解析座標數據
|
||||
buttonImages[$"button{i}"].normal, // 正常狀態影像
|
||||
buttonImages[$"button{i}"].mouseDown, // 按下狀態影像
|
||||
buttonImages[$"button{i}"].mouseOver, // 滑鼠懸停狀態影像
|
||||
LetterButtonPinYinSongs_Click // 點擊事件處理函式
|
||||
);
|
||||
|
||||
// 設定按鈕的標籤 (Tag) 為對應的字母,例如 Q、W、E...
|
||||
letterButtonsForPinYinSongs[i].Tag = qwertyLayout[i];
|
||||
|
||||
// 將按鈕新增到表單的控制項集合中,讓其顯示在介面上
|
||||
this.Controls.Add(letterButtonsForPinYinSongs[i]);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 處理拼音按鈕點擊事件
|
||||
/// </summary>
|
||||
/// <param name="sender">觸發事件按鈕</param>
|
||||
/// <param name="e">事件參數</param>
|
||||
// 處理拼音按鈕點擊事件
|
||||
private void LetterButtonPinYinSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 嘗試將觸發事件的物件轉換為 Button 類型
|
||||
@ -108,149 +241,26 @@ namespace DualScreenDemo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化拼音輸入相關的 UI 控件,包括字母按鈕、特殊功能按鈕(修改、清除、關閉),以及拼音輸入框。
|
||||
/// </summary>
|
||||
private void InitializeButtonsForPinYinSongs()
|
||||
{
|
||||
// 初始化拼音字母按鈕,根據 QWERTY 鍵盤佈局建立對應的按鈕
|
||||
InitializeLetterButtonsForPinYinSongs();
|
||||
|
||||
// 初始化特殊功能按鈕(修改、清除、關閉)
|
||||
InitializeSpecialButtonsForPinYinSongs();
|
||||
|
||||
// 初始化拼音輸入框,使用者可透過輸入拼音來搜尋歌曲
|
||||
InitializeInputBoxPinYinSongs();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化拼音輸入的特殊功能按鈕,包括:
|
||||
/// <para>1. 修改按鈕 - 刪除輸入框中的最後一個字母</para>
|
||||
/// <para>2. 清除按鈕 - 清空輸入框的內容</para>
|
||||
/// <para>3. 關閉按鈕 - 隱藏拼音輸入的 UI 元件</para>
|
||||
/// </summary>
|
||||
private void InitializeSpecialButtonsForPinYinSongs()
|
||||
{
|
||||
// 初始化「修改」按鈕(刪除輸入框最後一個字母)
|
||||
InitializeModifyButtonPinYinSongs();
|
||||
|
||||
// 初始化「清除」按鈕(清空輸入框內容)
|
||||
InitializeClearButtonPinYinSongs();
|
||||
|
||||
// 初始化「關閉」按鈕(關閉拼音輸入 UI)
|
||||
InitializeCloseButtonPinYinSongs();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化「修改」按鈕,提供刪除拼音輸入框最後一個字母的功能。
|
||||
/// </summary>
|
||||
private void InitializeModifyButtonPinYinSongs()
|
||||
{
|
||||
// 讀取設定檔,載入特殊按鈕的配置資料
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
// 從設定檔取得「修改按鈕」的座標與大小
|
||||
modifyButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "modifyButtonPinYinSongs");
|
||||
|
||||
// 讀取「修改按鈕」的圖片資源(一般狀態、滑鼠懸停、按下)
|
||||
var buttonImages = LoadButtonImages(data, "ModifyButtonImagesPinYin");
|
||||
|
||||
// 創建「修改」按鈕,並綁定點擊事件
|
||||
modifyButtonPinYinSongs = CreateSpecialButton(
|
||||
"btnModifyPinYinSongs", // 按鈕名稱
|
||||
modifyButtonPinYinCoords, // 設定按鈕的座標與大小
|
||||
buttonImages.normal, // 設定按鈕的正常狀態圖片
|
||||
buttonImages.mouseOver, // 設定按鈕的滑鼠懸停圖片
|
||||
buttonImages.mouseDown, // 設定按鈕的按下狀態圖片
|
||||
ModifyButtonPinYinSongs_Click // 綁定按鈕的點擊事件處理函式
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 「修改」按鈕點擊事件:刪除拼音輸入框 (inputBoxPinYinSongs) 中的最後一個字母。
|
||||
/// </summary>
|
||||
// 「修改」按鈕點擊事件:刪除拼音輸入框中的最後一個字母。
|
||||
private void ModifyButtonPinYinSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 確保 inputBoxPinYinSongs 存在於視窗控制項集合內,且輸入框內有文字
|
||||
if (this.Controls.Contains(inputBoxPinYinSongs) && inputBoxPinYinSongs.Text.Length > 0)
|
||||
if (pictureBoxPinYinSongs.Controls.Contains(inputBoxPinYinSongs) && inputBoxPinYinSongs.Text.Length > 0)
|
||||
{
|
||||
// 刪除輸入框內的最後一個字母
|
||||
inputBoxPinYinSongs.Text = inputBoxPinYinSongs.Text.Substring(0, inputBoxPinYinSongs.Text.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化「清除」按鈕 (clearButtonPinYinSongs),用於清空拼音輸入框 (inputBoxPinYinSongs)。
|
||||
/// </summary>
|
||||
private void InitializeClearButtonPinYinSongs()
|
||||
{
|
||||
// 從設定檔載入資料
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
// 讀取「清除」按鈕的座標配置 (X, Y, Width, Height)
|
||||
clearButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "clearButtonPinYinSongs");
|
||||
|
||||
// 載入「清除」按鈕的圖片 (一般狀態、滑鼠懸停、按下時的圖片)
|
||||
var buttonImages = LoadButtonImages(data, "ClearButtonImagesPinYin");
|
||||
|
||||
// 建立「清除」按鈕,設定對應的座標與圖片,並綁定點擊事件
|
||||
clearButtonPinYinSongs = CreateSpecialButton(
|
||||
"btnClearPinYinSongs", // 按鈕名稱
|
||||
clearButtonPinYinCoords, // 設定按鈕的座標與大小
|
||||
buttonImages.normal, // 設定按鈕的正常狀態圖片
|
||||
buttonImages.mouseOver, // 設定按鈕的滑鼠懸停圖片
|
||||
buttonImages.mouseDown, // 設定按鈕的按下狀態圖片
|
||||
ClearButtonPinYinSongs_Click // 綁定按鈕的點擊事件處理函式
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 清空拼音輸入框的內容。
|
||||
/// 當使用者點擊清除按鈕時,若輸入框存在且有內容,則將其清空。
|
||||
/// </summary>
|
||||
// 當使用者點擊清除按鈕時,若輸入框存在且有內容,則將其清空。
|
||||
private void ClearButtonPinYinSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 檢查視窗內是否包含 inputBoxPinYinSongs 控制項,且輸入框內是否有文字
|
||||
if (this.Controls.Contains(inputBoxPinYinSongs) && inputBoxPinYinSongs.Text.Length > 0)
|
||||
if (pictureBoxPinYinSongs.Controls.Contains(inputBoxPinYinSongs) && inputBoxPinYinSongs.Text.Length > 0)
|
||||
{
|
||||
// 清空拼音輸入框的內容
|
||||
inputBoxPinYinSongs.Text = "";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 初始化「關閉」按鈕 (closeButtonPinYinSongs),用於隱藏拼音輸入介面。
|
||||
/// </summary>
|
||||
private void InitializeCloseButtonPinYinSongs()
|
||||
{
|
||||
// 讀取設定檔中的按鈕配置數據
|
||||
var data = LoadBtnConfigData();
|
||||
|
||||
// 從設定檔中取得「關閉」按鈕的座標 (X, Y, Width, Height)
|
||||
closeButtonPinYinCoords = LoadSpecialButtonCoordinates(data, "SpecialButtonCoordinates", "closeButtonPinYinSongs");
|
||||
|
||||
// 從設定檔中讀取「關閉」按鈕的圖片 (一般狀態、滑鼠懸停、按下時的圖片)
|
||||
var buttonImages = LoadButtonImages(data, "CloseButtonImagesPinYin");
|
||||
|
||||
// 建立「關閉」按鈕,設定名稱、座標、圖片及點擊事件
|
||||
closeButtonPinYinSongs = CreateSpecialButton(
|
||||
"btnClosePinYinSongs", // 按鈕名稱
|
||||
closeButtonPinYinCoords, // 設定按鈕的座標與大小
|
||||
buttonImages.normal, // 設定按鈕的正常狀態圖片
|
||||
buttonImages.mouseOver, // 設定按鈕的滑鼠懸停圖片
|
||||
buttonImages.mouseDown, // 設定按鈕的按下狀態圖片
|
||||
CloseButtonPinYinSongs_Click // 綁定按鈕的點擊事件處理函式
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 關閉拼音輸入模式,隱藏相關 UI 元件。
|
||||
/// </summary>
|
||||
/// <param name="sender">觸發事件的按鈕。</param>
|
||||
/// <param name="e">事件參數。</param>
|
||||
private void CloseButtonPinYinSongs_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 隱藏拼音輸入的背景圖片 (可能是 UI 中的輸入框背景)
|
||||
@ -259,7 +269,6 @@ namespace DualScreenDemo
|
||||
// 設定拼音輸入框與所有相關按鈕的可見性為 false
|
||||
SetPinYinSongsAndButtonsVisibility(false);
|
||||
FindPinYinSongs();
|
||||
|
||||
}
|
||||
private void FindPinYinSongs(){
|
||||
string searchText = inputBoxPinYinSongs.Text;
|
||||
@ -276,230 +285,6 @@ namespace DualScreenDemo
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSongs(searchResults);
|
||||
}
|
||||
/// <summary>
|
||||
/// 初始化拼音輸入框 (RichTextBox),並從 config.ini 讀取相關設定。
|
||||
/// </summary>
|
||||
private void InitializeInputBoxPinYinSongs()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 創建一個 INI 檔案解析器
|
||||
var parser = new FileIniDataParser();
|
||||
|
||||
// 配置解析器的參數
|
||||
parser.Parser.Configuration.AssigmentSpacer = ""; // 設定 = 兩側沒有空格
|
||||
parser.Parser.Configuration.CommentString = "#"; // 使用 # 作為註解符號
|
||||
parser.Parser.Configuration.CaseInsensitive = true; // 參數名稱不區分大小寫
|
||||
|
||||
IniData data; // 儲存解析後的 INI 數據
|
||||
|
||||
// 讀取 config.ini 文件,使用 UTF-8 編碼
|
||||
using (var reader = new StreamReader("img.ini", System.Text.Encoding.UTF8))
|
||||
{
|
||||
data = parser.ReadData(reader);
|
||||
}
|
||||
|
||||
// **從 INI 檔案讀取拼音輸入框的位置與大小**
|
||||
int x = int.Parse(data["InputBoxPinYinSongs"]["X"]); // X 座標
|
||||
int y = int.Parse(data["InputBoxPinYinSongs"]["Y"]); // Y 座標
|
||||
int width = int.Parse(data["InputBoxPinYinSongs"]["Width"]); // 寬度
|
||||
int height = int.Parse(data["InputBoxPinYinSongs"]["Height"]); // 高度
|
||||
|
||||
// **讀取字型設定**
|
||||
string fontName = data["InputBoxPinYinSongs"]["FontName"]; // 字型名稱
|
||||
float fontSize = float.Parse(data["InputBoxPinYinSongs"]["FontSize"]); // 字體大小
|
||||
FontStyle fontStyle = (FontStyle)Enum.Parse(typeof(FontStyle), data["InputBoxPinYinSongs"]["FontStyle"]); // 字體樣式
|
||||
Color foreColor = Color.FromName(data["InputBoxPinYinSongs"]["ForeColor"]); // 文字顏色
|
||||
|
||||
// 創建拼音輸入框 (RichTextBox)
|
||||
inputBoxPinYinSongs = new RichTextBox
|
||||
{
|
||||
Visible = false, // 預設為隱藏
|
||||
Name = "inputBoxPinYinSongs", // 設定控制項名稱
|
||||
ForeColor = foreColor, // 設定文字顏色
|
||||
Font = new Font(
|
||||
fontName,
|
||||
fontSize / 900 * Screen.PrimaryScreen.Bounds.Height, // 根據螢幕大小調整字體
|
||||
fontStyle
|
||||
)
|
||||
};
|
||||
|
||||
// 設定輸入框的位置與大小
|
||||
ResizeAndPositionControl(inputBoxPinYinSongs, x, y, width, height);
|
||||
|
||||
// **綁定 TextChanged 事件 (當輸入內容改變時觸發搜尋)**
|
||||
/*inputBoxPinYinSongs.TextChanged += (sender, e) =>
|
||||
{
|
||||
string searchText = inputBoxPinYinSongs.Text;
|
||||
|
||||
// 根據拼音前綴篩選歌曲
|
||||
var searchResults = allSongs.Where(song => song.PinyinNotation.StartsWith(searchText)).ToList();
|
||||
|
||||
currentPage = 0; // 重置當前頁面索引
|
||||
currentSongList = searchResults; // 更新搜尋結果
|
||||
totalPages = (int)Math.Ceiling((double)searchResults.Count / itemsPerPage); // 計算總頁數
|
||||
|
||||
// 更新 UI,顯示搜尋結果
|
||||
multiPagePanel.currentPageIndex = 0;
|
||||
multiPagePanel.LoadSongs(currentSongList);
|
||||
};*/
|
||||
|
||||
// 將拼音輸入框加入視窗中
|
||||
this.Controls.Add(inputBoxPinYinSongs);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 發生錯誤時輸出錯誤訊息 (避免程式崩潰)
|
||||
Console.WriteLine($"An error occurred: {ex.Message}");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 存儲 PictureBoxPinYinSongs 的座標與尺寸信息。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 此元組包含以下四個值:
|
||||
/// X:X 座標
|
||||
/// , Y:Y 座標
|
||||
/// , Width:寬度
|
||||
/// , Height:高度
|
||||
/// </remarks>
|
||||
private (int X, int Y, int Width, int Height) pictureBoxPinYinSongCoords;
|
||||
|
||||
/// <summary>
|
||||
/// 從 config.ini 配置檔案中載入 PictureBoxPinYinSongs 的座標與尺寸設定。
|
||||
/// </summary>
|
||||
private void LoadPictureBoxPinYinSongCoordsFromConfig()
|
||||
{
|
||||
// 創建一個 INI 檔案解析器
|
||||
var parser = new FileIniDataParser();
|
||||
|
||||
// 讀取 config.ini 文件並解析成 IniData 對象
|
||||
string iniPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "img.ini");
|
||||
IniData data = parser.ReadFile(iniPath);
|
||||
|
||||
|
||||
// 取得 PictureBoxPinYinSongs 區段的設定值
|
||||
var coords = data["PictureBoxPinYinSongs"];
|
||||
|
||||
// 解析 X, Y, Width, Height,並存入 pictureBoxPinYinSongCoords
|
||||
pictureBoxPinYinSongCoords = (
|
||||
int.Parse(coords["X"]), // 解析 X 座標
|
||||
int.Parse(coords["Y"]), // 解析 Y 座標
|
||||
int.Parse(coords["Width"]), // 解析 寬度
|
||||
int.Parse(coords["Height"]) // 解析 高度
|
||||
);
|
||||
}
|
||||
/// <summary>
|
||||
/// 顯示拼音歌曲圖片
|
||||
/// </summary>
|
||||
/// <param name="imagePath">圖片路徑</param>
|
||||
private void ShowImageOnPictureBoxPinYinSongs(string imagePath)
|
||||
{
|
||||
// 從設定檔載入 PictureBox 的座標與大小
|
||||
LoadPictureBoxPinYinSongCoordsFromConfig();
|
||||
|
||||
// 使用指定的圖片路徑建立 Bitmap 影像
|
||||
Bitmap originalImage = new Bitmap(imagePath);
|
||||
|
||||
// 建立一個矩形,表示 PictureBox 應該顯示的範圍
|
||||
Rectangle displayArea = new Rectangle(
|
||||
pictureBoxPinYinSongCoords.X, // 設定 X 座標
|
||||
pictureBoxPinYinSongCoords.Y, // 設定 Y 座標
|
||||
pictureBoxPinYinSongCoords.Width, // 設定 寬度
|
||||
pictureBoxPinYinSongCoords.Height // 設定 高度
|
||||
);
|
||||
|
||||
// 將載入的圖片設定為 pictureBoxPinYinSongs 的影像
|
||||
pictureBoxPinYinSongs.Image = originalImage;
|
||||
|
||||
// 調整 PictureBox 的大小與位置,使其符合 displayArea 的設定
|
||||
ResizeAndPositionPictureBox(
|
||||
pictureBoxPinYinSongs,
|
||||
displayArea.X,
|
||||
displayArea.Y,
|
||||
displayArea.Width,
|
||||
displayArea.Height
|
||||
);
|
||||
|
||||
// 顯示 PictureBox
|
||||
pictureBoxPinYinSongs.Visible = true;
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 設定拼音模式的 UI 是否可見
|
||||
/// </summary>
|
||||
/// <param name="isVisible">是否可見</param>
|
||||
private void SetPinYinSongsAndButtonsVisibility(bool isVisible)
|
||||
{
|
||||
// 定義一個委派 (Action),用於更新 UI 控件的可見性
|
||||
System.Action action = () =>
|
||||
{
|
||||
// 暫停佈局更新,以防止 UI 閃爍或重繪時出現異常
|
||||
SuspendLayout();
|
||||
|
||||
// 設定 pictureBoxPinYinSongs 的可見性
|
||||
pictureBoxPinYinSongs.Visible = isVisible;
|
||||
if (isVisible) pictureBoxPinYinSongs.BringToFront(); // 確保顯示時位於最前方
|
||||
|
||||
// 設定所有拼音字母按鈕的可見性
|
||||
foreach (var button in letterButtonsForPinYinSongs)
|
||||
{
|
||||
button.Visible = isVisible;
|
||||
if (isVisible) button.BringToFront();
|
||||
}
|
||||
|
||||
// 設定 modifyButtonPinYinSongs (修改按鈕) 的可見性
|
||||
if (modifyButtonPinYinSongs != null)
|
||||
{
|
||||
modifyButtonPinYinSongs.Visible = isVisible;
|
||||
if (isVisible) modifyButtonPinYinSongs.BringToFront();
|
||||
}
|
||||
|
||||
// 設定 clearButtonPinYinSongs (清除按鈕) 的可見性
|
||||
if (clearButtonPinYinSongs != null)
|
||||
{
|
||||
clearButtonPinYinSongs.Visible = isVisible;
|
||||
if (isVisible) clearButtonPinYinSongs.BringToFront();
|
||||
}
|
||||
|
||||
// 設定 closeButtonPinYinSongs (關閉按鈕) 的可見性
|
||||
closeButtonPinYinSongs.Visible = isVisible;
|
||||
if (isVisible) closeButtonPinYinSongs.BringToFront();
|
||||
|
||||
// 設定 inputBoxPinYinSongs (輸入框) 的可見性
|
||||
inputBoxPinYinSongs.Visible = isVisible;
|
||||
if (isVisible) inputBoxPinYinSongs.BringToFront();
|
||||
|
||||
// 恢復佈局,允許 UI 更新
|
||||
ResumeLayout();
|
||||
PerformLayout();
|
||||
|
||||
// 刷新 pictureBoxPinYinSongs,確保畫面更新
|
||||
pictureBoxPinYinSongs.Refresh();
|
||||
|
||||
// 刷新拼音字母按鈕
|
||||
foreach (var button in letterButtonsForPinYinSongs)
|
||||
{
|
||||
button.Refresh();
|
||||
}
|
||||
|
||||
// 刷新其他按鈕與輸入框
|
||||
modifyButtonPinYinSongs.Refresh();
|
||||
clearButtonPinYinSongs.Refresh();
|
||||
closeButtonPinYinSongs.Refresh();
|
||||
inputBoxPinYinSongs.Refresh();
|
||||
};
|
||||
|
||||
// 如果當前執行緒不是 UI 執行緒,則使用 Invoke 確保執行於 UI 執行緒
|
||||
if (this.InvokeRequired)
|
||||
{
|
||||
this.Invoke(action);
|
||||
}
|
||||
else
|
||||
{
|
||||
action();
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
@ -14,7 +14,7 @@ namespace DualScreenDemo
|
||||
private static PrimaryForm primaryForm; // 儲存實例的參考
|
||||
public static Room room = new Room();
|
||||
|
||||
public static string verSion = "Server V2.10 202508270919";
|
||||
public static string verSion = "Server V2.10 202508291614";
|
||||
|
||||
[STAThread]
|
||||
static void Main()
|
||||
|
@ -74,8 +74,6 @@ namespace DualScreenDemo.Services
|
||||
return duration > 0 && Math.Abs(duration - time) < 1000;
|
||||
}
|
||||
|
||||
private bool _isTransitioning = false;
|
||||
|
||||
|
||||
public void LoadMedia(string filePath, int audioTrackIndex = 0)
|
||||
{
|
||||
|
@ -347,9 +347,11 @@ namespace DualScreenDemo
|
||||
{
|
||||
string pathToPlay = song.getFile();
|
||||
//同步畫面播放器載入media設置參數
|
||||
PrimaryForm.Instance.videoView0.Visible = false;
|
||||
_mediaService0.LoadMedia(pathToPlay, 0);
|
||||
_mediaService0.Player.Media.AddOption(":no-audio");
|
||||
_mediaService0.Player.AspectRatio = "8:5";
|
||||
PrimaryForm.Instance.videoView0.Visible = true;
|
||||
//影片畫面播放器載入media設置聲道
|
||||
_mediaService1.LoadMedia(pathToPlay, song.isPublicSong ? 0 : 1);
|
||||
//公播時註銷原唱按鈕事件
|
||||
|
206
img.ini
206
img.ini
@ -394,35 +394,13 @@ Y = 354
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PictureBoxEnglishSingers]
|
||||
X = 390
|
||||
Y = 350
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PictureBoxPinYinSingers]
|
||||
X = 390
|
||||
Y = 350
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PictureBoxZhuYinSongs]
|
||||
X = 390
|
||||
Y = 350
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PictureBoxEnglishSongs]
|
||||
X = 390
|
||||
Y = 350
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PictureBoxPinYinSongs]
|
||||
X = 390
|
||||
Y = 350
|
||||
Width = 808
|
||||
Height = 356
|
||||
|
||||
[PhoneticSymbols]
|
||||
Symbols=ㄅ,ㄉ,ㄍ,ㄐ,ㄓ,ㄗ,ㄛ,ㄡ,ㄤ,ㄧ,ㄆ,ㄊ,ㄎ,ㄑ,ㄔ,ㄘ,ㄜ,ㄢ,ㄦ,ㄨ,ㄇ,ㄋ,ㄏ,ㄒ,ㄕ,ㄙ,ㄞ,ㄣ,ㄩ,ㄈ,ㄌ, ,ㄖ,ㄚ,ㄠ
|
||||
@ -472,30 +450,11 @@ closeButtonZhuYinSingers = 1112,632,71,66
|
||||
modifyButtonZhuYinSongs =1035,632,71,66
|
||||
clearButtonZhuYinSongs = 408,632,71,66
|
||||
closeButtonZhuYinSongs = 1114,632,71,66
|
||||
modifyButtonEnglishSingers = 1032,633,70,66
|
||||
clearButtonEnglishSingers = 408,633,70,66
|
||||
closeButtonEnglishSingers = 1110,633,70,66
|
||||
modifyButtonPinYinSingers = 1032,612,70,84
|
||||
clearButtonPinYinSingers = 408,612,70,84
|
||||
closeButtonPinYinSingers = 1110,612,70,84
|
||||
modifyButtonEnglishSongs = 1032,633,70,66
|
||||
clearButtonEnglishSongs = 408,633,70,66
|
||||
closeButtonEnglishSongs = 1110,633,70,66
|
||||
modifyButtonPinYinSongs = 1032,612,70,84
|
||||
clearButtonPinYinSongs = 408,612,70,84
|
||||
closeButtonPinYinSongs = 1110,612,70,84
|
||||
modifyButtonWordCountSongs = 926,624,72,67
|
||||
clearButtonWordCountSongs = 845,624,72,67
|
||||
enterButtonWordCountSongs=1007,624,72,67
|
||||
closeButtonWordCountSongs = 1088,624,72,67
|
||||
modifyButtonWordCountSingers = 926,624,72,67
|
||||
clearButtonWordCountSingers = 845,624,72,67
|
||||
enterButtonWordCountSingers=1007,624,72,67
|
||||
closeButtonWordCountSingers = 1088,624,72,67
|
||||
modifyButtonSongIDSearch = 826,626,94,87
|
||||
clearButtonSongIDSearch = 721,626,93,87
|
||||
closeButtonSongIDSearch = 1038,626,94,87
|
||||
enterButtonSongIDSearch = 931,626,94,87
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[ModifyButtonImagesZhuYin]
|
||||
normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(拼音按鍵)_←.png
|
||||
@ -630,17 +589,7 @@ button34_normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星
|
||||
button34_mouseDown = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(注音按鍵)_ㄠ 複本.png
|
||||
button34_mouseOver = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(注音按鍵)_ㄠ.png
|
||||
|
||||
[NumberButtonCoordinates]
|
||||
button1 = 408,418,70,66
|
||||
button2 = 486,418,70,66
|
||||
button3 = 564,418,70,66
|
||||
button4 = 642,418,70,66
|
||||
button5 = 720,417,70,66
|
||||
button6 = 798,418,70,66
|
||||
button7 = 876,418,70,66
|
||||
button8 = 954,418,70,66
|
||||
button9 = 1033,418,70,66
|
||||
button10 = 1111,418,70,66
|
||||
|
||||
|
||||
[NumberButtonImages]
|
||||
button0_normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_1.png
|
||||
@ -674,33 +623,7 @@ button9_normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星
|
||||
button9_mouseDown = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_0 複本.png
|
||||
button9_mouseOver = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_0.png
|
||||
|
||||
[EnglishLetterButtonCoordinates]
|
||||
button0 = 408,490,70,66
|
||||
button1 = 486,490,70,66
|
||||
button2 = 564,490,70,66
|
||||
button3 = 642,490,70,66
|
||||
button4 = 720,489,70,66
|
||||
button5 = 798,490,70,66
|
||||
button6 = 876,490,70,66
|
||||
button7 = 954,490,70,66
|
||||
button8 = 1033,490,70,66
|
||||
button9 = 1111,490,70,66
|
||||
button10 = 449,561,70,66
|
||||
button11 = 527,561,70,66
|
||||
button12 = 605,561,70,66
|
||||
button13 = 683,561,70,66
|
||||
button14 = 761,561,70,66
|
||||
button15 = 839,561,70,66
|
||||
button16 = 917,561,70,66
|
||||
button17 = 995,561,70,66
|
||||
button18 = 1073,561,70,66
|
||||
button19 = 486,633,70,66
|
||||
button20 = 564,633,70,66
|
||||
button21 = 642,633,70,66
|
||||
button22 = 720,634,70,66
|
||||
button23 = 798,633,70,66
|
||||
button24 = 876,633,70,66
|
||||
button25 = 954,633,70,66
|
||||
|
||||
|
||||
[EnglishLetterButtonImages]
|
||||
button0_normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_Q.png
|
||||
@ -797,43 +720,8 @@ normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(
|
||||
mouseOver = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_關閉.png
|
||||
mouseDown = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(英文按鍵)_關閉 複本.png
|
||||
|
||||
[InputBoxEnglishSingers]
|
||||
X = 408
|
||||
Y = 361
|
||||
Width = 444
|
||||
Height = 47
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[PinYinLetterButtonCoordinates]
|
||||
button0 = 408,438,70,82
|
||||
button1 = 486,438,70,82
|
||||
button2 = 564,438,70,82
|
||||
button3 = 642,438,70,82
|
||||
button4 = 720,438,70,82
|
||||
button5 = 798,438,70,82
|
||||
button6 = 876,438,70,82
|
||||
button7 = 954,438,70,82
|
||||
button8 = 1032,438,70,82
|
||||
button9 = 1110,438,70,82
|
||||
button10 = 447,526,70,82
|
||||
button11 = 525,526,70,82
|
||||
button12 = 603,526,70,82
|
||||
button13 = 681,526,70,82
|
||||
button14 = 759,526,70,82
|
||||
button15 = 837,526,70,82
|
||||
button16 = 915,526,70,82
|
||||
button17 = 993,526,70,82
|
||||
button18 = 1071,526,70,82
|
||||
button19 = 486,614,70,82
|
||||
button20 = 564,614,70,82
|
||||
button21 = 642,614,70,82
|
||||
button22 = 720,614,70,82
|
||||
button23 = 798,614,70,82
|
||||
button24 = 876,614,70,82
|
||||
button25 = 954,614,70,82
|
||||
|
||||
|
||||
[PinYinLetterButtonImages]
|
||||
button0_normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(拼音按鍵)_Q.png
|
||||
@ -930,15 +818,7 @@ normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(
|
||||
mouseOver = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(拼音按鍵)_關閉.png
|
||||
mouseDown = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(拼音按鍵)_關閉 複本.png
|
||||
|
||||
[InputBoxPinYinSingers]
|
||||
X = 408
|
||||
Y = 371
|
||||
Width = 444
|
||||
Height = 57
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
|
||||
[RefillButtonImagesHandWriting]
|
||||
normal = themes\superstar\button\4.查詢\3.歌星查詢按鍵\3.歌星查詢(手寫按鍵)_重填.png
|
||||
@ -965,25 +845,6 @@ FontSize=26
|
||||
FontStyle=Bold
|
||||
ForeColor=Black
|
||||
|
||||
[InputBoxEnglishSongs]
|
||||
X = 408
|
||||
Y = 361
|
||||
Width = 444
|
||||
Height = 47
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[InputBoxPinYinSongs]
|
||||
X = 408
|
||||
Y = 371
|
||||
Width = 444
|
||||
Height = 57
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
|
||||
[NumberWordCountButtonImages]
|
||||
@ -1018,13 +879,12 @@ button9_normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名
|
||||
button9_mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_0 複本.png
|
||||
button9_mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_0.png
|
||||
|
||||
|
||||
[ClearButtonImagesWordCount]
|
||||
[ModifyButtonImagesWordCount]
|
||||
normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除.png
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_清除 複本.png
|
||||
|
||||
[ModifyButtonImagesWordCount]
|
||||
[ClearButtonImagesWordCount]
|
||||
normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填.png
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(手寫按鍵)_重填 複本.png
|
||||
@ -1039,37 +899,9 @@ normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_確認.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(字數按鍵)_確認 複本.png
|
||||
|
||||
[PictureBoxSongIDSearch]
|
||||
X = 645
|
||||
Y = 280
|
||||
Width = 554
|
||||
Height = 442
|
||||
|
||||
[InputBoxSongIDSearch]
|
||||
X = 660
|
||||
Y = 360
|
||||
Width = 528
|
||||
Height = 63
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[NumberSongIDSymbols]
|
||||
Symbols=1,2,3,4,5,6,7,8,9,0
|
||||
|
||||
[NumberSongIDButtonCoordinates]
|
||||
button0 = 652,550,94,87
|
||||
button1 = 665,435,94,87
|
||||
button2 = 771,435,94,87
|
||||
button3 = 879,435,94,87
|
||||
button4 = 985,435,94,87
|
||||
button5 = 1092,435,94,87
|
||||
button6 = 665,532,94,87
|
||||
button7 = 772,532,94,87
|
||||
button8 = 879,532,94,87
|
||||
button9 = 985,532,94,87
|
||||
button10 = 1092,532,94,87
|
||||
|
||||
[NumberSongIDButtonImages]
|
||||
button0_normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(編號按鍵)_1.png
|
||||
@ -1123,21 +955,5 @@ normal = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(
|
||||
mouseOver = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(編號按鍵)_確認.png
|
||||
mouseDown = themes\superstar\button\4.查詢\4.歌名查詢按鍵\4.歌名查詢(編號按鍵)_確認 複本.png
|
||||
|
||||
[PictureBoxWordCountSingers]
|
||||
X = 790
|
||||
Y = 350
|
||||
Width = 420
|
||||
Height = 350
|
||||
|
||||
[InputBoxWordCountSingers]
|
||||
X = 800
|
||||
Y = 405
|
||||
Width = 400
|
||||
Height = 60
|
||||
FontName = Times New Roman
|
||||
FontSize = 26
|
||||
FontStyle = Regular
|
||||
ForeColor = Black
|
||||
|
||||
[ImageSrc]
|
||||
path=\\sshost\KTVSuperstar
|
Loading…
x
Reference in New Issue
Block a user