protected DACustomButtonAttribute attr;
protected IDACustomButtonRenderer buttonRenderer = null;
+ private boolean isTapbutton = false;
+
/**
* Constructs a new instance of this class given its parent and style value
* describing its behavior and appearance.
}
/**
+ * Construct a new instance of this class. it makes gradation button.
+ *
+ * @param parent
+ * a composite control which will be the parent of the new
+ * instance (cannot be bull)
+ * @param normalStart
+ * the start color of normal state gradation
+ * @param normalEnd
+ * the end color of normal state gradation
+ * @param pushStart
+ * the start color of push state gradation
+ * @param pushEnd
+ * the end color of push state gradation
+ * @param hoverStart
+ * the start color of hover state gradation
+ * @param hoverEnd
+ * the end color of hover state gradation
+ * @param disableStart
+ * the start color of disable state gradation
+ * @param disableEnd
+ * the end color of disable state gradation
+ * @param istapbutton
+ * check tap button
+ */
+ public DACustomButton(Composite parent, Color normalStart, Color normalEnd,
+ Color pushStart, Color pushEnd, Color hoverStart, Color hoverEnd,
+ Color disableStart, Color disableEnd, boolean istapbutton) {
+ this(parent, SWT.NONE);
+ attr.setColor(0, normalStart);
+ attr.setColor(1, normalEnd);
+ attr.setColor(2, pushStart);
+ attr.setColor(3, pushEnd);
+ attr.setColor(4, hoverStart);
+ attr.setColor(5, hoverEnd);
+ attr.setColor(6, disableStart);
+ attr.setColor(7, disableEnd);
+ attr.setDrawType(TYPE_GRADATION);
+ isTapbutton = istapbutton;
+ }
+
+ /**
* add mouse listeners - enter, exit, mouse down, mouse up
*/
protected void addListeners() {
return;
}
- if (event.type == SWT.MouseEnter) {
+ if (event.type == SWT.MouseEnter && isTapbutton == false) {
changeButtonState(STATE_HOVER);
}
- if (event.type == SWT.MouseExit) {
+ if (event.type == SWT.MouseExit && isTapbutton == false) {
changeButtonState(STATE_NORMAL);
}