FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to create a multiline button?
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
How to create a multiline button?
Posted: Sat Jan 09, 2010 11:29 PM

Any code available to create a multiline button?

Useing resources..Borland workshop.

Thanks

Thank you

Harvey
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:08 AM
A sample :

REDEFINE BTNBMP oBtn ID 10 OF oFld1:aDialogs[1] 2007 ;
FILENAME c_path + "\Images\select.bmp" ;
LEFT ;
PROMPT " &Select " + CRLF + "Test" ;
FONT oBtnFont ;
ACTION MY_ACTION()
oBtn:lTransparent = .t.
oBtn:cTooltip := { "Select the 1. " + CRLF + "Color for " + CRLF + ;
"Gradient-Design","Color-Select", 1, CLR_BLACK, 14089979 }

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.
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:38 AM
Uwe

Thanks for the quick response but not sure the code works with my code
Code (fw): Select all Collapse
   REDEFINE BUTTON oBtn2 Id 4002 OF ODLG2 ;      
   action(oDlg2:End())


If I change it to:

Code (fw): Select all Collapse
 
 REDEFINE BUTTON oBtn2 prompt "&select"+CRLF+"test" Id 4002 OF ODLG2 ;                  
   action(oDlg2:End())


it doesn't work.
Thank you

Harvey
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:46 AM
We have 3 Button-Classes :

Button
ButtonBMP and
BtnBMP

Class Button doesn't support Linefeed.

For BtnBmp You can use a Resource for Resource-Workshop like:
CONTROL "", 804, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 181, 211, 31, 12

My new Buttontool supports all 3 Styles.
Maybe a good Idea, to support Multiline-Prompts ( Linefeed ) as well.

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.
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:59 AM

Thanks again...I'll try it tomorrow and let you know.

Thank you

Harvey
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 01:19 AM
My Solution for the Tools :
It is easy now, to test Multiline Prompts.
A activated Checkbox will force a CRLF between the 2 Gets,
otherwise the first get is trimmed + 1 char Space + the 2. Get in 1 Line.



A easy way to test, if Buttonsize, Bitmap and Fontsize work together.




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.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 11:20 AM
hag wrote:Any code available to create a multiline button?


This is a working sample:

Code (fw): Select all Collapse
#include "Fivewin.ch"


#define CR CHR( 13 )

#define BS_MULTILINE 8192


FUNCTION MAIN()

    LOCAL oDlg, oBtn

    DEFINE DIALOG oDlg

    @ 1, 1 BUTTON oBtn PROMPT "&Close" + CHR( 13 ) + "the dialog";
           SIZE 50, 30;
           ACTION oDlg:End()

    oBtn:nStyle = NOR( oBtn:nStyle, BS_MULTILINE )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:04 PM
Enrico,

I wanted to include Your Solution to the other
Tests of the Tools ( Button and ButtonBMP of the ButtonSkin-part ).
Is it possible, to use it for Resources to ?
I don't get it working.

REDEFINE BUTTON oBtn5 PROMPT TRIM(aBTNTEXT[5][1]) + CHR( 13 ) + "Multiline-Test" ID 210 OF oDlg70
oBtn5:oFont := oTextFont
oBtn5:nStyle = NOR( oBtn5:nStyle, BS_MULTILINE )



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.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 12:56 PM

You have to add 8192 as button style in the resource.

EMG

Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 05:48 PM

enrico

Thanks for the solution on the multiline button.
Its not working..using borland resources.
You indicated to uwe to add 8192 as a resource style.
Can you explain how to do that.

Went into the text of the dialog to edit style change but can't figure out how to do it on the button.
You additional help woild be appreciated.

Thank you

Harvey
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 05:54 PM
As an example:

Code (fw): Select all Collapse
PUSHBUTTON "", 201, 10, 10, 65, 40, BS_MULTILINE | WS_TABSTOP


EMG
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 07:28 PM

Enrico
Perfect.
Needed to edit the rc file outside of borland.
Borland doesn't compile properly with the code you provided.

But it works great.

Thanks again.

Thank you

Harvey
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to create a multiline button?
Posted: Sun Jan 10, 2010 08:53 PM
Just use

Code (fw): Select all Collapse
PUSHBUTTON "", 201, 10, 10, 65, 40, 8192 | WS_TABSTOP


and it will compile fine.

EMG
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to create a multiline button?
Posted: Mon Jan 11, 2010 01:19 PM
Enrico,

with normal ButtonStyle it works fine.
Using a ButtonSkin, it doesn't work.





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.

Continue the discussion