Salome HOME
Fix for problem: SIGSEGV appears if to select group after opening "Edit Group" dialog...
[modules/smesh.git] / doc / salome / gui / SMESH / whframes.js
1 // this value should be identical to the value used in whproxy.js\r
2 window.whname = "wh_stub";\r
3 \r
4 // this file will be used by Topic and NavBar and NavPane and other components\r
5 // and this file is used in child frame html.\r
6 // and the whstub.js will be used in the start page.\r
7 // see reference in whstub.js.\r
8 // Internal Area\r
9 var gbInited = false;\r
10 var gWndStubPage = null;\r
11 function getStubPage()\r
12 {\r
13         if (!gbInited)\r
14         {\r
15                 gWndStubPage = getStubPage_inter(window);\r
16                 gbInited = true;\r
17         }\r
18         return gWndStubPage;\r
19 }\r
20 \r
21 function getStubPage_inter(wCurrent) {\r
22         if (null == wCurrent.parent || wCurrent.parent == wCurrent)\r
23                 return null;\r
24 \r
25         if (wCurrent.parent.whname && "wh_stub" == wCurrent.parent.whname) \r
26                 return wCurrent.parent;\r
27         else\r
28                 if (wCurrent.parent.frames.length != 0 && wCurrent.parent != wCurrent)\r
29                         return getStubPage_inter(wCurrent.parent);\r
30                 else \r
31                         return null;\r
32 }\r
33 \r
34 // Public interface begin here................\r
35 function RegisterListener(framename, nMessageId)\r
36 {\r
37         var wStartPage = getStubPage();\r
38         if (wStartPage && wStartPage != this) {\r
39                 return wStartPage.RegisterListener(framename, nMessageId);\r
40         }\r
41         else \r
42                 return false;\r
43 }\r
44 \r
45 function RegisterListener2(oframe, nMessageId)\r
46 {\r
47         var wStartPage = getStubPage();\r
48         if (wStartPage && wStartPage != this) {\r
49                 return wStartPage.RegisterListener2(oframe, nMessageId);\r
50         }\r
51         else \r
52                 return false;\r
53 }\r
54 \r
55 function UnRegisterListener2(oframe, nMessageId)\r
56 {\r
57         var wStartPage = getStubPage();\r
58         if (wStartPage && wStartPage != this && wStartPage.UnRegisterListener2) {\r
59                 return wStartPage.UnRegisterListener2(oframe, nMessageId);\r
60         }\r
61         else \r
62                 return false;\r
63 }\r
64 \r
65 function SendMessage(oMessage)\r
66 {\r
67         var nMsgId = oMessage.nMessageId;\r
68         if (nMsgId == WH_MSG_ISINFRAMESET && oMessage.wSender != this)\r
69                 return true;\r
70         var wStartPage = getStubPage();\r
71         if (wStartPage && wStartPage != this && wStartPage.SendMessage) \r
72         {\r
73                 return wStartPage.SendMessage(oMessage);\r
74         }\r
75         else \r
76                 return false;\r
77 }\r
78 var gbWhProxy=true;