Dialog Label Height/Width workaround

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Dialog Label Height/Width workaround

Post by Bob Hansen » Sun Sep 07, 2003 4:48 pm

Note: This message is wider than normal due to code pasted below. There is nothing wrong with your browser!
=================================
I just submitted an Enhancement Request to have Width and Height added to values of Dialog Label. See: http://www.mjtnet.com/usergroup/viewtopic.php?t=569.
Until that is done, here is a workaround that worked for me:

1. Open the Dialog Designer
2. Add a Label to the Dialog in the relative position that you need it.
3. Save the Dialog and go back to the Editor and paste the results from the Desinger.
4. In the Editor, enter the text that you want in the Label field. Use %CRLF% at the end of each line where you want to wrap. WARNING -- Do not use any commas in this text. Commas are a delimiter that are expected to be followed by Top and Left values.
5. Open that Dialog in the Designer again.
6. Add a Memo object to the bottom of the form (will be deleted later) and drag it to the size that you want.

7. You now have two ways to make a Label look like a Memo:
(NOTE: Some steps have not been listed re how to open Dialog Sesigner, save results, close Designer, and paste into Editor. Expect you can do that already).

A1. Select the Memo object and look at the top of the Dialog Designer where you will see Height and Width values, remember them.
A2. Select the Label, click on the Icon for Size, and enter the values for Width and Height that you saw with the Memo object field.

OR

B1. Select both the Label and the Memo object fields.
B2. Click on the icon for Size.
B3. Under Width select "Shrink to smallest"
B4. Under Height select "Grow to largest"
B5. Click on OK.

8. You can now delete the Memo object, it is no longer needed.
9. Note that the actual Height and Width of the Label are not correct as shown in the Caption bar of the Designer window. Do not try to adjust position of the Label yet.
10. Save the Designer values and return to the Editor, pasting the results from the Designer.
11. If you look at the end of the Label line, you will not see any values for Height and Width, but somehow they are retained.
12. Now you can Show>DialogName,Result and see your Read Only label that has the same dimensions as a Memo object.
13. You can make some adjustments to the positioning in the Editor by changing the values of Top and Left. But changes in the Designer will need to be done by changing the values of Height and Width in the Size tool by trial and error. In some circumstances, you may actaully be able to use resize tools to adjust the Label, but it is most frequently shown as a single line.
==========================

Here is an example for a Dialog that I recently made for using on the TextPad Forum:

Let>Version=Version 1.c
Dialog>Setup
Caption=Text Pad Automated Poll Entries %Version%
Top=143
Width=542
Left=90
Height=310
Label=User Guidelines,210,6
Label=1. This is for use with Internet Explorer. Use browser to go to the Community Forum Index Page.%CRLF% The URL for Index Page is http://www.textpad.com/forum/index.php%CRLF%2. Be sure you are logged in. You must be logged in to create a Poll%CRLF%3. Close all Explorer Bar windows in browser for Bookmarks - History - Search - Media etc.%CRLF%4. If you have a Google Toolbar in Explorer close it before continuing.%CRLF% To do that from here click onto Browser window. Use ALT-VTG to toggle it off.%CRLF% Then come back here and click OK%CRLF%5. Remove all other Toolbars except Standard Buttons and Address Bar,50,24
Label=Select your Browser,127,168
Label=Enter home page of Forum,57,192
ComboBox=cboBrowser,241,168,145,MSIE 5.1%CRLF%MSIE 5.5%CRLF%MSIE 6.0%CRLF%MSIE 6.2
Edit=Forum,57,208,121,www.textpad.com
CheckBox=chkPollPage,Enter a check if already on New Reply Page,197,208,241,False
Button=OK,143,240,75,25,1
Button=CANCEL,263,240,75,25,3
EndDialog>Setup

Show>Setup,Result
Hope this was helpful...............good luck,
Bob

mo
Junior Coder
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Post by mo » Sun Sep 07, 2003 7:54 pm

Would it be safe to say the third way would be to copy a formerly completed box (such as above) and modify it?
Best Wishes!
mo

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sun Sep 07, 2003 11:23 pm

Hello mo........

Yes, you can copy that line.

Paste it into the Dialog details while in the Editor.
Be sure that the dimeensions of the Dialog Box are big enough to handle the Label with your other items.

When you look at the numbers at the top of the Dialog Designer, do not be confused by the Height=13, it is really about 300.

Guess you could copy that line and keep it in a Clip Library.

I know you have been learning Macro Scheduler and testing the MS compiled routine for TextPad for me. Do you want a copy of the Macro Scheduler source code as a learning tool?

Thanks, and good luck,
Bob

mo
Junior Coder
Posts: 49
Joined: Thu Aug 21, 2003 11:02 pm

Post by mo » Mon Sep 08, 2003 1:19 am

Yes I thought about asking you for the macro but thought you might be doing this for money.

Please send it along, thanks!

mo
Best Wishes!
mo

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Sep 08, 2003 1:55 am

A copy of the source Macro Scheduler scripts will on its way by noon tomorrow.

You thought perhaps:
doing this for money
?
:idea: Hmmmm. shoulda thought of that....oh well...........

This was always intended to be a freebie.

I guess I could do it for money, but I thought I would be giving something back to the forum users in return for what I have received from them.

I haven't checked many of the Add-Ons for TextPad, but I kind of thought that they might be freebies. Isn't that the purpose of users groups...to share knowledge and scar tissue?

I guess this should be cross posted in TextPad also......I will take care of that.......

Thanks for the chuckle :D

Dave1

Post by Dave1 » Tue Sep 09, 2003 12:28 am

Hi Bob,
Always admired your work and your energy.
Maybe the addition of FONTS and COLOR would be added to the wish list?
Thanks for your help in the past.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts