FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour DIALOG ON DIALOG
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
DIALOG ON DIALOG
Posted: Mon May 06, 2013 05:53 PM
is possible make a dialog no caption into a dialog ?

I wish create it as this picture :




I made this code but the dialog come to another position and not on the dialog

#include "FiveWin.ch"
#include "constant.ch"

Function test
Local odlg
Local nBottom := 16.5
Local nRight := 66
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H

Local odlg2,obtn

DEFINE DIALOG oDlg SIZE nWidth, nHeight TRANSPARENT PIXEL

@1,2 BUTTON obtn PROMPT "go" size 40,10 of oDlg ACTION Make_dlg2(oDlg)

ACTIVATE DIALOG oDlg CENTER

return nil


Function Make_dlg2(oDlg)
Local SuboDlg
DEFINE DIALOG SuboDlg OF oDlg
//SuboDlg:nStyle := nOR(WS_CAPTION , 4 )

ACTIVATE DIALOG SuboDlg
return nil
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 10:51 AM

any help ?

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 12:26 PM
I needed the same, a var-edit from Main-dialog-values,
to be displayed with a Sub-dialog with a position from Top 50 and Left 50 of Maindialog :
You can change the Sub-dialog-styyle if needed.

NO title NO caption

STYLE nOr( WS_POPUP, WS_BORDER )





Code (fw): Select all Collapse
...
...
DEFINE DIALOG oGDialog FROM nDlgTop, nDlgLeft TO nDlgHeight, nDlgWidth 聽OF oWnd PIXEL ;
STYLE nOr( WS_CAPTION, WS_POPUP, WS_BORDER );
TITLE "Dialog GRADIENT"
...
...
@ oGDialog:nBottom - 150, oGDialog:nRight - 220 聽BTNBMP oBtn1 OF oGDialog PIXEL SIZE 30, 25 ;
NOBORDER 2007 ;
FILENAME c_path1 + "Write.Bmp" ;
ACTION TEST_DLG(oGDialog) ; 
TOP
oBtn1:lTransparent := .t. 聽 
oBtn1:cTooltip := 聽{ "EXIT the" + CRLF + "GRADIENT-dialog","EXIT GRADIENT-dialog", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 16777215, )

@ oGDialog:nBottom - 150, oGDialog:nRight - 150 聽BTNBMP oBtn2 OF oGDialog PIXEL SIZE 30, 25 ;
NOBORDER 2007 ;
FILENAME c_path1 + "Exit.Bmp" ;
ACTION ( lGDialog := .F., oGDialog:End() ) ; 
TOP
oBtn2:lTransparent := .t. 聽 
oBtn2:cTooltip := 聽{ "EXIT the" + CRLF + "GRADIENT-dialog","EXIT GRADIENT-dialog", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 16777215, )

ACTIVATE DIALOG oGDialog 聽NOWAIT ;
ON INIT ( oBtn1:Move( oGDialog:nBottom - 150, oGDialog:nRight - 220, , , .f. ), ; 
聽 聽 聽 聽 聽 oBtn2:Move( oGDialog:nBottom - 150, oGDialog:nRight - 150, , , .f. ) ) // Top, Bottom 3

RETURN NIL

// -------------

FUNCTION TEST_DLG(oGDialog)
LOCAL oSubdlg, oBtn1, oBtn2, oBrush, oSay[6], oGet[6]

DEFINE BRUSH oBrush FILE c_path1 + "Marble.bmp" 

DEFINE DIALOG oSubdlg FROM oGDialog:nTop + 50, oGDialog:nLeft + 50 TO 300, 450 聽OF oGDialog PIXEL ;
STYLE nOr( WS_CAPTION, WS_POPUP, WS_BORDER );
TITLE "Dialog-settings" BRUSH oBrush

@ 10, 10 SAY oSay[1] PROMPT "Top : " ;
OF oSubdlg SIZE 90, 20 FONT oFont3 PIXEL 
oSay[1]:SetColor( 0, )
oSay[1]:lTransparent := .T.

@ 10, 45 GET oGet[1] VAR nDlgLeft OF oSubdlg SIZE 30, 10 PICTURE "9999" FONT oFont3 RIGHT PIXEL UPDATE

@ 30, 10 SAY oSay[2] PROMPT "Left : " ;
OF oSubdlg SIZE 90, 20 FONT oFont3 PIXEL 
oSay[2]:SetColor( 0, )
oSay[2]:lTransparent := .T.

@ 30, 45 GET oGet[2] VAR nDlgTop OF oSubdlg SIZE 30, 10 PICTURE "9999" FONT oFont3 RIGHT PIXEL UPDATE

@ 50, 10 SAY oSay[3] PROMPT "Bottom : " ;
OF oSubdlg SIZE 90, 20 FONT oFont3 PIXEL 
oSay[3]:SetColor( 0, )
oSay[3]:lTransparent := .T.

