How refresh a dialog ?

User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

How refresh a dialog ?

Post by Silvio »

I load a dialog
in this dialog I have a MENU pulldown where I can set a logic variable

before of this dialog thereis the variable lSmall

If lsmall
DIALOG
endif

IF Lbig
DIALOG
endif

ACTIVATE

If change the value of this logic variable How I can make to reload my application and reload the dialog ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

perhaps you not understand me

I made a menu
...
menuitem " scentific" action ( lstandard:=.f.,oDlg:refresh())
....
endmenu
where I must insert the command odlg:end() and define dialog ... ?

For me this is very difficult to understand...Perhaps it is time: here is rain
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

You have to End() the current dialog and call the function that created it, the one with
If lsmall
DIALOG
endif

IF Lbig
DIALOG
endif

ACTIVATE
EMG
User avatar
dutch
Posts: 1395
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Post by dutch »

I've used multilanguage menu and change on the fly.
You must end menu and rebuild it again.

Regards,
Dutch

Code: Select all

   MEMVAR->Lang := cLang
   oMenu:End()
   BuildMenu( oWnd )
   oWnd:SetMenu( oMenu )
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

It seems that Silvio wants to modify the entire dialog. If that is true, it is easier to design a new dialog and alternatively End() the current and DEFINE the new.

EMG
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

THansk Emg
I sent to Antonio the new msgcalc()
Best Regards, Saludos

Falconi Silvio
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Silvio,

Why don't you use some code like this :

Code: Select all

LOCAL cRet := .T.
LOCAL cCheck := .F.

DO WHILE cRet

   IF cCheck
      DEFINE DIALOG ...
   ELSE
      DEFINE DIALOG ...
   ENDIF
   ....
   REDEFINE CHECKBOX cCheck ID ... ON CHANGE (cRet:=.T.,oDlg:End())
   ....
   REDEFINE BUTTON ... ACTION (cRet:=.F.,oDlg:End())
   ....
   ACTIVATE ....

   IF !cRet
      EXIT
   ENDIF

ENDDO
The button is, of course, the END-button.

I use it often and it works fine.

Good luck.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

NOOOOOOOOOOOOO

I want refresh the same dialog

sample :
open the WIN XP ( OR 2000) CALC.EXE

NOW YOU HAVE THE CALC STANDARD
OPEN THE SCENTIFIC CALC

i HOPE YOU UNDERSTAND ME NOW
Best Regards, Saludos

Falconi Silvio
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

Ok, then you have to play with Hide() and Show() methods of the controls and with the Move() method of the dialog.

EMG
StefanHaupt
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Post by StefanHaupt »

you can also use pages, one for the standard look and one for scientific look. Then you can easily change the look.
kind regards
Stefan
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

DEAR EMG
Can you make an test small with move function please
for understand How I must make it
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

Its the same way the folder works. It shows the active page and hides the previous one:

oDlg1:Hide(), oDlg2:Show()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Dear Antonio,
None friend understand what I want
If you load Windows Calc you can select scentific calc or stardard calc
I have msgcal ( calc standard) and I insert on a menu pulldown a selection to change the form of the dialog

IF lStandard // active standard calc
DEFINE DIALOG oDlg SIZE 255, 245 TITLE cTitle FONT oFont ICON oIco
ELSE
DEFINE DIALOG oDlg SIZE 485, 245 TITLE cTitle FONT oFont ICON oIco
ENDIF

I want only refresh the dialog and change the form iand esecute

DEFINE DIALOG oDlg SIZE 485, 245 TITLE cTitle FONT oFont ICON oIco


if lstandard is .f.


I hope you help me
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

If you just want to change its size then you can use:

oDlg:SetSize( nWidth, nHeight )

To change its title use:

oDlg:SetText( "new title" )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply