TPD4 – Copy/Paste/Delete - Ugh
Joe Hebert
Posts: 2,159
I have a TP4 file that has a popup page with a batch of buttons with icon slots (scattered about in the 1000 range) assigned to the ON and OFF states. I want to copy that popup as is to a new TP4 file. I have everything checked on the Paste Controls dialog box including retain slot references and overwrite occupied slots. I have the max icon slots set at 9900.
When I copy the original popup and paste it into my new empty file the images end up getting pasted into the first empty icon slots starting at slot number 1 and not where they should be which is the 1000 range.
What sucks even worse is I also have double the icon slots used up in the new TP4 file. The ON and OFF states both referenced the same slot on the original popup, however, after I paste the popup in the new file the ON and OFF states both reference a different slot number which both have the same image.
What the...?
I then tried just copying one button from my original file that had the same icon slot assigned to both the ON and OFF state in the 1000 range and when I pasted into a new file the images were assigned to the first 2 empty slots.
Anyone else run into this icon slot problem?
Copying and pasting buttons with icon slots between files work fine if you start with fresh files so I know my settings are correct. But these TP4 files really get funky when they get too big and after cutting, pasting, and deleting too many times.
I had a large file that I wanted to use as a starting point for a new job but I wanted to trim it down to get rid of popups and pages that weren’t needed. I deleted some of the popups and everything looked ok at first. I saved the file and closed it. When I reopened the file I was shocked to see that every popup in the project had disappeared.
So I went back to the original large file and tried deleting the junk I didn’t need any more one more time and sure enough everything looked fine until I reopened the file and saw that every popup was gone. I did this several times until I narrowed it down to one particular popup that if it was deleted all popups would disappear after the file was reopened. I then deleted every button on that particular popup (I didn’t delete the popup) closed the file and reopened it and the other popups in the project were still intact. I then deleted that now blank popup and when I reopened the file every popup in the file was gone.
I’m constantly saving my TP4 files and making backups as I go along because I always feel like there is a time bomb ticking and one wrong move is going to set it off and destroy my work. Ugh.
I’m using TPD4 3.0.634. I decided not to upgrade to 3.1.643 after reading reports on the forum that the install rendered some computers useless.
When I copy the original popup and paste it into my new empty file the images end up getting pasted into the first empty icon slots starting at slot number 1 and not where they should be which is the 1000 range.
What sucks even worse is I also have double the icon slots used up in the new TP4 file. The ON and OFF states both referenced the same slot on the original popup, however, after I paste the popup in the new file the ON and OFF states both reference a different slot number which both have the same image.
What the...?
I then tried just copying one button from my original file that had the same icon slot assigned to both the ON and OFF state in the 1000 range and when I pasted into a new file the images were assigned to the first 2 empty slots.
Anyone else run into this icon slot problem?
Copying and pasting buttons with icon slots between files work fine if you start with fresh files so I know my settings are correct. But these TP4 files really get funky when they get too big and after cutting, pasting, and deleting too many times.
I had a large file that I wanted to use as a starting point for a new job but I wanted to trim it down to get rid of popups and pages that weren’t needed. I deleted some of the popups and everything looked ok at first. I saved the file and closed it. When I reopened the file I was shocked to see that every popup in the project had disappeared.
So I went back to the original large file and tried deleting the junk I didn’t need any more one more time and sure enough everything looked fine until I reopened the file and saw that every popup was gone. I did this several times until I narrowed it down to one particular popup that if it was deleted all popups would disappear after the file was reopened. I then deleted every button on that particular popup (I didn’t delete the popup) closed the file and reopened it and the other popups in the project were still intact. I then deleted that now blank popup and when I reopened the file every popup in the file was gone.
I’m constantly saving my TP4 files and making backups as I go along because I always feel like there is a time bomb ticking and one wrong move is going to set it off and destroy my work. Ugh.
I’m using TPD4 3.0.634. I decided not to upgrade to 3.1.643 after reading reports on the forum that the install rendered some computers useless.
0
Comments
As for ICONS, remember that they are essentially a different way to reference a bitmap. Import things as ICONS and they fill slots numerically, not positionally, and they make a bitmap in the bitmap section that they relate to. Paste in buttons that have icons on them, and you get duplicates... You can renumber icons after the fact... this isn't to say they handle well, but they aren't as awful as they seem once you get their zen.
The only reason to use icons at all instead of bitmaps is to be able to get more than one bitmap per button. If you don't need that, stop using icons. Bitmaps work more sensibly.
Of course I need to mention again that in VISTA and WIN7, the handy checkbox to choose whether to OVERWRITE or RENAME AS COPY for importing duplicate name bitmaps IS GONE. No way to access this feature from the UI, and it defualts to the tragic RENAME. Fortunately, I don't want to change it from OVERWRITE ever, so I changed the value of this in the windows registry for the app. Dangerous.
All that said, TPD4 is pretty amazingly comprehensive. It compares in complexity and maturity to many commercial drawing applications that are products in themselves. For a free development tool for a control system, it's impressive. But clearly not yet ideal.
Not true either, if not for the bug. That’s what the paste controls are for. As I said in my original post:
You can’t actual renumber them as far as I know but moving a batch of them around in a different order is easier said than done and I’d shouldn’t have to do it at all.
I know I’m sounding redundant but that’s absolutely not true. If that were the case there would be a bitmap 1 and bitmap 2 property. There would be no need for icon slots or the ^ICO command.
Part of my program uses multi-state bargraphs with different images for each state. While the program is running I change the number of states on the fly and I change the images for each state on the fly. Referencing slot numbers with the ^ICO command is better from a programming standpoint. My program doesn’t need to know or care what the image name is. The program uses icon slots in the same fashion as you would an array. I also use the bitmap property but there are cases when icon slots are the way to go. I doubt icon slots were invented for the sole purpose of putting another image on a button.
Is Vista or Win7 supported by AMX? I’ve been sticking with XP SP3 since that’s what AMX supports right now as far as I know.
Free or not I expect it to work as advertised. Netlinx Studio is free also but if the compiler has bugs we expect them to be fixed. After all these free development tools are used to sell AMX hardware that isn’t exactly free. You can buy a small car for the price of some of the panels.
TPD4 is impressive in many ways but it definitely has issues if you exercise it too much. If you are working with large files you’re bound to get bit sooner or later and it hurts pretty bad when it does.
To view an alligator perform the following steps:
1) Open ALLIGATOR.TP4. Notice there are 7 pages and 50 popups. The pages and popups have no buttons and the resource manager is completely empty. The function map is completely clear and there are no page flips anywhere.
2) Delete the popup named ALLIGATOR_DELETE_ME. You should see that everything still looks fine. There are now 7 pages and 49 popups.
3) SAVE the file ALLIGATOR.TP4 and then CLOSE it.
4) Reopen ALLIGATOR.TP4 and you should see all that remains are 7 pages. All the popups have magically disappeared.
The creation date is Fri Feb 15 11:28:46 2008 [TPDesign4 Build 545] so this file is pretty old and has been manipulated a lot. The file was originally created by someone else and not on my PC.
As I’m typing this I just realized that I don’t think I ever tried moving this file to a different PC to see if the file still gets mucked up after deleting that popup.
If you (or anyone) gets a chance can you try this yourself and let me know if you see what I see? Maybe it’s just my PC that is having issues with this file.
Thanks.
I can’t attach a TP4 file so I put it inside a zip.
Thanks.
I'll do a quick test and see if this holds true.
This is a severely gutted version of the original file that had hundreds of popups and pages. That particular popup was in a group with other popups and there were dozens of groups. It wasn’t in the first group and it wasn’t the first popup in the group it was in. I couldn’t find any reason why that one popup destroyed everything when deleted and it only destroyed everything after a save and a reopen.
I just kept enough to reproduce the bug. I wanted to delete as much as possible (including all artwork, buttons, and page flips) to see if I could find out why that one popup screwed things up.
You should be able to rename that popup to whatever you want or put it in its own group and the bug will stick with it.
Thanks for checking for me. If you find out anything I’d love to know what causes it.
Same behavior here, running Windows 7.
Running Win XP SP3.
Did you do "Remove user pages" on the new R4 before sending your file? I always have to do this on new R4s to prevent problems...though I can't specifically remember the error that gets thrown if I don't.
Just to be clear, I unzipped the file, opened the TPD4 file, deleted the pop-up, saved the file, completely closed TPD4, then re-opened the file. When I re-opened the file, all of the pop-up pages were still there.
Interesting. Can you try one more time with the original file and see if the same thing happens? If you do get the same results can you try one last time with the original file but this time do the delete, save and close the file, and then reopen the file without closing TPD4 and see if that makes any difference. Thanks.
I think so at some point. I also sent an 1 page file at one point too.
Hmm, no that's not it. I can't find any malformed XML in the project files or anything else that looks suss - I think it's TPD4, not that project.
Even though it seems 3.1.0 may fix the problems, I'm still too scared to update based on the few horror stories floating around about installing that version causing machines to go into a death spiral