How i do to show message "in progress" in a progress "SELECT

How i do to show message "in progress" in a progress "SELECT

Postby goosfancito » Sun Apr 05, 2009 4:41 pm

Hi,
i like show message when server is working in a select progress.
how i do it?

No this:
Code: Select all  Expand view
msgrun("moment","", { ||browser()})


Cha Gracias!
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: How i do to show message "in progress" in a progress "SELECT

Postby ukoenig » Sun Apr 05, 2009 5:52 pm

Hello from Germany,

normally we have WaitRun, MsgWait and MsgRun.
That doesn't solve our problem.

How You can do it :
During working inside the folder, the message stays on screen.

Image

Code: Select all  Expand view

...
DEFINE WINDOW oWnd TITLE "Background for Windows and Dialog"  MDI  MENU TMenu():New()  
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT Tools(oWnd) ;
ON PAINT ( gradpaint0( hDC, oWnd ), ;
ABPaint( hDC, 20, 20, oBmp1:hBitmap, 220 ) )

RETURN ( NIL )

//-----------------  FOLDER -----------------------------------------------------------//

FUNCTION Tools(oWnd)
local oDlg, oBar1, oBrush, oFont1, oDlg1
..
DEFINE DIALOG oDlg RESOURCE "MainDlg" OF oWnd STYLE nSTYLE TRANSPARENT ;
TITLE  "Background-Selection for Windows and Dialog" FONT oProgFont

// Your Message !!!
// ---------------------
DEFINE DIALOG oDlg1 TITLE "Test" OF oWnd
@ 1.2, 3 SAY oSay PROMPT "This is a Test-Message,"
@ 1.8, 3 SAY oSay PROMPT "Shown during a Action"
ACTIVATE DIALOG oDlg1 CENTERED NOWAIT

// Don't forget to close oDlg1, together with oDlg !!!
// ------------------------------------------------------------
..
..
ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ), DisableX(oDlg, .T.), ;
            SetImages( oDlg, oFld ) ) ;
ON PAINT ( gradpaint3( hDC, oDlg ), SetDialogsGradient( oFld )  )

RETURN NIL  
 

Regards
Uwe :lol:
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: How i do to show message "in progress" in a progress "SELECT

Postby goosfancito » Sun Apr 05, 2009 6:05 pm

ukoenig wrote:Hello from Germany,

normally we have WaitRun, MsgWait and MsgRun.
That doesn't solve our problem.

How You can do it :
During working inside the folder, the message stays on screen.

Image

Code: Select all  Expand view

...
DEFINE WINDOW oWnd TITLE "Background for Windows and Dialog"  MDI  MENU TMenu():New()  
...
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT Tools(oWnd) ;

Danke Schon

ON PAINT ( gradpaint0( hDC, oWnd ), ;
ABPaint( hDC, 20, 20, oBmp1:hBitmap, 220 ) )

RETURN ( NIL )

//-----------------  FOLDER -----------------------------------------------------------//

FUNCTION Tools(oWnd)
local oDlg, oBar1, oBrush, oFont1, oDlg1
..
DEFINE DIALOG oDlg RESOURCE "MainDlg" OF oWnd STYLE nSTYLE TRANSPARENT ;
TITLE  "Background-Selection for Windows and Dialog" FONT oProgFont

// Your Message !!!
// ---------------------
DEFINE DIALOG oDlg1 TITLE "Test" OF oWnd
@ 1.2, 3 SAY oSay PROMPT "This is a Test-Message,"
@ 1.8, 3 SAY oSay PROMPT "Shown during a Action"
ACTIVATE DIALOG oDlg1 CENTERED NOWAIT
..
..
ACTIVATE DIALOG oDlg CENTERED NOWAIT ;
ON INIT ( oDlg:Move( 30 , 10, oDlg:nWidth, oDlg:nHeight, .f. ), DisableX(oDlg, .T.), ;
            SetImages( oDlg, oFld ) ) ;
ON PAINT ( gradpaint3( hDC, oDlg ), SetDialogsGradient( oFld )  )

RETURN NIL  
 

Regards
Uwe :lol:
FWH 21.02
Harbour 3.2.0dev (r2104281802)
Copyright (c) 1999-2021, https://harbour.github.io/
User avatar
goosfancito
 
Posts: 1954
Joined: Fri Oct 07, 2005 7:08 pm

Re: How i do to show message "in progress" in a progress "SELECT

Postby ukoenig » Sun Apr 05, 2009 6:53 pm

A much better solution :
A Message with Gradient, Picture and different Font.
Displaying the Message on any place on Screen.
Disable the Exit-Button ( Message can only be closed together with the Main-Dialog ).

Image

Code: Select all  Expand view

#include "FiveWin.ch"

STATIC oWnd
STATIC nDAYS := 0, nPRICE := 0, lPRICE := .F., LDAYS := .F.
STATIC nDAYS1 := 0, nDAYS2 := 0, nDAYS3 := 0, nDAYS4 := 0

FUNCTION MAIN()

SetBalloon( .T. ) // Balloon shape required for tooltips

SET DATE GERMAN
SET CENTURY ON  
SET DECIMALS TO 2
PRIVATE aDAYS[1][2]
PRIVATE aSEASON[4][3]
PRIVATE aDAYS[3][1]
cYEAR := LTRIM( STR( YEAR(DATE()) ))

aSEASON[1] := { "17.05." + cYEAR, "27.06." + cYEAR, 7.00 } // LOW
aSEASON[2] := { "28.06." + cYEAR, "25.07." + cYEAR, 9.00 } // AVERAGE
aSEASON[3] := { "26.07." + cYEAR, "29.08." + cYEAR, 11.00 } // HIGHT
aSEASON[4] := { "30.08." + cYEAR, "20.09." + cYEAR, 7.00 } // LOW

lDAYS := .F.
aDAYS[1][1] := 0
aDAYS[2][1] := 0
aDAYS[3][1] := 0

dDAY1 := CTOD("18.05." + cYEAR )
dDAY2 := CTOD("15.09." + cYEAR )

lPRICE := .F.
cSEASON := "LOW"

nDAYS1 := 0 // LOW
nDAYS2 := 0 // AVERAGE
nDAYS3 := 0 // HIGHT
nDAYS4 := 0 // LOW

nPRICE1 := 0 // LOW
nPRICE2 := 0 // AVERAGE
nPRICE3 := 0 // HIGHT
nPRICE4 := 0 // LOW

DEFINE WINDOW oWnd TITLE "Price-Test"  // MDI ;
// MENU BuildMenu(oWnd)  //   TMenu():New()  

SET MESSAGE OF oWnd TO "Price-Test" ;
CENTERED CLOCK KEYBOARD 2007

ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT MSG_TEST(oWnd) ;
ON PAINT gradpaint0( hDC, oWnd )

RETURN NIL

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

static func gradpaint0( hDC, oWnd )

local aGrad := { { 0.50, 16054371, 11892819 } }

GradientFill( hDC,  0, 0, oWnd:nHeight, oWnd:nWidth, aGrad, .F. )

RETURN NIL

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

FUNCTION MSG_TEST(oWnd)
LOCAL oDlg, oDlg1, oBtn1, oBtn2, oGET, oGET1, oGET2, oGET3, oGET4, oGroup, oBmp1

DEFINE DIALOG oDlg SIZE 400, 290 TITLE "Price Test" TRANSPARENT

@ 0.6, 1.5 GROUP oGroup TO  7.5, 27 PROMPT "Calculation" OF oDlg  COLOR CLR_YELLOW, CLR_BLUE
oGroup:ltransparent:=.T.

@ 3.2, 3 SAY oSay PROMPT "Price = .T. only used for Price-calculation ( Days-Array = .F. )"
@ 3.8, 3 SAY oSay PROMPT "Price = .F. and Days-Array = .T. Displays Days as Array"

@ 4.8, 5 SAY oSay PROMPT "Start"
@ 4.8, 13 SAY oSay PROMPT "End"
@ 4.8, 20 SAY oSay PROMPT "Price or Days-Array ?"

@ 6.5, 2  GET oGet1 VAR dDAY1 OF oDlg SIZE 40, 15  PICTURE "##.##.####" UPDATE
@ 6.5, 8  GET oGet2 VAR dDAY2 OF oDlg SIZE 40, 15  PICTURE "##.##.####" UPDATE
@ 6.5, 17  CHECKBOX oGet3 VAR lPRICE PROMPT "&Price" SIZE 50, 20 OF oDlg UPDATE
@ 6.5, 21  CHECKBOX oGet4 VAR lDAYS PROMPT "&Day-Array" SIZE 80, 20 OF oDlg UPDATE

@ 6.2, 1.9 BUTTON oBtn1 PROMPT "Date-Test" size 50, 25 OF oDlg ;
ACTION ( oDlg:Update(), ;
   IIF( lDAYS = .F., GET_DAYS( dDAY1, dDAY2, aSEASON ), ;
                            ( GET_DAYS( dDAY1, dDAY2, aSEASON ), ;
                   MsgAlert( "LOW : " + STR(aDAYS[1][1]) + " Days" + CRLF + ;
                                       "AVERAGE : " + STR(aDAYS[2][1]) + " Days" + CRLF + ;
                               "HEIGHT : " + STR(aDAYS[3][1]) + " Days", "Day-Array" ) ) ) )

// Message and Dialog closed together
// -----------------------------------------
@ 6.2, 23 BUTTON oBtn2 PROMPT "Close" size 50, 25 OF oDlg ;
ACTION ( oDlg1:End(), oDlg:End() )

// YOUR MESSAGE !!!!!
///------------------------

oFont1 := TFont():New("Arial", ,-14,.F.,.F. , , , ,.F. )
DEFINE DIALOG oDlg1 SIZE 250, 100 TITLE "MsgTest" TRANSPARENT

@ 0.2, 1 SAY oSay PROMPT "This ais a Dialog-Message-Test" Font oFont1
@ 0.8, 1 SAY oSay PROMPT "and must be closed with the Main-Dlg" Font oFont1

ACTIVATE DIALOG oDlg1 CENTERED NOWAIT ;
ON INIT ( oDlg1:Move( 200 , 15, oDlg1:nWidth, oDlg1:nHeight, .f. ), DisableX(oDlg1, .T.) ) ;
ON PAINT gradpaint1( hDC, oDlg )
oFont1:End()

ACTIVATE DIALOG oDlg CENTERED ;
ON PAINT gradpaint1( hDC, oDlg )  

RETURN ( NIL )

// ---------------------  EXIT - BUTTON disabled -----------------

FUNCTION DisableX(oWin, lDisable)

LOCAL hMenu  := 0
LOCAL nCount := 0

IF lDisable
    hMenu  = GetSystemMenu(oWin:hWnd, .F.)
    nCount = GetMItemCount(hMenu)
    IF oWin:ClassName() = "TDIALOG"
        RemoveMenu(hMenu, 1, nOR( 1024, 2) )
    ELSE
        RemoveMenu(hMenu, nCount - 1, nOR( 1024, 2) )
        RemoveMenu(hMenu, nCount - 2, nOR( 1024, 2) )
    ENDIF    
    DrawMenuBar( oWin:hWnd )
ELSE
    GetSystemMenu( oWin:hWnd, .T. )
    DrawMenuBar( oWin:hWnd )
ENDIF

RETURN nil

// ------- Paints Gradient and BMP together ----------------------------------------

static func gradpaint1( hDC, oDlg )
Local oBmp1
local aGrad := { { 0.50, 16054371, 11892819 } }

GradientFill( hDC,  0, 0, oDlg:nHeight, oDlg:nWidth, aGrad, .F. )

DEFINE BITMAP oBmp1 FILENAME "User.bmp"
ABPaint( hDC, 40, 45, oBmp1:hBitmap, 220 )

RETURN NIL
 


Regards
Uwe :lol:
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: How i do to show message "in progress" in a progress "SELECT

Postby ryugarai27 » Tue Apr 07, 2009 8:57 am

Hi Uwe,

Is it possible to use dialog and say controls from resources with the same result?

I tested with say from resources but say background is not transparent to dialog



Thanks,

ryugarai
User avatar
ryugarai27
 
Posts: 65
Joined: Fri Feb 13, 2009 12:03 pm
Location: Manila, Philippines


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 93 guests

cron