PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: John Montenigro on November 13, 2013, 02:24:58 PM

Title: duplicating a FRM
Post by: John Montenigro on November 13, 2013, 02:24:58 PM
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
Title: Re: duplicating a FRM
Post by: John Montenigro on November 13, 2013, 02:37:24 PM
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
Title: Re: duplicating a FRM
Post by: Eddy Van Esch on November 13, 2013, 03:21:25 PM
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)
Title: Re: duplicating a FRM
Post by: John Montenigro on November 13, 2013, 03:58:25 PM
Thanks, Eddy!

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

-John

Title: Re: duplicating a FRM
Post by: John Montenigro on November 13, 2013, 04:43:57 PM
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

Title: Re: duplicating a FRM
Post by: John Montenigro on November 13, 2013, 04:57:16 PM
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
Title: Re: duplicating a FRM
Post by: Eddy Van Esch on November 13, 2013, 05:19:46 PM
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.
Title: Re: duplicating a FRM
Post by: John Montenigro on November 14, 2013, 12:06:36 AM
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
Title: Re: duplicating a FRM
Post by: John Montenigro on November 14, 2013, 02:14:02 AM
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
Title: Re: duplicating a FRM
Post by: Eddy Van Esch on November 14, 2013, 04:19:02 AM
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.
Title: Re: duplicating a FRM
Post by: Rolf Brandt on November 14, 2013, 05:03:26 AM
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
Title: Re: duplicating a FRM
Post by: Paul Squires on November 14, 2013, 09:27:04 AM
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.
Title: Re: duplicating a FRM
Post by: John Montenigro on November 14, 2013, 07:53:29 PM
@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
Title: Re: duplicating a FRM
Post by: John Montenigro on November 21, 2013, 05:56:39 PM
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

Title: Re: duplicating a FRM
Post by: Eddy Van Esch on November 21, 2013, 06:07:28 PM
John,
If I read Rolfs post right, it is even simpler than what you describe, but I will let him comment on this.
Title: Re: duplicating a FRM
Post by: Rolf Brandt on November 21, 2013, 07:05:09 PM
Here is how 1 duplicate a form:

1. In FF, click the TAB of the form you want to copy - let's say Form1.
2. In the Form properties change the name property to the new name - let's say Form2.
3. Select: Save As, and give the name you want the duplicated form to have
4. In Project->Add Form select 'Existing' and reload Form1.

That's it.

Rolf

Title: Re: duplicating a FRM
Post by: Eddy Van Esch on November 21, 2013, 07:12:26 PM
That's what I figured from your first post, but thanks for spelling it out for us, Rolf!  [thumbs up]
Title: Re: duplicating a FRM
Post by: John Montenigro on November 21, 2013, 07:18:35 PM
Even better!

Got it now, thanks!!!

-John