select solution
This commit is contained in:
20
src/SharpIDE.Godot/IdeRoot.cs
Normal file
20
src/SharpIDE.Godot/IdeRoot.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Godot;
|
||||
|
||||
namespace SharpIDE.Godot;
|
||||
|
||||
public partial class IdeRoot : Control
|
||||
{
|
||||
private Button _openSlnButton = null!;
|
||||
private FileDialog _fileDialog = null!;
|
||||
public override void _Ready()
|
||||
{
|
||||
_openSlnButton = GetNode<Button>("%OpenSlnButton");
|
||||
_fileDialog = GetNode<FileDialog>("%OpenSolutionDialog");
|
||||
_fileDialog.FileSelected += OnFileSelected;
|
||||
}
|
||||
|
||||
private void OnFileSelected(string path)
|
||||
{
|
||||
GD.Print($"Selected: {path}");
|
||||
}
|
||||
}
|
||||
1
src/SharpIDE.Godot/IdeRoot.cs.uid
Normal file
1
src/SharpIDE.Godot/IdeRoot.cs.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bavypuy7b375x
|
||||
@@ -1,4 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://b2oniigcp5ew5"]
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b2oniigcp5ew5"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bavypuy7b375x" path="res://IdeRoot.cs" id="1_whawi"]
|
||||
|
||||
[node name="IdeRoot" type="Control"]
|
||||
layout_mode = 3
|
||||
@@ -7,6 +9,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_whawi")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 1
|
||||
@@ -20,6 +23,13 @@ grow_vertical = 2
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="OpenSlnButton" type="Button" parent="VBoxContainer/Panel"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 78.0
|
||||
offset_bottom = 31.0
|
||||
text = "Open Sln"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
@@ -41,3 +51,14 @@ layout_mode = 2
|
||||
gutters_draw_line_numbers = true
|
||||
code_completion_enabled = true
|
||||
auto_brace_completion_enabled = true
|
||||
|
||||
[node name="OpenSolutionDialog" type="FileDialog" parent="."]
|
||||
unique_name_in_owner = true
|
||||
title = "Open a File"
|
||||
visible = true
|
||||
ok_button_text = "Open"
|
||||
dialog_hide_on_ok = true
|
||||
file_mode = 0
|
||||
access = 2
|
||||
filters = PackedStringArray("*.sln", "*.slnx")
|
||||
use_native_dialog = true
|
||||
|
||||
Reference in New Issue
Block a user