Implemented pressed state for toolbar button.

This commit is contained in:
Heng Sin Low 2008-12-03 02:48:02 +00:00
parent 82de714759
commit 89382502cd
3 changed files with 32 additions and 96 deletions

View File

@ -43,9 +43,9 @@ public class ToolBarButton extends org.zkoss.zul.Toolbarbutton
public void setPressed(boolean pressed) {
if (!isDisabled()) {
if (pressed)
setSclass("depressed");
else {
if (pressed) {
this.setSclass("depressed");
} else {
if (this.getSclass() != null && this.getSclass().indexOf("depressed") >= 0)
this.setSclass(this.getSclass().replace("depressed", ""));
}

View File

@ -565,7 +565,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
curTab.getAD_Table_ID(), record_ID, null);
curTab.loadAttachments(); // reload
//aAttachment.setPressed(m_curTab.hasAttachment());
toolbar.getButton("Attachment").setPressed(curTab.hasAttachment());
}
/**
@ -729,6 +729,14 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
toolbar.enableTabNavigation(curTabIndex > 0,
curTabIndex < (adTab.getTabCount() - 1));
toolbar.getButton("Attachment").setPressed(curTab.hasAttachment());
if (isFirstTab())
{
toolbar.getButton("HistoryRecords").setPressed(!curTab.isOnlyCurrentRows());
}
toolbar.getButton("Find").setPressed(curTab.isQueryActive());
//TODO: personal lock
}
public void dataStatusChanged(DataStatusEvent e)
@ -1008,6 +1016,14 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
* @see ToolbarListener#onSave()
*/
public void onSave()
{
onSave(true);
}
/**
* @param onSaveEvent
*/
private void onSave(boolean onSaveEvent)
{
if (curTab.isSortTab())
{
@ -1024,7 +1040,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return;
}
}
boolean retValue = curTab.dataSave(true);
boolean retValue = curTab.dataSave(onSaveEvent);
if (!retValue)
{
@ -1224,8 +1240,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return;
}
//TODO: cmd_save(false) -> onSave ?
//onSave();
onSave(false);
//
int table_ID = curTab.getAD_Table_ID();
int record_ID = curTab.getRecord_ID();
@ -1256,7 +1271,7 @@ public abstract class AbstractADWindowPanel extends AbstractUIPart implements To
return;
}
//TODO: cmd_save(false); -> onSave ?
onSave(false);
// Query
MQuery query = new MQuery(curTab.getTableName());

View File

@ -30,11 +30,11 @@ html,body {
-moz-opacity: 0.2;
}
.depressed {
.depressed img {
border-style: inset;
border-width: 1px;
border-color: #CCCCCC;
background-color: #E4E3DC;
border-color: #9CBDFF;
background-color: #C4DCFB;
-moz-border-radius: 5px;
padding: 1px 4px 1px 4px;
}
@ -76,85 +76,6 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none {
background-color: white;
}
<%-- desktop tabbox --%>
.desktop-tb {
position:absolute;
}
td.tab-desktop-tb-first1 {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-first2.gif')});
width: 1px; height: 1px;
}
td.tab-desktop-tb-first2 {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-first2.gif')});
width: 3px; height: 1px;
}
td.tab-desktop-tb-last1 {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')});
width: 3px; height: 1px;
}
td.tab-desktop-tb-last2 {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')});
width: 1px; height: 1px;
}
td.tab-desktop-tb-tl-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tl-sel.gif')});
width: 5px; height: 6px;
}
td.tab-desktop-tb-tl-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tl-uns.gif')});
width: 5px; height: 6px;
}
td.tab-desktop-tb-tm-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tm-sel.gif')});
height: 6px;
}
td.tab-desktop-tb-tm-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tm-uns.gif')});
height: 6px;
}
td.tab-desktop-tb-tr-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tr-sel.gif')});
width: 5px; height: 6px;
}
td.tab-desktop-tb-tr-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-tr-uns.gif')});
width: 5px; height: 6px;
}
td.tab-desktop-tb-ml-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-ml-sel.gif')});
width: 5px;
}
td.tab-desktop-tb-ml-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-ml-uns.gif')});
width: 5px;
}
td.tab-desktop-tb-mm-sel, td.tab-desktop-tb-mm-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-white.gif')});
}
td.tab-desktop-tb-mr-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-mr-sel.gif')});
width: 5px;
}
td.tab-desktop-tb-mr-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-mr-uns.gif')});
width: 5px;
}
td.tab-desktop-tb-bl-sel, td.tab-desktop-tb-bm-sel, td.tab-desktop-tb-br-sel {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-white.gif')});
width: 5px; height: 1px;
}
td.tab-desktop-tb-bl-uns, td.tab-desktop-tb-bm-uns, td.tab-desktop-tb-br-uns {
background-image: url(${c:encodeURL('~./zul/img/tab/lite-last1.gif')});
width: 5px; height: 1px;
}
tr.tab-desktop-tb-m {
height: 21px;
}
.desktop-tabpanel {
margin: 0;
padding: 0;