Skip to content

Commit 253d424

Browse files
committed
Update 16.5
1 parent 3fffb26 commit 253d424

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

develnext/src/ide/editors/FormEditor.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,6 +1937,11 @@ protected function makeDesigner($fullArea = false)
19371937
protected function makeContextMenu()
19381938
{
19391939
$this->contextMenu = new ContextMenu($this, $this->format->getContextCommands());
1940+
$this->contextMenu->addSeparator();
1941+
$this->contextMenu->addCommand(AbstractCommand::makeWithText('События объекта', null, function () {
1942+
$this->eventListPane->showEventMenu(true, $this->designer->pickedNode);
1943+
}));
1944+
19401945
$this->contextMenu->setFilter(function () {
19411946
return $this->layout->focused || $this->contextMenu->getRoot()->visible || $this->layout->findFocusedNode();
19421947
});

develnext/src/ide/project/behaviours/GuiFrameworkProjectBehaviour.php

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@
4949
use ide\utils\FileUtils;
5050
use ide\utils\Json;
5151
use php\gui\event\UXEvent;
52+
use php\gui\framework\AbstractForm;
53+
use php\gui\framework\AbstractModule;
5254
use php\gui\layout\UXHBox;
5355
use php\gui\layout\UXVBox;
5456
use php\gui\UXApplication;
@@ -855,9 +857,18 @@ public function createModule($name)
855857
$template = new PhpClassFileTemplate($name, 'AbstractModule');
856858
$template->setNamespace("{$this->project->getPackageName()}\\modules");
857859

858-
$template->setImports([
859-
"std, gui, framework, {$this->project->getPackageName()}"
860-
]);
860+
861+
$php = PhpProjectBehaviour::get();
862+
863+
if ($php && $php->getImportType() == 'package') {
864+
$template->setImports([
865+
"std, gui, framework, {$this->project->getPackageName()}"
866+
]);
867+
} else {
868+
$template->setImports([
869+
AbstractModule::class
870+
]);
871+
}
861872

862873
$file = $this->project->createFile("src/{$this->project->getPackageName()}/modules/$name.php", $template);
863874

@@ -1012,9 +1023,18 @@ public function createForm($name, $namespace = null)
10121023
$template = new PhpClassFileTemplate($name, 'AbstractForm');
10131024

10141025
$template->setNamespace($namespace);
1015-
$template->setImports([
1016-
"std, gui, framework, {$this->project->getPackageName()}"
1017-
]);
1026+
1027+
$php = PhpProjectBehaviour::get();
1028+
1029+
if ($php && $php->getImportType() == 'package') {
1030+
$template->setImports([
1031+
"std, gui, framework, {$this->project->getPackageName()}"
1032+
]);
1033+
} else {
1034+
$template->setImports([
1035+
AbstractForm::class
1036+
]);
1037+
}
10181038

10191039
$sources = $this->project->createFile($this->project->getAbsoluteFile("$file.php"), $template);
10201040
$sources->applyTemplate($template);

develnext/src/ide/project/behaviours/PhpProjectBehaviour.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ public function doMakeSettings(CommonProjectControlPane $editor)
570570
$importTitle = new UXLabel('Метод импортирования классов:');
571571
$importTypeSelect = new UXComboBox(self::$importTypes);
572572

573+
$importTypeSelect->on('action', function () {
574+
uiLater(function () {
575+
$this->setImportType(arr::keys(static::$importTypes)[$this->uiImportTypesSelect->selectedIndex]);
576+
});
577+
});
578+
573579
$this->uiImportTypesSelect = $importTypeSelect;
574580

575581
$importTypeSelect->padding = 5;

0 commit comments

Comments
 (0)