fix delay() hang
MODIFY
builder/src/main/java/builder/controller/CodeGenerator.java
builder/src/main/java/builder/controller/CodeGenerator.java
@@ -694,7 +694,13 @@ public class CodeGenerator {
String tmp = fileName.substring(0,n);
String skeletonName = new String(folder + System.getProperty("file.separator") + tmp + fileExtension);
projectFile = new File(skeletonName);
+ backupName = null;
+ backupFile = null;
+ if(projectFile.exists()) {
+ // Make a backup copy of projectFile
+ backupName = new String(skeletonName + ".bak");
CommonUtil.getInstance().backupFile(projectFile);
+ }
try {
// Here we are either going to use a previously generated file as input
// or we are generating a brand new file from one of our templates.

MODIFY
builder/src/main/java/builder/models/TextBoxModel.java
builder/src/main/java/builder/models/TextBoxModel.java
@@ -130,7 +130,7 @@ public class TextBoxModel extends WidgetModel {
*/
@Override
public void changeValueAt(Object value, int row) {
- boolean bChangeFontEnum = true;
+ boolean bChangeFontEnum = false;
// The test for Integer supports copy and paste from clipboard.
// Otherwise we get a can't cast class String to Integer fault
if ( (getClassAt(row) == Integer.class) && (value instanceof String)) {
@@ -138,7 +138,7 @@ public class TextBoxModel extends WidgetModel {
} else {
if (row == PROP_FONT) {
// check to see if user defined this font enum, if so we won't change it
- if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=false;
+ if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=true;
}
data[row][PROP_VAL_VALUE] = value;
}

MODIFY
builder/src/main/java/builder/models/TextModel.java
builder/src/main/java/builder/models/TextModel.java
@@ -186,7 +186,7 @@ public class TextModel extends WidgetModel {
*/
@Override
public void changeValueAt(Object value, int row) {
- boolean bChangeFontEnum = true;
+ boolean bChangeFontEnum = false;
// The test for Integer supports copy and paste from clipboard.
// Otherwise we get a can't cast class String to Integer fault
if ( (getClassAt(row) == Integer.class) && (value instanceof String)) {
@@ -194,7 +194,7 @@ public class TextModel extends WidgetModel {
} else {
if (row == PROP_FONT) {
// check to see if user defined this font enum, if so we won't change it
- if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=false;
+ if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=true;
}
data[row][PROP_VAL_VALUE] = value;
}

MODIFY
builder/src/main/java/builder/models/TxtButtonModel.java
builder/src/main/java/builder/models/TxtButtonModel.java
@@ -130,7 +130,7 @@ public class TxtButtonModel extends WidgetModel {
*/
@Override
public void changeValueAt(Object value, int row) {
- boolean bChangeFontEnum = true;
+ boolean bChangeFontEnum = false;
// The test for Integer supports copy and paste from clipboard.
// Otherwise we get a can't cast class String to Integer fault
if ( (getClassAt(row) == Integer.class) && (value instanceof String)) {
@@ -138,7 +138,7 @@ public class TxtButtonModel extends WidgetModel {
} else {
if (row == PROP_FONT) {
// check to see if user defined this font enum, if so we won't change it
- if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=false;
+ if (!ff.getFontEnum((String)value).equals(getFontEnum())) bChangeFontEnum=true;
}
data[row][PROP_VAL_VALUE] = value;
}

MODIFY
builder/templates/ino.t
builder/templates/ino.t
@@ -92,9 +92,8 @@ void setup()
// ------------------------------------------------
Serial.begin(9600);
// Wait for USB Serial
- while (!Serial) {
- yield();
- }
+ //delay(1000); // NOTE: Some devices require a delay after Serial.begin() before serial port can be used
+
gslc_InitDebug(&DebugOut);
if (!gslc_Init(&m_gui,&m_drv,m_asPage,MAX_PAGE,m_asFont,MAX_FONT)) { return; }

MODIFY
builder/templates/min.t
builder/templates/min.t
@@ -91,10 +91,8 @@ void setup()
// Initialize
// ------------------------------------------------
Serial.begin(9600);
- // Wait for USB Serial
- while (!Serial) {
- yield();
- }
+ //delay(1000); // NOTE: Some devices require a delay after Serial.begin() before serial port can be used
+
gslc_InitDebug(&DebugOut);
if (!gslc_Init(&m_gui,&m_drv,m_asPage,MAX_PAGE,m_asFont,MAX_FONT)) { return; }

fix delay() hang