MsgYesNoCancel

MsgYesNoCancel

Postby acwoo1 » Mon Dec 05, 2011 12:42 pm

Hi

How do I change the MsgYesNo() to something like MsgYesNoCancel() to accept 3 choices instead of 2 choices.

Thanks

Regards
ACWoo
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: MsgYesNoCancel

Postby ukoenig » Mon Dec 05, 2011 1:13 pm

ACWoo,

have a look at Sample TESTRTF.prg
Function MsgYesNoCancel is included there.

Best 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: MsgYesNoCancel

Postby acwoo1 » Mon Dec 05, 2011 1:49 pm

Thanks For Your Help

MENUITEM "&End..." ;
ACTION If( MsgYesNoCancel( "Want to end ?","Please Choose" ), Exitpro(cDirect1,oWnd:End()),Relaunch()) ;
MESSAGE "End this application"

static function MsgYesNoCancel( cMsg, cTitle )

return MessageBox( GetActiveWindow(), cMsg, cTitle, ;
nOR( MB_ICONQUESTION, MB_YESNOCANCEL ) )
*****************************************
The options appear in the MsgYesNoCancel() dislog box is "Yes", "No","Cancel", how do I change it to "Yes", "Relaunch", "Cancel".

How should I write for the above ACTION if(MsgYesNoCancel......

Thanks

Regards
ACWoo
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: MsgYesNoCancel

Postby anserkk » Mon Dec 05, 2011 3:27 pm

acwoo1 wrote:The options appear in the MsgYesNoCancel() dislog box is "Yes", "No","Cancel", how do I change it to "Yes", "Relaunch", "Cancel".

How should I write for the above ACTION if(MsgYesNoCancel......


I am afraid that you may have to write your own function to display custom buttons.

As far as i Know the available buttons for the MessageBox API are

Code: Select all  Expand view
MB_OK  
MB_OKCANCEL    
MB_ABORTRETRYIGNORE    
MB_YESNOCANCEL  
MB_YESNO    
MB_RETRYCANCEL  
MB_CANCELTRYCONTINUE    
MB_HELP
 


Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: MsgYesNoCancel

Postby RAMESHBABU » Tue Dec 06, 2011 3:19 pm

Hi ACwoo,

I was initially in need of the same requirement while I was converting my Clipper Application.

And I could use FWH's strong resources and write a small function to meet my requirement like this.
Pls. have a glance. Using my function you can have any number of Button Options :D

[url]
viewtopic.php?f=3&t=22834&p=122051#p122051
[/url]

Regards,

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: MsgYesNoCancel

Postby acwoo1 » Wed Dec 07, 2011 7:28 am

Thanks Ramesh Babu

I get unresolved external "_HB_FUN_HP_LIBDO"
It also require mymsgbox.dll

Regards

ACWoo
Using FWH1111+bcc582
acwoo1
 
Posts: 173
Joined: Tue Nov 10, 2009 10:56 am

Re: MsgYesNoCancel

Postby Gale FORd » Wed Dec 07, 2011 1:51 pm

I don't think you want to use hp_libdo unless you put the functions in your own mymsgbox.dll.
Just use his control straight from your own code.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: MsgYesNoCancel

Postby ukoenig » Wed Dec 07, 2011 3:24 pm

I added 2 useful Options to the Function :

1. Optional Message-position in Relation to the Window / Dialog
Setting top- and left-value = 0, means centered

2. Brush-background
A empty brush selects the Gradient

Image

Code: Select all  Expand view

@ 150, 170 BTNBMP oBtn1 OF oDlg PIXEL ;
SIZE 60, 30 ;
PROMPT "&Message" FILE c_path + "\images\preview.bmp" 2007 ;                
FONT oFont LEFT ;
ACTION ;
MYMSGBOX( oDlg, ;
"There is an error and the process could not be completed."+CRLF+"Please try it once again.", ;
, ;             // aOptions
50, ;               // Top ( 0 = centered )
50, ;               // Left ( 0 = centered )
"Error Message", ;  // Title
, ;             // xIcon
, ;             // nDefault
, ;             // aGradient
"marble5.bmp", ;    // Bmp-brush
, ;             // bAction
, ;             // oFont
, ;             // cFileRes
oIcon1)         //oIcon
 


Best 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: MsgYesNoCancel

Postby RAMESHBABU » Wed Dec 07, 2011 3:55 pm

Hi Uwe,

You are known for adding elegance to our Applications front end, in our Family :D .

And your additions to MyMsgBox have added more beauty to the MyMsgBox.

My best regards,

-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Re: MsgYesNoCancel

Postby ukoenig » Wed Dec 07, 2011 4:04 pm

Hello Ramesh,

do You need my changes, or adding the ideas by yourself ?

Selected Gradient or BMP-brush :
Code: Select all  Expand view

LOCAL c_path := CURDRIVE() + ":\" + GETCURDIR()

@ 200, 15 BTNBMP oBtn1 OF oDlg PIXEL ;
SIZE 60, 30 ;
PROMPT "
Msg &Error" FILE c_path + "\images\preview.bmp" 2007 ;                
FONT oFont LEFT ;
ACTION MYMSGBOX( ;
"
There is an error and the process could not be completed."+CRLF+"Please try it once again.", ;
150, ;          //  2. Top ( centered Top and Left = 0 )
140, ;          //  3. Left
{"
&Close"}, ;       //  4. aOptions
{"
Exit16.bmp"}, ;   //  5. aBmps
"
Error Message", ;  //  6. Title
"
X", ;              //  7. xIcon
, ;             //  8. nDefault
, ;             //  9. aGradient
"
marble5.bmp", ;    // 10. Bmp-brush
, ;             // 11. bAction
, ;             // 12. oFont
, ;             // 13. cFileRes
oIcon1, ;           // 14. oIcon
, ;             // 15. uVar
, ;             // 16. cPict,
, ;             // 17. bValid
, ;             // 18. lSpinner
, ;             // 19. lMeter
, ;             // 20. oMeter
, ;             // 21. lCancel
CURDRIVE() + "
:\" + GETCURDIR() )
..
..
ACTIVATE DIALOG oDlg ;
ON INIT ( DlgInit( oDlg, oFont, cMsg, nTop, nLeft, aOptions, cTitle, nDefault,;
            aGradiate, bAction, xIcon, @uVar, cPict, bValid,;
            lSpinner, lMeter, oMeter, @lCancel ), ;
            IIF( EMPTY(cBrush), Gradiate(oDlg, aGradiate), ;
                               DrawBrush(oDlg, c_path + "
\images\" + cBrush ) ) )

IF oIco # nil
      RELEASE ICON oIco
ENDIF

RELEASE FONT  oFont

RETURN oDlg:Cargo

// ---- BMP-Brush-function ---------

FUNCTION DrawBrush( oDlg, cBrush )
LOCAL oBrush

IF !FILE( cBrush )
    MsgAlert( "
File : " + cBrush + CRLF + ;
            "
does not exist to create" + CRLF + ;
            "
Brush-Background !", "ATTENTION" )
ELSE
    DEFINE BRUSH oBrush FILENAME cBrush
    oDlg:SetBrush( oBrush )
    oBrush:End()
ENDIF

RETURN nil


Maybe changing the Buttonstyle ( 16x16 BMP's from defined Array ) ?

Image

Code: Select all  Expand view

FOR nFor := 1 TO LEN(aOptions)
    @ nBtnHeight, nBtnOffset + ((nFor-1)*nBtnWidth) BTNBMP aBtns[nFor] OF oDlg ;
    SIZE nBtnWidth + 16, oDlg:nGetChrHeight()*2 PIXEL;
    NOBORDER ;
    PROMPT aOptions[nFor] ;
    FILENAME aBmp[nFor] ;
    FONT oFont 2007 ;
    LEFT

// old Button
//  @ nBtnHeight, nBtnOffset + ((nFor-1)*nBtnWidth) ;
//  BUTTON aBtns[nFor] PROMPT aOptions[nFor] OF oDlg ;
//  PIXEL SIZE nBtnWidth, oDlg:nGetChrHeight()*1.7

    nBtnOffset   := nBtnOffset + 8
    aBtns[nFor]:bAction := GenBlock(oDlg, nFor)
NEXT nFor
 


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

Re: MsgYesNoCancel

Postby RAMESHBABU » Thu Dec 08, 2011 2:12 am

Hello Uwe,

You are most welcome to make your suggestions for the
better looking MyMsgBox Screens.

I am using TSButtons in my copy of MyMsgBox.
Other may prefer to use Skin Buttons or BtnBmp etc..

Regards,

-Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 624
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests