proposed_change.diff
src/com/goldencode/p2j/ui/chui/ThinClient.java 2015-11-18 18:34:22 +0000 | ||
---|---|---|
2184 | 2184 |
** marked as HIDDEN, do not show the window. |
2185 | 2185 |
** More fixes related to working with HIDDEN frame/widgets and resolving |
2186 | 2186 |
** the window when nested frames are viewed directly. |
2187 |
** VIG 20151118 Prevent ENTRY raising and focus request for click of the button other |
|
2188 |
** than left button for all widgets. |
|
2187 | 2189 |
*/ |
2188 | 2190 | |
2189 | 2191 |
package com.goldencode.p2j.ui.chui; |
2190 | 2192 | |
2193 |
import java.awt.event.MouseEvent; |
|
2191 | 2194 |
import java.io.*; |
2192 | 2195 |
import java.lang.reflect.*; |
2193 | 2196 |
import java.util.*; |
... | ... | |
15255 | 15258 |
evtID == MouseEvt.MOUSE_RELEASED || |
15256 | 15259 |
evtID == MouseEvt.MOUSE_CLICKED) |
15257 | 15260 |
{ |
15258 |
maySwitchFocus = (mouseSource != null && evtID == MouseEvt.MOUSE_PRESSED); |
|
15261 |
// ENTRY event and focus request are sent only for a press of the left mouse button |
|
15262 |
// FILL-IN: ENTRY is sent later, after pop-up menu is closed. |
|
15263 |
maySwitchFocus = (mouseSource != null && |
|
15264 |
evtID == MouseEvt.MOUSE_PRESSED && |
|
15265 |
evt.getEvent().getButton() == MouseEvent.BUTTON1); |
|
15266 |
|
|
15259 | 15267 |
Widget<?> focus = UiUtils.getCurrentFocus(); |
15260 | 15268 |
|
15261 | 15269 |
if (focus != null && focus.isLeaveEventRequired((Widget) mouseSource, evt)) |
src/com/goldencode/p2j/ui/client/gui/ButtonGuiImpl.java 2015-11-18 18:36:21 +0000 | ||
---|---|---|
60 | 60 |
** Improve button paintings. Fix for several image based buttons drawing, width |
61 | 61 |
** and height mismatch. Some logic reordered and comments cleanup. The images |
62 | 62 |
** used for buttons must have convert-3d-colors flag to be on. |
63 |
** VIG 20151118 Added processing only left mouse button in mousePressed(..). |
|
63 | 64 |
*/ |
64 | 65 | |
65 | 66 |
package com.goldencode.p2j.ui.client.gui; |
... | ... | |
1401 | 1402 |
public void mousePressed(MouseEvent e) |
1402 | 1403 |
{ |
1403 | 1404 |
// push button effect |
1404 |
if (isEnabled() && !pressed) |
|
1405 |
if (isEnabled() && !pressed && e.getButton() == MouseEvent.BUTTON1)
|
|
1405 | 1406 |
{ |
1406 | 1407 |
requestFocus(); |
1407 | 1408 |
pressed = true; |
src/com/goldencode/p2j/ui/client/gui/SubMenuGuiImpl.java 2015-11-20 07:32:26 +0000 | ||
---|---|---|
21 | 21 |
** handle processing to modal windows. |
22 | 22 |
** 006 CA 20151026 Enclose driver API calls in select/releaseWindow(). |
23 | 23 |
** VIG 20151027 Added "pressed" state transferring to neighbor MENUBAR element. |
24 |
** Added mouseEntered=false to hideBody(..) and fixed javadoc. |
|
24 | 25 |
*/ |
25 | 26 | |
26 | 27 |
package com.goldencode.p2j.ui.client.gui; |
... | ... | |
592 | 593 |
parent().repaint(); |
593 | 594 | |
594 | 595 |
setSubmenusPressed(false, true); |
596 |
this.mouseEntered = false; |
|
595 | 597 |
|
596 | 598 |
super.hideBody(recursive); |
597 | 599 |
|
... | ... | |
1137 | 1139 |
* |
1138 | 1140 |
* @param pressed |
1139 | 1141 |
* <code>true</code> means pressed, <code>false</code - means not pressed. |
1142 |
* @param recursive |
|
1143 |
* <code>true</code> denotes recursive processing of nested sub-menus. |
|
1140 | 1144 |
*/ |
1141 | 1145 |
protected void setSubmenusPressed(boolean pressed, boolean recursive) |
1142 | 1146 |
{ |
src/com/goldencode/p2j/ui/client/gui/ToggleBoxGuiImpl.java 2015-11-18 18:39:27 +0000 | ||
---|---|---|
26 | 26 |
** 010 VIG 20151023 Fixed disposition of the label and highlight rectangle relative to check-box |
27 | 27 |
** and highlight rectangle coloring using XOR. |
28 | 28 |
** HC 20151112 Implemented THREE-D runtime support. |
29 |
** VIG 20151118 Added processing only left mouse button in mousePressed(..). |
|
29 | 30 |
*/ |
30 | 31 | |
31 | 32 |
package com.goldencode.p2j.ui.client.gui; |
... | ... | |
56 | 57 |
/** Checkbox width or length */ |
57 | 58 |
private static int CHKBOX_WIDTH = 11; |
58 | 59 |
|
59 |
/** |
|
60 |
* Color which is XORed with background to draw current row highlighting (dotted rectangle). |
|
61 |
*/ |
|
62 |
private final static ColorRgb CURRENT_ROW_XOR_COLOR = new ColorRgb(192, 192, 192); |
|
63 |
|
|
64 | 60 |
/** Color resolver */ |
65 | 61 |
private GuiColorResolver gc; |
66 | 62 | |
... | ... | |
356 | 352 |
} |
357 | 353 |
|
358 | 354 |
/** |
359 |
* Notification of a mouse dragged event occurred for this widget. No-op by default. |
|
360 |
* |
|
361 |
* @param e |
|
362 |
* The mouse event. |
|
363 |
*/ |
|
364 |
@Override |
|
365 |
public void mouseDragged(MouseEvent e) |
|
366 |
{ |
|
367 |
// TODO implement disabling during dragging |
|
368 |
} |
|
369 |
|
|
370 |
/** |
|
371 | 355 |
* Notification of a mouse pressed event occurred for this widget. |
372 | 356 |
* |
373 | 357 |
* @param e |
... | ... | |
376 | 360 |
@Override |
377 | 361 |
public void mousePressed(MouseEvent e) |
378 | 362 |
{ |
379 |
boolean oldVal = pressed; |
|
380 |
pressed = true; |
|
381 |
|
|
382 |
if (!oldVal) |
|
363 |
if (e.getButton() == MouseEvent.BUTTON1) |
|
383 | 364 |
{ |
384 |
repaint(); |
|
365 |
boolean oldVal = pressed; |
|
366 |
pressed = true; |
|
367 | ||
368 |
if (!oldVal) |
|
369 |
{ |
|
370 |
repaint(); |
|
371 |
} |
|
385 | 372 |
} |
386 | 373 |
} |
387 | 374 | |
... | ... | |
394 | 381 |
@Override |
395 | 382 |
public void mouseReleased(MouseEvent e) |
396 | 383 |
{ |
397 |
boolean oldVal = pressed; |
|
398 |
pressed = false; |
|
399 |
|
|
400 |
if (oldVal) |
|
384 |
if (e.getButton() == MouseEvent.BUTTON1) |
|
401 | 385 |
{ |
402 |
repaint(); |
|
386 |
boolean oldVal = pressed; |
|
387 |
pressed = false; |
|
388 | ||
389 |
if (oldVal) |
|
390 |
{ |
|
391 |
repaint(); |
|
392 |
} |
|
403 | 393 |
} |
404 | 394 |
} |
405 | 395 | |
... | ... | |
435 | 425 |
return new int[] |
436 | 426 |
{ |
437 | 427 |
MouseEvent.MOUSE_CLICKED, |
438 |
MouseEvent.MOUSE_DRAGGED, |
|
439 | 428 |
MouseEvent.MOUSE_PRESSED, |
440 | 429 |
MouseEvent.MOUSE_RELEASED |
441 | 430 |
}; |