I have A Main oWnd where I call a Dialog ( edit record) on a get open a PopPup where the user can select some procedure. One of this procedure open a second Dialog and i try to show it on center.
on this Dialog there is a combo a 4 buttons:
First option the dialog bottom is 14.1 moving the buttons on top but bottom of combobox
the second option the bottom is 29.2 moving the buttons on bottom.
The function Allarga() change the Size of oDlg.
The error is the dialog is not on the center but on algle top left of Main window ...why ?
ON Windows Xp when the Allarga Function change the size not refresh the dialog and it show the oldest part
the code test
I tried insert also a Move but then not run ok
oDlgMail:move(200,200,nWidth,nHeight) )
I tried to change allarga() function
with
on Windows xp not refresh()
on this Dialog there is a combo a 4 buttons:
First option the dialog bottom is 14.1 moving the buttons on top but bottom of combobox
the second option the bottom is 29.2 moving the buttons on bottom.
The function Allarga() change the Size of oDlg.
The error is the dialog is not on the center but on algle top left of Main window ...why ?
ON Windows Xp when the Allarga Function change the size not refresh the dialog and it show the oldest part
the code test
#include "Fivewin.ch"
#include "constant.ch"
static oWnd
Function Main()
Local oWnd
define window oWnd
activate window ownd maximized on init test()
return nil
//--------------------------------------------------------------------//
function test()
local oDlg, cMail := Space( 20 )
DEFINE DIALOG oDlg
@ 2, 2 GET cMail ACTION ShowMailPopup( oDlg,cMail )
ACTIVATE DIALOG oDlg CENTERED
return nil
//--------------------------------------------------------------------//
function ShowMailPopup( oDlg,cMail )
local oMenu
Local cModello_Generico:= "Spett.le Ambaraba', "+ CRLF+ "Distinti saluti"
MENU oMenu POPUP
MENUITEM "Messaggio generico" ACTION Email(cMail)
ENDMENU
ACTIVATE POPUP oMenu OF oDlg AT 80, 100
return nil
//--------------------------------------------------------------------//
Function Email(cMail)
Local nBottom := 12// 25
Local nRight := 58
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
Local aGet[1]
Local aItemMail := {"- Programma di posta predefinito - ","Invio diretto al server di posta in uscita ( SMTP )"}
Local cTipo := "- Programma di posta predefinito - "
local obtn[4]
DEFINE FONT oFont NAME 'Tahoma' SIZE 0, -12
DEFINE FONT oFontBold NAME 'Tahoma' SIZE 0, -18 BOLD
DEFINE DIALOG oDlgMail ;
SIZE nWidth, nHeight PIXEL TRUEPIXEL ;
TITLE "test"
@ 60,10 COMBOBOX aGet[1] var cTipo ITEMS aItemMail size 214,45 PIXEL of oDlgMail ;
ON CHANGE Allarga(aGet,oDlgMail,obtn)
@ 190, 10 Button obtn[1] Prompt "&Conferma" of oDlgMail size 50,12 PIXEL FONT oFont DEFAULT ACTION ( oDlgMail:end( IDOK ) )
@ 190, 65 Button obtn[2] Prompt "&e-mail di prova" of oDlgMail size 50,12 PIXEL FONT oFont ACTION NIL
@ 190, 120 Button obtn[3] Prompt "&Annulla" of oDlgMail size 50,12 PIXEL FONT oFont CANCEL ACTION ( oDlgMail:end( IDCANCEL ) )
@ 190, 175 Button obtn[4] Prompt "Ai&uto" of oDlgMail size 50,12 PIXEL FONT oFont ACTION Helpindex()
ACTIVATE DIALOG oDlgMail CENTERED ;
ON INIT ( Allarga(aGet,oDlgMail,obtn))
return nil
//-------------------------------------------------------------------------------------------------//
static Function Allarga(oControl, oDlgMail,obtn)
Local oDlgMail_Height
Local nValue
local nTipo:= oControl[1]:nAt
Do case
case nTipo= 2
nValue:= 29.2
oDlgMail_Height := nValue * DLG_CHARPIX_H
for n=1 to 4
obtn[n]:nTop = 380
next
case nTipo= 1
nValue:= 14.1
oDlgMail_Height := nValue * DLG_CHARPIX_H
for n=1 to 4
obtn[n]:nTop = 150
next
endcase
oDlgMail:nBottom := oDlgMail_Height
oDlgMail:setsize(oDlgMail:nWidth,oDlgMail_Height)
return nil
//------------------------------------------------------------------------------------------------------------//
Function DlgCenter( oDlg,oWnd )
oDlg:Center( oWnd )
Return NILI tried insert also a Move but then not run ok
oDlgMail:move(200,200,nWidth,nHeight) )
I tried to change allarga() function
with
static Function Allarga(oControl, oDlgMail,obtn)
Local oDlgMail_Height
Local nValue
local nTipo:= oControl[1]:nAt
local ntopDlgMail:=oDlgMail:ntop
local nLeftDlgMail:= oDlgMail:nleft
local aClient := GetClientRect (oDlgMail)
Do case
case nTipo= 2
nValue:= 29.2
oDlgMail_Height := nValue * DLG_CHARPIX_H
for n=1 to 4
obtn[n]:nTop = 380
next
case nTipo= 1
nValue:= 14.1
oDlgMail_Height := nValue * DLG_CHARPIX_H
for n=1 to 4
obtn[n]:nTop = 150
next
endcase
oDlgMail:nBottom := oDlgMail_Height
oDlgMail:setsize(oDlgMail:nWidth,oDlgMail_Height)
oDlgMail:move(aClient[1]+100,aClient[2]+100,oDlgMail:nWidth,oDlgMail_Height)
return nilon Windows xp not refresh()
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
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