Skip to content

Commit

Permalink
Merge pull request #239 from RobertBColton/16b5
Browse files Browse the repository at this point in the history
Adds print support to Game Information editor
  • Loading branch information
RobertBColton committed Jan 25, 2016
2 parents b96f99c + c489039 commit 564cfd3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion org/lateralgm/icons/README
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This directory contains the following icons (.png extension omitted):
Nuvola icon theme for KDE 3.x:
actions/
accept cancel colorize copy cut find
new next open paste previous redo save
new next open paste previous print redo save
save-as sound-play sound-stop undo
restree/
gm group group-open info
Expand Down
Binary file added org/lateralgm/icons/actions/print.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions org/lateralgm/main/icons.properties
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ EventNode.GROUP10=events/keyreleasefolder.png

GameInformationFrame.LOAD=actions/open.png
GameInformationFrame.FILESAVE=actions/save.png
GameInformationFrame.PRINT=actions/print.png
GameInformationFrame.FONTCOLOR=restree/font.png
GameInformationFrame.COLOR=actions/colorize.png
GameInformationFrame.CUT=actions/cut.png
Expand Down
17 changes: 17 additions & 0 deletions org/lateralgm/subframes/GameInformationFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.print.PrinterException;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
Expand Down Expand Up @@ -126,6 +127,10 @@ private JMenuBar makeMenuBar()
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,KeyEvent.CTRL_DOWN_MASK));
menu.add(item);
menu.addSeparator();
item = addItem("GameInformationFrame.PRINT"); //$NON-NLS-1$
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P,KeyEvent.CTRL_DOWN_MASK));
menu.add(item);
menu.addSeparator();
item = addItem("GameInformationFrame.CLOSESAVE"); //$NON-NLS-1$
menu.add(item);

Expand Down Expand Up @@ -574,6 +579,18 @@ public void actionPerformed(ActionEvent ev)
saveToFile();
return;
}
if (com.equals("GameInformationFrame.PRINT")) //$NON-NLS-1$
{
try
{
editor.print();
}
catch (PrinterException e)
{
e.printStackTrace();
}
return;
}
if (com.equals("GameInformationFrame.FONTCOLOR")) //$NON-NLS-1$
{
String colorStr = Messages.getString("GameInformationFrame.FONTCOLOR"); //$NON-NLS-1$
Expand Down

0 comments on commit 564cfd3

Please sign in to comment.