@ 50,45 GET oGet[3] VAR nDlgHeight OF oSubdlg SIZE 30, 10 PICTURE "9999" FONT oFont3 RIGHT PIXEL UPDATE

@ 70, 10 SAY oSay[4] PROMPT "Right : " ;
OF oSubdlg SIZE 90, 20 FONT oFont3 PIXEL 
oSay[4]:SetColor( 0, )
oSay[4]:lTransparent := .T.

@ 70, 45 GET oGet[4] VAR nDlgWidth OF oSubdlg SIZE 30, 10 PICTURE "9999" FONT oFont3 RIGHT PIXEL UPDATE

@ oSubdlg:nBottom - 150, oSubdlg:nRight - 190 聽BTNBMP oBtn1 OF oSubdlg PIXEL SIZE 30, 25 ;
NOBORDER 2007 ;
FILENAME c_path1 + "Save.Bmp" ;
ACTION oSubdlg:End() ; 
TOP
oBtn1:lTransparent := .t. 聽 
oBtn1:cTooltip := 聽{ "EXIT the" + CRLF + "Sub-Dialog","EXIT Sub-dialog", 1, CLR_BLACK, 14089979 }
oBtn1:SetColor( 16777215, )

@ oSubdlg:nBottom - 150, oSubdlg:nRight - 120 聽BTNBMP oBtn2 OF oSubdlg PIXEL SIZE 30, 25 ;
NOBORDER 2007 ;
FILENAME c_path1 + "Exit.Bmp" ;
ACTION oSubdlg:End() ; 
TOP
oBtn2:lTransparent := .t. 聽 
oBtn2:cTooltip := 聽{ "EXIT the" + CRLF + "Sub-Dialog","EXIT Sub-dialog", 1, CLR_BLACK, 14089979 }
oBtn2:SetColor( 16777215, )

ACTIVATE DIALOG oSubdlg 聽;
ON INIT ( oBtn2:Move( oSubdlg:nBottom - 120, oSubdlg:nRight - 120, , , .f. ), ;
聽 聽 聽 聽 聽 聽 聽 oBtn1:Move( oSubdlg:nBottom - 120, oSubdlg:nRight - 190, , , .f. ) )

oBrush:End()

RETURN NIL


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 02:23 PM
Silvio.Falconi wrote:any help ?


Esto funciona bien

This works well

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "constant.ch"

Function main
Local odlg 
Local nBottom := 16.5
Local nRight := 66
Local nWidth := Max( nRight * DLG_CHARPIX_W, 280 )
Local nHeight := nBottom * DLG_CHARPIX_H + 80

Local odlg2,obtn

DEFINE DIALOG oDlg SIZE nWidth, nHeight TRANSPARENT PIXEL
@ 1,2 BUTTON obtn PROMPT "go" size 40,10 of oDlg ACTION Make_dlg2( oDlg )
ACTIVATE DIALOG oDlg CENTER

return nil 


Function Make_dlg2(oDlg)
Local SuboDlg
DEFINE DIALOG SuboDlg OF oDlg TRANSPARENT 
SuboDlg:nStyle -= WS_CAPTION //nOR(WS_CAPTION , 4 )
SuboDlg:nStyle += WS_CHILD
//SuboDlg:nStyle += WS_CLIPCHILDREN

@ 4,4 SAY "Dialog" OF SuboDlg

