Dlg2Wnd
Dlg2Wnd
Hi dear friends,
I searched this forum without success- so I ask you if anyone knows a tool or procedure to transform a dialog into a window?
My dialog is designed with rc-editor of Pelles C because this way it's easy to place all my controls.
But I want a window as start screen.
I'll be glad for each hint.
-Detlef
I searched this forum without success- so I ask you if anyone knows a tool or procedure to transform a dialog into a window?
My dialog is designed with rc-editor of Pelles C because this way it's easy to place all my controls.
But I want a window as start screen.
I'll be glad for each hint.
-Detlef
- cmsoft
- Posts: 1297
- Joined: Wed Nov 16, 2005 9:14 pm
- Location: Mercedes - Bs As. Argentina
- Been thanked: 2 times
Re: Dlg2Wnd
Detlef:
A good starting point would be to look at the xbrowser function which uses a resizable dialog
A good starting point would be to look at the xbrowser function which uses a resizable dialog
- Antonio Linares
- Site Admin
- Posts: 42598
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 41 times
- Been thanked: 88 times
- Contact:
Re: Dlg2Wnd
Detlef,
If you use the style WS_THICKFRAME in your dialog then you will be able to resize it
If you use the style WS_THICKFRAME in your dialog then you will be able to resize it
- nageswaragunupudi
- Posts: 10729
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Been thanked: 10 times
- Contact:
Re: Dlg2Wnd
Code: Select all | Expand
DEFINE DIALOG oDlg RESIZABLE
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: Dlg2Wnd
Many thanks for all your help.
Unfortunately I did explain my concern very bad.
It was not the resizing that I wanted.
My program should start showing a window with buttonbar, three browses, a memo edit and some normal buttons.
I found it very annoying to place all those objects by trying to find exact values for @ y, x . . . to align all my objects.
So I created a Dialog with Pelles rc-editor and was able to place all my controls visually much more comfortable.
Now I'm looking for a way to covert this dialog to a window object.
May be I will write a codeblock for right clicks of my components to display the exact coordinates.
Those values I could use to design a window looking equal to that dialog.
-Detlef
Unfortunately I did explain my concern very bad.
It was not the resizing that I wanted.
My program should start showing a window with buttonbar, three browses, a memo edit and some normal buttons.
I found it very annoying to place all those objects by trying to find exact values for @ y, x . . . to align all my objects.
So I created a Dialog with Pelles rc-editor and was able to place all my controls visually much more comfortable.
Now I'm looking for a way to covert this dialog to a window object.
May be I will write a codeblock for right clicks of my components to display the exact coordinates.
Those values I could use to design a window looking equal to that dialog.
-Detlef
- Antonio Linares
- Site Admin
- Posts: 42598
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 41 times
- Been thanked: 88 times
- Contact:
Re: Dlg2Wnd
Dear Detlef,
Here you have an example you can use in your apps:
Here you have an example you can use in your apps:
Code: Select all | Expand
#include "FiveWin.ch"
#define GW_CHILD 5
#define GW_HWNDNEXT 2
function Main()
local oWnd
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd ON INIT GetControls( oWnd, "MyDialog" )
return nil
function GetControls( oWnd, cResName )
local oDlg
DEFINE DIALOG oDlg RESOURCE cResName
ACTIVATE DIALOG oDlg ON INIT ( MoveControls( oDlg, oWnd ), oDlg:End() )
return nil
function MoveControls( oDlg, oWnd )
local hCtrl := GetWindow( oDlg:hWnd, GW_CHILD ), hCtrlNext
while hCtrl != 0 .and. GetParent( hCtrl ) == oDlg:hWnd
hCtrlNext = GetWindow( hCtrl, GW_HWNDNEXT )
SetParent( hCtrl, oWnd:hWnd )
hCtrl = hCtrlNext
end
oWnd:aControls = oDlg:aControls
AEval( oWnd:aControls, { | oCtrl | oCtrl:oWnd := oWnd } )
return nil
Re: Dlg2Wnd
Dear Antonio,
thanks for your advice. I tried your code but it gives me an Error FiveWin/3 Cannot create Dialog Box: Resource: START
Now I do configure my start window by "try 'n error" with @ y, n ...
And take it as a training for design
-Detlef
thanks for your advice. I tried your code but it gives me an Error FiveWin/3 Cannot create Dialog Box: Resource: START
Code: Select all | Expand
Stack Calls
===========
Called from: .\source\classes\DIALOG.PRG => CREATEDLGERROR( 717 )
Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE( 306 )
Called from: svp.prg => GETCONTROLS( 295 )
Called from: svp.prg => (b)MAIN( 40 )
Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE( 1083 )
Called from: svp.prg => MAIN( 40 )
Now I do configure my start window by "try 'n error" with @ y, n ...
And take it as a training for design

-Detlef
- Antonio Linares
- Site Admin
- Posts: 42598
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 41 times
- Been thanked: 88 times
- Contact:
Re: Dlg2Wnd
Detlef,
For the above example you have to use this RC:
For the above example you have to use this RC:
Code: Select all | Expand
#include "windows.h"
MyDialog DIALOG 32, 18, 236, 118
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "DIALOG"
FONT 6, "MS San Serif"
BEGIN
RTEXT "Name" , -1, 3, 5, 41, 8
RTEXT "Level" , -1, 3, 61, 41, 8
EDITTEXT 10, 45, 59, 12, 12
RTEXT "Date" , -1, 3, 75, 41, 8
EDITTEXT 20, 45, 73, 36, 12
RTEXT "Notes" , -1, 100, 89, 41, 8
END
Re: Dlg2Wnd
Dear Antonio,
now your example works fine.
I'll try to use it for my app.
Sorry for troubling you.
-Detlef
now your example works fine.
I'll try to use it for my app.
Sorry for troubling you.
-Detlef
- Antonio Linares
- Site Admin
- Posts: 42598
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 41 times
- Been thanked: 88 times
- Contact:
- Marc Venken
- Posts: 1485
- Joined: Tue Jun 14, 2016 7:51 am
- Location: Belgium
Re: Dlg2Wnd
Detlef,
You may also consider of using a Xbrowse as setup Dialog/Window designer.
All coordinates can be filled/change at runtime and this way the recompile of prg etc.. is not needed.
Button, Position, action, visuals, can be in the Xbrowse and in the program a loop while create the dialog.
You may also consider of using a Xbrowse as setup Dialog/Window designer.
All coordinates can be filled/change at runtime and this way the recompile of prg etc.. is not needed.
Button, Position, action, visuals, can be in the Xbrowse and in the program a loop while create the dialog.
Marc Venken
Using: FWH 23.08 with Harbour
Using: FWH 23.08 with Harbour