mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-21 11:28:58 +00:00
added option to not format applesoft
This commit is contained in:
parent
e7554f7856
commit
f5ca23da26
@ -17,6 +17,7 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
{
|
{
|
||||||
static final String underline = "----------------------------------------------------"
|
static final String underline = "----------------------------------------------------"
|
||||||
+ "----------------------------------------------";
|
+ "----------------------------------------------";
|
||||||
|
|
||||||
private final List<SourceLine> sourceLines = new ArrayList<> ();
|
private final List<SourceLine> sourceLines = new ArrayList<> ();
|
||||||
private final int endPtr;
|
private final int endPtr;
|
||||||
private final int longestVarName;
|
private final int longestVarName;
|
||||||
@ -85,13 +86,52 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
longestVarName = getLongestName ();
|
longestVarName = getLongestName ();
|
||||||
formatLeft = longestVarName > 7 ? "%-" + longestVarName + "." + longestVarName + "s "
|
formatLeft = longestVarName > 7 ? "%-" + longestVarName + "." + longestVarName + "s "
|
||||||
: "%-7.7s ";
|
: "%-7.7s ";
|
||||||
formatRight = longestVarName > 7 ? "%" + longestVarName + "." + longestVarName + "s "
|
formatRight = formatLeft.replace ("-", "");
|
||||||
: "%7.7s ";
|
|
||||||
|
|
||||||
maxDigits = getMaxDigits ();
|
maxDigits = getMaxDigits ();
|
||||||
formatLineNumber = "%" + maxDigits + "d ";
|
formatLineNumber = "%" + maxDigits + "d ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
private String list ()
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
StringBuilder text = new StringBuilder ();
|
||||||
|
|
||||||
|
if (basicPreferences.showHeader)
|
||||||
|
addHeader (text);
|
||||||
|
|
||||||
|
int loadAddress = getLoadAddress ();
|
||||||
|
int ptr = 0;
|
||||||
|
int nextLine;
|
||||||
|
byte b;
|
||||||
|
|
||||||
|
while ((nextLine = Utility.unsignedShort (buffer, ptr)) != 0)
|
||||||
|
{
|
||||||
|
int lineNumber = Utility.unsignedShort (buffer, ptr + 2);
|
||||||
|
text.append (String.format ("%5d ", lineNumber));
|
||||||
|
// text.append (
|
||||||
|
// String.format ("%04X %04X %5d ", loadAddress + ptr, nextLine, lineNumber));
|
||||||
|
ptr += 4;
|
||||||
|
|
||||||
|
while ((b = buffer[ptr++]) != 0)
|
||||||
|
if (Utility.isHighBitSet (b))
|
||||||
|
text.append (
|
||||||
|
String.format (" %s ", ApplesoftConstants.tokens[b & 0x7F].trim ()));
|
||||||
|
else
|
||||||
|
text.append ((char) b);
|
||||||
|
|
||||||
|
assert ptr == nextLine - loadAddress;
|
||||||
|
// ptr = nextLine - loadAddress;
|
||||||
|
text.append ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (text.length () > 0)
|
||||||
|
text.deleteCharAt (text.length () - 1);
|
||||||
|
// text.append (String.format ("%04X %04X%n%n", loadAddress + ptr, nextLine));
|
||||||
|
return text.toString ();
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
void checkVar (String var, int lineNumber, Map<String, List<Integer>> map,
|
void checkVar (String var, int lineNumber, Map<String, List<Integer>> map,
|
||||||
Map<String, List<String>> unique)
|
Map<String, List<String>> unique)
|
||||||
@ -175,6 +215,9 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
private String getProgramText ()
|
private String getProgramText ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
if (!basicPreferences.formatApplesoft)
|
||||||
|
return list ();
|
||||||
|
|
||||||
int indentSize = 2;
|
int indentSize = 2;
|
||||||
boolean insertBlankLine = false;
|
boolean insertBlankLine = false;
|
||||||
|
|
||||||
@ -383,6 +426,9 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
|||||||
private int getMaxDigits ()
|
private int getMaxDigits ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
if (sourceLines.size () == 0)
|
||||||
|
return 4; // anything non-zero
|
||||||
|
|
||||||
SourceLine lastLine = sourceLines.get (sourceLines.size () - 1);
|
SourceLine lastLine = sourceLines.get (sourceLines.size () - 1);
|
||||||
return (lastLine.lineNumber + "").length ();
|
return (lastLine.lineNumber + "").length ();
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public interface ApplesoftConstants
|
|||||||
"RUN ", "IF ", "RESTORE ", "& ", // 0xAC
|
"RUN ", "IF ", "RESTORE ", "& ", // 0xAC
|
||||||
"GOSUB ", "RETURN ", "REM ", "STOP ", // 0xB0
|
"GOSUB ", "RETURN ", "REM ", "STOP ", // 0xB0
|
||||||
"ON ", "WAIT ", "LOAD ", "SAVE ", // 0xB4
|
"ON ", "WAIT ", "LOAD ", "SAVE ", // 0xB4
|
||||||
"DEF", "POKE ", "PRINT ", "CONT", // 0xB8
|
"DEF ", "POKE ", "PRINT ", "CONT", // 0xB8
|
||||||
"LIST ", "CLEAR ", "GET ", "NEW ", // 0xBC
|
"LIST ", "CLEAR ", "GET ", "NEW ", // 0xBC
|
||||||
"TAB(", "TO ", "FN ", "SPC(", // 0xC0
|
"TAB(", "TO ", "FN ", "SPC(", // 0xC0
|
||||||
"THEN ", "AT ", "NOT ", "STEP ", // 0xC4
|
"THEN ", "AT ", "NOT ", "STEP ", // 0xC4
|
||||||
|
@ -39,8 +39,8 @@ public class SubLine implements ApplesoftConstants
|
|||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
this.startPtr = startPtr;
|
this.startPtr = startPtr;
|
||||||
this.length = length;
|
this.length = length;
|
||||||
|
|
||||||
this.buffer = parent.buffer;
|
this.buffer = parent.buffer;
|
||||||
|
|
||||||
byte firstByte = buffer[startPtr];
|
byte firstByte = buffer[startPtr];
|
||||||
|
|
||||||
if (Utility.isHighBitSet (firstByte))
|
if (Utility.isHighBitSet (firstByte))
|
||||||
@ -59,6 +59,7 @@ public class SubLine implements ApplesoftConstants
|
|||||||
|
|
||||||
int ptr = startPtr;
|
int ptr = startPtr;
|
||||||
String var = "";
|
String var = "";
|
||||||
|
|
||||||
boolean inQuote = false;
|
boolean inQuote = false;
|
||||||
boolean inFunction = false;
|
boolean inFunction = false;
|
||||||
boolean inDefine = false;
|
boolean inDefine = false;
|
||||||
@ -120,6 +121,21 @@ public class SubLine implements ApplesoftConstants
|
|||||||
checkVar (var, (byte) 0);
|
checkVar (var, (byte) 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
private void doDigit ()
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
int targetLine = getLineNumber (buffer, startPtr);
|
||||||
|
addXref (targetLine, gotoLines);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
private void doAlpha ()
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
recordEqualsPosition ();
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
private void checkFunction (String var, byte terminator)
|
private void checkFunction (String var, byte terminator)
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
@ -306,21 +322,6 @@ public class SubLine implements ApplesoftConstants
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
|
||||||
private void doDigit ()
|
|
||||||
// ---------------------------------------------------------------------------------//
|
|
||||||
{
|
|
||||||
int targetLine = getLineNumber (buffer, startPtr);
|
|
||||||
addXref (targetLine, gotoLines);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
|
||||||
private void doAlpha ()
|
|
||||||
// ---------------------------------------------------------------------------------//
|
|
||||||
{
|
|
||||||
recordEqualsPosition ();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
private void addXref (int targetLine, List<Integer> list)
|
private void addXref (int targetLine, List<Integer> list)
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
|
@ -4,10 +4,11 @@ package com.bytezone.diskbrowser.gui;
|
|||||||
public class BasicPreferences
|
public class BasicPreferences
|
||||||
// -----------------------------------------------------------------------------------//
|
// -----------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
public boolean showHeader = true;
|
||||||
|
public boolean formatApplesoft = true;
|
||||||
public boolean splitRem = false;
|
public boolean splitRem = false;
|
||||||
public boolean alignAssign = true;
|
public boolean alignAssign = true;
|
||||||
public boolean showTargets = true;
|
public boolean showTargets = true;
|
||||||
public boolean showHeader = true;
|
|
||||||
public boolean onlyShowTargetLineNumbers = true;
|
public boolean onlyShowTargetLineNumbers = true;
|
||||||
public boolean showCaret = false;
|
public boolean showCaret = false;
|
||||||
public boolean showThen = true;
|
public boolean showThen = true;
|
||||||
@ -39,6 +40,7 @@ public class BasicPreferences
|
|||||||
text.append (
|
text.append (
|
||||||
String.format ("Only target lines ........ %s%n", onlyShowTargetLineNumbers));
|
String.format ("Only target lines ........ %s%n", onlyShowTargetLineNumbers));
|
||||||
text.append (String.format ("Show header .............. %s%n", showHeader));
|
text.append (String.format ("Show header .............. %s%n", showHeader));
|
||||||
|
text.append (String.format ("Format applesoft ......... %s%n", formatApplesoft));
|
||||||
text.append (String.format ("Show caret ............... %s%n", showCaret));
|
text.append (String.format ("Show caret ............... %s%n", showCaret));
|
||||||
text.append (String.format ("Show THEN ................ %s%n", showThen));
|
text.append (String.format ("Show THEN ................ %s%n", showThen));
|
||||||
text.append (String.format ("Show Xref ................ %s%n", showXref));
|
text.append (String.format ("Show Xref ................ %s%n", showXref));
|
||||||
|
@ -4,6 +4,7 @@ import java.awt.Desktop;
|
|||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
@ -42,12 +43,13 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
private static final String PREFS_MONOCHROME = "monochrome";
|
private static final String PREFS_MONOCHROME = "monochrome";
|
||||||
private static final String PREFS_SCALE = "scale";
|
private static final String PREFS_SCALE = "scale";
|
||||||
|
|
||||||
|
private static final String PREFS_SHOW_HEADER = "showHeader";
|
||||||
|
private static final String PREFS_FORMAT_APPLESOFT = "formatApplesoft";
|
||||||
private static final String PREFS_SPLIT_REMARKS = "splitRemarks";
|
private static final String PREFS_SPLIT_REMARKS = "splitRemarks";
|
||||||
private static final String PREFS_SPLIT_DIM = "splitDim";
|
private static final String PREFS_SPLIT_DIM = "splitDim";
|
||||||
private static final String PREFS_ALIGN_ASSIGN = "alignAssign";
|
private static final String PREFS_ALIGN_ASSIGN = "alignAssign";
|
||||||
private static final String PREFS_SHOW_TARGETS = "showTargets";
|
private static final String PREFS_SHOW_TARGETS = "showTargets";
|
||||||
private static final String PREFS_ONLY_SHOW_TARGETS = "onlyShowTargets";
|
private static final String PREFS_ONLY_SHOW_TARGETS = "onlyShowTargets";
|
||||||
private static final String PREFS_SHOW_HEADER = "showHeader";
|
|
||||||
private static final String PREFS_SHOW_CARET = "showCaret";
|
private static final String PREFS_SHOW_CARET = "showCaret";
|
||||||
private static final String PREFS_SHOW_THEN = "showThen";
|
private static final String PREFS_SHOW_THEN = "showThen";
|
||||||
private static final String PREFS_SHOW_XREF = "showXref";
|
private static final String PREFS_SHOW_XREF = "showXref";
|
||||||
@ -92,6 +94,8 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
private final List<TextPreferencesListener> textPreferencesListeners =
|
private final List<TextPreferencesListener> textPreferencesListeners =
|
||||||
new ArrayList<> ();
|
new ArrayList<> ();
|
||||||
|
|
||||||
|
private List<JCheckBoxMenuItem> applesoftMenuItems;
|
||||||
|
|
||||||
JMenuBar menuBar = new JMenuBar ();
|
JMenuBar menuBar = new JMenuBar ();
|
||||||
JMenu fileMenu = new JMenu ("File");
|
JMenu fileMenu = new JMenu ("File");
|
||||||
JMenu formatMenu = new JMenu ("Format");
|
JMenu formatMenu = new JMenu ("Format");
|
||||||
@ -136,13 +140,14 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
final JMenuItem scale3Item = new JRadioButtonMenuItem ("Scale 2");
|
final JMenuItem scale3Item = new JRadioButtonMenuItem ("Scale 2");
|
||||||
|
|
||||||
// Applesoft menu items
|
// Applesoft menu items
|
||||||
|
final JMenuItem showHeaderItem = new JCheckBoxMenuItem ("Show header");
|
||||||
|
final JMenuItem showFormatApplesoftItem = new JCheckBoxMenuItem ("Format Applesoft");
|
||||||
final JMenuItem splitRemarkItem = new JCheckBoxMenuItem ("Split remarks");
|
final JMenuItem splitRemarkItem = new JCheckBoxMenuItem ("Split remarks");
|
||||||
final JMenuItem splitDimItem = new JCheckBoxMenuItem ("Split DIM");
|
final JMenuItem splitDimItem = new JCheckBoxMenuItem ("Split DIM");
|
||||||
final JMenuItem alignAssignItem = new JCheckBoxMenuItem ("Align consecutive assign");
|
final JMenuItem alignAssignItem = new JCheckBoxMenuItem ("Align consecutive assign");
|
||||||
final JMenuItem showBasicTargetsItem = new JCheckBoxMenuItem ("Show targets");
|
final JMenuItem showBasicTargetsItem = new JCheckBoxMenuItem ("Show targets");
|
||||||
final JMenuItem onlyShowTargetLinesItem =
|
final JMenuItem onlyShowTargetLinesItem =
|
||||||
new JCheckBoxMenuItem ("Only show target line numbers");
|
new JCheckBoxMenuItem ("Only show target line numbers");
|
||||||
final JMenuItem showHeaderItem = new JCheckBoxMenuItem ("Show header");
|
|
||||||
final JMenuItem showCaretItem = new JCheckBoxMenuItem ("Show caret");
|
final JMenuItem showCaretItem = new JCheckBoxMenuItem ("Show caret");
|
||||||
final JMenuItem showThenItem = new JCheckBoxMenuItem ("Show THEN after IF");
|
final JMenuItem showThenItem = new JCheckBoxMenuItem ("Show THEN after IF");
|
||||||
final JMenuItem showXrefItem = new JCheckBoxMenuItem ("List GOSUB/GOTO");
|
final JMenuItem showXrefItem = new JCheckBoxMenuItem ("List GOSUB/GOTO");
|
||||||
@ -246,6 +251,8 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
imageMenu.add (scale3Item);
|
imageMenu.add (scale3Item);
|
||||||
|
|
||||||
applesoftMenu.add (showHeaderItem);
|
applesoftMenu.add (showHeaderItem);
|
||||||
|
applesoftMenu.add (showFormatApplesoftItem);
|
||||||
|
applesoftMenu.addSeparator ();
|
||||||
applesoftMenu.add (splitRemarkItem);
|
applesoftMenu.add (splitRemarkItem);
|
||||||
applesoftMenu.add (splitDimItem);
|
applesoftMenu.add (splitDimItem);
|
||||||
applesoftMenu.add (alignAssignItem);
|
applesoftMenu.add (alignAssignItem);
|
||||||
@ -274,6 +281,12 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
|
|
||||||
prodosMenu.add (prodosSortDirectoriesItem);
|
prodosMenu.add (prodosSortDirectoriesItem);
|
||||||
|
|
||||||
|
applesoftMenuItems = new ArrayList (Arrays.asList (splitRemarkItem, splitDimItem,
|
||||||
|
alignAssignItem, showBasicTargetsItem, onlyShowTargetLinesItem, showCaretItem,
|
||||||
|
showThenItem, blankAfterReturn, deleteExtraRemSpace, deleteExtraDataSpace,
|
||||||
|
showXrefItem, showCallsItem, showSymbolsItem, showFunctionsItem,
|
||||||
|
showConstantsItem, listStringsItem, showDuplicateSymbolsItem));
|
||||||
|
|
||||||
ActionListener basicPreferencesAction = new ActionListener ()
|
ActionListener basicPreferencesAction = new ActionListener ()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@ -314,24 +327,27 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
splitRemarkItem.addActionListener (basicPreferencesAction);
|
|
||||||
splitDimItem.addActionListener (basicPreferencesAction);
|
|
||||||
alignAssignItem.addActionListener (basicPreferencesAction);
|
|
||||||
showBasicTargetsItem.addActionListener (basicPreferencesAction);
|
|
||||||
onlyShowTargetLinesItem.addActionListener (basicPreferencesAction);
|
|
||||||
showHeaderItem.addActionListener (basicPreferencesAction);
|
showHeaderItem.addActionListener (basicPreferencesAction);
|
||||||
showCaretItem.addActionListener (basicPreferencesAction);
|
showFormatApplesoftItem.addActionListener (basicPreferencesAction);
|
||||||
showThenItem.addActionListener (basicPreferencesAction);
|
// splitRemarkItem.addActionListener (basicPreferencesAction);
|
||||||
showXrefItem.addActionListener (basicPreferencesAction);
|
// splitDimItem.addActionListener (basicPreferencesAction);
|
||||||
showCallsItem.addActionListener (basicPreferencesAction);
|
// alignAssignItem.addActionListener (basicPreferencesAction);
|
||||||
showSymbolsItem.addActionListener (basicPreferencesAction);
|
// showBasicTargetsItem.addActionListener (basicPreferencesAction);
|
||||||
showFunctionsItem.addActionListener (basicPreferencesAction);
|
// onlyShowTargetLinesItem.addActionListener (basicPreferencesAction);
|
||||||
showConstantsItem.addActionListener (basicPreferencesAction);
|
// showCaretItem.addActionListener (basicPreferencesAction);
|
||||||
showDuplicateSymbolsItem.addActionListener (basicPreferencesAction);
|
// showThenItem.addActionListener (basicPreferencesAction);
|
||||||
listStringsItem.addActionListener (basicPreferencesAction);
|
// showXrefItem.addActionListener (basicPreferencesAction);
|
||||||
blankAfterReturn.addActionListener (basicPreferencesAction);
|
// showCallsItem.addActionListener (basicPreferencesAction);
|
||||||
deleteExtraRemSpace.addActionListener (basicPreferencesAction);
|
// showSymbolsItem.addActionListener (basicPreferencesAction);
|
||||||
deleteExtraDataSpace.addActionListener (basicPreferencesAction);
|
// showFunctionsItem.addActionListener (basicPreferencesAction);
|
||||||
|
// showConstantsItem.addActionListener (basicPreferencesAction);
|
||||||
|
// showDuplicateSymbolsItem.addActionListener (basicPreferencesAction);
|
||||||
|
// listStringsItem.addActionListener (basicPreferencesAction);
|
||||||
|
// blankAfterReturn.addActionListener (basicPreferencesAction);
|
||||||
|
// deleteExtraRemSpace.addActionListener (basicPreferencesAction);
|
||||||
|
// deleteExtraDataSpace.addActionListener (basicPreferencesAction);
|
||||||
|
for (JMenuItem item : applesoftMenuItems)
|
||||||
|
item.addActionListener (basicPreferencesAction);
|
||||||
|
|
||||||
showAssemblerTargetsItem.addActionListener (assemblerPreferencesAction);
|
showAssemblerTargetsItem.addActionListener (assemblerPreferencesAction);
|
||||||
showAssemblerStringsItem.addActionListener (assemblerPreferencesAction);
|
showAssemblerStringsItem.addActionListener (assemblerPreferencesAction);
|
||||||
@ -367,10 +383,21 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
saveSectorsItem.setAction (saveSectorsAction);
|
saveSectorsItem.setAction (saveSectorsAction);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
private void enableApplesoftMenuItems (boolean value)
|
||||||
|
// ---------------------------------------------------------------------------------//
|
||||||
|
{
|
||||||
|
for (JMenuItem item : applesoftMenuItems)
|
||||||
|
item.setEnabled (value);
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
private void setBasicPreferences ()
|
private void setBasicPreferences ()
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
basicPreferences.showHeader = showHeaderItem.isSelected ();
|
||||||
|
basicPreferences.formatApplesoft = showFormatApplesoftItem.isSelected ();
|
||||||
|
|
||||||
basicPreferences.splitRem = splitRemarkItem.isSelected ();
|
basicPreferences.splitRem = splitRemarkItem.isSelected ();
|
||||||
basicPreferences.splitDim = splitDimItem.isSelected ();
|
basicPreferences.splitDim = splitDimItem.isSelected ();
|
||||||
basicPreferences.alignAssign = alignAssignItem.isSelected ();
|
basicPreferences.alignAssign = alignAssignItem.isSelected ();
|
||||||
@ -386,10 +413,11 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
basicPreferences.blankAfterReturn = blankAfterReturn.isSelected ();
|
basicPreferences.blankAfterReturn = blankAfterReturn.isSelected ();
|
||||||
basicPreferences.deleteExtraRemSpace = deleteExtraRemSpace.isSelected ();
|
basicPreferences.deleteExtraRemSpace = deleteExtraRemSpace.isSelected ();
|
||||||
basicPreferences.deleteExtraDataSpace = deleteExtraDataSpace.isSelected ();
|
basicPreferences.deleteExtraDataSpace = deleteExtraDataSpace.isSelected ();
|
||||||
basicPreferences.showHeader = showHeaderItem.isSelected ();
|
|
||||||
basicPreferences.showTargets = showBasicTargetsItem.isSelected ();
|
basicPreferences.showTargets = showBasicTargetsItem.isSelected ();
|
||||||
basicPreferences.onlyShowTargetLineNumbers = onlyShowTargetLinesItem.isSelected ();
|
basicPreferences.onlyShowTargetLineNumbers = onlyShowTargetLinesItem.isSelected ();
|
||||||
BasicProgram.setBasicPreferences (basicPreferences);
|
BasicProgram.setBasicPreferences (basicPreferences);
|
||||||
|
|
||||||
|
enableApplesoftMenuItems (basicPreferences.formatApplesoft);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
@ -535,6 +563,9 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
int scale = scale1Item.isSelected () ? 1 : scale2Item.isSelected () ? 2 : 3;
|
int scale = scale1Item.isSelected () ? 1 : scale2Item.isSelected () ? 2 : 3;
|
||||||
prefs.putInt (PREFS_SCALE, scale);
|
prefs.putInt (PREFS_SCALE, scale);
|
||||||
|
|
||||||
|
prefs.putBoolean (PREFS_SHOW_HEADER, showHeaderItem.isSelected ());
|
||||||
|
prefs.putBoolean (PREFS_FORMAT_APPLESOFT, showFormatApplesoftItem.isSelected ());
|
||||||
|
|
||||||
prefs.putBoolean (PREFS_SPLIT_REMARKS, splitRemarkItem.isSelected ());
|
prefs.putBoolean (PREFS_SPLIT_REMARKS, splitRemarkItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_SPLIT_DIM, splitDimItem.isSelected ());
|
prefs.putBoolean (PREFS_SPLIT_DIM, splitDimItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_ALIGN_ASSIGN, alignAssignItem.isSelected ());
|
prefs.putBoolean (PREFS_ALIGN_ASSIGN, alignAssignItem.isSelected ());
|
||||||
@ -548,7 +579,6 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
prefs.putBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS,
|
prefs.putBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS,
|
||||||
showDuplicateSymbolsItem.isSelected ());
|
showDuplicateSymbolsItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_LIST_STRINGS, listStringsItem.isSelected ());
|
prefs.putBoolean (PREFS_LIST_STRINGS, listStringsItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_SHOW_HEADER, showHeaderItem.isSelected ());
|
|
||||||
prefs.putBoolean (PREFS_SHOW_TARGETS, showBasicTargetsItem.isSelected ());
|
prefs.putBoolean (PREFS_SHOW_TARGETS, showBasicTargetsItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_ONLY_SHOW_TARGETS, onlyShowTargetLinesItem.isSelected ());
|
prefs.putBoolean (PREFS_ONLY_SHOW_TARGETS, onlyShowTargetLinesItem.isSelected ());
|
||||||
prefs.putBoolean (PREFS_BLANK_AFTER_RETURN, blankAfterReturn.isSelected ());
|
prefs.putBoolean (PREFS_BLANK_AFTER_RETURN, blankAfterReturn.isSelected ());
|
||||||
@ -593,6 +623,9 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showHeaderItem.setSelected (prefs.getBoolean (PREFS_SHOW_HEADER, true));
|
||||||
|
showFormatApplesoftItem.setSelected (prefs.getBoolean (PREFS_FORMAT_APPLESOFT, true));
|
||||||
|
|
||||||
splitRemarkItem.setSelected (prefs.getBoolean (PREFS_SPLIT_REMARKS, false));
|
splitRemarkItem.setSelected (prefs.getBoolean (PREFS_SPLIT_REMARKS, false));
|
||||||
splitDimItem.setSelected (prefs.getBoolean (PREFS_SPLIT_DIM, false));
|
splitDimItem.setSelected (prefs.getBoolean (PREFS_SPLIT_DIM, false));
|
||||||
alignAssignItem.setSelected (prefs.getBoolean (PREFS_ALIGN_ASSIGN, true));
|
alignAssignItem.setSelected (prefs.getBoolean (PREFS_ALIGN_ASSIGN, true));
|
||||||
@ -606,7 +639,6 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
|||||||
showDuplicateSymbolsItem
|
showDuplicateSymbolsItem
|
||||||
.setSelected (prefs.getBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS, false));
|
.setSelected (prefs.getBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS, false));
|
||||||
listStringsItem.setSelected (prefs.getBoolean (PREFS_LIST_STRINGS, false));
|
listStringsItem.setSelected (prefs.getBoolean (PREFS_LIST_STRINGS, false));
|
||||||
showHeaderItem.setSelected (prefs.getBoolean (PREFS_SHOW_HEADER, true));
|
|
||||||
showBasicTargetsItem.setSelected (prefs.getBoolean (PREFS_SHOW_TARGETS, false));
|
showBasicTargetsItem.setSelected (prefs.getBoolean (PREFS_SHOW_TARGETS, false));
|
||||||
onlyShowTargetLinesItem
|
onlyShowTargetLinesItem
|
||||||
.setSelected (prefs.getBoolean (PREFS_ONLY_SHOW_TARGETS, false));
|
.setSelected (prefs.getBoolean (PREFS_ONLY_SHOW_TARGETS, false));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user