ACTIVATE DIALOG SuboDlg NOMODAL ON INIT ( ;
聽 聽 聽 聽 聽 聽 聽 聽 SETPARENT( SuboDlg:hWnd , oDlg:hWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 SuboDlg:Move( 18 , 260 , 226, 300 , .T. ))
return nil


Saludos

Regards
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 03:50 PM
Cristobal Navarro,

that will not work, because of controls from Main-dialog :



Your extended sample :
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "constant.ch

STATIC c_path , c_path1 

Function main
Local odlg 
Local nBottom := 16.5
Local nRight := 66
Local nWidth := Max( nRight * DLG_CHARPIX_W, 280 )
Local nHeight := nBottom * DLG_CHARPIX_H + 80

Local odlg2,obtn, oFont1, oSay1, oSay2

c_path := cFilePath(GetModuleFileName( GetInstance() ) ) 
c_path1 := c_path + "IMAGES\" 

oFont1 := TFont():New("Arial",0,-40,.F.,.T.,0,0,0,.F. )

DEFINE DIALOG oDlg SIZE nWidth, nHeight 聽PIXEL

@ 50, 50 BUTTON obtn PROMPT "go" size 40,10 of oDlg PIXEL ;
ACTION Make_dlg2( oDlg, oFont1 )

@ 70, 20 SAY oSay1 PROMPT "Main-Dialog" SIZE 130, 30 聽OF oDlg PIXEL FONT oFont1
oSay1:lTransparent := .T.
oSay1:SetColor( 255, )

@ 100, 40 SAY oSay2 PROMPT "Main-Dialog" SIZE 130, 30 聽OF oDlg PIXEL FONT oFont1
oSay2:lTransparent := .T.
oSay2:SetColor( 16443068, )

ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( D_BACKGRD( oDlg, 1, 16744448 ) )

oFont1:End()

return nil 

// -----

Function Make_dlg2(oDlg,oFont1)
Local SuboDlg, oSay1
DEFINE DIALOG SuboDlg OF oDlg PIXEL // TRANSPARENT 
SuboDlg:nStyle -= WS_CAPTION //nOR(WS_CAPTION , 4 )
SuboDlg:nStyle += WS_CHILD
//SuboDlg:nStyle += WS_CLIPCHILDREN

@ 20, 10 SAY oSay1 PROMPT "Sub-Dlg." SIZE 130, 30 聽OF SuboDlg PIXEL FONT oFont1
oSay1:lTransparent := .T.
oSay1:SetColor( 16443068, )

ACTIVATE DIALOG SuboDlg NOMODAL ;
ON INIT ( SETPARENT( SuboDlg:hWnd , oDlg:hWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 聽 SuboDlg:Move( 18 , 260 , 226, 300 , .T. ), ;
聽 聽 聽 聽 聽 D_BACKGRD( SuboDlg, 1, 255 ) )

return nil

// -------- 聽WINDOW / DIALOG - Background ---------------

FUNCTION D_BACKGRD( oDlg, nStyle, nColor1, nColor2, nMove, lDirect, cBrush, cImage ) 
LOCAL oBrush, hDC, aGrad, oImage
LOCAL aRect := GETCLIENTRECT( oDlg:hWnd )

IF nStyle = 1 // COLOR
聽 聽 DEFINE BRUSH oBrush COLOR nColor1
聽 聽 oDlg:SetBrush( oBrush )
聽 聽 oBrush:End()
ENDIF
IF nStyle = 2 // GRADIENT Brush
聽 聽 aGrad := { { nMove, nColor1, nColor2 }, { nMove, nColor2, nColor1 } }
聽 聽 hDC = CreateCompatibleDC( oDlg:GetDC() )
聽 聽 hBmp = CreateCompatibleBitMap( oDlg:hDC, oDlg:nWidth, oDlg:nHeight ) 
聽 聽 hBmpOld = SelectObject( hDC, hBmp )
聽 聽 GradientFill( hDC, 0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, lDirect ) // .T: = Vertical
聽 聽 DeleteObject( oDlg:hBrush )
聽 聽 oBrush := TBrush():New( ,,,, hBmp )
聽 聽 oBrush:Cargo 聽:= aGrad
聽 聽 SelectObject( hDC, hBmpOld )
聽 聽 ReleaseDC(hDC)
聽 聽 oDlg:SetBrush( oBrush )
聽 聽 oBrush:End()
ENDIF
IF nStyle = 3 // BMP-BRUSH
聽 聽 DEFINE BRUSH oBrush FILE c_path1 + cBrush
聽 聽 oDlg:SetBrush( oBrush )
聽 聽 oBrush:End()
ENDIF
IF nStyle = 4 // Image ADJUSTED
聽 聽 IF FILE( c_path1 + cImage ) 
聽 聽 聽 聽 DEFINE IMAGE oImage FILE c_path1 + cImage
聽 聽 聽 聽 oBrush := TBrush():new( ,,,, ResizeBmp( oImage:hBitmap, 聽aRect[4], aRect[3], .T. ) ) 
聽 聽 聽 聽 oImage:End()
聽 聽 聽 聽 oDlg:SetBrush( oBrush )
聽 聽 聽 聽 oBrush:End()
聽 聽 ELSE
聽 聽 聽 聽 IF !EMPTY(cImage)
聽 聽 聽 聽 聽 聽 MsgAlert( "File : " + cImage + CRLF + ;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "does not exist" + CRLF + ; 
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 "to show Image !", "ATTENTION" ) 
聽 聽 聽 聽 ENDIF
聽 聽 ENDIF
ENDIF

RETURN( NIL )


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 07:48 PM
on subdlg I must insert a button as :


DEFINE DIALOG SuboDlg OF oDlg TRANSPARENT
SuboDlg:nStyle -= WS_CAPTION //nOR(WS_CAPTION , 4 )
SuboDlg:nStyle += WS_CHILD


@ 5,8 BUTTON obtnok PROMPT "&Ritorna" OF SuboDlg ;
FONT oFont SIZE 40, 10 ACTION ( SuboDlg:end( IDOK ) )

ACTIVATE DIALOG SuboDlg NOMODAL ON INIT (oGetNum:=21.4, ;
SETPARENT( SuboDlg:hWnd , oDlg:hWnd ),;
SuboDlg:Move( 10 , 260 , 250, 215 , .T. ))

because I must make a control on End

if SuboDlg:nresult == IDOK
.....
endif


But it not run because let me error on if SuboDlg:nresult == IDOK
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 07:59 PM

Puedes adjuntar algo mas de tu codigo?
No entiendo bien lo que quieres hacer.

Saludos

You can attach your code some more?
I do not understand what you want to do.

regards

Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 09:16 PM
Ok Now I explain you :

I wish add % percentual math control to msgcalc (it there is on msgcalc but I wish add different calculation)



I wish add calculation, incremental and decremental I need it to calculate Tax on a price


First
I first I made a function to change the size of dialog called allarge(oDlg,ntipo)

nTipo can be 1 to second dlg size and 2 to return to first size

when I have the msgcalc I have :



when I call the percentual I have : (it call allarge(oDlg,1) and made subdialog





on this subdialog I insert some controls
Tipo := 1
PorCien := 0

@ 0.2, 2 SAY cPercentual OF SuboDlg SIZE 200,40 FONT oFont TRANSPARENT

@ 1.4,2 GET oGetNum VAR Porcien PICTURE "99.99" SPINNER OF SuboDlg SIZE 40,4

@ 4, 2 RADIO oRad VAR Tipo OF SuboDlg ;
PROMPT cCalculate, cIncremental ,cDecremental SIZE 100,12

@ 5,8 BUTTON obtnok PROMPT "OK" OF SuboDlg ;
FONT oFont SIZE 40, 10 ACTION ( SuboDlg:end( IDOK ) )//,lSave:=.t. ) oGetNum:=21.4


if the user press OK the procedure must make a calculation :

if SuboDlg:nresult == IDOK


DO CASE
CASE Tipo == 1
Display := ( nMemo ) * ( PorCien / 100 )
CASE Tipo == 2
Display := (nMemo ) * ( 1 + ( PorCien / 100 ) )
CASE Tipo == 3
Display := ( nMemo ) / ( 1 + ( PorCien / 100 ) )
ENDCASE

nMemo := Display
oGet:cText( Space(18)+Transform( nMemo , cPict ))

oDlg:Update() // update the msgcalc dialog


Endif

Allarge(oDlg,1) // return to first size dialog

return NIL
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: DIALOG ON DIALOG
Posted: Tue May 07, 2013 10:02 PM
Buenas noches

Es posible que este c贸digo te pueda servir

good night

It is possible that you can serve this code

Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "constant.ch"

Function main
Local odlg 
Local nBottom := 16.5
Local nRight := 66
Local nWidth := Max( nRight * DLG_CHARPIX_W, 280 )
Local nHeight := nBottom * DLG_CHARPIX_H + 80

Local odlg2,obtn
Local lSw

DEFINE DIALOG oDlg SIZE nWidth, nHeight TRANSPARENT PIXEL

@ 1,2 BUTTON obtn PROMPT "go" size 40,10 of oDlg ;
聽 聽 聽 ACTION 聽lSw := Make_dlg2( oDlg )

ACTIVATE DIALOG oDlg CENTER 

return nil 


Function Make_dlg2( oDlg )
Local SuboDlg
Local obtnok 
Local lSw1 聽 := .F.

DEFINE DIALOG SuboDlg OF oDlg TRANSPARENT 
SuboDlg:nStyle -= WS_CAPTION //nOR(WS_CAPTION , 4 )
SuboDlg:nStyle += WS_CHILD
//SuboDlg:nStyle += WS_CLIPCHILDREN

@ 4,4 BUTTON obtnok PROMPT "&Ritorna" OF SuboDlg ;
聽 聽 聽 SIZE 40, 10 ACTION ( lSw1 := .T. , SuboDlg:end( IDOK ) ) 
//@ 4,4 SAY "Dialog" OF SuboDlg

ACTIVATE DIALOG SuboDlg NOMODAL ON INIT ( ;
聽 聽 聽 聽 聽 聽 聽 聽 SETPARENT( SuboDlg:hWnd , oDlg:hWnd ),;
聽 聽 聽 聽 聽 聽 聽 聽 SuboDlg:Move( 18 , 260 , 226, 300 , .T. )) ;
聽 聽 聽 聽 聽 聽 聽 聽 VALID ( Ritorna( SuboDlg, lSw1 ), 聽.T. )

return lSw1

function Ritorna( SuboDlg, lSw )

// Resto de acciones
MsgInfo( lSw )
聽 聽 
Return lSw


Un saludo
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noci贸n del tiempo

El secreto de la felicidad no est谩 en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion