Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SP2 Modal Form - Combobox
Message
From
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:
01274700
Views:
11
Hi Sergey,

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

Agnes

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
>Hi Agnes,
>
>Can you provide repro code?
>
>>
>>I've a form that is called modal from an other form. The form called instantiated in callers init and cleared at callers destroy ()
>>
>>All runs as expected, until I add an combobox to the modal form
>>
>>The problem comes if I open the combo to select an item.
>>
>>If I close the form (infact: hide) and try to show the called form later it will stay behind the caller and will not com to top, wether using activate nor SHOW WINDO .. TOP.
>>
>>I've stripped the combo from everything, it's now just instance of combobox with name,top,left altered. no controlsource, no item, no nothing. The problem is still there.
>>
>>Under SP1 all runs fine
>>
>>
>>Any ideas?
>>
>>
>>Agnes
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform