Launching Child Form in MDI (OpenInsight 32-Bit)
At 19 JAN 2010 10:57:57AM Matthew Watson wrote:
IO 7.3 (XP pro)
I have a MDI_Frame with a menu that I launch a parent form with. And inside the parent form if an edit box value is not in our database that it will launch a child form. the problem i am having is it is in the lost focus of the editbox when i know the client is done entering in data. but when i launch the child i can not stop the parent form moving to the next edit box. I have focused it back to itsself and highlighted the data but when it launches the child it is in an endless loop. i have tried dialog_box and create_dialog but they both end up outside of the mdi_frame but do lock down the parent form. i have tried start_mdiframe which puts it inside the frame like i want but it does not lock down the parent form until i enter in the data i need.
Coming from Microsoft VB background I get total confused with how things are named and run… Would be helpful if there where useful examples with the documentation.
i did get 9.0 but that is another headache for later when i have time.
At 19 JAN 2010 06:54PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Matthew,
When your LOSTFOCUS event runs you have already moved onto the next control (otherwise you wouldn't have lost the focus) - there's nothing you can do about that. You can move the focus back without triggering any other event code by turning off OI's event processing while you reset the focus - look at the SYSTEM BLOCK_EVENTS property - turn it on, move the SYSTEM FOCUS, and turn it off again.
I've seen other developers want a "modal" MDI Child before - you could try something like disabling the MDIChild "parent" yourself before you launch the MDIChild "child" and re-enable again when your child is closed?
World leaders in all things RevSoft
At 19 JAN 2010 07:17PM [email protected]'s Don Bakke wrote:
Alternatively, if the problem is strictly within the GOTFOCUS event of the edit control you can use Set_Property(Ctrl, 'FOCUS', True$) rather than Set_Property('SYSTEM', 'FOCUS', Ctrl). This prevents the GOTFOCUS event from being processed.
At 20 JAN 2010 10:27AM Matthew Watson wrote:
I have tried the system focus but it does not work the way i want it to.
I guess my MDI frame is the parent and the first form is the child and i am trying to launch a child from the child and disabling the first child till the second child is filled out and saved. all forms reside inside the parent mdi. But I want the user to still be able to go to the menu and select other forms if they were to get a call from there agents/clients. Just the first form they are working on needs to be locked down till i am happy with the data saved releasing the first form.
I know you can not have a child with a child but i can launch it using start_mdichild.
At 20 JAN 2010 10:31AM Bob Carten wrote:
]]inside the parent form if an edit box value is not in our database that it will launch a child form.
The classic OI approach is to use a verifile edit pattern plus options button / options event event which pops up a list of acceptable values.
The verifile will warn people that the value they entered is not a key in the foreign table, then return focus to the control. The popup takes care of providing the window with a list of choices.
Alternatively, you replace the edit control
with a combo-box that is pre-filled with correct values, leading the user to a correct value, or if you are accepting a list of values, consider an edit table control with a combo-box edit style.
At 20 JAN 2010 11:35AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
To achieve this we had to develop our own Start_MDI_Child
Function ZZ_Start_MDIChild(Window, MDIFrame, CreateParam, Parent) /* Purpose to launch a new window locking out the window underneath WITHOUT disabling the MDI frame */
Declare Function Start_MDIChild, Get_Property RetVal = Start_MDIChild(Window, MDIFrame, CreateParam) CtrlArray = Parent PropArray = "ENABLED" DataArray = Get_Property(CtrlArray, PropArray) SaveEnabled = DataArray1, @Rm Call Set_Property(RetVal, "FOCUS", 1) Call Set_Property(Parent, "ENABLED", 0) Loop Call Yield() While Get_Property(RetVal, "HANDLE") Call Sleep(50) Repeat Call Set_Property(Parent, "ENABLED", SaveEnabled) Return RetVal
World leaders in all things RevSoft
At 20 JAN 2010 11:38AM Matthew Watson wrote:
but i can not have a popup. it has to launch a different form. The first form is in like a document table and the second form is with a client table. the client form has to be in the system filled out before you can do anything with the document form. I dont want the user to shut down the first form if they already have it up and partially filled out.
At 20 JAN 2010 12:12PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Hmmm embedded not liked :(
Function ZZ_Start_MDIChild(Window, MDIFrame, CreateParam, Parent) /* Purpose to launch a new window locking out the window underneath WITHOUT disabling the MDI frame */
Declare Function Start_MDIChild, Get_Property RetVal = Start_MDIChild(Window, MDIFrame, CreateParam) CtrlArray = Parent PropArray = "ENABLED" DataArray = Get_Property(CtrlArray, PropArray) SaveEnabled = DataArray1, @Rm Call Set_Property(RetVal, "FOCUS", 1) Call Set_Property(Parent, "ENABLED", 0) Loop Call Yield() While Get_Property(RetVal, "HANDLE") Call Sleep(50) Repeat Call Set_Property(Parent, "ENABLED", SaveEnabled) Return RetVal
World leaders in all things RevSoft
At 20 JAN 2010 12:15PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Hopefully stating the obvious
SaveEnabled = DataArray1, @Rm
should be
SaveEnabled = DataArray1, @Rm
World leaders in all things RevSoft
At 20 JAN 2010 01:38PM Matthew Watson wrote:
Thanks for the code. I am able to duplicate it and make it kind of work. the only problem i have with it is that it does not know what to do with the Sleep(50) can not find it in the system and i did search and it does not exist in 7.3 that i know of.
Is Sleep() something you had made?
At 20 JAN 2010 03:23PM Matthew Crozier wrote:
This brings up a finding I've been meaning to clarify. I presume that the Yield loop
Loop Call [/color]Yield() [/color]While [/color]Get_Property(RetVal, [/color]"HANDLE"[/color]) [/color]Call [/color]Sleep([/color]50[/color]) [/color]Repeat [/color][/color][/size]can be replaced with this? (OI 8.0.? +)
Call [/color]Utility( [/color]'DIALOG_BOX'[/color], RetVal)[/color][/color][/size]It seems that doing so will allow any synchronous OLE events to get processed without failing due to the 'Engine is Busy'.
Cheers, M@
[img]http://www.vernonsystems.com/images/logo_main_ani.gif[/img]
At 20 JAN 2010 04:07PM Matthew Watson wrote:
Thanks for all the help guys.
I ended up doing it a little differently with bits of different ideas.
I set form1child to focus back on itself, enabled to 0 then set @user0 to send over info. @user0 is only used for me and my programs… then i use start_mdichild to launch the form2child once this data is saved or not saved, i check to see what is in @user0 and if it was from form1child then i set enabled to 1 and close/(save/not save) form2child. It works and i am happy for the time being… would like to still know how to get sleep to work in the program.
i like to call my programs hybrids since they are not truly oi and not vb but both.
At 20 JAN 2010 04:33PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote:
Sorry, it's a WINAPI call
in SYSPROCS Row DLL_KERNEL32
add
VOID STDCALL Sleep(UINT)
then RUN DECLARE_FCNS in system monitor.
World leaders in all things RevSoft
At 20 JAN 2010 09:09PM [email protected] wrote:
What version of the publisher you using there A?