1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

146683 Double clicking on a cell should highlight that cell

This commit is contained in:
Ted Williams 2007-03-14 07:49:05 +00:00
parent 4aa55aa207
commit 87988bb1a1

View file

@ -26,6 +26,7 @@ public abstract class AbstractPane extends Canvas
protected Rendering fRendering;
// selection state
protected boolean fSelectionStarted = false;
protected boolean fSelectionInProgress = false;
protected BigInteger fSelectionStartAddress = null;
@ -89,10 +90,12 @@ public abstract class AbstractPane extends Canvas
fCaret.setVisible(true);
if(me.button == 1)
if(fSelectionInProgress && me.button == 1)
{
endSelection(me.x, me.y);
}
fSelectionInProgress = fSelectionStarted = false;
}
public void mouseDown(MouseEvent me)
@ -119,7 +122,7 @@ public abstract class AbstractPane extends Canvas
AbstractPane.this.fSelectionStartAddress = fRendering
.getSelection().getStart();
AbstractPane.this.fSelectionInProgress = true;
AbstractPane.this.fSelectionStarted = true;
AbstractPane.this.appendSelection(me.x, me.y);
@ -135,6 +138,21 @@ public abstract class AbstractPane extends Canvas
public void mouseDoubleClick(MouseEvent me)
{
try
{
BigInteger address = getViewportAddress(me.x / getCellWidth(), me.y
/ getCellHeight());
fRendering.getSelection().clear();
fRendering.getSelection().setStart(address.add(BigInteger
.valueOf(fRendering.getAddressesPerColumn())), address);
fRendering.getSelection().setEnd(address.add(BigInteger
.valueOf(fRendering.getAddressesPerColumn())), address);
}
catch(DebugException de)
{
// do nothing
}
}
});
@ -142,8 +160,9 @@ public abstract class AbstractPane extends Canvas
{
public void mouseMove(MouseEvent me)
{
if(fSelectionInProgress)
if(fSelectionStarted)
{
fSelectionInProgress = true;
appendSelection(me.x, me.y);
}
}
@ -269,7 +288,10 @@ public abstract class AbstractPane extends Canvas
else if(Rendering.isValidEditCharacter(ke.character))
{
if(fRendering.getSelection().hasSelection())
{
setCaretAddress(fRendering.getSelection().getLow());
fSubCellCaretPosition = 0;
}
editCell(fCaretAddress, fSubCellCaretPosition, ke.character);
}
@ -504,7 +526,7 @@ public abstract class AbstractPane extends Canvas
fRendering.getSelection().setStart(address.add(BigInteger.valueOf(
fRendering.getBytesPerColumn() / fRendering.getAddressableSize())), address);
fSelectionInProgress = true;
fSelectionStarted = true;
}
}
catch(DebugException e)