|
- import win.ui;
- /*DSG{{*/
- var winform = win.form(text="aardio form";right=400;bottom=184)
- winform.add(
- custom={cls="custom";text="custom";left=20;top=70;right=369;bottom=94;db=1;dl=1;dr=1;dt=1;edge=1;z=1}
- )
- /*}}*/
- import web.layout;
- import web.layout.behavior.dropdown;
- namespace web.layout.behavior.mouse{
- //namespace sinking{
- onMouseDblClick = function( ltTarget,ltOwner,x,y,ltMouseParams ) {
- import console
- console.dumpJson(ltTarget.innerHTML)
- }
- // }
- }
- var wbLayout = web.layout(winform.custom);
- wbLayout.html = /**
- <!doctype html>
- <html>
- <body>
- <select type="droptree">
- <caption>hahahahha</caption><div role="dropdown"></div>
- <popup>
- <widget #dd type="tree" treelines>
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
- <option id="alltype" expanded>所有类型
- <option>新类型
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
- </option>
- </option>
- <option id="alltype" expanded>所有类型
- <option>新类型</option>
- </option>
-
- </widget>
- </popup>
- </select>
- </body>
- </html>
- **/
- wbLayout.css = /**
- html,body{ height:100%; margin:0px; }
- select[type=droptree]{
- font:system;
- padding:0;
- flow:horizontal; /* caption, button*/
- background-repeat:stretch;
- background-image:url(theme:edit-normal);
- width: *;
- height: *;
- overflow-x:hidden;
- behavior:dropdown;
- }
- select[type=droptree]:disabled
- {
- background-image:url(theme:edit-disabled);
- color:graytext;
- }
- select[type=droptree] > caption{
- padding:1px;
- margin:2px 1px 2px 2px;
- overflow-x:hidden;
- overflow-x:hidden;
- width:100%%;
- height:100%%;
- min-height:1em;
- min-width: system-scrollbar-width;
- vertical-align:middle;
- white-space: nowrap;
- color:windowtext;
- }
- select[type=droptree]:focus > caption
- {
- background-color:highlight; color:highlighttext;
- }
- select[type=droptree] > popup
- {
- overflow-x:hidden;
- overflow-y:auto;
- padding:0px;
- display:block;
- visibility:collapse;/* invisible normally */
- border:none;
- width: *;
- min-width: max-intrinsic;
- height: min-intrinsic;
- transition:window-slide-ttb;
- }
- select[type=droptree] > popup:popup
- {
- width: *;
- min-width: max-intrinsic;
- height:min-intrinsic;
- visibility:visible;
- }
- select[type=droptree] > popup #dd{
- width: *;
- height: max-intrinsic;
- behavior:~ mouse;
- }
- select[type=droptree] div[role=dropdown]
- {
- display:inline-block;
- width :system-scrollbar-width;
- height :100%%;
- margin :system-border-width; /*1px 1px 1px 0px;*/
- padding :0;
- background-repeat :stretch;
- background-image :url(theme:combobox-button-normal);
- /*behavior :clickable; */
- white-space :nowrap;
- }
- select[type=droptree] div[role=dropdown]:hover
- {
- transition :none;
- background-image:url(theme:combobox-button-hover);
- }
- select[type=droptree] div[role=dropdown]:active
- {
- background-image:url(theme:combobox-button-pressed);
- }
- select[type=droptree]:disabled div[role=dropdown]
- {
- background-image:url(theme:combobox-button-disabled);
- color:graytext;
- }
- **/
- import console;
- var eleTree = wbLayout.querySelector("#dd");
- eleTree.onMouseDblClick = function( ltTarget,ltOwner,x,y,ltMouseParams ) {
- console.log(ltTarget.innerHTML)
- }
- eleTree.attachEventHandler();
- winform.show();
- win.loopMessage();
复制代码
在单独的tree控件里 ,可以响应到鼠标双击事件,但是放在弹出层中后,试了这几种方法,都不起作用。
|
|