Работа в процессе. Добавление файлов

This commit is contained in:
sasha80
2023-07-21 16:24:04 +03:00
parent f801656cd3
commit 41cb996d4c
3 changed files with 88 additions and 0 deletions

35
scenes/frm_threats.gd Normal file
View File

@@ -0,0 +1,35 @@
extends "res://scenes/рамка.gd"
var TableHeader = preload('res://table/header.tscn')
var TableNode = preload('res://table/node.tscn')
func _ready() -> void:
assert(TableHeader)
assert(TableNode)
call_deferred('init_table')
func init_table():
$scrl_threats/tbl_threats.set_header([TableHeader, TableHeader, TableHeader, TableHeader])
$scrl_threats/tbl_threats.set_header_text(['Номер', 'Пеленг', 'Частота, МГц', 'Назначено'])
$scrl_threats/tbl_threats.set_columns_min_size([50, 140, 140, 100])
$scrl_threats/tbl_threats.pin_header($scrl_threats, self)
$scrl_threats/tbl_threats.connect('row_pressed', Callable(self, 'on_row_pressed'))
func on_row_pressed(i_row: int):
$scrl_threats/tbl_threats.set_row_selected(i_row, true)
func _on_btn_add_thr_pressed() -> void:
var i_row = $scrl_threats/tbl_threats.get_rows_count()
$scrl_threats/tbl_threats.add_row([TableNode, TableNode, TableNode, TableNode])
$scrl_threats/tbl_threats.set_row_text(i_row, ['%d' % i_row, '%d' % ((i_row * 100) + 2000), '%d' % ((i_row * 20) % 360), 'Нет'])
func _on_btn_del_thr_pressed() -> void:
var i_rows: = Array()
$scrl_threats/tbl_threats.get_selected_rows(i_rows)
for i in i_rows:
$scrl_threats/tbl_threats.remove_row(i)

15
scenes/tab_switch.gd Normal file
View File

@@ -0,0 +1,15 @@
extends TabContainer
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _enter_tree() -> void:
REPNetwork.logger_page = $'журнал'