Resource dialog destroy method

Resource dialog destroy method

Postby pawelu » Sun Oct 29, 2006 11:21 am

Antonio,

What is properly method for new FWPPC build to destroy resource dialog object ? In this moment where I call End() method dialog still visible. Below is sample code.

Regards
Pawel

Code: Select all  Expand view
// testrdlg.prg
#Include 'FwCe.Ch'

// destroy object test
Function TestRDlg ()

   Local oWnd := Nil
   Local aCtl := Array (4)
   Local cGet := Space (10)
   Local cSay := 'TestH04'

   Define Window oWnd Title 'TestH04'
   @  20, 100 Get aCtl[1] Var cGet Size 100, 20 Pixel
   @  42, 100 Get aCtl[2] Var cGet Size 100, 20 Pixel
   @  64, 100 Say aCtl[3] Prompt cSay Size 100, 15 Pixel
   @ 200, 176 Button aCtl[4] Prompt 'Ok' Size 60, 20 Pixel Action CtlDst (oWnd, aCtl)
   Activate Window oWnd

Return .T.

// destroy object test
Function CtlDst (oWnd, aCtl)

   Local i := 0

   DateTime (oWnd)

   For i := 1 To Len (aCtl)
       aCtl[i] : End ()
   Next

   @ 200, 110 Button 'Ok2' Size 60, 20 Pixel Action oWnd : End () Of oWnd

Return .T.

// simple dialog
Function DateTime (oWnd)

   Local oDlg := Nil
   Local dDate := Date ()
   Local cTime := Left (Time (), 5)
   Local lRet := .F.

   Define Dialog oDlg Resource 'DateTime' Of oWnd

   ReDefine Get dDate Id 1003 Of oDlg Picture '@D' ReadOnly
   ReDefine Get cTime Id 1004 Of oDlg ReadOnly
   ReDefine Button Id 1005 Of oDlg Action (lRet := .T., oDlg : End ())
   ReDefine Button Id 1006 Of oDlg Action (lRet := .F., oDlg : End ())

   Activate Dialog oDlg Centered

Return lRet

// testrdlg.rc
#include "c:\vce\include\arm\windows.h"
#include "c:\vce\include\arm\commctrl.h"

LANGUAGE LANG_POLISH,SUBLANG_DEFAULT

DateTime DIALOG DISCARDABLE 0, 0, 126, 54
STYLE WS_POPUP|DS_MODALFRAME|WS_CAPTION|WS_VISIBLE
CAPTION "Data and time"
FONT 8, "MS Shell Dlg"
BEGIN
  CONTROL "System date:", 1001, "Static", SS_RIGHT|WS_GROUP, 2, 8, 60, 12
  CONTROL "System time:", 1002, "Static", SS_RIGHT|WS_GROUP, 2, 21, 60, 12
  CONTROL "", 1003, "Edit", ES_READONLY|WS_BORDER|WS_TABSTOP, 64, 8, 50, 12
  CONTROL "", 1004, "Edit", ES_READONLY|WS_BORDER|WS_TABSTOP, 64, 21, 50, 12
  CONTROL "OK", 1005, "Button", WS_TABSTOP, 56, 38, 32, 12
  CONTROL "Cancel", 1006, "Button", WS_TABSTOP, 90, 38, 32, 12
END
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Sun Oct 29, 2006 12:47 pm

Pawel,

It looks like a bug introduced with recent changes.

We are reviewing it, Thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Oct 29, 2006 3:58 pm

Pawel,

Already fixed. Please download a new FWPPC build, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Sun Oct 29, 2006 6:56 pm

Pawel,

Please download it again, thanks.

We had an extra call to method Destroy(). Now it is ok :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42097
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 4 guests