show a message then created a dialog and not before

show a message then created a dialog and not before

Postby Silvio.Falconi » Fri Aug 23, 2019 3:38 pm

I have a dialog
at init go to add a array aItems I need on xbrowse from a function calcolo()

if I make a check calcolo function have some message boxes

I wish before create the dialog with all object and then the calcolo function can show the messages

my problem is the message is showed before to create the dialog

how I can resolve it ?

I made a small test
Code: Select all  Expand view  RUN
#include "fivewin.ch"

Function test()
Local odlg,oFolder,oPanelGreen
Local aItems:= {}
LOCAL oBrowse
 DEFINE DIALOG oDlg TITLE "test" SIZE 1120,650 ;
             PIXEL TRUEPIXEL RESIZABLE

 @ 1, 0 FOLDEREX oFolder OF oDlg SIZE oDlg:nWidth-585,oDlg:nHeight-390 PIXEL  ;
        PROMPT "Reservation","Payments"


     @ 100, 02 XBROWSE  oBrowse OF oFolder:aDialogs[1] ;
       ARRAY aItems       ;
        SIZE 100,90 PIXEL STYLE FLAT NOBORDER

         WITH OBJECT oBrowse
            :CreateFromCode()
    END








         oDlg:bResized  := <||
                local oRect    := oDlg:GetCliRect()
                oFolder:nWidth     := oRect:nRight-2
                oFolder:nHeight    := oRect:nBottom-60

                oPanelGreen:nTop   := oRect:ntop +80
                oPanelGreen:nLeft  := oRect:nleft+5
                oPanelGreen:nwidth := oRect:nRight - 20

                oBrowse:nTop      := oRect:nBottom-350
                oBrowse:nWidth    := oRect:nWidth - 15
               return nil
                  >


 ACTIVATE DIALOG oDlg CENTERED;
                ON INIT ( oPanelGreen  := PanelGreen(oFolder),;
                 Calcolo(@aItems),EVAL( oDlg:bResized))

return nil

//-----------------------------------------------//
 function PanelGreen(oFld)
  local oPanel,oBrushGreen
  Local aGradgreen := { Rgb( 225,239,219),Rgb( 225,239,219)}
  DEFINE BRUSH oBrushGreen GRADIENT aGradgreen
     oPanel:=Tpanel():New( 35, 2, 75, oFld:aDialogs[1]:nWidth-5, oFld:aDialogs[1])
     oPanel:SetBrush( oBrushGreen )
     oPanel:bPainted := { || oPanel:Box( 1,1,oPanel:nHeight-1,oPanel:nWidth-1 ) }
     return oPanel
//-----------------------------------------------//


function Calcolo(aItems)
   msginfo("wwww")
   return aItems
//-----------------------------------------------//
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: show a message then created a dialog and not before

Postby ukoenig » Fri Aug 23, 2019 4:07 pm

Silvio,

just change to :
.....
.....
oDlg:bPainted := {||Calcolo(@aItems) }

ACTIVATE DIALOG oDlg CENTERED;
ON INIT ( oPanelGreen := PanelGreen(oFolder),;
EVAL( oDlg:bResized))

regards
Uwe :D
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: show a message then created a dialog and not before

Postby Silvio.Falconi » Fri Aug 23, 2019 4:49 pm

each time I resize it come the message ...no good
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: show a message then created a dialog and not before

Postby ukoenig » Fri Aug 23, 2019 4:55 pm

Silvio,

You can use a var that will show the message only at once.

lMessage := .F.
oDlg:bPainted := {|| IIF( lMessage = .F., ( Calcolo(@aItems), lMessage := .T.), NIL ) }


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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: show a message then created a dialog and not before

Postby Silvio.Falconi » Fri Aug 23, 2019 6:58 pm

goods :) it an good idea
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 7072
Joined: Thu Oct 18, 2012 7:17 pm

Re: show a message then created a dialog and not before

Postby VictorCasajuana » Thu Aug 05, 2021 11:37 am

oDlg:bStart := {||Calcolo(@aItems) }
--------
¿ Y porque no ?
¿ And why not ?
User avatar
VictorCasajuana
 
Posts: 265
Joined: Wed Mar 28, 2018 4:38 pm
Location: Vinaròs


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests