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.
move controls from dialog to window or panel
- reinaldocrespo
- Posts: 979
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
- reinaldocrespo
- Posts: 979
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Re: move controls from dialog to window or panel
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:
Reinaldo.
Code: Select all | Expand
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.
Re: move controls from dialog to window or panel
explain me where it can be usefull , because I not understood!!
Best Regards, Saludos
Falconi Silvio
Falconi Silvio
Re: move controls from dialog to window or panel
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
Re: move controls from dialog to window or panel
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
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
Falconi Silvio
- reinaldocrespo
- Posts: 979
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
Re: move controls from dialog to window or panel
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.
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.