PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Forms issues

Kornalius,

This is mostly a user experience document. You get to decide if this is the user experience you were trying to achieve.

I have been playing with bits and pieces and decided to take what I learned and apply it to a bigger program. Here is what I'm trying to do:
- Make a new CRC Demo out of Project>New>Windows API project.
- Put a edit control for a file name entry and a button to call up the File Open Dialog.
- Start & Stop buttons to start stop a thread doing the work.
- Progress controls for the table calc and one for progress through the file
- A multi line edit box to display the results for each method: times & CRC values

I have most of the CRC code in a .PPL file from my CRC_Demo3 project. My first thoughts are to open PIDE and select Projects>New>Windows API Project, add some code to the controls, include the CRC.PPL file and I'm done.

I create the project. Main.FRM is created and some controls are added. First problem, almost everything I have created to date with the project generator has the name Main.FRM or Main.PPL. I must remember to change the location of the project in the options when created. I can see some people wanting to keep multiple projects in the same directory. You need to allow users to select the base name of the files when creating the project.

After adding the existing CRC_Demo3.PPL file to the project, I decided the name needs to change. The only way to do it is to remove the file from the project, rename it, and add it back in. Or I could edit the project file and rename the file. You should be able to rename a file, have the name change in the project and rename any open windows from the old name to the new name.

I have some procedures in a PPL file and a FRM file. When I press a button and want a thread proc to start. The thread proc is in the PPL file. How to include the PPL file in a form, so it can get to the thread? To do this the user needs to be able to place directives on the form. Another way to achieve the same goal would be to allow the user to place user functions on the form. Maybe a small invisible button on the form that you can click on in the form builder that brings up a code window that users can place their code into.

Here I've sumarized my 4 points from above.

1. Allow setting the base name for all files when creating a project?
2. Allow changing file names in a project?
3. Able to Include PPL directives on forms?
4. Able to add User Functions to a form?

These are probably bugs. All of this below is with no project open

With a form open, opening the same form again gives 2 instances of the same form. I think it should bring to the top the form already open.

This happened by accident because the form window was on the bottom and I forgot it was there. I'd like to see the form windows be made a child window of the main PIDE window inside the PIDE window frame (like the code windows).

Creating a new form, changing it and saving doesn't put the saved name into the reopen list.

Creating a new form, add a control and you can't compile or run. You get compile and run buttons if you click on a control and open the code window, but I think it is actually trying to do the code in the window and not the form as a whole. It works properly if in a project.

And a request...

I'd like to see a new project type in the Project>New dialog. The new project wizzard would create 4 files The PPL file being the main file for user code and user initializations and it would load the main user interface from a FRM file (a dialog form). The 3rd file would be the #defines from the form. The last file would be a project file. That way the user could use the defines file in their code also.

Maybe a second request...

I'd like to see an option in the form builder to make the #defines list an external file...

This isn't the end of the story, just a good stopping point.

B.

P.S. WOW! 8O I'm impressed with the new matrix functions! :) Reminds me of APL. AND I'm really looking forward to trying the new PC version! :D What an embarassment of riches. :oops:


UPDATE: I've played with the options in the form builder and it looks as though the Generate Code option effects the WinMain statement in the code. I thought this would apply to the Dialog Form option. The Dialog Form option didn't seem to have any effect on the generated code.
PointOfLight · 10 Sep 2004, 17:58 UTC
Well, I think I can address one of your points (albeit a minor one). To add custom functions (or include files) to a form, click somewhere on the form that is not covered by a control. Then go up to the Controls menu and select Code.... Any functions, defines, or includes placed here will be accessable to the form. Sorry I can't be much use on the rest of it.
Hi brad,

I create the project. Main.FRM is created and some controls are added. First problem, almost everything I have created to date with the project generator has the name Main.FRM or Main.PPL. I must remember to change the location of the project in the options when created. I can see some people wanting to keep multiple projects in the same directory. You need to allow users to select the base name of the files when creating the project.


I just fixed this by making the main project form the same name as the project. So you end up with:

my_project.prj
my_project.frm instead of main.frm

After adding the existing CRC_Demo3.PPL file to the project, I decided the name needs to change. The only way to do it is to remove the file from the project, rename it, and add it back in. Or I could edit the project file and rename the file. You should be able to rename a file, have the name change in the project and rename any open windows from the old name to the new name.


This is standard on pretty much all tools. You need to remove it and add it back. Even Microsoft didn't do it. :)

I have some procedures in a PPL file and a FRM file. When I press a button and want a thread proc to start. The thread proc is in the PPL file. How to include the PPL file in a form, so it can get to the thread? To do this the user needs to be able to place directives on the form. Another way to achieve the same goal would be to allow the user to place user functions on the form. Maybe a small invisible button on the form that you can click on in the form builder that brings up a code window that users can place their code into.


^^ What PointOfLight said. Click the form and press F12.

With a form open, opening the same form again gives 2 instances of the same form. I think it should bring to the top the form already open.


Fixed, just now. Thanks for noticing.

Creating a new form, add a control and you can't compile or run. You get compile and run buttons if you click on a control and open the code window, but I think it is actually trying to do the code in the window and not the form as a whole. It works properly if in a project.


Now that is a tricky one. No you can't compile/run forms outside a project. You can now view the source code from the visual form builder menu and then compile/run the source directly. This is a new feature btw.

I'd like to see a new project type in the Project>New dialog. The new project wizzard would create 4 files The PPL file being the main file for user code and user initializations and it would load the main user interface from a FRM file (a dialog form). The 3rd file would be the #defines from the form. The last file would be a project file. That way the user could use the defines file in their code also.


Done. But it doesn't create a dialog by default, you will to go and check the Dialog Form menu item yourself.

UPDATE: I've played with the options in the form builder and it looks as though the Generate Code option effects the WinMain statement in the code. I thought this would apply to the Dialog Form option. The Dialog Form option didn't seem to have any effect on the generated code.


I think I will make the Dialog Form menu item check the Library Form menu item automatically. A dialog cannot really be anything else than a library form.
Kornalius and Eric,

First the issue that Eric addressed...

Clicking on the background of the form takes you to the piece of code that handles messages going to the form window (F12 gives the same result). You can insert code and directives there, but this works only because the form message handler is the first thing in the file. Stating that this will always be the case will limit your future design changes as you will be at risk of breaking existing apps. I'd still prefer to have a separate selection for user items. At the very least this should be documented when you get around to putting a section in the CHM for the Form Builder.

Not being able to build or run outside a project is interesting. I think the access to the Form Builder through both buttons and menus should be disabled unless a project is open. Also the when the File Menu or the Reopen Menu tries to open a .FRM with no project open then the user should get a dialog stating that forms only work with a project open. What do you think?

I think "Edit WinMain code..." in the Edit Menu of the Form Builder should be called something different because (from my understanding) if Dialog Form is selected there is no WinMain Code. With this option there is a <form name>Create function. How about "Form Creation Code...".

Two things you didn't mention... Did you like the idea of a #defines file and did you like or not the idea of making Form Builder a child window of PIDE?

Everything else it looks like you fixed or otherwise addressed. Thanks!

B.
Clicking on the background of the form takes you to the piece of code that handles messages going to the form window (F12 gives the same result). You can insert code and directives there, but this works only because the form message handler is the first thing in the file. Stating that this will always be the case will limit your future design changes as you will be at risk of breaking existing apps. I'd still prefer to have a separate selection for user items. At the very least this should be documented when you get around to putting a section in the CHM for the Form Builder.


I think I will implement a new menu item, something like "Edit declare section" or something like that. This will solve the problem of #defines as well.


Not being able to build or run outside a project is interesting. I think the access to the Form Builder through both buttons and menus should be disabled unless a project is open. Also the when the File Menu or the Reopen Menu tries to open a .FRM with no project open then the user should get a dialog stating that forms only work with a project open. What do you think?


You will see the new version allow to run forms without being in a project. I will need to explain this in the help file for sure though.

I think "Edit WinMain code..." in the Edit Menu of the Form Builder should be called something different because (from my understanding) if Dialog Form is selected there is no WinMain Code. With this option there is a <form name>Create function. How about "Form Creation Code...".


Done!

Two things you didn't mention... Did you like the idea of a #defines file and did you like or not the idea of making Form Builder a child window of PIDE?


Sorry the form file will stay one file. If you want to, you #include definition files within the form. See first reply in this post for answer! ^^
I'm glad you've decided to include the "User Code..." section. I can see this product appealing to a lot of new users who don't want to deal with the complexities of C++ and I think this will help them avoid a lot of confusion. Maybe when this window opens it should just have some commments like "add #includes here", "add Compiler directives here", "add #defines here" and "add Functions here". This will give people clues as to where they should add stuff and in what order.

I just wanted to throw my last 2 cents in.

Thanks for all of the fixes and changes.

Brad