-
-
Notifications
You must be signed in to change notification settings - Fork 58
Adds new Processing sketch templates to enhance the user's initial coding experience in the Processing IDE. #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
f727013
db4b6b9
0e5507a
089607d
7276460
152b14c
6ba547a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -586,9 +586,9 @@ public JMenu initDefaultFileMenu() { | |
item.addActionListener(e -> handleNew()); | ||
defaultFileMenu.add(item); | ||
|
||
item = Toolkit.newJMenuItem(Language.text("menu.file.open"), 'O'); | ||
item.addActionListener(e -> handleOpenPrompt()); | ||
defaultFileMenu.add(item); | ||
// item = Toolkit.newJMenuItem(Language.text("menu.file.open"), 'O'); | ||
// item.addActionListener(e -> handleOpenPrompt()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please clean up any comments and unused code left in your Pull Request |
||
// defaultFileMenu.add(item); | ||
|
||
item = Toolkit.newJMenuItemShift(Language.text("menu.file.sketchbook"), 'K'); | ||
item.addActionListener(e -> showSketchbookFrame()); | ||
|
@@ -598,6 +598,10 @@ public JMenu initDefaultFileMenu() { | |
item.addActionListener(e -> thinkDifferentExamples()); | ||
defaultFileMenu.add(item); | ||
|
||
item = Toolkit.newJMenuItem(Language.text("menu.file.templates"), 'T'); | ||
//item.addActionListener(e -> handleTemplates()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One more comment |
||
defaultFileMenu.add(item); | ||
|
||
return defaultFileMenu; | ||
} | ||
|
||
|
@@ -1288,6 +1292,8 @@ private void openContribBundle(String path) { | |
}); | ||
} | ||
|
||
// Open templates to start with any work | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another |
||
|
||
|
||
/** | ||
* Return true if it's an obvious sketch folder: only .pde files, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package processing.app.ui; | ||
|
||
public class Template { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer used correct? |
||
|
||
// New templates | ||
public static final String animationSketchCode = | ||
"void setup() {\n" + | ||
" size(500, 500);\n" + | ||
" // write code that will be called once in this function\n" + | ||
"}\n\n" + | ||
"void draw() {\n" + | ||
" // write code that will be called for every frame here\n" + | ||
"}"; | ||
|
||
public static final String interactiveSketchCode = | ||
"void setup() {\n" + | ||
" size(500, 500);\n" + | ||
" // write code that will be called once in this function\n" + | ||
"}\n\n" + | ||
"void draw() {\n" + | ||
" // write code that will be called for every frame here\n" + | ||
"}\n\n" + | ||
"void mousePressed() {\n" + | ||
" ellipse(mouseX, mouseY, 20, 20);\n" + | ||
" // write code that will run when you click\n" + | ||
"}"; | ||
|
||
public static final String fullscreenSketchCode = | ||
"void setup() {\n" + | ||
" fullScreen(); // create a fullscreen canvas\n" + | ||
"}\n\n" + | ||
"void draw() {\n" + | ||
" circle(width / 2, height / 2, height * 0.5);\n" + | ||
"}"; | ||
|
||
public static final String resizeableSketchCode = | ||
"void setup() {\n" + | ||
" size(500, 500);\n" + | ||
" windowResizable(true);\n" + | ||
" // allow the window to be resized\n" + | ||
"}\n\n" + | ||
"void draw() {\n" + | ||
" circle(width / 2, height / 2, min(width, height) * 0.5);\n" + | ||
" // draw a circle that resizes with the window\n" + | ||
"}\n\n" + | ||
"void windowResized() {\n" + | ||
" println(\"Window resized to: \" + width + \"x\" + height);\n" + | ||
" // this function is called whenever the window is resized\n" + | ||
"}"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realised that the file->open menu item certainly should not be deleted here