1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Set focus to class name when opening Class Generator

This commit is contained in:
disarray2077 2025-02-18 20:26:01 -03:00 committed by GitHub
parent 6e0cabf8aa
commit ad22d71e21
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -63,7 +63,7 @@ namespace System
mCmdInfo.Append("\n");
}
public void AddEdit(StringView dataName, StringView label, StringView defaultValue)
public void AddEdit(StringView dataName, StringView label, StringView defaultValue, bool focus = false)
{
mCmdInfo.AppendF($"addEdit\t");
dataName.QuoteString(mCmdInfo);
@ -71,7 +71,7 @@ namespace System
label.QuoteString(mCmdInfo);
mCmdInfo.Append("\t");
defaultValue.QuoteString(mCmdInfo);
mCmdInfo.Append("\n");
mCmdInfo.AppendF($"\t{focus}\n");
}
public void AddFilePath(StringView dataName, StringView label, StringView defaultValue)
@ -216,7 +216,7 @@ namespace System
public override void InitUI()
{
AddEdit("name", "Class Name", "");
AddEdit("name", "Class Name", "", true);
}
public override void Generate(String outFileName, String outText, ref Flags generateFlags)

View file

@ -581,12 +581,15 @@ namespace IDE.ui
uiEntry.mName = partItr.GetNext().Value.UnQuoteString(.. new .());
uiEntry.mLabel = partItr.GetNext().Value.UnQuoteString(.. new .());
var defaultValue = partItr.GetNext().Value.UnQuoteString(.. scope .());
var focus = partItr.GetNext().Value;
DarkEditWidget editWidget = new DarkEditWidget();
uiEntry.mWidget = editWidget;
editWidget.SetText(defaultValue);
editWidget.mEditWidgetContent.SelectAll();
editWidget.mOnSubmit.Add(new => EditSubmitHandler);
AddWidget(editWidget);
if (focus == "True")
editWidget.SetFocus();
mUIEntries.Add(uiEntry);
mTabWidgets.Add(editWidget);
case "addFilePath", "addFolderPath":