Home AMX User Forum AMX Design Tools

TPD4 – Copy/Paste/Delete - Ugh

Joe HebertJoe Hebert Junior MemberPosts: 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.

Comments

  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    I've had such bad experience with icons in TPD that I've quit using them altogether. TPD4 is still pretty half-baked if you ask me. The icons don't seem to work right and the lack of ability to copy/paste multiple pages/popups is very annoying.
  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,682
    I've seen issues with older projects being edited with newer versions of TPD4. If there's a corruption early on, it travels with it like herpes, ready to bloom when you least expect it. FONTS similarly hang around forever after you no longer use them, and foul your later attempts to load the panel project with a PC that is missing the unused font. No way to "clean" a TP4 file except by creating a new one and pasting only the good stuff into it. Which is very painful as mentioned, with no multi-page paste option.

    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.
  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    John Nagy wrote:
    Import things as ICONS and they fill slots numerically, not positionally.
    Not true. I wasn’t talking about importing I was talking about pasting but you can indeed import by position number. Just click on the icon slot position, press import, and grab a new image from you drive to be placed in that slot. It is kind of ironic that you can’t actually put icons (.ico) in icon slots.

    John Nagy wrote:
    Paste in buttons that have icons on them, and you get duplicates
    Not true either, if not for the bug. That’s what the paste controls are for. As I said in my original post:
    Joe Hebert wrote:
    Copying and pasting buttons with icon slots between files work fine if you start with fresh files so I know my settings are correct.

    John Nagy wrote:
    You can renumber icons after the fact
    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.

    John Nagy wrote:
    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.
    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.

    John Nagy wrote:
    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.
    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.

    John Nagy wrote:
    For a free development tool for a control system, it's impressive. But clearly not yet ideal.
    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.
  • John NagyJohn Nagy CineTouch Product Manager Posts: 1,682
    Thanks for the learning experience. You've gone deeper than I and found more alligators there...
  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    Here’s an alligator...
    John Nagy wrote: »
    Thanks for the learning experience. You've gone deeper than I and found more alligators there...

    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.
  • AuserAuser Junior Member Posts: 506
    Same behaviour on my PC.
  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    Wow that was fast.
    Thanks.
  • AuserAuser Junior Member Posts: 506
    Looking at the underlying XMA project definition, the "delete me" page is the first subpage defined in the project. I wonder if this bug always occurs when you delete the first subpage defined in a project...

    I'll do a quick test and see if this holds true.
  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    Auser wrote: »
    Looking at the underlying XMA project definition, the "delete me" page is the first subpage defined in the project. I wonder if this bug always occurs when you delete the first subpage defined in a project...

    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.
  • ColzieColzie Senior Member Posts: 470
    Joe Hebert wrote: »
    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.

    Same behavior here, running Windows 7.
  • ColzieColzie Senior Member Posts: 470
    ...and TPD4 3.0.0.634.
  • viningvining X Member Posts: 4,368
    I had a problem with TPD4 3.0.0.634 2 weeks ago with a small R4 file. On brand new out of the box R4s I would send the TPD file that was loaded on the other R4s already installed. I would constantly get an error during transfer that a popup page file was missing. In was in TPD4 and recently saved. I'd re-add it, change its name and eventually I'd have to delete it in order to get the file transfer to complete. It drove me batty. Eventually I'd be able to send the modified file, it would complete and then I could send the original that I initially couldn't. Was it TPD4, the R4 or my PC, I couldn't tell you but me thinks it was TPD4.

    Running Win XP SP3.
  • ColzieColzie Senior Member Posts: 470
    vining wrote: »
    I would constantly get an error during transfer that a popup page file was missing.

    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.
  • DHawthorneDHawthorne Old Timer Posts: 4,584
    I've had some limited success with various file corruptions by using the "Verify Function Maps" tool under "Panel" on the menu. At the very least it prevents phantom channels, etc., from being saved to the file.
  • Andrew G WelkerAndrew G Welker Junior Member Posts: 124
    No issue with deleting that popup for me here. I'm running Windows 7 Home Premium and TPD4 is version 3.1.0 bulid 643 border version 9.

    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.
  • Joe HebertJoe Hebert Junior Member Posts: 2,159
    No issue with deleting that popup for me here. I'm running Windows 7 Home Premium and TPD4 is version 3.1.0 bulid 643 border version 9.

    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.
  • Andrew G WelkerAndrew G Welker Junior Member Posts: 124
    Still no issues. Reunzipped the file both times, and no issues either time.
  • viningvining X Member Posts: 4,368
    Colzie wrote: »
    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.

    I think so at some point. I also sent an 1 page file at one point too.
  • AuserAuser Junior Member Posts: 506
    Auser wrote: »
    Looking at the underlying XMA project definition, the "delete me" page is the first subpage defined in the project. I wonder if this bug always occurs when you delete the first subpage defined in a project...

    I'll do a quick test and see if this holds true.

    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 :(
Sign In or Register to comment.