FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour oDlg as oClient of oWnd (MDICHILD)
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
oDlg as oClient of oWnd (MDICHILD)
Posted: Sat Jun 05, 2010 12:53 AM
Dear All,

Just trying to do this..

...
Define Window MDICHILD...

.........Define Dialog (CHILD)

.........Active Dialog NOWAIT

.........oWnd:oClient := oDlg //runtime here.. "Message not found: TDIALOG:ADJCLIENT"

Activate Window
...

The goal is to bind oDlg as child to oWnd (MDI CHILD)


Is this possible?

Mr. Antonio?


regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: oDlg as oClient of oWnd (MDICHILD)
Posted: Sat Jun 05, 2010 01:28 AM
Hello Frances

Try this way
Code (fw): Select all Collapse
#include "fivewin.ch"



FUNCTION Main()
   LOCAL oWndMain, oWndChild, oDlg
   LOCAL oMenu
   
   MENU oMenu
      MENUITEM "Test" ACTION LoadMdiChild( oWndMain )
   ENDMENU
   
   
   DEFINE WINDOW oWndMain MDI MENU oMenu
   
   ACTIVATE WINDOW oWndMain
   
RETURN NIL


FUNCTION LoadMdiChild( oWndMain )

   LOCAL oWndChild, oDlg  

   DEFINE WINDOW oWndChild MDICHILD OF oWndMain
   
   DEFINE DIALOG oDlg OF oWndChild STYLE nOR( WS_VISIBLE, WS_CHILD )

   oWndChild:bResized = {| nType, nWidth, nHeight | WndAdjClient( oDlg:hWnd ) }

   ACTIVATE DIALOG oDlg NOWAIT
   
   ACTIVATE WINDOW oWndChild

RETURN NIL
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: oDlg as oClient of oWnd (MDICHILD)
Posted: Sat Jun 05, 2010 02:29 AM
Dear Daniel,

Thanks for the help..

Yours is much simplier which is better than mine..

Mine:
Code (fw): Select all Collapse
      oWndOP:bResized := {|nType, nWidth, nHeight| oDlgOP:SetSize( oWndOP:oWndClient:nWidth,;
                                                                              oWndOP:oWndClient:nHeight) }


Both works but I now prefer WndAdjClient( oDlgOP:hWnd )


Regards,
Frances
Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: oDlg as oClient of oWnd (MDICHILD)
Posted: Sat Jun 05, 2010 06:39 AM

Frances,

It is advisable to avoid the use of such dialogbox so there is just one mdi child window and its controls. Here you have a working example (using a resource dialog to design the controls):

viewtopic.php?p=31982#p31982

viewtopic.php?p=32134#p32134

There is a working example in FWH\samples\TestMDir.prg

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 811
Joined: Tue May 06, 2008 04:28 AM
Re: oDlg as oClient of oWnd (MDICHILD)
Posted: Sat Jun 05, 2010 08:02 AM

Dear Mr. Antonio,

Thank you for pointing the right way.. It enlightens my perception in binding child dialog to window mdichild.

I will revise my project and provide or post feedback here.

My best regards,
Frances

Kind Regards,

Frances



Fivewin for xHarbour v18.07

xHarbour v1.2.3.x

BCC 7.3 + PellesC8 ( Resource Compiler only)

ADS 10.1 / MariaDB

Crystal Reports 8.5/9.23 DE

xMate v1.15

Continue the discussion