Fields resize
Posted: Mon Sep 03, 2012 3:56 pm
We have a program for creating concept maps, and a feature that allows the positions of all of the fields to be recorded in a text file. When we want to 'open' that same map, it just calls on the text file and recreates the fields in the positions they were in when the map was saved, and inputs the text that was in each field into the new node. So it is basically a save/open text file.
I have it set to record the size of each field when saved, and set the new node to that size when opened. However, for some reason it doesn't like putting the text on just one line, even if it saved that way. So if it saved with "transformation processes" on one line in the field, when we open it again the size of the field is the same, but "processes" gets bumped down a line and, consequently, cut off. Any ideas on how to fix this? I will include the script for when files are opened, and the script for the templatefield.
this is only a small part of the openmap handler, but it is the only relevant part, I think:
templatefield script:
I have it set to record the size of each field when saved, and set the new node to that size when opened. However, for some reason it doesn't like putting the text on just one line, even if it saved that way. So if it saved with "transformation processes" on one line in the field, when we open it again the size of the field is the same, but "processes" gets bumped down a line and, consequently, cut off. Any ideas on how to fix this? I will include the script for when files are opened, and the script for the templatefield.
this is only a small part of the openmap handler, but it is the only relevant part, I think:
Code: Select all
--adjusts the size of the new node to fit content
set the height of last field to item 6 of line x of gFinalMapData
set the width of last field to item 7 of line x of gFinalMapData
--puts the content of the node into the new node
put item 5 of line x of gFinalMapData into last field
Code: Select all
on keydown --checks when the key is pressed
if gEditMode is true then
updateSize
pass keydown
else
pass keydown
end if
end keydown
on backspaceKey
updatesize
pass backspaceKey
end backspaceKey
on updatesize
if gEditMode is true then
if the formattedwidth of me + 1 >100 then
set the dontwrap of me to false
set the height of me to the formattedheight of me + 1
else
set the dontwrap of me to true
set the width of me to the formattedwidth of me + 1
end if
set the height of me to the formattedheight of me + 1
end if
end updatesize