Program Layout
Main program code.
Code: Select all
AllPoints = undefined;
ZeroPoint = new RVector(0,0);
Corner1 = undefined;Corner2 = undefined;Corner4 = undefined;Corner5 = undefined;
Corner7 = undefined;Corner8 = undefined;var DrawOrder = 0;
var U4width = 0;var U4first = 0;var U4space = 0;var U6width = 0;var U6first = 0;var U6second = 0;var U6space = 0;var U6offset = 0;
var U8width = 0;var U8first = 0;var U8second = 0;var U8third = 0;var U8space = 0;var U8offset = 0;var U8offset2 = 0;
Code: Select all
// Include base class definition:
include("../nTruss.js");
// Constructor calls base class constructor:
function nTrussOptions(guiAction) {
nTruss.call(this, guiAction);
}
// Derive class nTrussOptions from class nTruss:
nTrussOptions.prototype = new nTruss();
nTrussOptions.includeBasePath = includeBasePath;
nTrussOptions.prototype.beginEvent = function() {
nTruss.prototype.beginEvent.call(this);
// Create the dialog from the .ui file using the helper function WidgetFactory.createWidget().
var dialog = WidgetFactory.createWidget(nTrussOptions.includeBasePath,"nTrussOptions.ui");
// Restore the previous user data or display default values as set in Qt Designer:
WidgetFactory.restoreState(dialog);
// Display and execute the dialog:
if (!dialog.exec()) {
dialog.destroy();
EAction.activateMainWindow();
// User hit cancel:
this.terminate();
return;
}
// User hit OK. Store the new user input:
WidgetFactory.saveState(dialog);
var widgets = getWidgets(dialog);
nTruss.U6width = widgets["x6width"].text;
nTruss.U6first = widgets["x6first"].text;
nTruss.U6second = widgets["x6second"].text;
nTruss.U6space = widgets["x6space"].text;
nTruss.U6offset = widgets["x6offset"].text;
nTruss.U8width = widgets["x8width"].text;
nTruss.U8first = widgets["x8first"].text;
nTruss.U8second = widgets["x8second"].text;
nTruss.U8third = widgets["x8third"].text;
nTruss.U8space = widgets["x8space"].text;
nTruss.U8offset = widgets["x8offset"].text;
nTruss.U8offset2 = widgets["x8offset2"].text;
nTruss.U4width = widgets["x4width"].text;
nTruss.U4first = widgets["x4first"].text;
nTruss.U4space = widgets["x4space"].text;
dialog.destroy();
EAction.activateMainWindow();
this.terminate();
};
This is the error that is generated. If anyone is interested, I can send you the complete project to test.
This does not happed if I don't open the dialog box.