-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmrs_password.php
More file actions
97 lines (95 loc) · 3.39 KB
/
mrs_password.php
File metadata and controls
97 lines (95 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
namespace app\MrsUI;
use std, gui, framework, app;
class mrs_password
{
var $pass;
var $isKeyLose;
public function Mrs_password_show($title,$txt,$Animation_show)
{
//Mrs_alert
$form = new UXForm();
$form->centerOnScreen();//Оцентровать по середине
$form->modality = 'APPLICATION_MODAL';
$form->layout->size = [448,304];
$form->style = 'TRANSPARENT';
$form->layout->backgroundColor = 'transparent';
$form->transparent = true;
$form->title = $title;
//end settings
$background = new UXRectangle();
$background->size = [400,256];
$background->position = [24,24];
$background->fillColor = 'white';
$background->focusTraversable = false;
//buttonMove
$move = new UXMaterialButton();
$move->position = [24,24];
$move->size = [400,32];
$move->focusTraversable = false;
$move->text = $title;
//buttonApply
$buttonApply = new UXMaterialButton();
$buttonApply->position = [384,24];
$buttonApply->size = [32,32];
$buttonApply->focusTraversable = false;
$buttonApply->backgroundColor = '#ccffcc';
$buttonApply->text = 'Ok';
//text
$text = new UXLabel();
$text->position = [24,56];
$text->size = [400,224];
$text->text = $txt;
$text->alignment = 'TOP_LEFT';
$text->wrapText = true;
//password_Field
$password = new UXPasswordField();
$password->position = [24,248];
$password->size = [400,32];
$password->focusTraversable = false;
$password->promptText = 'Введите пароль...';
//shadow(background)
$Shadow = new DropShadowEffectBehaviour();
$Shadow->apply($background);//Add background
//moveEffect
$move_ = new DraggingFormBehaviour();
$move_->opacityEnabled = true;
$move_->apply($move);
//ограничение символов -> !
if($this->isKeyLose)//Iskeylose :)
{
$keylose = new KeyInputRuleBehaviour();
$keylose->allowedSymbols = '1234567890_-zaqxswcdevfrbgtnhymjukilopяфйчыцсвумакипетрньогблшюдщжзэхъ';//Типо какие символы возможно использовать )
$keylose->apply($password);//ApLyA
}
//Event
$buttonApply->on('click', function () use ($form,$password)
{
if($password->text == $this->pass)
{
UXDialog::showAndWait('Успешна!','INFORMATION');
$form->hide();
$password->text = null;
}
else
{
UXDialog::showAndWait('Введен не верный пароль!','ERROR');
$password->text = null;
}
});
//add component
$form->add($background);
$form->add($move);
$form->add($buttonApply);
$form->add($text);
$form->add($password);
//showing
if($Animation_show == true)
{
$time = 2000;//use time add
$form->opacity = 0; // делаем её прозрачной
Animation::fadeIn($form, $time);
}
$form->showAndWait();//Create Форм типа создать форму ))0
}
}