Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP2 Modal Form - Combobox
Message
 
 
To
11/12/2007 02:02:52
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows NT
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01273849
Message ID:
01275029
Views:
16
Hi Agnes,

I can confirm that i get the same behavior as you under SP2. It could be a bug.
However if you remove following strange piece of code than it works fine under SP2 as well.
  IF THIS.VISIBLE THEN
   THIS.SHOW()
  ENDIF &&THIS.Visible
>
>as I see you are far in the east now. (From EU point of view: not inside Europe ::))
>
>I've created a simple example, see below. You need to click the "ShowModal" button, try to open the combo in the second form, return via the "Hide" Button and try the "ShowModal" again. On my comp the second form is not reachable, all what works is the 'Kill' on form1
>
>
>
>Example:
>
>CLEAR
>CLEAR ALL
>PUBLIC lof
>
>lof = CREATEOBJECT('form1')
>lof.SHOW()
>
>DEFINE CLASS form1 AS FORM
> DOCREATE = .T.
> AUTOCENTER = .T.
> CAPTION = "Form1"
> NAME = "Form1"
>
> ADD OBJECT command1 AS COMMANDBUTTON WITH ;
>  TOP = 17, ;
>  CAPTION = "ShowModal", ;
>  NAME = "Command1"
>
>
> ADD OBJECT command2 AS COMMANDBUTTON WITH ;
>  TOP = 75, ;
>  CAPTION = "Kill", ;
>  NAME = "Command2"
>
>
> PROCEDURE show_modal
>  #DEFINE T_Object 'O'
>  LPARAMETERS;
>   toWindow AS FORM
>
>  LOCAL;
>   lnLeft_Old AS INTEGER,;
>   lnTop_Old  AS INTEGER,;
>   lnOldWindowType AS INTEGER
>
>  lnLeft_Old = THIS.LEFT
>  lnTop_Old  = THIS.TOP
>
>  THIS.MOVE(0,0)
>
>  IF toWindow.VISIBLE THEN
>   toWindow.HIDE
>  ENDIF &&toWindow.VISIBLE
>
>  DOEVENTS
>
>  lnOldWindowType = toWindow.WINDOWTYPE
>  toWindow.WINDOWTYPE = 1
>  toWindow.SHOW(1)
>
>  DOEVENTS
>
>  IF VARTYPE(toWindow)=T_Object AND !ISNULL(toWindow) AND !toWindow.VISIBLE THEN
>   toWindow.WINDOWTYPE = lnOldWindowType
>  ENDIF &&VARTYPE(toWindow)=T_Object AND !ISNULL(toWindow) and !toWindow.VISIBLE
>
>  THIS.MOVE(lnLeft_Old,lnTop_Old)
>
>  IF THIS.VISIBLE THEN
>   THIS.SHOW()
>  ENDIF &&THIS.Visible
> ENDPROC &&form1.show_modal
>
>
> PROCEDURE INIT
>  THIS.ADDPROPERTY('frmModal',CREATEOBJECT('Form2'))
> ENDPROC &&form1.INIT
>
>
> PROCEDURE command1.CLICK
>  THISFORM.Show_Modal(THISFORM.frmModal)
> ENDPROC &&form1.command1.CLICK
>
>
> PROCEDURE command2.CLICK
>*just to kill if locked ::)
>  THISFORM.frmModal.HIDE
>  THISFORM.RELEASE
> ENDPROC &&form1.command2.CLICK
>ENDDEFINE &&form1 AS FORM
>
>DEFINE CLASS form2 AS FORM
> DOCREATE = .T.
> AUTOCENTER = .T.
> NAME = "Form2"
>
>
> ADD OBJECT combo1 AS COMBOBOX WITH ;
>  TOP = 18, ;
>  NAME = "Combo1"
>
>
> ADD OBJECT command1 AS COMMANDBUTTON WITH ;
>  TOP = 78, ;
>  CAPTION = "Hide", ;
>  NAME = "Command1"
>
>
> PROCEDURE command1.CLICK
>  THISFORM.HIDE
> ENDPROC &&form2.command1.CLICK
>ENDDEFINE &&form2 AS FORM
>
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform