You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is Issue 191 moved from a Google Code project.
Added by 2010-01-25T15:35:08.000Z by qist...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Defect, Priority-Medium, Component-IDE, OpSys-All, Milestone-0019
Original description
What steps will reproduce the problem?
Start a new Sketch
Add a file "test.cpp" to the Sketch
Add a file "test.h" to the Sketch
Open the tab menu and select the first "test" (the test.cpp opens)
Open the tab menu and select the second "test" (the test.cpp opens again)
What is the expected output? What do you see instead?
Only one of the files (alphabetically first seemingly) can be opened from
the tab-menu if there are multiple files with the same name, and only a
different extension.
What version of the Arduino software are you using?
Arduino 0017 and Arduino 0018 running on Windows Vista.
Please provide any additional information below.
The solution is quite simple.
Sketch.setCurrentCode(String fileName) already checks for file name as well
as 'pretty name'.
The jumpListener in SketchHeader already uses the action command to get the
filename (which is the button text if none is set, and thus the pretty name).
Setting the action command specifically allows the tab menu to function
properly.
Old code
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getPrettyName());
item.addActionListener(jumpListener);
menu.add(item);
}
New code
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getPrettyName());
item.setActionCommand(code.getFileName());
item.addActionListener(jumpListener);
menu.add(item);
}
For more clarity it's maybe a good idea to also show the extension in the
tab menu. The easiest way to do this would be:
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getFileName());
item.addActionListener(jumpListener);
menu.add(item);
}
The text was updated successfully, but these errors were encountered:
This is Issue 191 moved from a Google Code project.
Added by 2010-01-25T15:35:08.000Z by qist...@gmail.com.
Please review that bug for more context and additional comments, but update this bug.
Closed (Fixed).
Original labels: Type-Defect, Priority-Medium, Component-IDE, OpSys-All, Milestone-0019
Original description
What steps will reproduce the problem?
What is the expected output? What do you see instead?
Only one of the files (alphabetically first seemingly) can be opened from
the tab-menu if there are multiple files with the same name, and only a
different extension.
What version of the Arduino software are you using?
Arduino 0017 and Arduino 0018 running on Windows Vista.
Please provide any additional information below.
The solution is quite simple.
Sketch.setCurrentCode(String fileName) already checks for file name as well
as 'pretty name'.
The jumpListener in SketchHeader already uses the action command to get the
filename (which is the button text if none is set, and thus the pretty name).
Setting the action command specifically allows the tab menu to function
properly.
Old code
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getPrettyName());
item.addActionListener(jumpListener);
menu.add(item);
}
New code
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getPrettyName());
item.setActionCommand(code.getFileName());
item.addActionListener(jumpListener);
menu.add(item);
}
For more clarity it's maybe a good idea to also show the extension in the
tab menu. The easiest way to do this would be:
for (SketchCode code : sketch.getCode()) {
item = new JMenuItem(code.getFileName());
item.addActionListener(jumpListener);
menu.add(item);
}
The text was updated successfully, but these errors were encountered: