Author
|
Topic: Edit Control
|
Glen Martin Member
|
posted 02-08-2001 10:01 AM
ChrisUseing EZ_ControlEx I can create a Richedit control on the Main form but on the page it dos'nt work! Is there a reason that it can't be created on a page form? [This message has been edited by Glen Martin (edited 02-08-2001).] |
Chris Boss Administrator
|
posted 02-08-2001 10:38 AM
Glen;I don't see why not ! I can create a RichEdit control on a Page Form in EZGUI 2.0 (I used the EZGUI command for the RichEdit control to do it, rather than EZ_ControlEx). Make sure you create the RichEdit control in the right part of your code (in the Page Forms section of EZ_DesignWindow). You put the EZ_Form command for the Page Form in the parents EZ_DesignWindow section, but you must have a section for the Page Form itself, to create its controls. code:
SELECT CASE FormName$ CASE "PARENTFORM" ' create Parents controls here ' Page Forms must be created last after ' all the Parents Controls are created . EZ_Form "PAGEFORM", "PARENTFORM", .... CASE "PAGEFORM" ' Create Page Form controls here CASE ELSE END SELECT
|
Glen Martin Member
|
posted 02-08-2001 02:41 PM
ChrisI was createing the page forms first so that may be the problem. I was using your samples in EZGUI and in it you created the page forms before the controls for the main form! I'll try puting the main form controls first and see if this will make a difference. Thanks |
Glen Martin Member
|
posted 02-08-2001 03:33 PM
ChrisIt did'nt work because I was creating it on the wrong page form! But now I have a more serious problem. Richedit control works fine but when I exit the program it GPF's and I'm pretty sure it's because of where I have to free the library. The only place I could figure out where to free the library is in the main forms EZ_Close event. I load the library in EZ_Main before creating the main form. Where should these be done? |
Chris Boss Administrator
|
posted 02-08-2001 05:23 PM
Glen;In EZGUI 1.0 you have to be careful, where you free the RichEdit DLL. You can add your code to the ezwmain.inc as the last line in the winmain procedure. You can use the #IF conditional command to test for a constant (ie. %USE_RichEdit ) and if the constant exists (in your main source code file), then Load the Library in the beginning of WinMain and free at the end of WinMain. The problem is that the %EZ_Close event occurs while the Form and its controls still exist and this GPFs if you try to free the library. You could also unload the richedit control in the %EZ_Close event, then use EZ_DoEvents and then free the RichEdit Library after the RichEdit control is unloaded. Basically, you are trying to free the library while the control still exists.
|
Glen Martin Member
|
posted 02-08-2001 09:01 PM
ChrisThanks On another topic EZGUI 2.0 is to have a key preview. The message loop hook won't be eleminated will it? [This message has been edited by Glen Martin (edited 02-08-2001).] |
Chris Boss Administrator
|
posted 02-08-2001 11:00 PM
Glen;None of the features in EZGUI 1.0 have been eliminated in version 2.0 ! You can use either method, the new keypreview or the messageloop hook. Actually, the keypreview will be the prefered way, since it will be easier and the events are generated directly by the internal message loop. Its like having a hook into the message loop, without actually using the hook procedure. Also, the key preview will send the events to the correct control that has the focus, where as a hook procedure would require you to double check window handles. All in all, it will be much easier !
|
Glen Martin Member
|
posted 02-09-2001 09:47 AM
ChrisThe advantage to the hook is that you can use the same procedure for muliple forms or change it at any time to a different procedure. I process all the controls in a form in a single procedure. I even developed a masked edit function that process's all text controls in a db that works simular to MS masked edit control. This is something that I would like to convert to a custom control if I had enough experience. |