FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour move controls from dialog to window or panel
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
move controls from dialog to window or panel
Posted: Sun Feb 20, 2011 08:26 PM

Hi.

I remember there was a way to move dialog resources from the dialog to a window or another similar control. I'm trying to move the controls from a resource dialog to a panel. I remember it was something like odlg:sendtowindow( ownd ) or some like that.

Can someone help?

Thank you,

Reinaldo.

Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: move controls from dialog to window or panel
Posted: Sun Feb 20, 2011 09:42 PM
Ok... finally I was able to remember the trick. I'm posting it here because I know I will forget and now I know I can look at my previous posts and find the answer:
Code (fw): Select all Collapse
    Activate Dialog oDlg NOWAIT ON INIT ChangeParent( oDlg, oOtherDlgOrWnd )

function ChangeParent( oDlg, oChild )
local n
   
    for n = 1 to Len( oDlg:aControls )
        SetParent( oDlg:aControls[ n ]:hWnd, oChild:hWnd )
        AAdd( oChild:aControls, oDlg:aControls[ n ] )
    next
   
return nil


Reinaldo.
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: move controls from dialog to window or panel
Posted: Mon Feb 21, 2011 08:17 AM

explain me where it can be usefull , because I not understood!!

Best Regards, Saludos



Falconi Silvio
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: move controls from dialog to window or panel
Posted: Mon Feb 21, 2011 09:06 AM
Silvio wrote:explain me where it can be usefull , because I not understood!!


One example is :-

You can use a resource editor to design your screen layouts on a DIALOG and using the above posted example, you can move the controls (For eg. GET, SAY etc) from the dialog to a WINDOW at runtime.

Using a resource editor saves your screen designing time and once you have designed the screen, later you can move all the controls from the dialog to a window at run time. This becomes useful mostly when you want to use a window in your application and you need to design the screen layout using a resource editor.

I have not used any resource editors till now, and what I understand is that you can design only DIALOG's using a resource editor and NOT a WINDOW

Regards
Anser
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: move controls from dialog to window or panel
Posted: Mon Feb 21, 2011 09:11 AM

Perhaps with a pratical sample Can I understand
But on Windows seven I not use a resource editor for the dialog because it too leak memory, i use pellesc only to save bmps
We need an editor to create easy dialog on source code to create easy our applications

Best Regards, Saludos



Falconi Silvio
Posts: 990
Joined: Thu Nov 17, 2005 05:49 PM
Re: move controls from dialog to window or panel
Posted: Tue Feb 22, 2011 02:42 PM
Silvio;

How are you?

Anser's response is quite complete.

There are also other situations where you MUST use a redefined control. I could list some. But I suppose one example is plenty. So far, I have never been able to create a dtpicker control with style DTS_SHOWNONE from source. That's a dtpicker control that might return an empty date. But with this technique I am able to place such control on a explorer panel.

See below:


Hope this helps,


Reinaldo.

Continue the discussion