-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass.TcPage.js
More file actions
executable file
·93 lines (91 loc) · 5.33 KB
/
class.TcPage.js
File metadata and controls
executable file
·93 lines (91 loc) · 5.33 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
/*---------------------------------------------------------------------------------------------------------
Mantenedor : Rodrigo Dittmar
Linguaguem : javascript (2.1)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Modulo : Controla o "Desktop"
---------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------
TcPage : Classe de gerenciamento do desktop/Janelas e Formularios
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------------------------------------------*/
function TcPage( ) {
this.FMouse = new TcMouse( true ); //Armazena o ponteiro do mouse
//this.FKey = new TcKey( true ); //Teclas Pressionadas
this.FSKey = new Array(); //Armazena as Teclas de Funcoes (ShortCut)
//------------------------------------------------
//this.FWindows = new TcWindows(); //Armazena os dados das Janelas
//------------------------------------------------
//this.FConfig = new TcConfig(); //Armazena as configuracoes
};
/*=========================================================================================================
Manutencao dos Eventos
/*---------------------------------------------------------------------------------------------------------
addEvent : Adiciona eventos ao sistema - Variavel global esEvent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
o :variant : ID do elemento ( String ou DOM Element)
event :string : nome do evento
js :string : codigo javascript
propagate :boolean : Nao Permite Evento em cascata ( true / nao permite )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------------------------------------------*/
TcPage.prototype.addEvent=function( o , event , js , propagate ) {
this.addEvent( o , event , js , propagate );
};
/*=========================================================================================================
Funcoes Auxiliares de Manutencao das Janelas
/*---------------------------------------------------------------------------------------------------------
destroy : Destroi uma janela e seus filhos/Eventos/Formularios
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
o :string : ID do Elemento DOM ou * para todas as janelas
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------------------------------------------*/
TcPage.prototype.destroy=function( o ) {
this.FWindows.destroy( o );
};
/*---------------------------------------------------------------------------------------------------------
setKey : Associa uma tecla a um evento do sistema
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
event :string : Evento interno da chamada
key :Object JS : Valor das teclas para acesso
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
---------------------------------------------------------------------------------------------------------
TcPage.prototype.setKey=function( event , key ) {
var events = new Object, obj = this, js;
//recuperando a codificacao das teclas
key = {'char' :key.char,
'ctrl' :(key.ctrl?key.ctrl:false),
'alt' :(key.alt?key.alt:false),
'shift':(key.shift?key.shift:false)};
//Fecha a janela corrente
events.closewindow = function( event , target ) {
var form = target.form.id.substring(2);
if( obj.FWindows.FWindows[ form ].FType == 'F' )
obj.destroy( form );
stopPropagation(event);
};
//Abre a Janela de Busca
events.recordbrowse = function( event , target ) {
var form = target.form.id.substring(2);
var field = target.id.substring( target.form.id.length );
if( obj.FWindows.FWindows[ form ].FField[ field ].FSeek ) {
obj.getBrowse( form , field );
};
stopPropagation(event);
};
//Acesso a tela do registro
events.recordlink = function( event , target ) { stopPropagation(event); };
//Consultar
events.recordc = function( event , target ) { stopPropagation(event); };
//Alterar (update)
events.recordu = function( event , target ) { stopPropagation(event); };
//Incluir (insert)
events.recordi = function( event , target ) { stopPropagation(event); };
//Excluir (delete)
events.recordd = function( event , target ) { stopPropagation(event); };
//------------------------------------------------
//Incluindo o Evento
if( events[event] ) {
this.FKey.shortCut( key , events[event] );
}
};*/