cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
miguello
Level VI

How to control size of Text Box, Border Box or Outline Box?

I'm having hard times trying to control size of my Display Boxes.

So, I have a number of reports where there is a Graph Builder of certain size.

For some reports there is nothing to report (missing files) and I want to place a text box saying files are missing instead of the Graph Builder.

I would like to match the size of it to the size of Graph Builder in other reports, and I cannot.

None of the messages I try work, the size only depends on Font Size of the text and partially on Padding of the boxes.

I have the following structure in place of the Graph Builder:

Outline Box( "Missing files",
	missingFilePlaceholderBB = Border Box( Left( 50 ), Right( 50 ), Top( 50 ), Bottom( 50 ), Sides( 15 ),
		missingFilePlaceholderTB = Text Box( "One or More of the following files could not be found: \!n" || O_file || "\!n" || N_file )
	)
)

What messages and to what Display Box out of these three I need to send in order to control the overall size?

 

5 REPLIES 5
txnelson
Super User

Re: How to control size of Text Box, Border Box or Outline Box?

The approach I would take, is that since you are replacing a Graph Box with a specified Frame Box size, I would create a Graph Box of the same Frame Box size with a line of text in the Graph Box that states 

"One or More of the following files could not be found: \!n" || O_file || "\!n" || N_file
Jim
miguello
Level VI

Re: How to control size of Text Box, Border Box or Outline Box?

How would I set size of Graph Box then? None of the messages I'm using work on any of Display Boxes.
Set Size()
Set Height()
Set Width()
Set Max\Min Heigh\Width()

Set Height, for instance, is working only when I go properties and set Auto Stretching to 1. But if I use << Set AutoStretching (1) in the script - it doesn't change anything.
txnelson
Super User

Re: How to control size of Text Box, Border Box or Outline Box?

Here is a simple example

Names Default To Here( 1 );
New Window( "Example",
		gb = Graph Box(
			Frame Size( 300, 300 ),
			Text Color( "red" );
			Text( Center Justified, {40, 60}, "centered" );
		)
);

framebox = gb[Frame Box( 1 )];
framebox << Frame Size( 500, 500 );

 

Jim
miguello
Level VI

Re: How to control size of Text Box, Border Box or Outline Box?

Does this text have all the customization options (like, font size, face, color, border styles etc.)?
txnelson
Super User

Re: How to control size of Text Box, Border Box or Outline Box?

Yes, this is all fully documented in the Scripting Index under the category selection "Graphics"

graphics.PNG

Jim