Skip to content
Snippets Groups Projects
Commit 0c8d1eb1 authored by buehlera's avatar buehlera
Browse files

fixed error with higlighted blocks

parent d1e41572
No related branches found
No related tags found
No related merge requests found
......@@ -94,7 +94,6 @@ public class ArduBlockTool implements Tool, OpenblocksFrameListener
if(upload) { //added by letsgoING
ArduBlockTool.editor.handleExport(false);
}
}
private String getArduinoVersion()
......
......@@ -164,7 +164,7 @@ public class SketchBlock extends TranslatorBlock
mainVec.add(new CodeWhile(boolTrue, whileVec));
SimCodeFunction main = new SimCodeFunction("main", mainVec);
System.out.println("Add new Functions");
//System.out.println("Add new Functions");
sim.addFunctionsCode(setupFunc);
sim.addFunctionsCode(loopFunc);
......
......@@ -340,6 +340,10 @@ public class OpenblocksFrame extends JFrame
ActionListener modeBasicButtonListener = new ActionListener () {
public void actionPerformed(ActionEvent e) {
//get current zoomLevel
//remove highlights
context.resetHightlightBlock();
int currentWorkspaceZoom = zoomSlider.getValue();
try {
WorkspaceController workspaceController = context.getWorkspaceController();
......@@ -370,6 +374,10 @@ public class OpenblocksFrame extends JFrame
JButton modeProButton = new JButton(uiMessageBundle.getString("ardublock.ui.mode.expert"));
ActionListener modeProButtonListener = new ActionListener () {
public void actionPerformed(ActionEvent e) {
//remove highlights
context.resetHightlightBlock();
//get current zoomLevel
int currentWorkspaceZoom = zoomSlider.getValue();
try {
......@@ -401,6 +409,9 @@ public class OpenblocksFrame extends JFrame
JButton modeSimButton = new JButton(uiMessageBundle.getString("ardublock.ui.mode.sim"));
ActionListener modeSimButtonListener = new ActionListener () {
public void actionPerformed(ActionEvent e) {
//remove highlights
context.resetHightlightBlock();
//get current zoomLevel
int currentWorkspaceZoom = zoomSlider.getValue();
try {
......
......@@ -28,6 +28,7 @@ public class ArdublockWorkspaceListener implements WorkspaceListener
frame.setTitle(title);
}
}
context.resetHightlightBlock();
......
......@@ -9,16 +9,17 @@ import com.ardublock.ui.OpenblocksFrame;
public class NewButtonListener implements ActionListener
{
private OpenblocksFrame parentFrame;
private Context context;
public NewButtonListener(OpenblocksFrame frame)
{
Context.getContext();
context = Context.getContext();
this.parentFrame = frame;
}
public void actionPerformed(ActionEvent e)
{
context.resetHightlightBlock();
parentFrame.doNewArduBlockFile();
}
......
......@@ -9,16 +9,17 @@ import com.ardublock.ui.OpenblocksFrame;
public class OpenButtonListener implements ActionListener
{
private OpenblocksFrame parentFrame;
private Context context;
public OpenButtonListener(OpenblocksFrame frame)
{
Context.getContext();
context = Context.getContext();
this.parentFrame = frame;
}
public void actionPerformed(ActionEvent e)
{
context.resetHightlightBlock();
parentFrame.doOpenArduBlockFile();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment