duplicating a FRM

Started by John Montenigro, November 13, 2013, 02:24:58 PM

Previous topic - Next topic

John Montenigro

I know I screwed this up, and FF is not happy!

I wanted to duplicate one form in a project, edit it, and add it to the project under its own name. But I must have missed some things!

Now, when I open the project and double-click on any of the form tabs, FF acts as if I'm dragging the form to another position, and won't let go. The workspace panel keeps popping up, and even if I dismiss it, as soon as I move the mouse pointer over a tab, the workspace panel pops up again.

1. Should I edit the project file? Ii so, what should I edit?

2. How to avoid this in the first place? Is there a way to "duplicate" a form?

I know FF's not broken; this is definitely a user-generated problem. I apologize!

-John

John Montenigro

I'm noticing that the workspace panel pops up whenever I switch from code to form.

Is that the way it's always been?

I thought that if I'd hidden the workspace, it would stay hidden, even if I opened another window.

-John

Eddy Van Esch

John,

Perhaps this is too late to read, but read here how to currently duplicate a form in FF 3.70:
http://www.planetsquires.com/protect/forum/index.php?topic=3418.msg24852#msg24852   (Reply #8)

And to rename an existing form:
http://www.planetsquires.com/protect/forum/index.php?topic=2384.msg24885#msg24885   (Reply #3)
Eddy

John Montenigro

Thanks, Eddy!

Using those references, I'll re-read the file carefully to see if I missed anything.

-John


John Montenigro

#4
OK, this is making me crazy (crazier?)!!

I removed the form that I had added, and I still see this odd behavior. (What have I done?)

When I open the project, all's OK until I click on a tab in the row of tabs for forms and modules.
- IF the tab was last seen as Code, all is well.
- IF the tab was last seen as Form, the workspace pops up, and if I try to dismiss it, it pops right back up again. Also, when moving the mouse pointer, the tab title moves around as if I'm choosing to relocate it, 
AND the workspace panel covers the current tab making it hard to double-click back to Code.

I CAN change between Code and Form by clicking on the button at the bottom.

It's as if there's a gremlin in the mouse-double-click detection???

Maybe my mouse driver is kaput.

Or I have something out of whack in the project file...

-John


John Montenigro

Paul,
Can you tell me the significance of each field in the .FFP file; maybe I've overwritten something important.

Also, must the lines in the two subgroups under [OBJECTS] correlate to each other by position? Is it OK if they're not in the same order?

QuoteForm=.\forms\frmStraightInterest.frm|0|0|
Module=.\modules\Util.inc|0|0|

TopTab=#FF_AppStart#|False|True|0|0
TopTab=#FF_WinMain#|False|True|0|0
TopTab=.\forms\frmMain.frm|False|True|2|16
TopTab=.\forms\frmPVcalc.frm|False|True|176|201

Also, I note that there are some lines with ending numeric values, others not.

Other projects don't display this odd behavior...
-jhm

Eddy Van Esch

John,
Just a thought: Remove the .ffp project file from the folder (or delete it if you dare..).
Compose the project from scratch. That is, create a new project (can be the same name since the ffp file is gone) and add all the existing .frm files and modules (.inc files) to this 'new' project.
Could be done in a few minutes, and then .. see if you still see this odd behaviour.
Eddy

John Montenigro

Thanks, Eddy,
I renamed the .FFP and opened FF, started a new project in the same directory as the original, set the Project Properties, and started doing "Add Form", Existing.

I added 8 forms, and because I wanted the latest to be on the right instead of the left, I started to grab the tabs to re-sequence them. And then the problem appeared!

These forms were fine before, and I had not gotten to load the form that was the duplication.

So, now I'm seeing this odd behavior where it didn't exist before.

But at least, now I have a "fresh" .FFP file to examine.

I have limited time over the next week, so I may be slow to get back here, but I will let you know if I figure this out.

It was a good idea, Eddy, thanks again!
-John

John Montenigro

OK, a little more info...

I think that having a lot of forms/modules in the separate tabs contributes to creating this problem...

Set the title-bar of the FF Workspace panel to be about the same height as the form tabs (maybe a little higher, but not lower), and partially covering the right-most tab or two.

Now try to double-click on one of the right-side tabs, then move the mouse pointer to the left.

This is the point at which I've observed the tabs being highlighted as if I were dragging the tab to re-position it...

Given that I was able to do this with a fresh, new .FFP, I wonder if anyone else can re-create this behavior.

That's it for tonight...
-John

Eddy Van Esch

John,

I did not dare to exactly duplicate what you describe to avoid messing up my own project :)  But I currently have 14 form and module tabs open in my project.
But to drag tabs, I don't double-click them as you describe. I do a single left mouse click on the tab and drag the form. And that works fine here.
Eddy

Rolf Brandt

I never had problems with that. If I wante to duplicate a form I give the existing form a new name, save it with "Save Form as". After reloading the original form I have both of them in the project without any conflicts.

Since the name of all controls is composed of the formname and control name their really should not be a conflict.

HWND_FRMOLDFORM_CMDOK
would become
HWND_FRMNEWFORM_CMDOK

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Paul Squires

John- I think this is a case where I would need to actually see what you are doing. I have never experienced the problem that you are describing.
Paul Squires
PlanetSquires Software

John Montenigro

@Eddy, I can understand not wanting to mess up a project. No problem, I appreciate all your help.

@Rolf, I wish I would have done it that way! Next time, I will.

@Paul, How do we do that? I'm not keen on remote access. Maybe screen shots? Let me know.

-John

John Montenigro

OK, for a few days now I've been re-learning FF etc, and have a totally new project in the works...

The new project is not mis-behaving at all. The one that was giving me trouble, I seem to have got fixed.

I'm pretty sure the problems were the result of my mistaken way of trying to duplicate a FRM.

I've been using Rolf's suggested method and have not been having any problems like I tried to describe in my OP.

SO to duplicate a FRM:
1. In FF, click the TAB of the form you want to copy
2. Select: Save As, and give the name you want the duplicated form to have
3. Save the project and exit FF.
4. In a text editor, edit the new form: change the name of the form and the caption text, and save those changes.
5. Open FF, open the project, and select Add Form.
6. Select the original form that you copied from.
7. Save Project.

You might not need to exit in Step 3, but I felt it was cleaner to do the edits while FF was closed...

Thanks for the help and suggestions!
-John


Eddy Van Esch

John,
If I read Rolfs post right, it is even simpler than what you describe, but I will let him comment on this.
Eddy