seanhoughton
Active member
I'm having a really difficult time getting the HorizontalSizer to work. My brute force approach to the problem was to keep deleting things until my script looked exactly like the HelloWorld example. I did this and it was still broken. The only difference was one variable name. I renamed this and all of a sudden the sizer started working. I renamed it back to the original name and it still worked, which is pretty weird. I started from scratch again and I've included the script below. How do I make the controls stack?
Code:
#include <pjsr/Sizer.jsh>
#include <pjsr/FrameStyle.jsh>
#include <pjsr/TextAlign.jsh>
#include <pjsr/StdButton.jsh>
#include <pjsr/StdIcon.jsh>
#include <pjsr/NumericControl.jsh>
#define TITLE Demonstration
#define VERSION 0.1
function DemonstrationDialog()
{
this.__base__ = Dialog;
this.__base__();
this.helpLabel = new Label( this );
with ( this.helpLabel )
{
frameStyle = FrameStyle_Box;
margin = 4;
wordWrapping = true;
useRichText = true;
text = "This is a helpful label";
}
this.findExposureButton = new PushButton( this );
this.findExposureButton.text = "Press me";
this.contentSizer = new VerticalSizer;
this.contentSizer.add(this.helpLabel);
this.contentSizer.add(this.findExposureButton);
this.windowTitle = #TITLE + " Script";
this.adjustToContents();
}
DemonstrationDialog.prototype = new Dialog;
var dialog = new DemonstrationDialog;
dialog.execute();